Exemplo n.º 1
0
static gboolean _on_web_view_ready(WebKitWebView * view, gpointer data)
{
	GHtml * ghtml;
	WebKitWebWindowFeatures * features;
	gboolean b;
	gint w;
	gint h;

	ghtml = g_object_get_data(G_OBJECT(data), "ghtml");
	features = webkit_web_view_get_window_features(WEBKIT_WEB_VIEW(view));
	/* FIXME track properties with notify:: instead */
	g_object_get(G_OBJECT(features), "width", &w, "height", &h, NULL);
	if(w > 0 && h > 0)
		surfer_resize(ghtml->surfer, w, h);
	g_object_get(G_OBJECT(features), "fullscreen", &b, NULL);
	if(b == TRUE)
		surfer_set_fullscreen(ghtml->surfer, TRUE);
# ifndef EMBEDDED
	g_object_get(G_OBJECT(features), "menubar-visible", &b, NULL);
	surfer_show_menubar(ghtml->surfer, b);
# endif
	g_object_get(G_OBJECT(features), "toolbar-visible", &b, NULL);
	surfer_show_toolbar(ghtml->surfer, b);
	g_object_get(G_OBJECT(features), "statusbar-visible", &b, NULL);
	surfer_show_statusbar(ghtml->surfer, b);
	surfer_show_window(ghtml->surfer, TRUE);
	return FALSE;
}
Exemplo n.º 2
0
/* htmlapp_on_fullscreen */
static void _htmlapp_on_fullscreen(gpointer data)
{
	HTMLApp * htmlapp = data;
	GdkWindow * window;
	gboolean fullscreen;

#if GTK_CHECK_VERSION(2, 14, 0)
	window = gtk_widget_get_window(htmlapp->window);
#else
	window = htmlapp->window->window;
#endif
	fullscreen = (gdk_window_get_state(window)
			& GDK_WINDOW_STATE_FULLSCREEN)
		== GDK_WINDOW_STATE_FULLSCREEN;
	surfer_set_fullscreen(htmlapp, !fullscreen);
}