Exemple #1
0
 WindowProperties(WebKitWindowProperties* windowProperties)
     : m_isNull(false)
     , m_toolbarVisible(webkit_window_properties_get_toolbar_visible(windowProperties))
     , m_statusbarVisible(webkit_window_properties_get_statusbar_visible(windowProperties))
     , m_scrollbarsVisible(webkit_window_properties_get_scrollbars_visible(windowProperties))
     , m_menubarVisible(webkit_window_properties_get_menubar_visible(windowProperties))
     , m_locationbarVisible(webkit_window_properties_get_locationbar_visible(windowProperties))
     , m_resizable(webkit_window_properties_get_resizable(windowProperties))
     , m_fullscreen(webkit_window_properties_get_fullscreen(windowProperties))
 {
     webkit_window_properties_get_geometry(windowProperties, &m_geometry);
 }
Exemple #2
0
static void webViewReadyToShow(WebKitWebView *webView, BrowserWindow *window)
{
    WebKitWindowProperties *windowProperties = webkit_web_view_get_window_properties(webView);

    GdkRectangle geometry;
    webkit_window_properties_get_geometry(windowProperties, &geometry);
    if (geometry.x >= 0 && geometry.y >= 0)
        gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y);
    if (geometry.width > 0 && geometry.height > 0)
        gtk_window_resize(GTK_WINDOW(window), geometry.width, geometry.height);

    if (!webkit_window_properties_get_toolbar_visible(windowProperties))
        gtk_widget_hide(window->toolbar);
    else if (!webkit_window_properties_get_locationbar_visible(windowProperties))
        gtk_widget_hide(window->uriEntry);

    if (!webkit_window_properties_get_resizable(windowProperties))
        gtk_window_set_resizable(GTK_WINDOW(window), FALSE);

    gtk_widget_show(GTK_WIDGET(window));
}