这篇教程C++ webkit_web_view_new函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中webkit_web_view_new函数的典型用法代码示例。如果您正苦于以下问题:C++ webkit_web_view_new函数的具体用法?C++ webkit_web_view_new怎么用?C++ webkit_web_view_new使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了webkit_web_view_new函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: testWebViewGroupDefaultstatic void testWebViewGroupDefault(Test* test, gconstpointer){ // Default group is shared by all WebViews by default. GRefPtr<WebKitWebView> webView1 = WEBKIT_WEB_VIEW(webkit_web_view_new()); GRefPtr<WebKitWebView> webView2 = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_assert(webkit_web_view_get_group(webView1.get()) == webkit_web_view_get_group(webView2.get())); // Settings are shared by all web view in the same group. g_assert(webkit_web_view_get_settings(webView1.get()) == webkit_web_view_get_settings(webView2.get())); g_assert(webkit_web_view_get_settings(webView1.get()) == webkit_web_view_group_get_settings(webkit_web_view_get_group(webView2.get())));}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:11,
示例2: auth_browser_initstatic voidauth_browser_init (AuthBrowser *self){ AuthBrowserPrivate *priv = GET_PRIVATE (self); GtkWidget *vbox, *scrolled_window; priv->title = NULL; priv->progress = 0; priv->stop_url = NULL; priv->callback = NULL; vbox = gtk_vbox_new (FALSE, 0); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); priv->webview = WEBKIT_WEB_VIEW (webkit_web_view_new ()); gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (priv->webview)); gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0); priv->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (priv->window), DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT); gtk_widget_set_name (priv->window, "AuthBrowser");// gtk_window_set_screen (GTK_WINDOW (priv->window), gdk_screen_get_default ()); gtk_container_add (GTK_CONTAINER (priv->window), vbox); g_signal_connect (G_OBJECT (priv->webview), "title-changed", G_CALLBACK (title_change_cb), self); g_signal_connect (G_OBJECT (priv->webview), "load-progress-changed", G_CALLBACK (progress_change_cb), self); g_signal_connect (G_OBJECT (priv->webview), "load-committed", G_CALLBACK (load_commit_cb), self);}
开发者ID:lcp,项目名称:libsocialweb-extra-plugins,代码行数:30,
示例3: testWebViewSettingsstatic void testWebViewSettings(WebViewTest* test, gconstpointer){ WebKitSettings* defaultSettings = webkit_web_view_get_settings(test->m_webView); test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(defaultSettings)); g_assert(defaultSettings); g_assert(webkit_settings_get_enable_javascript(defaultSettings)); GRefPtr<WebKitSettings> newSettings = adoptGRef(webkit_settings_new()); test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(newSettings.get())); g_object_set(G_OBJECT(newSettings.get()), "enable-javascript", FALSE, NULL); webkit_web_view_set_settings(test->m_webView, newSettings.get()); WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView); g_assert(settings != defaultSettings); g_assert(!webkit_settings_get_enable_javascript(settings)); GRefPtr<GtkWidget> webView2 = webkit_web_view_new(); test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webView2.get())); webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webView2.get()), settings); g_assert(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView2.get())) == settings); GRefPtr<WebKitSettings> newSettings2 = adoptGRef(webkit_settings_new()); test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(newSettings2.get())); webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webView2.get()), newSettings2.get()); settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView2.get())); g_assert(settings == newSettings2.get()); g_assert(webkit_settings_get_enable_javascript(settings)); GRefPtr<GtkWidget> webView3 = webkit_web_view_new_with_settings(newSettings2.get()); test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webView3.get())); g_assert(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView3.get())) == newSettings2.get());}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:32,
示例4: createstatic voidcreate (){ main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (main_window), 1024, 780); gtk_window_set_title (GTK_WINDOW (main_window), "Khan Academy"); g_signal_connect(main_window, "destroy", G_CALLBACK (gtk_main_quit), NULL); web_view = webkit_web_view_new (); gtk_container_add (GTK_CONTAINER (main_window), web_view); WebKitSettings *settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (web_view)); g_object_set (G_OBJECT (settings), "enable-fullscreen", TRUE, "enable-developer-extras", TRUE, "enable-plugins", FALSE, NULL); g_object_connect (G_OBJECT(web_view), "signal::web-process-crashed", G_CALLBACK (crashed), NULL, "signal::load-changed", G_CALLBACK (changed), NULL, "signal::load-failed", G_CALLBACK (failed), NULL, NULL); gtk_widget_show_all (main_window);}
开发者ID:ceyusa,项目名称:gtk-wk,代码行数:25,
示例5: WEBKIT_WEB_VIEWWebKitWebView *control___::new_wwv__(Gtk::ScrolledWindow* sw){ WebKitWebView *wwv = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(G_OBJECT(wwv)); switch(use_){ case use_for_browse_: names_[wwv]=this; if(!sw){ sw=Gtk::manage(new Gtk::ScrolledWindow()); } page_[sw]=new page___(page_.size(),n_,wwv,sw); break; } if(!user_agent_.empty()){ WebKitWebSettings* wws=webkit_web_view_get_settings(wwv); WebKitWebSettings* wws2; //wws2=wws; wws2=webkit_web_settings_copy(wws); //wws2=(WebKitWebSettings*)webkit_web_settings_new(); g_object_set((GObject*)wws2, "user-agent", user_agent_.c_str(), NULL); webkit_web_view_set_settings(wwv,wws2); } zhenting__(wwv); return wwv;}
开发者ID:BGCX261,项目名称:zhscript-svn-to-git,代码行数:26,
示例6: mainint main(int argc, char** argv) { gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(window), HEIGHT, WIDTH); // hardwired position GTK_WIN_POS_CENTER_ALWAYS gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS); g_signal_connect(window, "key-press-event", G_CALLBACK(on_key_press), NULL); g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); web_view = WEBKIT_WEB_VIEW(webkit_web_view_new()); signal(SIGHUP, reload_browser); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(web_view)); webkit_web_view_load_uri(web_view, DEFAULT_URL); // maximize() gtk_window_maximize(GTK_WINDOW(window)); gtk_window_fullscreen(GTK_WINDOW(window)); gtk_window_set_decorated(GTK_WINDOW(window), FALSE); gtk_widget_show_all(window); gtk_main(); return 0;}
开发者ID:repat,项目名称:kiosk-browser,代码行数:29,
示例7: mainintmain (int argc, gchar* argv[]) { gtk_init(&argc, &argv); if (argc < 2) { printf("Usage: URI [filename]/n"); return 1; } const gchar *uri = argv[1]; const gchar *filename = argc > 2 ? argv[2] : "a.pdf"; if (!g_thread_supported()) {g_thread_init(NULL);} WebKitWebView *web_view = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_signal_connect(web_view, "notify::load-status", G_CALLBACK(load_status_cb), (gpointer) filename); GtkWidget *offscren = gtk_offscreen_window_new(); gtk_container_add(GTK_CONTAINER(offscren), GTK_WIDGET(web_view)); gtk_widget_show_all(offscren); webkit_web_view_load_uri(web_view, uri); gtk_main(); return 0;}
开发者ID:oyvindsk,项目名称:Webkit,代码行数:25,
示例8: FloatingWindowWindowShowRelatedVerses::WindowShowRelatedVerses(GtkWidget * parent_layout, GtkAccelGroup *accelerator_group, bool startup): FloatingWindow(parent_layout, widShowRelatedVerses, _("Related verses"), startup), myreference(0)// Window showing related verses.{ item_type = ritNone; thread_runs = false; event_id = 0; scrolledwindow = gtk_scrolled_window_new(NULL, NULL); gtk_widget_show(scrolledwindow); gtk_container_add(GTK_CONTAINER(vbox_client), scrolledwindow); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow), GTK_SHADOW_IN); webview = webkit_web_view_new(); gtk_widget_show(webview); gtk_container_add(GTK_CONTAINER(scrolledwindow), webview); connect_focus_signals (webview); g_signal_connect((gpointer) webview, "navigation-policy-decision-requested", G_CALLBACK(on_navigation_policy_decision_requested), gpointer(this)); last_focused_widget = webview; gtk_widget_grab_focus (last_focused_widget); button_item = gtk_button_new ();}
开发者ID:alerque,项目名称:bibledit,代码行数:27,
示例9: mainint main(int argc, char** argv){ // Make sure that both GAIL and the ATK bridge are loaded. g_setenv("GTK_MODULES", "gail:atk-bridge", TRUE); gtk_init(&argc, &argv); WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); webkit_web_view_load_html(webView, "<html>" " <body>" " <h1>This is a test</h1>" " <p>This is a paragraph with some plain text.</p>" " <p>This paragraph contains <a href=/"http://www.webkitgtk.org/">a link</a> in the middle.</p>" " </body>" "</html>", 0); GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(webView)); gtk_widget_show_all(window); g_signal_connect(window, "delete-event", G_CALLBACK(gtk_main_quit), 0); g_signal_connect(webView, "load-changed", G_CALLBACK(loadChangedCallback), 0); gtk_main();}
开发者ID:3163504123,项目名称:phantomjs,代码行数:27,
示例10: phidias_items_classic_initstatic void phidias_items_classic_init (PhidiasItemsClassic *item){ GtkWidget *scroll; GtkCellRenderer *renderer; GtkTreeViewColumn *col; GtkTreeSelection *selection; item->priv = PHIDIAS_ITEMS_CLASSIC_GET_PRIVATE (item); item->priv->list = gtk_tree_view_new (); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (item->priv->list), FALSE); renderer = gtk_cell_renderer_text_new (); col = gtk_tree_view_column_new_with_attributes ("Title", renderer, "text", ITEM_INFO_TITLE, NULL); gtk_tree_view_column_set_cell_data_func (col, renderer, set_line_style, NULL, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (item->priv->list), col); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (item->priv->list)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); g_signal_connect (selection, "changed", G_CALLBACK (item_selected_cb), item); scroll = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll), item->priv->list); gtk_paned_add1 (GTK_PANED (item), scroll); item->priv->description = webkit_web_view_new (); scroll = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll), item->priv->description); gtk_paned_add2 (GTK_PANED (item), scroll);}
开发者ID:madbob,项目名称:Phidias,代码行数:32,
示例11: html_initstatic voidhtml_init(Html *html){ html->webview = WEBKIT_WEB_VIEW(webkit_web_view_new()); html->scrolled = gtk_scrolled_window_new(0,0); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (html->scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); GTK_WIDGET_SET_FLAGS (html->scrolled, GTK_CAN_FOCUS); gtk_container_add(GTK_CONTAINER (html->scrolled), GTK_WIDGET(html->webview)); g_signal_connect(G_OBJECT (html->webview), "title-changed", G_CALLBACK (webkit_web_view_title_changed_cb), html); g_signal_connect(G_OBJECT (html->webview), "button-press-event", G_CALLBACK (webkit_web_view_mouse_click_cb), html); g_signal_connect(G_OBJECT (html->webview), "hovering-over-link", G_CALLBACK (webkit_web_view_hovering_over_link_cb), html); g_signal_connect(G_OBJECT (html->webview), "load-committed", G_CALLBACK (webkit_web_view_load_committed_cb), html); gtk_drag_dest_unset(GTK_WIDGET(html->webview));}
开发者ID:JackieXie168,项目名称:chmsee,代码行数:29,
示例12: win_createWin*win_create(void) { Win *w; GdkGeometry g; GtkPolicyType h, v; w = emalloc(sizeof(Win)); w->win = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); w->scroll = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(NULL, NULL)); w->web = WEBKIT_WEB_VIEW(webkit_web_view_new()); w->ignore = w->zoom = FALSE; g.min_width = g.min_height = 1; data.wins = g_list_append(data.wins, w); webkit_web_view_set_full_content_zoom(w->web, TRUE); webkit_web_view_set_zoom_level(w->web, ZOOM); gtk_window_set_geometry_hints(w->win, NULL, &g, GDK_HINT_MIN_SIZE); gtk_window_set_default_size(w->win, WIDTH, HEIGHT); gtk_container_add(GTK_CONTAINER(w->scroll), GTK_WIDGET(w->web)); gtk_container_add(GTK_CONTAINER(w->win), GTK_WIDGET(w->scroll)); gtk_widget_show_all(GTK_WIDGET(w->win)); gdk_window_set_events(GWIN(w), GDK_PROPERTY_CHANGE_MASK); gdk_window_add_filter(GWIN(w), atom_propertynotify, w); event_init(w); h = SHOW_HSCROLL ? GTK_POLICY_AUTOMATIC : GTK_POLICY_NEVER; v = SHOW_VSCROLL ? GTK_POLICY_AUTOMATIC : GTK_POLICY_NEVER; gtk_scrolled_window_set_policy(w->scroll, h, v); gtk_widget_grab_focus(GTK_WIDGET(w->web)); return w;}
开发者ID:andreas-volker,项目名称:owl-wb,代码行数:29,
示例13: webkit_web_view_newGtkWidget* webkit_view___::webview_new__(GtkWidget* scrolled) { GtkWidget* webview = webkit_web_view_new (); //g_object_ref_sink(webview); gtk_object_set_data(GTK_OBJECT(webview),object_data_view_,(gpointer)this); if(scrolled) { gtk_object_set_data(GTK_OBJECT(webview),object_data_scrolled_,(gpointer)scrolled); //gtk_container_add (GTK_CONTAINER (scrolled), webview); GtkWidget* scrolled2 = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (scrolled2), webview); gtk_container_add (GTK_CONTAINER (scrolled), scrolled2); outer_scrolled_ = scrolled2; if(is_app_paintable_) { webkit_web_view_set_transparent(WEBKIT_WEB_VIEW(webview), true); } g_signal_connect(webview,"window-object-cleared",G_CALLBACK(window_object_cleared__),NULL); g_object_connect(G_OBJECT(webview), "signal::geolocation-policy-decision-requested", geolocation_policy_decision_requested__, 0, NULL); signal_connect__(webview); } if(!user_agent_.empty()) { WebKitWebSettings* wws=webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview)); WebKitWebSettings* wws2=webkit_web_settings_copy(wws); g_object_set((GObject*)wws2, "user-agent", user_agent_.c_str(), NULL); webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webview), wws2); } return webview;}
开发者ID:zzzzzzzzzzz0,项目名称:zhscript,代码行数:31,
示例14: createBrowserWindowstatic void createBrowserWindow(const gchar *uri, WebKitSettings *webkitSettings, gboolean shouldLoadSession){ GtkWidget *webView = webkit_web_view_new(); if (editorMode) webkit_web_view_set_editable(WEBKIT_WEB_VIEW(webView), TRUE); GtkWidget *mainWindow = browser_window_new(WEBKIT_WEB_VIEW(webView), NULL); if (backgroundColor) browser_window_set_background_color(BROWSER_WINDOW(mainWindow), backgroundColor); if (webkitSettings) webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webView), webkitSettings); if (!editorMode) { if (shouldLoadSession && sessionFile) browser_window_load_session(BROWSER_WINDOW(mainWindow), sessionFile); else { gchar *url = argumentToURL(uri); browser_window_load_uri(BROWSER_WINDOW(mainWindow), url); g_free(url); } } gtk_widget_grab_focus(webView); gtk_widget_show(mainWindow);}
开发者ID:TigerWFH,项目名称:webkit,代码行数:25,
示例15: definedstatic GtkWidget *create_htmlview(GtkNotebook *notebook){#if defined(USE_WEBKITGTK) WebKitWebView *html_widget = WEBKIT_WEB_VIEW(webkit_web_view_new());#elif defined(USE_GTKHTML) GtkWidget *html_widget = gtk_html_new();#endif GtkWidget *scrolled; SYLPF_START_FUNC; scrolled = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(scrolled), GTK_WIDGET(html_widget)); gtk_widget_show_all(GTK_WIDGET(scrolled)); gtk_container_add(GTK_CONTAINER(notebook), GTK_WIDGET(scrolled)); gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(notebook), GTK_WIDGET(scrolled), _("HTML")); SYLPF_RETURN_VALUE(GTK_WIDGET(html_widget));}
开发者ID:kenhys,项目名称:sylpheed-htmlview,代码行数:25,
示例16: create_inspector_cbWebKitWebView*create_inspector_cb (WebKitWebInspector* web_inspector, WebKitWebView* page, gpointer data){ (void) data; (void) page; (void) web_inspector; GtkWidget* scrolled_window; GtkWidget* new_web_view; GUI *g = &uzbl.gui; g->inspector_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(g->inspector_window), "delete-event", G_CALLBACK(hide_window_cb), NULL); gtk_window_set_title(GTK_WINDOW(g->inspector_window), "Uzbl WebInspector"); gtk_window_set_default_size(GTK_WINDOW(g->inspector_window), 400, 300); gtk_widget_show(g->inspector_window); scrolled_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(g->inspector_window), scrolled_window); gtk_widget_show(scrolled_window); new_web_view = webkit_web_view_new(); gtk_container_add(GTK_CONTAINER(scrolled_window), new_web_view); return WEBKIT_WEB_VIEW(new_web_view);}
开发者ID:minozake,项目名称:uzbl,代码行数:28,
|