WebKit2.WindowProperties

g GObject.Object GObject.Object WebKit2.WindowProperties WebKit2.WindowProperties GObject.Object->WebKit2.WindowProperties

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_fullscreen ()

get_geometry ()

get_locationbar_visible ()

get_menubar_visible ()

get_resizable ()

get_scrollbars_visible ()

get_statusbar_visible ()

get_toolbar_visible ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

fullscreen

bool

r/w/co

geometry

Gdk.Rectangle

r/w/co

locationbar-visible

bool

r/w/co

menubar-visible

bool

r/w/co

resizable

bool

r/w/co

scrollbars-visible

bool

r/w/co

statusbar-visible

bool

r/w/co

toolbar-visible

bool

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.WindowProperties(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2.WindowPropertiesClass

Window properties of a WebKit2.WebView.

The content of a WebKit2.WebView can request to change certain properties of the window containing the view. This can include the x, y position of the window, the width and height but also if a toolbar, scrollbar, statusbar, locationbar should be visible to the user, and the request to show the WebKit2.WebView fullscreen.

The WebKit2.WebView ::ready-to-show signal handler is the proper place to apply the initial window properties. Then you can monitor the WebKit2.WindowProperties by connecting to ::notify signal.

```c static void ready_to_show_cb (WebKit2.WebView *web_view, object user_data) { Gtk.Widget *window; WebKit2.WindowProperties *window_properties; bool visible;

// Create the window to contain the WebKit2.WebView. window = browser_window_new (); Gtk.Container.add (GTK_CONTAINER (window), GTK_WIDGET (web_view)); Gtk.Widget.show (GTK_WIDGET (web_view));

// Get the WebKit2.WindowProperties of the web view and monitor it. window_properties = WebKit2.WebView.get_window_properties (web_view); g_signal_connect (window_properties, “notify::geometry”, G_CALLBACK (window_geometry_changed), window); g_signal_connect (window_properties, “notify::toolbar-visible”, G_CALLBACK (window_toolbar_visibility_changed), window); g_signal_connect (window_properties, “notify::menubar-visible”, G_CALLBACK (window_menubar_visibility_changed), window);

// Apply the window properties before showing the window. visible = WebKit2.WindowProperties.get_toolbar_visible (window_properties); browser_window_set_toolbar_visible (BROWSER_WINDOW (window), visible); visible = WebKit2.WindowProperties.get_menubar_visible (window_properties); browser_window_set_menubar_visible (BROWSER_WINDOW (window), visible);

if (WebKit2.WindowProperties.get_fullscreen (window_properties)) { Gtk.Window.fullscreen (GTK_WINDOW (window)); } else { Gdk.Rectangle geometry;

Gtk.Window.set_resizable (GTK_WINDOW (window), WebKit2.WindowProperties.get_resizable (window_properties)); WebKit2.WindowProperties.get_geometry (window_properties, &geometry); Gtk.Window.move (GTK_WINDOW (window), geometry.x, geometry.y); Gtk.Window.resize (GTK_WINDOW (window), geometry.width, geometry.height); }

Gtk.Widget.show (window); } ```

get_fullscreen()
Returns:

True if the window should be fullscreen or False otherwise.

Return type:

bool

Get whether the window should be shown in fullscreen state or not.

get_geometry()
Returns:

return location for the window geometry

Return type:

geometry: Gdk.Rectangle

Get the geometry the window should have on the screen when shown.

get_locationbar_visible()
Returns:

True if locationbar should be visible or False otherwise.

Return type:

bool

Get whether the window should have the locationbar visible or not.

get_menubar_visible()
Returns:

True if menubar should be visible or False otherwise.

Return type:

bool

Get whether the window should have the menubar visible or not.

get_resizable()
Returns:

True if the window should be resizable or False otherwise.

Return type:

bool

Get whether the window should be resizable by the user or not.

get_scrollbars_visible()
Returns:

True if scrollbars should be visible or False otherwise.

Return type:

bool

Get whether the window should have the scrollbars visible or not.

get_statusbar_visible()
Returns:

True if statusbar should be visible or False otherwise.

Return type:

bool

Get whether the window should have the statusbar visible or not.

get_toolbar_visible()
Returns:

True if toolbar should be visible or False otherwise.

Return type:

bool

Get whether the window should have the toolbar visible or not.

Property Details

WebKit2.WindowProperties.props.fullscreen
Name:

fullscreen

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether window will be displayed fullscreen.

WebKit2.WindowProperties.props.geometry
Name:

geometry

Type:

Gdk.Rectangle

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The size and position of the window on the screen.

WebKit2.WindowProperties.props.locationbar_visible
Name:

locationbar-visible

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the locationbar should be visible for the window.

WebKit2.WindowProperties.props.menubar_visible
Name:

menubar-visible

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the menubar should be visible for the window.

WebKit2.WindowProperties.props.resizable
Name:

resizable

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the window can be resized.

WebKit2.WindowProperties.props.scrollbars_visible
Name:

scrollbars-visible

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the scrollbars should be visible for the window.

WebKit2.WindowProperties.props.statusbar_visible
Name:

statusbar-visible

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the statusbar should be visible for the window.

WebKit2.WindowProperties.props.toolbar_visible
Name:

toolbar-visible

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the toolbar should be visible for the window.