~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Igalia S.L.
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Library General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Library General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Library General Public License
 
15
 * along with this library; see the file COPYING.LIB.  If not, write to
 
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
 * Boston, MA 02110-1301, USA.
 
18
 */
 
19
 
 
20
#include "config.h"
 
21
#include "WebKitWindowProperties.h"
 
22
 
 
23
#include "ImmutableDictionary.h"
 
24
#include "WebKitPrivate.h"
 
25
#include "WebKitWindowPropertiesPrivate.h"
 
26
#include "WebNumber.h"
 
27
#include "WebURLRequest.h"
 
28
#include <WebCore/IntRect.h>
 
29
#include <glib/gi18n-lib.h>
 
30
 
 
31
using namespace WebKit;
 
32
using namespace WebCore;
 
33
 
 
34
/**
 
35
 * SECTION: WebKitWindowProperties
 
36
 * @short_description: Window properties of a #WebKitWebView
 
37
 * @title: WebKitWindowProperties
 
38
 * @see_also: #WebKitWebView::ready-to-show
 
39
 *
 
40
 * The content of a #WebKitWebView can request to change certain
 
41
 * properties of the window containing the view. This can include the x, y position
 
42
 * of the window, the width and height but also if a toolbar,
 
43
 * scrollbar, statusbar, locationbar should be visible to the user,
 
44
 * and the request to show the #WebKitWebView fullscreen.
 
45
 *
 
46
 * The #WebKitWebView::ready-to-show signal handler is the proper place
 
47
 * to apply the initial window properties. Then you can monitor the
 
48
 * #WebKitWindowProperties by connecting to ::notify signal.
 
49
 *
 
50
 * <informalexample><programlisting>
 
51
 * static void ready_to_show_cb (WebKitWebView *web_view, gpointer user_data)
 
52
 * {
 
53
 *     GtkWidget *window;
 
54
 *     WebKitWindowProperties *window_properties;
 
55
 *     gboolean visible;
 
56
 *
 
57
 *     /<!-- -->* Create the window to contain the WebKitWebView *<!-- -->/
 
58
 *     window = browser_window_new ();
 
59
 *     gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (web_view));
 
60
 *     gtk_widget_show (GTK_WIDGET (web_view));
 
61
 *
 
62
 *     /<!-- -->* Get the WebKitWindowProperties of the web view and monitor it *<!-- -->/
 
63
 *     window_properties = webkit_web_view_get_window_properties (web_view);
 
64
 *     g_signal_connect (window_properties, "notify::geometry",
 
65
 *                       G_CALLBACK (window_geometry_changed), window);
 
66
 *     g_signal_connect (window_properties, "notify::toolbar-visible",
 
67
 *                       G_CALLBACK (window_toolbar_visibility_changed), window);
 
68
 *     g_signal_connect (window_properties, "notify::menubar-visible",
 
69
 *                       G_CALLBACK (window_menubar_visibility_changed), window);
 
70
 *     ....
 
71
 *
 
72
 *     /<!-- -->* Apply the window properties before showing the window *<!-- -->/
 
73
 *     visible = webkit_window_properties_get_toolbar_visible (window_properties);
 
74
 *     browser_window_set_toolbar_visible (BROWSER_WINDOW (window), visible);
 
75
 *     visible = webkit_window_properties_get_menubar_visible (window_properties);
 
76
 *     browser_window_set_menubar_visible (BROWSER_WINDOW (window), visible);
 
77
 *     ....
 
78
 *
 
79
 *     if (webkit_window_properties_get_fullscreen (window_properties)) {
 
80
 *         gtk_window_fullscreen (GTK_WINDOW (window));
 
81
 *     } else {
 
82
 *         GdkRectangle geometry;
 
83
 *
 
84
 *         gtk_window_set_resizable (GTK_WINDOW (window),
 
85
 *                                   webkit_window_properties_get_resizable (window_properties));
 
86
 *         webkit_window_properties_get_geometry (window_properties, &geometry);
 
87
 *         gtk_window_move (GTK_WINDOW (window), geometry.x, geometry.y);
 
88
 *         gtk_window_resize (GTK_WINDOW (window), geometry.width, geometry.height);
 
89
 *     }
 
90
 *
 
91
 *     gtk_widget_show (window);
 
92
 * }
 
93
 * </programlisting></informalexample>
 
94
 */
 
95
 
 
96
enum {
 
97
    PROP_0,
 
98
 
 
99
    PROP_GEOMETRY,
 
100
    PROP_TOOLBAR_VISIBLE,
 
101
    PROP_STATUSBAR_VISIBLE,
 
102
    PROP_SCROLLBARS_VISIBLE,
 
103
    PROP_MENUBAR_VISIBLE,
 
104
    PROP_LOCATIONBAR_VISIBLE,
 
105
    PROP_RESIZABLE,
 
106
    PROP_FULLSCREEN
 
107
};
 
108
 
 
109
struct _WebKitWindowPropertiesPrivate {
 
110
    GdkRectangle geometry;
 
111
 
 
112
    bool toolbarVisible : 1;
 
113
    bool statusbarVisible : 1;
 
114
    bool scrollbarsVisible : 1;
 
115
    bool menubarVisible : 1;
 
116
    bool locationbarVisible : 1;
 
117
 
 
118
    bool resizable : 1;
 
119
    bool fullscreen : 1;
 
120
};
 
121
 
 
122
WEBKIT_DEFINE_TYPE(WebKitWindowProperties, webkit_window_properties, G_TYPE_OBJECT)
 
123
 
 
124
static void webkitWindowPropertiesGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
 
125
{
 
126
    WebKitWindowProperties* windowProperties = WEBKIT_WINDOW_PROPERTIES(object);
 
127
 
 
128
    switch (propId) {
 
129
    case PROP_GEOMETRY:
 
130
        g_value_set_boxed(value, &windowProperties->priv->geometry);
 
131
        break;
 
132
    case PROP_TOOLBAR_VISIBLE:
 
133
        g_value_set_boolean(value, webkit_window_properties_get_toolbar_visible(windowProperties));
 
134
        break;
 
135
    case PROP_STATUSBAR_VISIBLE:
 
136
        g_value_set_boolean(value, webkit_window_properties_get_statusbar_visible(windowProperties));
 
137
        break;
 
138
    case PROP_SCROLLBARS_VISIBLE:
 
139
        g_value_set_boolean(value, webkit_window_properties_get_scrollbars_visible(windowProperties));
 
140
        break;
 
141
    case PROP_MENUBAR_VISIBLE:
 
142
        g_value_set_boolean(value, webkit_window_properties_get_menubar_visible(windowProperties));
 
143
        break;
 
144
    case PROP_LOCATIONBAR_VISIBLE:
 
145
        g_value_set_boolean(value, webkit_window_properties_get_locationbar_visible(windowProperties));
 
146
        break;
 
147
    case PROP_RESIZABLE:
 
148
        g_value_set_boolean(value, webkit_window_properties_get_resizable(windowProperties));
 
149
        break;
 
150
    case PROP_FULLSCREEN:
 
151
        g_value_set_boolean(value, webkit_window_properties_get_fullscreen(windowProperties));
 
152
        break;
 
153
    default:
 
154
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
 
155
    }
 
156
}
 
157
 
 
158
static void webkitWindowPropertiesSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
 
159
{
 
160
    WebKitWindowProperties* windowProperties = WEBKIT_WINDOW_PROPERTIES(object);
 
161
 
 
162
    switch (propId) {
 
163
    case PROP_GEOMETRY:
 
164
        if (GdkRectangle* geometry = static_cast<GdkRectangle*>(g_value_get_boxed(value)))
 
165
            windowProperties->priv->geometry = *geometry;
 
166
        break;
 
167
    case PROP_TOOLBAR_VISIBLE:
 
168
        windowProperties->priv->toolbarVisible = g_value_get_boolean(value);
 
169
        break;
 
170
    case PROP_STATUSBAR_VISIBLE:
 
171
        windowProperties->priv->statusbarVisible = g_value_get_boolean(value);
 
172
        break;
 
173
    case PROP_SCROLLBARS_VISIBLE:
 
174
        windowProperties->priv->scrollbarsVisible = g_value_get_boolean(value);
 
175
        break;
 
176
    case PROP_MENUBAR_VISIBLE:
 
177
        windowProperties->priv->menubarVisible = g_value_get_boolean(value);
 
178
        break;
 
179
    case PROP_LOCATIONBAR_VISIBLE:
 
180
        windowProperties->priv->locationbarVisible = g_value_get_boolean(value);
 
181
        break;
 
182
    case PROP_RESIZABLE:
 
183
        windowProperties->priv->resizable = g_value_get_boolean(value);
 
184
        break;
 
185
    case PROP_FULLSCREEN:
 
186
        windowProperties->priv->fullscreen = g_value_get_boolean(value);
 
187
        break;
 
188
    default:
 
189
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
 
190
    }
 
191
}
 
192
 
 
193
static void webkit_window_properties_class_init(WebKitWindowPropertiesClass* requestClass)
 
194
{
 
195
    GObjectClass* objectClass = G_OBJECT_CLASS(requestClass);
 
196
    objectClass->get_property = webkitWindowPropertiesGetProperty;
 
197
    objectClass->set_property = webkitWindowPropertiesSetProperty;
 
198
 
 
199
    GParamFlags paramFlags = static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
 
200
 
 
201
    /**
 
202
     * WebKitWebWindowProperties:geometry:
 
203
     *
 
204
     * The size and position of the window on the screen.
 
205
     */
 
206
    g_object_class_install_property(objectClass,
 
207
                                    PROP_GEOMETRY,
 
208
                                    g_param_spec_boxed("geometry",
 
209
                                                       _("Geometry"),
 
210
                                                       _("The size and position of the window on the screen."),
 
211
                                                       GDK_TYPE_RECTANGLE,
 
212
                                                       paramFlags));
 
213
 
 
214
    /**
 
215
     * WebKitWebWindowProperties:toolbar-visible:
 
216
     *
 
217
     * Whether the toolbar should be visible for the window.
 
218
     */
 
219
    g_object_class_install_property(objectClass,
 
220
                                    PROP_TOOLBAR_VISIBLE,
 
221
                                    g_param_spec_boolean("toolbar-visible",
 
222
                                                         _("Toolbar Visible"),
 
223
                                                         _("Whether the toolbar should be visible for the window."),
 
224
                                                         TRUE,
 
225
                                                         paramFlags));
 
226
 
 
227
    /**
 
228
     * WebKitWebWindowProperties:statusbar-visible:
 
229
     *
 
230
     * Whether the statusbar should be visible for the window.
 
231
     */
 
232
    g_object_class_install_property(objectClass,
 
233
                                    PROP_STATUSBAR_VISIBLE,
 
234
                                    g_param_spec_boolean("statusbar-visible",
 
235
                                                         _("Statusbar Visible"),
 
236
                                                         _("Whether the statusbar should be visible for the window."),
 
237
                                                         TRUE,
 
238
                                                         paramFlags));
 
239
 
 
240
    /**
 
241
     * WebKitWebWindowProperties:scrollbars-visible:
 
242
     *
 
243
     * Whether the scrollbars should be visible for the window.
 
244
     */
 
245
    g_object_class_install_property(objectClass,
 
246
                                    PROP_SCROLLBARS_VISIBLE,
 
247
                                    g_param_spec_boolean("scrollbars-visible",
 
248
                                                         _("Scrollbars Visible"),
 
249
                                                         _("Whether the scrollbars should be visible for the window."),
 
250
                                                         TRUE,
 
251
                                                         paramFlags));
 
252
 
 
253
    /**
 
254
     * WebKitWebWindowProperties:menubar-visible:
 
255
     *
 
256
     * Whether the menubar should be visible for the window.
 
257
     */
 
258
    g_object_class_install_property(objectClass,
 
259
                                    PROP_MENUBAR_VISIBLE,
 
260
                                    g_param_spec_boolean("menubar-visible",
 
261
                                                         _("Menubar Visible"),
 
262
                                                         _("Whether the menubar should be visible for the window."),
 
263
                                                         TRUE,
 
264
                                                         paramFlags));
 
265
 
 
266
    /**
 
267
     * WebKitWebWindowProperties:locationbar-visible:
 
268
     *
 
269
     * Whether the locationbar should be visible for the window.
 
270
     */
 
271
    g_object_class_install_property(objectClass,
 
272
                                    PROP_LOCATIONBAR_VISIBLE,
 
273
                                    g_param_spec_boolean("locationbar-visible",
 
274
                                                         _("Locationbar Visible"),
 
275
                                                         _("Whether the locationbar should be visible for the window."),
 
276
                                                         TRUE,
 
277
                                                         paramFlags));
 
278
    /**
 
279
     * WebKitWebWindowProperties:resizable:
 
280
     *
 
281
     * Whether the window can be resized.
 
282
     */
 
283
    g_object_class_install_property(objectClass,
 
284
                                    PROP_RESIZABLE,
 
285
                                    g_param_spec_boolean("resizable",
 
286
                                                         _("Resizable"),
 
287
                                                         _("Whether the window can be resized."),
 
288
                                                         TRUE,
 
289
                                                         paramFlags));
 
290
 
 
291
    /**
 
292
     * WebKitWebWindowProperties:fullscreen:
 
293
     *
 
294
     * Whether window will be displayed fullscreen.
 
295
     */
 
296
    g_object_class_install_property(objectClass,
 
297
                                    PROP_FULLSCREEN,
 
298
                                    g_param_spec_boolean("fullscreen",
 
299
                                                         _("Fullscreen"),
 
300
                                                         _("Whether window will be displayed fullscreen."),
 
301
                                                         FALSE,
 
302
                                                         paramFlags));
 
303
}
 
304
 
 
305
WebKitWindowProperties* webkitWindowPropertiesCreate()
 
306
{
 
307
    return WEBKIT_WINDOW_PROPERTIES(g_object_new(WEBKIT_TYPE_WINDOW_PROPERTIES, NULL));
 
308
}
 
309
 
 
310
void webkitWindowPropertiesSetGeometry(WebKitWindowProperties* windowProperties, GdkRectangle* geometry)
 
311
{
 
312
    if (windowProperties->priv->geometry.x == geometry->x
 
313
        && windowProperties->priv->geometry.y == geometry->y
 
314
        && windowProperties->priv->geometry.width == geometry->width
 
315
        && windowProperties->priv->geometry.height == geometry->height)
 
316
        return;
 
317
    windowProperties->priv->geometry = *geometry;
 
318
    g_object_notify(G_OBJECT(windowProperties), "geometry");
 
319
}
 
320
 
 
321
void webkitWindowPropertiesSetToolbarVisible(WebKitWindowProperties* windowProperties, bool toolbarsVisible)
 
322
{
 
323
    if (windowProperties->priv->toolbarVisible == toolbarsVisible)
 
324
        return;
 
325
    windowProperties->priv->toolbarVisible = toolbarsVisible;
 
326
    g_object_notify(G_OBJECT(windowProperties), "toolbar-visible");
 
327
}
 
328
 
 
329
void webkitWindowPropertiesSetMenubarVisible(WebKitWindowProperties* windowProperties, bool menuBarVisible)
 
330
{
 
331
    if (windowProperties->priv->menubarVisible == menuBarVisible)
 
332
        return;
 
333
    windowProperties->priv->menubarVisible = menuBarVisible;
 
334
    g_object_notify(G_OBJECT(windowProperties), "menubar-visible");
 
335
}
 
336
 
 
337
void webkitWindowPropertiesSetStatusbarVisible(WebKitWindowProperties* windowProperties, bool statusBarVisible)
 
338
{
 
339
    if (windowProperties->priv->statusbarVisible == statusBarVisible)
 
340
        return;
 
341
    windowProperties->priv->statusbarVisible = statusBarVisible;
 
342
    g_object_notify(G_OBJECT(windowProperties), "statusbar-visible");
 
343
}
 
344
 
 
345
void webkitWindowPropertiesSetLocationbarVisible(WebKitWindowProperties* windowProperties, bool locationBarVisible)
 
346
{
 
347
    if (windowProperties->priv->locationbarVisible == locationBarVisible)
 
348
        return;
 
349
    windowProperties->priv->locationbarVisible = locationBarVisible;
 
350
    g_object_notify(G_OBJECT(windowProperties), "locationbar-visible");
 
351
}
 
352
 
 
353
void webkitWindowPropertiesSetScrollbarsVisible(WebKitWindowProperties* windowProperties, bool scrollBarsVisible)
 
354
{
 
355
    if (windowProperties->priv->scrollbarsVisible == scrollBarsVisible)
 
356
        return;
 
357
    windowProperties->priv->scrollbarsVisible = scrollBarsVisible;
 
358
    g_object_notify(G_OBJECT(windowProperties), "scrollbars-visible");
 
359
}
 
360
 
 
361
void webkitWindowPropertiesSetResizable(WebKitWindowProperties* windowProperties, bool resizable)
 
362
{
 
363
    if (windowProperties->priv->resizable == resizable)
 
364
        return;
 
365
    windowProperties->priv->resizable = resizable;
 
366
    g_object_notify(G_OBJECT(windowProperties), "resizable");
 
367
}
 
368
 
 
369
void webkitWindowPropertiesSetFullscreen(WebKitWindowProperties* windowProperties, bool fullscreen)
 
370
{
 
371
    if (windowProperties->priv->fullscreen == fullscreen)
 
372
        return;
 
373
    windowProperties->priv->fullscreen = fullscreen;
 
374
    g_object_notify(G_OBJECT(windowProperties), "fullscreen");
 
375
}
 
376
 
 
377
void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties* windowProperties, ImmutableDictionary* features)
 
378
{
 
379
    GdkRectangle geometry = windowProperties->priv->geometry;
 
380
 
 
381
    WebDouble* doubleValue = static_cast<WebDouble*>(features->get("x"));
 
382
    if (doubleValue)
 
383
        geometry.x = doubleValue->value();
 
384
 
 
385
    doubleValue = static_cast<WebDouble*>(features->get("y"));
 
386
    if (doubleValue)
 
387
        geometry.y = doubleValue->value();
 
388
 
 
389
    doubleValue = static_cast<WebDouble*>(features->get("width"));
 
390
    if (doubleValue)
 
391
        geometry.width = doubleValue->value();
 
392
 
 
393
    doubleValue = static_cast<WebDouble*>(features->get("height"));
 
394
    if (doubleValue)
 
395
        geometry.height = doubleValue->value();
 
396
    webkitWindowPropertiesSetGeometry(windowProperties, &geometry);
 
397
 
 
398
    WebBoolean* booleanValue = static_cast<WebBoolean*>(features->get("menuBarVisible"));
 
399
    if (booleanValue)
 
400
        webkitWindowPropertiesSetMenubarVisible(windowProperties, booleanValue->value());
 
401
 
 
402
    booleanValue = static_cast<WebBoolean*>(features->get("statusBarVisible"));
 
403
    if (booleanValue)
 
404
        webkitWindowPropertiesSetStatusbarVisible(windowProperties, booleanValue->value());
 
405
 
 
406
    booleanValue = static_cast<WebBoolean*>(features->get("toolBarVisible"));
 
407
    if (booleanValue)
 
408
        webkitWindowPropertiesSetToolbarVisible(windowProperties, booleanValue->value());
 
409
 
 
410
    booleanValue = static_cast<WebBoolean*>(features->get("locationBarVisible"));
 
411
    if (booleanValue)
 
412
        webkitWindowPropertiesSetLocationbarVisible(windowProperties, booleanValue->value());
 
413
 
 
414
    booleanValue = static_cast<WebBoolean*>(features->get("scrollbarsVisible"));
 
415
    if (booleanValue)
 
416
        webkitWindowPropertiesSetScrollbarsVisible(windowProperties, booleanValue->value());
 
417
 
 
418
    booleanValue = static_cast<WebBoolean*>(features->get("resizable"));
 
419
    if (booleanValue)
 
420
        webkitWindowPropertiesSetResizable(windowProperties, booleanValue->value());
 
421
 
 
422
    booleanValue = static_cast<WebBoolean*>(features->get("fullscreen"));
 
423
    if (booleanValue)
 
424
        webkitWindowPropertiesSetFullscreen(windowProperties, booleanValue->value());
 
425
}
 
426
 
 
427
/**
 
428
 * webkit_window_properties_get_geometry:
 
429
 * @window_properties: a #WebKitWindowProperties
 
430
 * @geometry: (out): return location for the window geometry
 
431
 *
 
432
 * Get the geometry the window should have on the screen when shown.
 
433
 */
 
434
void webkit_window_properties_get_geometry(WebKitWindowProperties* windowProperties, GdkRectangle* geometry)
 
435
{
 
436
    g_return_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties));
 
437
    g_return_if_fail(geometry);
 
438
 
 
439
    *geometry = windowProperties->priv->geometry;
 
440
}
 
441
 
 
442
/**
 
443
 * webkit_window_properties_get_toolbar_visible:
 
444
 * @window_properties: a #WebKitWindowProperties
 
445
 *
 
446
 * Get whether the window should have the toolbar visible or not.
 
447
 *
 
448
 * Returns: %TRUE if toolbar should be visible or %FALSE otherwise.
 
449
 */
 
450
gboolean webkit_window_properties_get_toolbar_visible(WebKitWindowProperties* windowProperties)
 
451
{
 
452
    g_return_val_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties), TRUE);
 
453
 
 
454
    return windowProperties->priv->toolbarVisible;
 
455
}
 
456
 
 
457
/**
 
458
 * webkit_window_properties_get_statusbar_visible:
 
459
 * @window_properties: a #WebKitWindowProperties
 
460
 *
 
461
 * Get whether the window should have the statusbar visible or not.
 
462
 *
 
463
 * Returns: %TRUE if statusbar should be visible or %FALSE otherwise.
 
464
 */
 
465
gboolean webkit_window_properties_get_statusbar_visible(WebKitWindowProperties* windowProperties)
 
466
{
 
467
    g_return_val_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties), TRUE);
 
468
 
 
469
    return windowProperties->priv->statusbarVisible;
 
470
}
 
471
 
 
472
/**
 
473
 * webkit_window_properties_get_scrollbars_visible:
 
474
 * @window_properties: a #WebKitWindowProperties
 
475
 *
 
476
 * Get whether the window should have the scrollbars visible or not.
 
477
 *
 
478
 * Returns: %TRUE if scrollbars should be visible or %FALSE otherwise.
 
479
 */
 
480
gboolean webkit_window_properties_get_scrollbars_visible(WebKitWindowProperties* windowProperties)
 
481
{
 
482
    g_return_val_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties), TRUE);
 
483
 
 
484
    return windowProperties->priv->scrollbarsVisible;
 
485
}
 
486
 
 
487
/**
 
488
 * webkit_window_properties_get_menubar_visible:
 
489
 * @window_properties: a #WebKitWindowProperties
 
490
 *
 
491
 * Get whether the window should have the menubar visible or not.
 
492
 *
 
493
 * Returns: %TRUE if menubar should be visible or %FALSE otherwise.
 
494
 */
 
495
gboolean webkit_window_properties_get_menubar_visible(WebKitWindowProperties* windowProperties)
 
496
{
 
497
    g_return_val_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties), TRUE);
 
498
 
 
499
    return windowProperties->priv->menubarVisible;
 
500
}
 
501
 
 
502
/**
 
503
 * webkit_window_properties_get_locationbar_visible:
 
504
 * @window_properties: a #WebKitWindowProperties
 
505
 *
 
506
 * Get whether the window should have the locationbar visible or not.
 
507
 *
 
508
 * Returns: %TRUE if locationbar should be visible or %FALSE otherwise.
 
509
 */
 
510
gboolean webkit_window_properties_get_locationbar_visible(WebKitWindowProperties* windowProperties)
 
511
{
 
512
    g_return_val_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties), TRUE);
 
513
 
 
514
    return windowProperties->priv->locationbarVisible;
 
515
}
 
516
 
 
517
/**
 
518
 * webkit_window_properties_get_resizable:
 
519
 * @window_properties: a #WebKitWindowProperties
 
520
 *
 
521
 * Get whether the window should be resizable by the user or not.
 
522
 *
 
523
 * Returns: %TRUE if the window should be resizable or %FALSE otherwise.
 
524
 */
 
525
gboolean webkit_window_properties_get_resizable(WebKitWindowProperties* windowProperties)
 
526
{
 
527
    g_return_val_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties), TRUE);
 
528
 
 
529
    return windowProperties->priv->resizable;
 
530
}
 
531
 
 
532
/**
 
533
 * webkit_window_properties_get_fullscreen:
 
534
 * @window_properties: a #WebKitWindowProperties
 
535
 *
 
536
 * Get whether the window should be shown in fullscreen state or not.
 
537
 *
 
538
 * Returns: %TRUE if the window should be fullscreen or %FALSE otherwise.
 
539
 */
 
540
gboolean webkit_window_properties_get_fullscreen(WebKitWindowProperties* windowProperties)
 
541
{
 
542
    g_return_val_if_fail(WEBKIT_IS_WINDOW_PROPERTIES(windowProperties), FALSE);
 
543
 
 
544
    return windowProperties->priv->fullscreen;
 
545
}