WebKit.WindowProperties

g GObject.Object GObject.Object WebKit.WindowProperties WebKit.WindowProperties GObject.Object->WebKit.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)

Class Details

class WebKit.WindowProperties(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit.WindowPropertiesClass

Window properties of a WebKit.WebView.

The content of a WebKit.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 WebKit.WebView fullscreen.

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

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

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

// Get the WebKit.WindowProperties of the web view and monitor it. window_properties = WebKit.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 = WebKit.WindowProperties.get_toolbar_visible (window_properties); browser_window_set_toolbar_visible (BROWSER_WINDOW (window), visible); visible = WebKit.WindowProperties.get_menubar_visible (window_properties); browser_window_set_menubar_visible (BROWSER_WINDOW (window), visible);

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

Gtk.Window.set_resizable (GTK_WINDOW (window), WebKit.WindowProperties.get_resizable (window_properties)); WebKit.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

WebKit.WindowProperties.props.fullscreen
Name:

fullscreen

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether window will be displayed fullscreen.

WebKit.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.

WebKit.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.

WebKit.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.

WebKit.WindowProperties.props.resizable
Name:

resizable

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the window can be resized.

WebKit.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.

WebKit.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.

WebKit.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.