source: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp @ 174188

Revision 171742, 111.0 KB checked in by commit-queue@webkit.org, 2 months ago (diff)

[GTK] Remove WebKitWebViewGroup from WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=133729

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2014-07-29
Reviewed by Carlos Garcia Campos.

Removes WebKitWebViewGroup, effectively reverting the changes
introduced by r149117. The motivation for WebKitWebViewGroup
was using the user style sheet injection API, which has been
moved into WebKitUserContentManager, rendering it unneeded.

Source/WebKit2:

  • PlatformGTK.cmake: Remove WebKitWebViewGroup source files

from the build.

  • UIProcess/API/C/gtk/WKView.cpp:

(WKViewCreate): Accomodate for changes in the signature of
webkitWebViewBaseCreate().

  • UIProcess/API/gtk/WebKitSettings.cpp: Update API documentation.
  • UIProcess/API/gtk/WebKitWebContext.cpp: Remove the default web

view group from WebKitWebContext.
(webkitWebContextCreatePageForWebView): Allow passing a
WebPreferences object at construction.
(webkitWebContextGetDefaultWebViewGroup): Deleted.

  • UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
  • UIProcess/API/gtk/WebKitWebView.cpp:

(webkitWebViewUpdateSettings): Use WebPageProxy::setPreferences()
directly. Handle the case when webkit_web_view_set_settings()
is called on construction by doing an early-return.
(webkitWebViewConstructed): Call webkitWebViewUpdateSettings()
after creating the internal WebPageProxy object.
(webkitWebViewSetProperty): Removed "group" property, added
"settings" property.
(webkitWebViewGetProperty): Ditto.
(webkitWebViewDispose): Do not disconnect signal handler for
the (now unexistant) WebKitWebViewGroup.
(webkit_web_view_class_init): Removed "group" property, added
"settings" property.
(webkitWebViewHandleAuthenticationChallenge): Access the
WebKitWebSettings directly.
(webkit_web_view_new_with_related_view): Make new views share
settings with their related view.
(webkit_web_view_new_with_settings): Added.
(webkit_web_view_set_settings): Access the settings directly in
the WebKitWebView.
(webkit_web_view_get_settings): Ditto.
(webkit_web_view_set_zoom_level): Ditto.
(webkit_web_view_get_zoom_level): Ditto.
(webkitWebViewSettingsChanged): Deleted.
(webkitWebViewDisconnectSettingsChangedSignalHandler): Deleted.
(webkit_web_view_new_with_group): Deleted.
(webkit_web_view_get_group): Deleted.

  • UIProcess/API/gtk/WebKitWebView.h: Removed API methods related

to WebKitWebViewGroup.

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkitWebViewBaseCreate): Allow passing a WebPreferences object
for constructing the WebPageProxy.
(webkitWebViewBaseUpdatePreferences): Instead of going through
the page group, use WebPageProxy::preferences() directly.
(webkitWebViewBaseCreateWebPage): Allow passing a WebPreferences
object for constructing the WebPageProxy.

  • UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Update the

prototypes of the internal functions.

  • UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed.
  • UIProcess/API/gtk/WebKitWebViewGroup.h: Removed.
  • UIProcess/API/gtk/WebKitWebViewGroupPrivate.h: Removed.
  • UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Change public API

bits in the documentation.

  • UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto.
  • UIProcess/API/gtk/docs/webkit2gtk.types: Ditto.
  • UIProcess/API/gtk/webkit2.h: Removed WebKitWebViewGroup.h header.
  • UIProcess/gtk/WebInspectorProxyGtk.cpp:

(WebKit::WebInspectorProxy::platformCreateInspectorPage):
Accomodate for changes in the signature of
webkitWebViewBaseCreate().

Tools:

  • TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt: Remove tests

for WebKitWebViewGroup.

  • TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:

(testWebViewSettings):
Restore the assertions that check that settings objects are
released. Add test for webkit_web_view_new_with_settings().

  • TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp: Removed.
  • Property svn:eol-style set to LF
Line 
1/*
2 * Copyright (c) 2011 Motorola Mobility, Inc.  All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification,
5 * are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation and/or
12 * other materials provided with the distribution.
13 *
14 * Neither the name of Motorola Mobility, Inc. nor the names of its contributors may
15 * be used to endorse or promote products derived from this software without
16 * specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include "config.h"
32#include "WebKitSettings.h"
33
34#include "ExperimentalFeatures.h"
35#include "WebKitPrivate.h"
36#include "WebKitSettingsPrivate.h"
37#include "WebPageProxy.h"
38#include "WebPreferences.h"
39#include <WebCore/UserAgentGtk.h>
40#include <glib/gi18n-lib.h>
41#include <wtf/text/CString.h>
42
43using namespace WebKit;
44
45struct _WebKitSettingsPrivate {
46    _WebKitSettingsPrivate()
47        : preferences(WebPreferences::create(String(), "WebKit2.", "WebKit2."))
48    {
49        defaultFontFamily = preferences->standardFontFamily().utf8();
50        monospaceFontFamily = preferences->fixedFontFamily().utf8();
51        serifFontFamily = preferences->serifFontFamily().utf8();
52        sansSerifFontFamily = preferences->sansSerifFontFamily().utf8();
53        cursiveFontFamily = preferences->cursiveFontFamily().utf8();
54        fantasyFontFamily = preferences->fantasyFontFamily().utf8();
55        pictographFontFamily = preferences->pictographFontFamily().utf8();
56        defaultCharset = preferences->defaultTextEncodingName().utf8();
57    }
58
59    RefPtr<WebPreferences> preferences;
60    CString defaultFontFamily;
61    CString monospaceFontFamily;
62    CString serifFontFamily;
63    CString sansSerifFontFamily;
64    CString cursiveFontFamily;
65    CString fantasyFontFamily;
66    CString pictographFontFamily;
67    CString defaultCharset;
68    CString userAgent;
69    bool allowModalDialogs;
70    bool zoomTextOnly;
71};
72
73/**
74 * SECTION:WebKitSettings
75 * @short_description: Control the behaviour of a #WebKitWebView
76 *
77 * #WebKitSettings can be applied to a #WebKitWebView to control text charset,
78 * color, font sizes, printing mode, script support, loading of images and various
79 * other things on a #WebKitWebView. After creation, a #WebKitSettings object
80 * contains default settings.
81 *
82 * <informalexample><programlisting>
83 * /<!-- -->* Disable JavaScript. *<!-- -->/
84 * WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group);
85 * webkit_settings_set_enable_javascript (settings, FALSE);
86 *
87 * </programlisting></informalexample>
88 */
89
90WEBKIT_DEFINE_TYPE(WebKitSettings, webkit_settings, G_TYPE_OBJECT)
91
92enum {
93    PROP_0,
94
95    PROP_ENABLE_JAVASCRIPT,
96    PROP_AUTO_LOAD_IMAGES,
97    PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING,
98    PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
99    PROP_ENABLE_HTML5_LOCAL_STORAGE,
100    PROP_ENABLE_HTML5_DATABASE,
101    PROP_ENABLE_XSS_AUDITOR,
102    PROP_ENABLE_FRAME_FLATTENING,
103    PROP_ENABLE_PLUGINS,
104    PROP_ENABLE_JAVA,
105    PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
106    PROP_ENABLE_HYPERLINK_AUDITING,
107    PROP_DEFAULT_FONT_FAMILY,
108    PROP_MONOSPACE_FONT_FAMILY,
109    PROP_SERIF_FONT_FAMILY,
110    PROP_SANS_SERIF_FONT_FAMILY,
111    PROP_CURSIVE_FONT_FAMILY,
112    PROP_FANTASY_FONT_FAMILY,
113    PROP_PICTOGRAPH_FONT_FAMILY,
114    PROP_DEFAULT_FONT_SIZE,
115    PROP_DEFAULT_MONOSPACE_FONT_SIZE,
116    PROP_MINIMUM_FONT_SIZE,
117    PROP_DEFAULT_CHARSET,
118    PROP_ENABLE_PRIVATE_BROWSING,
119    PROP_ENABLE_DEVELOPER_EXTRAS,
120    PROP_ENABLE_RESIZABLE_TEXT_AREAS,
121    PROP_ENABLE_TABS_TO_LINKS,
122    PROP_ENABLE_DNS_PREFETCHING,
123    PROP_ENABLE_CARET_BROWSING,
124    PROP_ENABLE_FULLSCREEN,
125    PROP_PRINT_BACKGROUNDS,
126    PROP_ENABLE_WEBAUDIO,
127    PROP_ENABLE_WEBGL,
128    PROP_ALLOW_MODAL_DIALOGS,
129    PROP_ZOOM_TEXT_ONLY,
130    PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
131    PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
132    PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
133    PROP_DRAW_COMPOSITING_INDICATORS,
134    PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
135    PROP_ENABLE_PAGE_CACHE,
136    PROP_USER_AGENT,
137    PROP_ENABLE_SMOOTH_SCROLLING,
138    PROP_ENABLE_ACCELERATED_2D_CANVAS,
139    PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT,
140    PROP_ENABLE_MEDIA_STREAM,
141    PROP_ENABLE_SPATIAL_NAVIGATION,
142    PROP_ENABLE_MEDIASOURCE
143};
144
145static void webKitSettingsConstructed(GObject* object)
146{
147    G_OBJECT_CLASS(webkit_settings_parent_class)->constructed(object);
148
149    WebPreferences* prefs = WEBKIT_SETTINGS(object)->priv->preferences.get();
150    prefs->setShouldRespectImageOrientation(true);
151}
152
153static void webKitSettingsSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
154{
155    WebKitSettings* settings = WEBKIT_SETTINGS(object);
156
157    switch (propId) {
158    case PROP_ENABLE_JAVASCRIPT:
159        webkit_settings_set_enable_javascript(settings, g_value_get_boolean(value));
160        break;
161    case PROP_AUTO_LOAD_IMAGES:
162        webkit_settings_set_auto_load_images(settings, g_value_get_boolean(value));
163        break;
164    case PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING:
165        webkit_settings_set_load_icons_ignoring_image_load_setting(settings, g_value_get_boolean(value));
166        break;
167    case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
168        webkit_settings_set_enable_offline_web_application_cache(settings, g_value_get_boolean(value));
169        break;
170    case PROP_ENABLE_HTML5_LOCAL_STORAGE:
171        webkit_settings_set_enable_html5_local_storage(settings, g_value_get_boolean(value));
172        break;
173    case PROP_ENABLE_HTML5_DATABASE:
174        webkit_settings_set_enable_html5_database(settings, g_value_get_boolean(value));
175        break;
176    case PROP_ENABLE_XSS_AUDITOR:
177        webkit_settings_set_enable_xss_auditor(settings, g_value_get_boolean(value));
178        break;
179    case PROP_ENABLE_FRAME_FLATTENING:
180        webkit_settings_set_enable_frame_flattening(settings, g_value_get_boolean(value));
181        break;
182    case PROP_ENABLE_PLUGINS:
183        webkit_settings_set_enable_plugins(settings, g_value_get_boolean(value));
184        break;
185    case PROP_ENABLE_JAVA:
186        webkit_settings_set_enable_java(settings, g_value_get_boolean(value));
187        break;
188    case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
189        webkit_settings_set_javascript_can_open_windows_automatically(settings, g_value_get_boolean(value));
190        break;
191    case PROP_ENABLE_HYPERLINK_AUDITING:
192        webkit_settings_set_enable_hyperlink_auditing(settings, g_value_get_boolean(value));
193        break;
194    case PROP_DEFAULT_FONT_FAMILY:
195        webkit_settings_set_default_font_family(settings, g_value_get_string(value));
196        break;
197    case PROP_MONOSPACE_FONT_FAMILY:
198        webkit_settings_set_monospace_font_family(settings, g_value_get_string(value));
199        break;
200    case PROP_SERIF_FONT_FAMILY:
201        webkit_settings_set_serif_font_family(settings, g_value_get_string(value));
202        break;
203    case PROP_SANS_SERIF_FONT_FAMILY:
204        webkit_settings_set_sans_serif_font_family(settings, g_value_get_string(value));
205        break;
206    case PROP_CURSIVE_FONT_FAMILY:
207        webkit_settings_set_cursive_font_family(settings, g_value_get_string(value));
208        break;
209    case PROP_FANTASY_FONT_FAMILY:
210        webkit_settings_set_fantasy_font_family(settings, g_value_get_string(value));
211        break;
212    case PROP_PICTOGRAPH_FONT_FAMILY:
213        webkit_settings_set_pictograph_font_family(settings, g_value_get_string(value));
214        break;
215    case PROP_DEFAULT_FONT_SIZE:
216        webkit_settings_set_default_font_size(settings, g_value_get_uint(value));
217        break;
218    case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
219        webkit_settings_set_default_monospace_font_size(settings, g_value_get_uint(value));
220        break;
221    case PROP_MINIMUM_FONT_SIZE:
222        webkit_settings_set_minimum_font_size(settings, g_value_get_uint(value));
223        break;
224    case PROP_DEFAULT_CHARSET:
225        webkit_settings_set_default_charset(settings, g_value_get_string(value));
226        break;
227    case PROP_ENABLE_PRIVATE_BROWSING:
228        webkit_settings_set_enable_private_browsing(settings, g_value_get_boolean(value));
229        break;
230    case PROP_ENABLE_DEVELOPER_EXTRAS:
231        webkit_settings_set_enable_developer_extras(settings, g_value_get_boolean(value));
232        break;
233    case PROP_ENABLE_RESIZABLE_TEXT_AREAS:
234        webkit_settings_set_enable_resizable_text_areas(settings, g_value_get_boolean(value));
235        break;
236    case PROP_ENABLE_TABS_TO_LINKS:
237        webkit_settings_set_enable_tabs_to_links(settings, g_value_get_boolean(value));
238        break;
239    case PROP_ENABLE_DNS_PREFETCHING:
240        webkit_settings_set_enable_dns_prefetching(settings, g_value_get_boolean(value));
241        break;
242    case PROP_ENABLE_CARET_BROWSING:
243        webkit_settings_set_enable_caret_browsing(settings, g_value_get_boolean(value));
244        break;
245    case PROP_ENABLE_FULLSCREEN:
246        webkit_settings_set_enable_fullscreen(settings, g_value_get_boolean(value));
247        break;
248    case PROP_PRINT_BACKGROUNDS:
249        webkit_settings_set_print_backgrounds(settings, g_value_get_boolean(value));
250        break;
251    case PROP_ENABLE_WEBAUDIO:
252        webkit_settings_set_enable_webaudio(settings, g_value_get_boolean(value));
253        break;
254    case PROP_ENABLE_WEBGL:
255        webkit_settings_set_enable_webgl(settings, g_value_get_boolean(value));
256        break;
257    case PROP_ALLOW_MODAL_DIALOGS:
258        webkit_settings_set_allow_modal_dialogs(settings, g_value_get_boolean(value));
259        break;
260    case PROP_ZOOM_TEXT_ONLY:
261        webkit_settings_set_zoom_text_only(settings, g_value_get_boolean(value));
262        break;
263    case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
264        webkit_settings_set_javascript_can_access_clipboard(settings, g_value_get_boolean(value));
265        break;
266    case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
267        webkit_settings_set_media_playback_requires_user_gesture(settings, g_value_get_boolean(value));
268        break;
269    case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
270        webkit_settings_set_media_playback_allows_inline(settings, g_value_get_boolean(value));
271        break;
272    case PROP_DRAW_COMPOSITING_INDICATORS:
273        if (g_value_get_boolean(value))
274            webkit_settings_set_draw_compositing_indicators(settings, g_value_get_boolean(value));
275        else {
276            char* debugVisualsEnvironment = getenv("WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS");
277            bool showDebugVisuals = debugVisualsEnvironment && !strcmp(debugVisualsEnvironment, "1");
278            webkit_settings_set_draw_compositing_indicators(settings, showDebugVisuals);
279        }
280        break;
281    case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
282        webkit_settings_set_enable_site_specific_quirks(settings, g_value_get_boolean(value));
283        break;
284    case PROP_ENABLE_PAGE_CACHE:
285        webkit_settings_set_enable_page_cache(settings, g_value_get_boolean(value));
286        break;
287    case PROP_USER_AGENT:
288        webkit_settings_set_user_agent(settings, g_value_get_string(value));
289        break;
290    case PROP_ENABLE_SMOOTH_SCROLLING:
291        webkit_settings_set_enable_smooth_scrolling(settings, g_value_get_boolean(value));
292        break;
293    case PROP_ENABLE_ACCELERATED_2D_CANVAS:
294        webkit_settings_set_enable_accelerated_2d_canvas(settings, g_value_get_boolean(value));
295        break;
296    case PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT:
297        webkit_settings_set_enable_write_console_messages_to_stdout(settings, g_value_get_boolean(value));
298        break;
299    case PROP_ENABLE_MEDIA_STREAM:
300        webkit_settings_set_enable_media_stream(settings, g_value_get_boolean(value));
301        break;
302    case PROP_ENABLE_SPATIAL_NAVIGATION:
303        webkit_settings_set_enable_spatial_navigation(settings, g_value_get_boolean(value));
304        break;
305    case PROP_ENABLE_MEDIASOURCE:
306        webkit_settings_set_enable_mediasource(settings, g_value_get_boolean(value));
307        break;
308    default:
309        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
310        break;
311    }
312}
313
314static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
315{
316    WebKitSettings* settings = WEBKIT_SETTINGS(object);
317
318    switch (propId) {
319    case PROP_ENABLE_JAVASCRIPT:
320        g_value_set_boolean(value, webkit_settings_get_enable_javascript(settings));
321        break;
322    case PROP_AUTO_LOAD_IMAGES:
323        g_value_set_boolean(value, webkit_settings_get_auto_load_images(settings));
324        break;
325    case PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING:
326        g_value_set_boolean(value, webkit_settings_get_load_icons_ignoring_image_load_setting(settings));
327        break;
328    case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
329        g_value_set_boolean(value, webkit_settings_get_enable_offline_web_application_cache(settings));
330        break;
331    case PROP_ENABLE_HTML5_LOCAL_STORAGE:
332        g_value_set_boolean(value, webkit_settings_get_enable_html5_local_storage(settings));
333        break;
334    case PROP_ENABLE_HTML5_DATABASE:
335        g_value_set_boolean(value, webkit_settings_get_enable_html5_database(settings));
336        break;
337    case PROP_ENABLE_XSS_AUDITOR:
338        g_value_set_boolean(value, webkit_settings_get_enable_xss_auditor(settings));
339        break;
340    case PROP_ENABLE_FRAME_FLATTENING:
341        g_value_set_boolean(value, webkit_settings_get_enable_frame_flattening(settings));
342        break;
343    case PROP_ENABLE_PLUGINS:
344        g_value_set_boolean(value, webkit_settings_get_enable_plugins(settings));
345        break;
346    case PROP_ENABLE_JAVA:
347        g_value_set_boolean(value, webkit_settings_get_enable_java(settings));
348        break;
349    case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
350        g_value_set_boolean(value, webkit_settings_get_javascript_can_open_windows_automatically(settings));
351        break;
352    case PROP_ENABLE_HYPERLINK_AUDITING:
353        g_value_set_boolean(value, webkit_settings_get_enable_hyperlink_auditing(settings));
354        break;
355    case PROP_DEFAULT_FONT_FAMILY:
356        g_value_set_string(value, webkit_settings_get_default_font_family(settings));
357        break;
358    case PROP_MONOSPACE_FONT_FAMILY:
359        g_value_set_string(value, webkit_settings_get_monospace_font_family(settings));
360        break;
361    case PROP_SERIF_FONT_FAMILY:
362        g_value_set_string(value, webkit_settings_get_serif_font_family(settings));
363        break;
364    case PROP_SANS_SERIF_FONT_FAMILY:
365        g_value_set_string(value, webkit_settings_get_sans_serif_font_family(settings));
366        break;
367    case PROP_CURSIVE_FONT_FAMILY:
368        g_value_set_string(value, webkit_settings_get_cursive_font_family(settings));
369        break;
370    case PROP_FANTASY_FONT_FAMILY:
371        g_value_set_string(value, webkit_settings_get_fantasy_font_family(settings));
372        break;
373    case PROP_PICTOGRAPH_FONT_FAMILY:
374        g_value_set_string(value, webkit_settings_get_pictograph_font_family(settings));
375        break;
376    case PROP_DEFAULT_FONT_SIZE:
377        g_value_set_uint(value, webkit_settings_get_default_font_size(settings));
378        break;
379    case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
380        g_value_set_uint(value, webkit_settings_get_default_monospace_font_size(settings));
381        break;
382    case PROP_MINIMUM_FONT_SIZE:
383        g_value_set_uint(value, webkit_settings_get_minimum_font_size(settings));
384        break;
385    case PROP_DEFAULT_CHARSET:
386        g_value_set_string(value, webkit_settings_get_default_charset(settings));
387        break;
388    case PROP_ENABLE_PRIVATE_BROWSING:
389        g_value_set_boolean(value, webkit_settings_get_enable_private_browsing(settings));
390        break;
391    case PROP_ENABLE_DEVELOPER_EXTRAS:
392        g_value_set_boolean(value, webkit_settings_get_enable_developer_extras(settings));
393        break;
394    case PROP_ENABLE_RESIZABLE_TEXT_AREAS:
395        g_value_set_boolean(value, webkit_settings_get_enable_resizable_text_areas(settings));
396        break;
397    case PROP_ENABLE_TABS_TO_LINKS:
398        g_value_set_boolean(value, webkit_settings_get_enable_tabs_to_links(settings));
399        break;
400    case PROP_ENABLE_DNS_PREFETCHING:
401        g_value_set_boolean(value, webkit_settings_get_enable_dns_prefetching(settings));
402        break;
403    case PROP_ENABLE_CARET_BROWSING:
404        g_value_set_boolean(value, webkit_settings_get_enable_caret_browsing(settings));
405        break;
406    case PROP_ENABLE_FULLSCREEN:
407        g_value_set_boolean(value, webkit_settings_get_enable_fullscreen(settings));
408        break;
409    case PROP_PRINT_BACKGROUNDS:
410        g_value_set_boolean(value, webkit_settings_get_print_backgrounds(settings));
411        break;
412    case PROP_ENABLE_WEBAUDIO:
413        g_value_set_boolean(value, webkit_settings_get_enable_webaudio(settings));
414        break;
415    case PROP_ENABLE_WEBGL:
416        g_value_set_boolean(value, webkit_settings_get_enable_webgl(settings));
417        break;
418    case PROP_ALLOW_MODAL_DIALOGS:
419        g_value_set_boolean(value, webkit_settings_get_allow_modal_dialogs(settings));
420        break;
421    case PROP_ZOOM_TEXT_ONLY:
422        g_value_set_boolean(value, webkit_settings_get_zoom_text_only(settings));
423        break;
424    case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
425        g_value_set_boolean(value, webkit_settings_get_javascript_can_access_clipboard(settings));
426        break;
427    case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
428        g_value_set_boolean(value, webkit_settings_get_media_playback_requires_user_gesture(settings));
429        break;
430    case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
431        g_value_set_boolean(value, webkit_settings_get_media_playback_allows_inline(settings));
432        break;
433    case PROP_DRAW_COMPOSITING_INDICATORS:
434        g_value_set_boolean(value, webkit_settings_get_draw_compositing_indicators(settings));
435        break;
436    case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
437        g_value_set_boolean(value, webkit_settings_get_enable_site_specific_quirks(settings));
438        break;
439    case PROP_ENABLE_PAGE_CACHE:
440        g_value_set_boolean(value, webkit_settings_get_enable_page_cache(settings));
441        break;
442    case PROP_USER_AGENT:
443        g_value_set_string(value, webkit_settings_get_user_agent(settings));
444        break;
445    case PROP_ENABLE_SMOOTH_SCROLLING:
446        g_value_set_boolean(value, webkit_settings_get_enable_smooth_scrolling(settings));
447        break;
448    case PROP_ENABLE_ACCELERATED_2D_CANVAS:
449        g_value_set_boolean(value, webkit_settings_get_enable_accelerated_2d_canvas(settings));
450        break;
451    case PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT:
452        g_value_set_boolean(value, webkit_settings_get_enable_write_console_messages_to_stdout(settings));
453        break;
454    case PROP_ENABLE_MEDIA_STREAM:
455        g_value_set_boolean(value, webkit_settings_get_enable_media_stream(settings));
456        break;
457    case PROP_ENABLE_SPATIAL_NAVIGATION:
458        g_value_set_boolean(value, webkit_settings_get_enable_spatial_navigation(settings));
459        break;
460    case PROP_ENABLE_MEDIASOURCE:
461        g_value_set_boolean(value, webkit_settings_get_enable_mediasource(settings));
462        break;
463
464    default:
465        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
466        break;
467    }
468}
469
470static void webkit_settings_class_init(WebKitSettingsClass* klass)
471{
472    GObjectClass* gObjectClass = G_OBJECT_CLASS(klass);
473    gObjectClass->constructed = webKitSettingsConstructed;
474    gObjectClass->set_property = webKitSettingsSetProperty;
475    gObjectClass->get_property = webKitSettingsGetProperty;
476
477    GParamFlags readWriteConstructParamFlags = static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
478
479    /**
480     * WebKitSettings:enable-javascript:
481     *
482     * Determines whether or not JavaScript executes within a page.
483     */
484    g_object_class_install_property(gObjectClass,
485                                    PROP_ENABLE_JAVASCRIPT,
486                                    g_param_spec_boolean("enable-javascript",
487                                                         _("Enable JavaScript"),
488                                                         _("Enable JavaScript."),
489                                                         TRUE,
490                                                         readWriteConstructParamFlags));
491
492    /**
493     * WebKitSettings:auto-load-images:
494     *
495     * Determines whether images should be automatically loaded or not.
496     * On devices where network bandwidth is of concern, it might be
497     * useful to turn this property off.
498     */
499    g_object_class_install_property(gObjectClass,
500                                    PROP_AUTO_LOAD_IMAGES,
501                                    g_param_spec_boolean("auto-load-images",
502                                                         _("Auto load images"),
503                                                         _("Load images automatically."),
504                                                         TRUE,
505                                                         readWriteConstructParamFlags));
506
507    /**
508     * WebKitSettings:load-icons-ignoring-image-load-setting:
509     *
510     * Determines whether a site can load favicons irrespective
511     * of the value of #WebKitSettings:auto-load-images.
512     */
513    g_object_class_install_property(gObjectClass,
514                                    PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING,
515                                    g_param_spec_boolean("load-icons-ignoring-image-load-setting",
516                                                         _("Load icons ignoring image load setting"),
517                                                         _("Whether to load site icons ignoring image load setting."),
518                                                         FALSE,
519                                                         readWriteConstructParamFlags));
520
521    /**
522     * WebKitSettings:enable-offline-web-application-cache:
523     *
524     * Whether to enable HTML5 offline web application cache support. Offline
525     * web application cache allows web applications to run even when
526     * the user is not connected to the network.
527     *
528     * HTML5 offline web application specification is available at
529     * http://dev.w3.org/html5/spec/offline.html.
530     */
531    g_object_class_install_property(gObjectClass,
532                                    PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
533                                    g_param_spec_boolean("enable-offline-web-application-cache",
534                                                         _("Enable offline web application cache"),
535                                                         _("Whether to enable offline web application cache."),
536                                                         TRUE,
537                                                         readWriteConstructParamFlags));
538
539    /**
540     * WebKitSettings:enable-html5-local-storage:
541     *
542     * Whether to enable HTML5 local storage support. Local storage provides
543     * simple synchronous storage access.
544     *
545     * HTML5 local storage specification is available at
546     * http://dev.w3.org/html5/webstorage/.
547     */
548    g_object_class_install_property(gObjectClass,
549                                    PROP_ENABLE_HTML5_LOCAL_STORAGE,
550                                    g_param_spec_boolean("enable-html5-local-storage",
551                                                         _("Enable HTML5 local storage"),
552                                                         _("Whether to enable HTML5 Local Storage support."),
553                                                         TRUE,
554                                                         readWriteConstructParamFlags));
555
556    /**
557     * WebKitSettings:enable-html5-database:
558     *
559     * Whether to enable HTML5 client-side SQL database support. Client-side
560     * SQL database allows web pages to store structured data and be able to
561     * use SQL to manipulate that data asynchronously.
562     *
563     * HTML5 database specification is available at
564     * http://www.w3.org/TR/webdatabase/.
565     */
566    g_object_class_install_property(gObjectClass,
567                                    PROP_ENABLE_HTML5_DATABASE,
568                                    g_param_spec_boolean("enable-html5-database",
569                                                         _("Enable HTML5 database"),
570                                                         _("Whether to enable HTML5 database support."),
571                                                         TRUE,
572                                                         readWriteConstructParamFlags));
573
574    /**
575     * WebKitSettings:enable-xss-auditor:
576     *
577     * Whether to enable the XSS auditor. This feature filters some kinds of
578     * reflective XSS attacks on vulnerable web sites.
579     */
580    g_object_class_install_property(gObjectClass,
581                                    PROP_ENABLE_XSS_AUDITOR,
582                                    g_param_spec_boolean("enable-xss-auditor",
583                                                         _("Enable XSS auditor"),
584                                                         _("Whether to enable the XSS auditor."),
585                                                         TRUE,
586                                                         readWriteConstructParamFlags));
587
588
589    /**
590     * WebKitSettings:enable-frame-flattening:
591     *
592     * Whether to enable the frame flattening. With this setting each subframe is expanded
593     * to its contents, which will flatten all the frames to become one scrollable page.
594     * On touch devices scrollable subframes on a page can result in a confusing user experience.
595     */
596    g_object_class_install_property(gObjectClass,
597                                    PROP_ENABLE_FRAME_FLATTENING,
598                                    g_param_spec_boolean("enable-frame-flattening",
599                                                         _("Enable frame flattening"),
600                                                         _("Whether to enable frame flattening."),
601                                                         FALSE,
602                                                         readWriteConstructParamFlags));
603
604    /**
605     * WebKitSettings:enable-plugins:
606     *
607     * Determines whether or not plugins on the page are enabled.
608     */
609    g_object_class_install_property(gObjectClass,
610                                    PROP_ENABLE_PLUGINS,
611                                    g_param_spec_boolean("enable-plugins",
612                                                         _("Enable plugins"),
613                                                         _("Enable embedded plugin objects."),
614                                                         TRUE,
615                                                         readWriteConstructParamFlags));
616
617    /**
618     * WebKitSettings:enable-java:
619     *
620     * Determines whether or not Java is enabled on the page.
621     */
622    g_object_class_install_property(gObjectClass,
623                                    PROP_ENABLE_JAVA,
624                                    g_param_spec_boolean("enable-java",
625                                                         _("Enable Java"),
626                                                         _("Whether Java support should be enabled."),
627                                                         TRUE,
628                                                         readWriteConstructParamFlags));
629
630    /**
631     * WebKitSettings:javascript-can-open-windows-automatically:
632     *
633     * Whether JavaScript can open popup windows automatically without user
634     * intervention.
635     */
636    g_object_class_install_property(gObjectClass,
637                                    PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
638                                    g_param_spec_boolean("javascript-can-open-windows-automatically",
639                                                         _("JavaScript can open windows automatically"),
640                                                         _("Whether JavaScript can open windows automatically."),
641                                                         FALSE,
642                                                         readWriteConstructParamFlags));
643
644    /**
645     * WebKitSettings:enable-hyperlink-auditing:
646     *
647     * Determines whether or not hyperlink auditing is enabled.
648     *
649     * The hyperlink auditing specification is available at
650     * http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing.
651     */
652    g_object_class_install_property(gObjectClass,
653                                    PROP_ENABLE_HYPERLINK_AUDITING,
654                                    g_param_spec_boolean("enable-hyperlink-auditing",
655                                                         _("Enable hyperlink auditing"),
656                                                         _("Whether <a ping> should be able to send pings."),
657                                                         FALSE,
658                                                         readWriteConstructParamFlags));
659
660    /**
661     * WebKitWebSettings:default-font-family:
662     *
663     * The font family to use as the default for content that does not specify a font.
664     */
665    g_object_class_install_property(gObjectClass,
666                                    PROP_DEFAULT_FONT_FAMILY,
667                                    g_param_spec_string("default-font-family",
668                                                        _("Default font family"),
669                                                        _("The font family to use as the default for content that does not specify a font."),
670                                                        "sans-serif",
671                                                        readWriteConstructParamFlags));
672
673    /**
674     * WebKitWebSettings:monospace-font-family:
675     *
676     * The font family used as the default for content using a monospace font.
677     *
678     */
679    g_object_class_install_property(gObjectClass,
680                                    PROP_MONOSPACE_FONT_FAMILY,
681                                    g_param_spec_string("monospace-font-family",
682                                                        _("Monospace font family"),
683                                                        _("The font family used as the default for content using monospace font."),
684                                                        "monospace",
685                                                        readWriteConstructParamFlags));
686
687    /**
688     * WebKitWebSettings:serif-font-family:
689     *
690     * The font family used as the default for content using a serif font.
691     */
692    g_object_class_install_property(gObjectClass,
693                                    PROP_SERIF_FONT_FAMILY,
694                                    g_param_spec_string("serif-font-family",
695                                                        _("Serif font family"),
696                                                        _("The font family used as the default for content using serif font."),
697                                                        "serif",
698                                                        readWriteConstructParamFlags));
699
700    /**
701     * WebKitWebSettings:sans-serif-font-family:
702     *
703     * The font family used as the default for content using a sans-serif font.
704     */
705    g_object_class_install_property(gObjectClass,
706                                    PROP_SANS_SERIF_FONT_FAMILY,
707                                    g_param_spec_string("sans-serif-font-family",
708                                                        _("Sans-serif font family"),
709                                                        _("The font family used as the default for content using sans-serif font."),
710                                                        "sans-serif",
711                                                        readWriteConstructParamFlags));
712
713    /**
714     * WebKitWebSettings:cursive-font-family:
715     *
716     * The font family used as the default for content using a cursive font.
717     */
718    g_object_class_install_property(gObjectClass,
719                                    PROP_CURSIVE_FONT_FAMILY,
720                                    g_param_spec_string("cursive-font-family",
721                                                        _("Cursive font family"),
722                                                        _("The font family used as the default for content using cursive font."),
723                                                        "serif",
724                                                        readWriteConstructParamFlags));
725
726    /**
727     * WebKitWebSettings:fantasy-font-family:
728     *
729     * The font family used as the default for content using a fantasy font.
730     */
731    g_object_class_install_property(gObjectClass,
732                                    PROP_FANTASY_FONT_FAMILY,
733                                    g_param_spec_string("fantasy-font-family",
734                                                        _("Fantasy font family"),
735                                                        _("The font family used as the default for content using fantasy font."),
736                                                        "serif",
737                                                        readWriteConstructParamFlags));
738
739    /**
740     * WebKitWebSettings:pictograph-font-family:
741     *
742     * The font family used as the default for content using a pictograph font.
743     */
744    g_object_class_install_property(gObjectClass,
745                                    PROP_PICTOGRAPH_FONT_FAMILY,
746                                    g_param_spec_string("pictograph-font-family",
747                                                        _("Pictograph font family"),
748                                                        _("The font family used as the default for content using pictograph font."),
749                                                        "serif",
750                                                        readWriteConstructParamFlags));
751
752    /**
753     * WebKitWebSettings:default-font-size:
754     *
755     * The default font size in pixels to use for content displayed if
756     * no font size is specified.
757     */
758    g_object_class_install_property(gObjectClass,
759                                    PROP_DEFAULT_FONT_SIZE,
760                                    g_param_spec_uint("default-font-size",
761                                                      _("Default font size"),
762                                                      _("The default font size used to display text."),
763                                                      0, G_MAXUINT, 16,
764                                                      readWriteConstructParamFlags));
765
766    /**
767     * WebKitWebSettings:default-monospace-font-size:
768     *
769     * The default font size in pixels to use for content displayed in
770     * monospace font if no font size is specified.
771     */
772    g_object_class_install_property(gObjectClass,
773                                    PROP_DEFAULT_MONOSPACE_FONT_SIZE,
774                                    g_param_spec_uint("default-monospace-font-size",
775                                                      _("Default monospace font size"),
776                                                      _("The default font size used to display monospace text."),
777                                                      0, G_MAXUINT, 13,
778                                                      readWriteConstructParamFlags));
779
780    /**
781     * WebKitWebSettings:minimum-font-size:
782     *
783     * The minimum font size in points used to display text. This setting
784     * controls the absolute smallest size. Values other than 0 can
785     * potentially break page layouts.
786     */
787    g_object_class_install_property(gObjectClass,
788                                    PROP_MINIMUM_FONT_SIZE,
789                                    g_param_spec_uint("minimum-font-size",
790                                                      _("Minimum font size"),
791                                                      _("The minimum font size used to display text."),
792                                                      0, G_MAXUINT, 0,
793                                                      readWriteConstructParamFlags));
794
795    /**
796     * WebKitSettings:default-charset:
797     *
798     * The default text charset used when interpreting content with an unspecified charset.
799     */
800    g_object_class_install_property(gObjectClass,
801                                    PROP_DEFAULT_CHARSET,
802                                    g_param_spec_string("default-charset",
803                                                        _("Default charset"),
804                                                        _("The default text charset used when interpreting content with unspecified charset."),
805                                                        "iso-8859-1",
806                                                        readWriteConstructParamFlags));
807
808    /**
809     * WebKitSettings:enable-private-browsing:
810     *
811     * Determines whether or not private browsing is enabled. Private browsing
812     * will disable history, cache and form auto-fill for any pages visited.
813     */
814    g_object_class_install_property(gObjectClass,
815                                    PROP_ENABLE_PRIVATE_BROWSING,
816                                    g_param_spec_boolean("enable-private-browsing",
817                                                         _("Enable private browsing"),
818                                                         _("Whether to enable private browsing"),
819                                                         FALSE,
820                                                         readWriteConstructParamFlags));
821
822    /**
823     * WebKitSettings:enable-developer-extras:
824     *
825     * Determines whether or not developer tools, such as the Web Inspector, are enabled.
826     */
827    g_object_class_install_property(gObjectClass,
828                                    PROP_ENABLE_DEVELOPER_EXTRAS,
829                                    g_param_spec_boolean("enable-developer-extras",
830                                                         _("Enable developer extras"),
831                                                         _("Whether to enable developer extras"),
832                                                         FALSE,
833                                                         readWriteConstructParamFlags));
834
835    /**
836     * WebKitSettings:enable-resizable-text-areas:
837     *
838     * Determines whether or not text areas can be resized.
839     */
840    g_object_class_install_property(gObjectClass,
841                                    PROP_ENABLE_RESIZABLE_TEXT_AREAS,
842                                    g_param_spec_boolean("enable-resizable-text-areas",
843                                                         _("Enable resizable text areas"),
844                                                         _("Whether to enable resizable text areas"),
845                                                         TRUE,
846                                                         readWriteConstructParamFlags));
847
848    /**
849     * WebKitSettings:enable-tabs-to-links:
850     *
851     * Determines whether the tab key cycles through the elements on the page.
852     * When this setting is enabled, users will be able to focus the next element
853     * in the page by pressing the tab key. If the selected element is editable,
854     * then pressing tab key will insert the tab character.
855     */
856    g_object_class_install_property(gObjectClass,
857                                    PROP_ENABLE_TABS_TO_LINKS,
858                                    g_param_spec_boolean("enable-tabs-to-links",
859                                                         _("Enable tabs to links"),
860                                                         _("Whether to enable tabs to links"),
861                                                         TRUE,
862                                                         readWriteConstructParamFlags));
863
864    /**
865     * WebKitSettings:enable-dns-prefetching:
866     *
867     * Determines whether or not to prefetch domain names. DNS prefetching attempts
868     * to resolve domain names before a user tries to follow a link.
869     */
870    g_object_class_install_property(gObjectClass,
871                                    PROP_ENABLE_DNS_PREFETCHING,
872                                    g_param_spec_boolean("enable-dns-prefetching",
873                                                         _("Enable DNS prefetching"),
874                                                         _("Whether to enable DNS prefetching"),
875                                                         FALSE,
876                                                         readWriteConstructParamFlags));
877
878    /**
879     * WebKitSettings:enable-caret-browsing:
880     *
881     * Whether to enable accessibility enhanced keyboard navigation.
882     */
883    g_object_class_install_property(gObjectClass,
884                                    PROP_ENABLE_CARET_BROWSING,
885                                    g_param_spec_boolean("enable-caret-browsing",
886                                                         _("Enable Caret Browsing"),
887                                                         _("Whether to enable accessibility enhanced keyboard navigation"),
888                                                         FALSE,
889                                                         readWriteConstructParamFlags));
890
891    /**
892     * WebKitSettings:enable-fullscreen:
893     *
894     * Whether to enable the Javascript Fullscreen API. The API
895     * allows any HTML element to request fullscreen display. See also
896     * the current draft of the spec:
897     * http://www.w3.org/TR/fullscreen/
898     */
899    g_object_class_install_property(gObjectClass,
900        PROP_ENABLE_FULLSCREEN,
901        g_param_spec_boolean("enable-fullscreen",
902            _("Enable Fullscreen"),
903            _("Whether to enable the Javascript Fullscreen API"),
904            TRUE,
905            readWriteConstructParamFlags));
906
907    /**
908     * WebKitSettings:print-backgrounds:
909     *
910     * Whether background images should be drawn during printing.
911     */
912    g_object_class_install_property(gObjectClass,
913                                    PROP_PRINT_BACKGROUNDS,
914                                    g_param_spec_boolean("print-backgrounds",
915                                                         _("Print Backgrounds"),
916                                                         _("Whether background images should be drawn during printing"),
917                                                         TRUE,
918                                                         readWriteConstructParamFlags));
919
920    /**
921     * WebKitSettings:enable-webaudio:
922     *
923     *
924     * Enable or disable support for WebAudio on pages. WebAudio is an
925     * experimental proposal for allowing web pages to generate Audio
926     * WAVE data from JavaScript. The standard is currently a
927     * work-in-progress by the W3C Audio Working Group.
928     *
929     * See also https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
930     */
931    g_object_class_install_property(gObjectClass,
932                                    PROP_ENABLE_WEBAUDIO,
933                                    g_param_spec_boolean("enable-webaudio",
934                                                         _("Enable WebAudio"),
935                                                         _("Whether WebAudio content should be handled"),
936                                                         FALSE,
937                                                         readWriteConstructParamFlags));
938
939    /**
940    * WebKitSettings:enable-webgl:
941    *
942    * Enable or disable support for WebGL on pages. WebGL is an experimental
943    * proposal for allowing web pages to use OpenGL ES-like calls directly. The
944    * standard is currently a work-in-progress by the Khronos Group.
945    */
946    g_object_class_install_property(gObjectClass,
947                                    PROP_ENABLE_WEBGL,
948                                    g_param_spec_boolean("enable-webgl",
949                                                         _("Enable WebGL"),
950                                                         _("Whether WebGL content should be rendered"),
951                                                         FALSE,
952                                                         readWriteConstructParamFlags));
953
954    /**
955     * WebKitSettings:allow-modal-dialogs:
956     *
957     * Determine whether it's allowed to create and run modal dialogs
958     * from a #WebKitWebView through JavaScript with
959     * <function>window.showModalDialog</function>. If it's set to
960     * %FALSE, the associated #WebKitWebView won't be able to create
961     * new modal dialogs, so not even the #WebKitWebView::create
962     * signal will be emitted.
963     */
964    g_object_class_install_property(gObjectClass,
965                                    PROP_ALLOW_MODAL_DIALOGS,
966                                    g_param_spec_boolean("allow-modal-dialogs",
967                                                         _("Allow modal dialogs"),
968                                                         _("Whether it is possible to create modal dialogs"),
969                                                         FALSE,
970                                                         readWriteConstructParamFlags));
971
972    /**
973     * WebKitSettings:zoom-text-only:
974     *
975     * Whether #WebKitWebView:zoom-level affects only the
976     * text of the page or all the contents. Other contents containing text
977     * like form controls will be also affected by zoom factor when
978     * this property is enabled.
979     */
980    g_object_class_install_property(gObjectClass,
981                                    PROP_ZOOM_TEXT_ONLY,
982                                    g_param_spec_boolean("zoom-text-only",
983                                                         _("Zoom Text Only"),
984                                                         _("Whether zoom level of web view changes only the text size"),
985                                                         FALSE,
986                                                         readWriteConstructParamFlags));
987
988    /**
989     * WebKitSettings:javascript-can-access-clipboard:
990     *
991     * Whether JavaScript can access the clipboard. The default value is %FALSE. If
992     * set to %TRUE, document.execCommand() allows cut, copy and paste commands.
993     *
994     */
995    g_object_class_install_property(gObjectClass,
996                                    PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
997                                    g_param_spec_boolean("javascript-can-access-clipboard",
998                                                         _("JavaScript can access clipboard"),
999                                                         _("Whether JavaScript can access Clipboard"),
1000                                                         FALSE,
1001                                                         readWriteConstructParamFlags));
1002
1003    /**
1004     * WebKitSettings:media-playback-requires-user-gesture:
1005     *
1006     * Whether a user gesture (such as clicking the play button)
1007     * would be required to start media playback or load media. This is off
1008     * by default, so media playback could start automatically.
1009     * Setting it on requires a gesture by the user to start playback, or to
1010     * load the media.
1011     */
1012    g_object_class_install_property(gObjectClass,
1013                                    PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
1014                                    g_param_spec_boolean("media-playback-requires-user-gesture",
1015                                                         _("Media playback requires user gesture"),
1016                                                         _("Whether media playback requires user gesture"),
1017                                                         FALSE,
1018                                                         readWriteConstructParamFlags));
1019
1020    /**
1021     * WebKitSettings:media-playback-allows-inline:
1022     *
1023     * Whether media playback is full-screen only or inline playback is allowed.
1024     * This is %TRUE by default, so media playback can be inline. Setting it to
1025     * %FALSE allows specifying that media playback should be always fullscreen.
1026     */
1027    g_object_class_install_property(gObjectClass,
1028                                    PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
1029                                    g_param_spec_boolean("media-playback-allows-inline",
1030                                                         _("Media playback allows inline"),
1031                                                         _("Whether media playback allows inline"),
1032                                                         TRUE,
1033                                                         readWriteConstructParamFlags));
1034
1035    /**
1036     * WebKitSettings:draw-compositing-indicators:
1037     *
1038     * Whether to draw compositing borders and repaint counters on layers drawn
1039     * with accelerated compositing. This is useful for debugging issues related
1040     * to web content that is composited with the GPU.
1041     */
1042    g_object_class_install_property(gObjectClass,
1043                                    PROP_DRAW_COMPOSITING_INDICATORS,
1044                                    g_param_spec_boolean("draw-compositing-indicators",
1045                                                         _("Draw compositing indicators"),
1046                                                         _("Whether to draw compositing borders and repaint counters"),
1047                                                         FALSE,
1048                                                         readWriteConstructParamFlags));
1049
1050    /**
1051     * WebKitSettings:enable-site-specific-quirks:
1052     *
1053     * Whether to turn on site-specific quirks. Turning this on will
1054     * tell WebKit to use some site-specific workarounds for
1055     * better web compatibility. For example, older versions of
1056     * MediaWiki will incorrectly send to WebKit a css file with KHTML
1057     * workarounds. By turning on site-specific quirks, WebKit will
1058     * special-case this and other cases to make some specific sites work.
1059     */
1060    g_object_class_install_property(
1061        gObjectClass,
1062        PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
1063        g_param_spec_boolean(
1064            "enable-site-specific-quirks",
1065            _("Enable Site Specific Quirks"),
1066            _("Enables the site-specific compatibility workarounds"),
1067            TRUE,
1068            readWriteConstructParamFlags));
1069
1070    /**
1071     * WebKitSettings:enable-page-cache:
1072     *
1073     * Enable or disable the page cache. Disabling the page cache is
1074     * generally only useful for special circumstances like low-memory
1075     * scenarios or special purpose applications like static HTML
1076     * viewers. This setting only controls the Page Cache, this cache
1077     * is different than the disk-based or memory-based traditional
1078     * resource caches, its point is to make going back and forth
1079     * between pages much faster. For details about the different types
1080     * of caches and their purposes see:
1081     * http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
1082     */
1083    g_object_class_install_property(gObjectClass,
1084                                    PROP_ENABLE_PAGE_CACHE,
1085                                    g_param_spec_boolean("enable-page-cache",
1086                                                         _("Enable page cache"),
1087                                                         _("Whether the page cache should be used"),
1088                                                         TRUE,
1089                                                         readWriteConstructParamFlags));
1090
1091    /**
1092     * WebKitSettings:user-agent:
1093     *
1094     * The user-agent string used by WebKit. Unusual user-agent strings may cause web
1095     * content to render incorrectly or fail to run, as many web pages are written to
1096     * parse the user-agent strings of only the most popular browsers. Therefore, it's
1097     * typically better to not completely override the standard user-agent, but to use
1098     * webkit_settings_set_user_agent_with_application_details() instead.
1099     *
1100     * If this property is set to the empty string or %NULL, it will revert to the standard
1101     * user-agent.
1102     */
1103    g_object_class_install_property(gObjectClass,
1104                                    PROP_USER_AGENT,
1105                                    g_param_spec_string("user-agent",
1106                                                        _("User agent string"),
1107                                                        _("The user agent string"),
1108                                                        0, // A null string forces the standard user agent.
1109                                                        readWriteConstructParamFlags));
1110
1111    /**
1112     * WebKitSettings:enable-smooth-scrolling:
1113     *
1114     * Enable or disable smooth scrolling.
1115     */
1116    g_object_class_install_property(gObjectClass,
1117                                    PROP_ENABLE_SMOOTH_SCROLLING,
1118                                    g_param_spec_boolean("enable-smooth-scrolling",
1119                                                         _("Enable smooth scrolling"),
1120                                                         _("Whether to enable smooth scrolling"),
1121                                                         FALSE,
1122                                                         readWriteConstructParamFlags));
1123
1124    /**
1125     * WebKitSettings:enable-accelerated-2d-canvas:
1126     *
1127     * Enable or disable accelerated 2D canvas. Accelerated 2D canvas is only available
1128     * if WebKitGTK+ was compiled with a version of Cairo including the unstable CairoGL API.
1129     * When accelerated 2D canvas is enabled, WebKit may render some 2D canvas content
1130     * using hardware accelerated drawing operations.
1131     *
1132     * Since: 2.2
1133     */
1134    g_object_class_install_property(gObjectClass,
1135        PROP_ENABLE_ACCELERATED_2D_CANVAS,
1136        g_param_spec_boolean("enable-accelerated-2d-canvas",
1137            _("Enable accelerated 2D canvas"),
1138            _("Whether to enable accelerated 2D canvas"),
1139            FALSE,
1140            readWriteConstructParamFlags));
1141
1142    /**
1143     * WebKitSettings:enable-write-console-messages-to-stdout:
1144     *
1145     * Enable or disable writing console messages to stdout. These are messages
1146     * sent to the console with console.log and related methods.
1147     *
1148     * Since: 2.2
1149     */
1150    g_object_class_install_property(gObjectClass,
1151        PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT,
1152        g_param_spec_boolean("enable-write-console-messages-to-stdout",
1153            _("Write console messages on stdout"),
1154            _("Whether to write console messages on stdout"),
1155            FALSE,
1156            readWriteConstructParamFlags));
1157
1158    /**
1159     * WebKitSettings:enable-media-stream:
1160     *
1161     * Enable or disable support for MediaStream on pages. MediaStream
1162     * is an experimental proposal for allowing web pages to access
1163     * audio and video devices for capture.
1164     *
1165     * See also http://dev.w3.org/2011/webrtc/editor/getusermedia.html
1166     *
1167     * Since: 2.4
1168     */
1169    g_object_class_install_property(gObjectClass,
1170        PROP_ENABLE_MEDIA_STREAM,
1171        g_param_spec_boolean("enable-media-stream",
1172            _("Enable MediaStream"),
1173            _("Whether MediaStream content should be handled"),
1174            FALSE,
1175            readWriteConstructParamFlags));
1176
1177   /**
1178     * WebKitSettings:enable-spatial-navigation:
1179     *
1180     * Whether to enable Spatial Navigation. This feature consists in the ability
1181     * to navigate between focusable elements in a Web page, such as hyperlinks
1182     * and form controls, by using Left, Right, Up and Down arrow keys.
1183     * For example, if an user presses the Right key, heuristics determine whether
1184     * there is an element they might be trying to reach towards the right, and if
1185     * there are multiple elements, which element they probably wants.
1186     *
1187     * Since: 2.3
1188     */
1189    g_object_class_install_property(gObjectClass,
1190        PROP_ENABLE_SPATIAL_NAVIGATION,
1191        g_param_spec_boolean("enable-spatial-navigation",
1192            _("Enable Spatial Navigation"),
1193            _("Whether to enable Spatial Navigation support."),
1194            FALSE,
1195            readWriteConstructParamFlags));
1196
1197    /**
1198     * WebKitSettings:enable-mediasource:
1199     *
1200     * Enable or disable support for MediaSource on pages. MediaSource is an
1201     * experimental proposal which extends HTMLMediaElement to allow
1202     * JavaScript to generate media streams for playback.  The standard is
1203     * currently a work-in-progress by the W3C HTML Media Task Force.
1204     *
1205     * See also http://www.w3.org/TR/media-source/
1206     *
1207     * Since: 2.4
1208     */
1209    g_object_class_install_property(gObjectClass,
1210        PROP_ENABLE_MEDIASOURCE,
1211        g_param_spec_boolean("enable-mediasource",
1212            _("Enable MediaSource"),
1213            _("Whether MediaSource should be enabled."),
1214            FALSE,
1215            readWriteConstructParamFlags));
1216}
1217
1218WebPreferences* webkitSettingsGetPreferences(WebKitSettings* settings)
1219{
1220    return settings->priv->preferences.get();
1221}
1222
1223/**
1224 * webkit_settings_new:
1225 *
1226 * Creates a new #WebKitSettings instance with default values. It must
1227 * be manually attached to a #WebKitWebView.
1228 * See also webkit_settings_new_with_settings().
1229 *
1230 * Returns: a new #WebKitSettings instance.
1231 */
1232WebKitSettings* webkit_settings_new()
1233{
1234    return WEBKIT_SETTINGS(g_object_new(WEBKIT_TYPE_SETTINGS, NULL));
1235}
1236
1237/**
1238 * webkit_settings_new_with_settings:
1239 * @first_setting_name: name of first setting to set
1240 * @...: value of first setting, followed by more settings,
1241 *    %NULL-terminated
1242 *
1243 * Creates a new #WebKitSettings instance with the given settings. It must
1244 * be manually attached to a #WebKitWebView.
1245 *
1246 * Returns: a new #WebKitSettings instance.
1247 */
1248WebKitSettings* webkit_settings_new_with_settings(const gchar* firstSettingName, ...)
1249{
1250    va_list args;
1251    va_start(args, firstSettingName);
1252    WebKitSettings* settings = WEBKIT_SETTINGS(g_object_new_valist(WEBKIT_TYPE_SETTINGS, firstSettingName, args));
1253    va_end(args);
1254    return settings;
1255}
1256
1257/**
1258 * webkit_settings_get_enable_javascript:
1259 * @settings: a #WebKitSettings
1260 *
1261 * Get the #WebKitSettings:enable-javascript property.
1262 *
1263 * Returns: %TRUE If JavaScript is enabled or %FALSE otherwise.
1264 */
1265gboolean webkit_settings_get_enable_javascript(WebKitSettings* settings)
1266{
1267    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1268
1269    return settings->priv->preferences->javaScriptEnabled();
1270}
1271
1272/**
1273 * webkit_settings_set_enable_javascript:
1274 * @settings: a #WebKitSettings
1275 * @enabled: Value to be set
1276 *
1277 * Set the #WebKitSettings:enable-javascript property.
1278 */
1279void webkit_settings_set_enable_javascript(WebKitSettings* settings, gboolean enabled)
1280{
1281    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1282
1283    WebKitSettingsPrivate* priv = settings->priv;
1284    bool currentValue = priv->preferences->javaScriptEnabled();
1285    if (currentValue == enabled)
1286        return;
1287
1288    priv->preferences->setJavaScriptEnabled(enabled);
1289    g_object_notify(G_OBJECT(settings), "enable-javascript");
1290}
1291
1292/**
1293 * webkit_settings_get_auto_load_images:
1294 * @settings: a #WebKitSettings
1295 *
1296 * Get the #WebKitSettings:auto-load-images property.
1297 *
1298 * Returns: %TRUE If auto loading of images is enabled or %FALSE otherwise.
1299 */
1300gboolean webkit_settings_get_auto_load_images(WebKitSettings* settings)
1301{
1302    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1303
1304    return settings->priv->preferences->loadsImagesAutomatically();
1305}
1306
1307/**
1308 * webkit_settings_set_auto_load_images:
1309 * @settings: a #WebKitSettings
1310 * @enabled: Value to be set
1311 *
1312 * Set the #WebKitSettings:auto-load-images property.
1313 */
1314void webkit_settings_set_auto_load_images(WebKitSettings* settings, gboolean enabled)
1315{
1316    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1317
1318    WebKitSettingsPrivate* priv = settings->priv;
1319    bool currentValue = priv->preferences->loadsImagesAutomatically();
1320    if (currentValue == enabled)
1321        return;
1322
1323    priv->preferences->setLoadsImagesAutomatically(enabled);
1324    g_object_notify(G_OBJECT(settings), "auto-load-images");
1325}
1326
1327/**
1328 * webkit_settings_get_load_icons_ignoring_image_load_setting:
1329 * @settings: a #WebKitSettings
1330 *
1331 * Get the #WebKitSettings:load-icons-ignoring-image-load-setting property.
1332 *
1333 * Returns: %TRUE If site icon can be loaded irrespective of image loading preference or %FALSE otherwise.
1334 */
1335gboolean webkit_settings_get_load_icons_ignoring_image_load_setting(WebKitSettings* settings)
1336{
1337    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1338
1339    return settings->priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
1340}
1341
1342/**
1343 * webkit_settings_set_load_icons_ignoring_image_load_setting:
1344 * @settings: a #WebKitSettings
1345 * @enabled: Value to be set
1346 *
1347 * Set the #WebKitSettings:load-icons-ignoring-image-load-setting property.
1348 */
1349void webkit_settings_set_load_icons_ignoring_image_load_setting(WebKitSettings* settings, gboolean enabled)
1350{
1351    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1352
1353    WebKitSettingsPrivate* priv = settings->priv;
1354    bool currentValue = priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
1355    if (currentValue == enabled)
1356        return;
1357
1358    priv->preferences->setLoadsSiteIconsIgnoringImageLoadingPreference(enabled);
1359    g_object_notify(G_OBJECT(settings), "load-icons-ignoring-image-load-setting");
1360}
1361
1362/**
1363 * webkit_settings_get_enable_offline_web_application_cache:
1364 * @settings: a #WebKitSettings
1365 *
1366 * Get the #WebKitSettings:enable-offline-web-application-cache property.
1367 *
1368 * Returns: %TRUE If HTML5 offline web application cache support is enabled or %FALSE otherwise.
1369 */
1370gboolean webkit_settings_get_enable_offline_web_application_cache(WebKitSettings* settings)
1371{
1372    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1373
1374    return settings->priv->preferences->offlineWebApplicationCacheEnabled();
1375}
1376
1377/**
1378 * webkit_settings_set_enable_offline_web_application_cache:
1379 * @settings: a #WebKitSettings
1380 * @enabled: Value to be set
1381 *
1382 * Set the #WebKitSettings:enable-offline-web-application-cache property.
1383 */
1384void webkit_settings_set_enable_offline_web_application_cache(WebKitSettings* settings, gboolean enabled)
1385{
1386    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1387
1388    WebKitSettingsPrivate* priv = settings->priv;
1389    bool currentValue = priv->preferences->offlineWebApplicationCacheEnabled();
1390    if (currentValue == enabled)
1391        return;
1392
1393    priv->preferences->setOfflineWebApplicationCacheEnabled(enabled);
1394    g_object_notify(G_OBJECT(settings), "enable-offline-web-application-cache");
1395}
1396
1397/**
1398 * webkit_settings_get_enable_html5_local_storage:
1399 * @settings: a #WebKitSettings
1400 *
1401 * Get the #WebKitSettings:enable-html5-local-storage property.
1402 *
1403 * Returns: %TRUE If HTML5 local storage support is enabled or %FALSE otherwise.
1404 */
1405gboolean webkit_settings_get_enable_html5_local_storage(WebKitSettings* settings)
1406{
1407    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1408
1409    return settings->priv->preferences->localStorageEnabled();
1410}
1411
1412/**
1413 * webkit_settings_set_enable_html5_local_storage:
1414 * @settings: a #WebKitSettings
1415 * @enabled: Value to be set
1416 *
1417 * Set the #WebKitSettings:enable-html5-local-storage property.
1418 */
1419void webkit_settings_set_enable_html5_local_storage(WebKitSettings* settings, gboolean enabled)
1420{
1421    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1422
1423    WebKitSettingsPrivate* priv = settings->priv;
1424    bool currentValue = priv->preferences->localStorageEnabled();
1425    if (currentValue == enabled)
1426        return;
1427
1428    priv->preferences->setLocalStorageEnabled(enabled);
1429    g_object_notify(G_OBJECT(settings), "enable-html5-local-storage");
1430}
1431
1432/**
1433 * webkit_settings_get_enable_html5_database:
1434 * @settings: a #WebKitSettings
1435 *
1436 * Get the #WebKitSettings:enable-html5-database property.
1437 *
1438 * Returns: %TRUE If HTML5 database support is enabled or %FALSE otherwise.
1439 */
1440gboolean webkit_settings_get_enable_html5_database(WebKitSettings* settings)
1441{
1442    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1443
1444    return settings->priv->preferences->databasesEnabled();
1445}
1446
1447/**
1448 * webkit_settings_set_enable_html5_database:
1449 * @settings: a #WebKitSettings
1450 * @enabled: Value to be set
1451 *
1452 * Set the #WebKitSettings:enable-html5-database property.
1453 */
1454void webkit_settings_set_enable_html5_database(WebKitSettings* settings, gboolean enabled)
1455{
1456    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1457
1458    WebKitSettingsPrivate* priv = settings->priv;
1459    bool currentValue = priv->preferences->databasesEnabled();
1460    if (currentValue == enabled)
1461        return;
1462
1463    priv->preferences->setDatabasesEnabled(enabled);
1464    g_object_notify(G_OBJECT(settings), "enable-html5-database");
1465}
1466
1467/**
1468 * webkit_settings_get_enable_xss_auditor:
1469 * @settings: a #WebKitSettings
1470 *
1471 * Get the #WebKitSettings:enable-xss-auditor property.
1472 *
1473 * Returns: %TRUE If XSS auditing is enabled or %FALSE otherwise.
1474 */
1475gboolean webkit_settings_get_enable_xss_auditor(WebKitSettings* settings)
1476{
1477    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1478
1479    return settings->priv->preferences->xssAuditorEnabled();
1480}
1481
1482/**
1483 * webkit_settings_set_enable_xss_auditor:
1484 * @settings: a #WebKitSettings
1485 * @enabled: Value to be set
1486 *
1487 * Set the #WebKitSettings:enable-xss-auditor property.
1488 */
1489void webkit_settings_set_enable_xss_auditor(WebKitSettings* settings, gboolean enabled)
1490{
1491    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1492
1493    WebKitSettingsPrivate* priv = settings->priv;
1494    bool currentValue = priv->preferences->xssAuditorEnabled();
1495    if (currentValue == enabled)
1496        return;
1497
1498    priv->preferences->setXSSAuditorEnabled(enabled);
1499    g_object_notify(G_OBJECT(settings), "enable-xss-auditor");
1500}
1501
1502/**
1503 * webkit_settings_get_enable_frame_flattening:
1504 * @settings: a #WebKitSettings
1505 *
1506 * Get the #WebKitSettings:enable-frame-flattening property.
1507 *
1508 * Returns: %TRUE If frame flattening is enabled or %FALSE otherwise.
1509 *
1510 **/
1511gboolean webkit_settings_get_enable_frame_flattening(WebKitSettings* settings)
1512{
1513    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1514
1515    return settings->priv->preferences->frameFlatteningEnabled();
1516}
1517
1518/**
1519 * webkit_settings_set_enable_frame_flattening:
1520 * @settings: a #WebKitSettings
1521 * @enabled: Value to be set
1522 *
1523 * Set the #WebKitSettings:enable-frame-flattening property.
1524 */
1525void webkit_settings_set_enable_frame_flattening(WebKitSettings* settings, gboolean enabled)
1526{
1527    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1528
1529    WebKitSettingsPrivate* priv = settings->priv;
1530    bool currentValue = priv->preferences->frameFlatteningEnabled();
1531    if (currentValue == enabled)
1532        return;
1533
1534    priv->preferences->setFrameFlatteningEnabled(enabled);
1535    g_object_notify(G_OBJECT(settings), "enable-frame-flattening");
1536}
1537
1538/**
1539 * webkit_settings_get_enable_plugins:
1540 * @settings: a #WebKitSettings
1541 *
1542 * Get the #WebKitSettings:enable-plugins property.
1543 *
1544 * Returns: %TRUE If plugins are enabled or %FALSE otherwise.
1545 */
1546gboolean webkit_settings_get_enable_plugins(WebKitSettings* settings)
1547{
1548    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1549
1550    return settings->priv->preferences->pluginsEnabled();
1551}
1552
1553/**
1554 * webkit_settings_set_enable_plugins:
1555 * @settings: a #WebKitSettings
1556 * @enabled: Value to be set
1557 *
1558 * Set the #WebKitSettings:enable-plugins property.
1559 */
1560void webkit_settings_set_enable_plugins(WebKitSettings* settings, gboolean enabled)
1561{
1562    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1563
1564    WebKitSettingsPrivate* priv = settings->priv;
1565    bool currentValue = priv->preferences->pluginsEnabled();
1566    if (currentValue == enabled)
1567        return;
1568
1569    priv->preferences->setPluginsEnabled(enabled);
1570    g_object_notify(G_OBJECT(settings), "enable-plugins");
1571}
1572
1573/**
1574 * webkit_settings_get_enable_java:
1575 * @settings: a #WebKitSettings
1576 *
1577 * Get the #WebKitSettings:enable-java property.
1578 *
1579 * Returns: %TRUE If Java is enabled or %FALSE otherwise.
1580 */
1581gboolean webkit_settings_get_enable_java(WebKitSettings* settings)
1582{
1583    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1584
1585    return settings->priv->preferences->javaEnabled();
1586}
1587
1588/**
1589 * webkit_settings_set_enable_java:
1590 * @settings: a #WebKitSettings
1591 * @enabled: Value to be set
1592 *
1593 * Set the #WebKitSettings:enable-java property.
1594 */
1595void webkit_settings_set_enable_java(WebKitSettings* settings, gboolean enabled)
1596{
1597    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1598
1599    WebKitSettingsPrivate* priv = settings->priv;
1600    bool currentValue = priv->preferences->javaEnabled();
1601    if (currentValue == enabled)
1602        return;
1603
1604    priv->preferences->setJavaEnabled(enabled);
1605    g_object_notify(G_OBJECT(settings), "enable-java");
1606}
1607
1608/**
1609 * webkit_settings_get_javascript_can_open_windows_automatically:
1610 * @settings: a #WebKitSettings
1611 *
1612 * Get the #WebKitSettings:javascript-can-open-windows-automatically property.
1613 *
1614 * Returns: %TRUE If JavaScript can open window automatically or %FALSE otherwise.
1615 */
1616gboolean webkit_settings_get_javascript_can_open_windows_automatically(WebKitSettings* settings)
1617{
1618    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1619
1620    return settings->priv->preferences->javaScriptCanOpenWindowsAutomatically();
1621}
1622
1623/**
1624 * webkit_settings_set_javascript_can_open_windows_automatically:
1625 * @settings: a #WebKitSettings
1626 * @enabled: Value to be set
1627 *
1628 * Set the #WebKitSettings:javascript-can-open-windows-automatically property.
1629 */
1630void webkit_settings_set_javascript_can_open_windows_automatically(WebKitSettings* settings, gboolean enabled)
1631{
1632    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1633
1634    WebKitSettingsPrivate* priv = settings->priv;
1635    bool currentValue = priv->preferences->javaScriptCanOpenWindowsAutomatically();
1636    if (currentValue == enabled)
1637        return;
1638
1639    priv->preferences->setJavaScriptCanOpenWindowsAutomatically(enabled);
1640    g_object_notify(G_OBJECT(settings), "javascript-can-open-windows-automatically");
1641}
1642
1643/**
1644 * webkit_settings_get_enable_hyperlink_auditing:
1645 * @settings: a #WebKitSettings
1646 *
1647 * Get the #WebKitSettings:enable-hyperlink-auditing property.
1648 *
1649 * Returns: %TRUE If hyper link auditing is enabled or %FALSE otherwise.
1650 */
1651gboolean webkit_settings_get_enable_hyperlink_auditing(WebKitSettings* settings)
1652{
1653    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1654
1655    return settings->priv->preferences->hyperlinkAuditingEnabled();
1656}
1657
1658/**
1659 * webkit_settings_set_enable_hyperlink_auditing:
1660 * @settings: a #WebKitSettings
1661 * @enabled: Value to be set
1662 *
1663 * Set the #WebKitSettings:enable-hyperlink-auditing property.
1664 */
1665void webkit_settings_set_enable_hyperlink_auditing(WebKitSettings* settings, gboolean enabled)
1666{
1667    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1668
1669    WebKitSettingsPrivate* priv = settings->priv;
1670    bool currentValue = priv->preferences->hyperlinkAuditingEnabled();
1671    if (currentValue == enabled)
1672        return;
1673
1674    priv->preferences->setHyperlinkAuditingEnabled(enabled);
1675    g_object_notify(G_OBJECT(settings), "enable-hyperlink-auditing");
1676}
1677
1678/**
1679 * webkit_web_settings_get_default_font_family:
1680 * @settings: a #WebKitSettings
1681 *
1682 * Gets the #WebKitSettings:default-font-family property.
1683 *
1684 * Returns: The default font family used to display content that does not specify a font.
1685 */
1686const gchar* webkit_settings_get_default_font_family(WebKitSettings* settings)
1687{
1688    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1689
1690    return settings->priv->defaultFontFamily.data();
1691}
1692
1693/**
1694 * webkit_settings_set_default_font_family:
1695 * @settings: a #WebKitSettings
1696 * @default_font_family: the new default font family
1697 *
1698 * Set the #WebKitSettings:default-font-family property.
1699 */
1700void webkit_settings_set_default_font_family(WebKitSettings* settings, const gchar* defaultFontFamily)
1701{
1702    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1703    g_return_if_fail(defaultFontFamily);
1704
1705    WebKitSettingsPrivate* priv = settings->priv;
1706    if (!g_strcmp0(priv->defaultFontFamily.data(), defaultFontFamily))
1707        return;
1708
1709    String standardFontFamily = String::fromUTF8(defaultFontFamily);
1710    priv->preferences->setStandardFontFamily(standardFontFamily);
1711    priv->defaultFontFamily = standardFontFamily.utf8();
1712    g_object_notify(G_OBJECT(settings), "default-font-family");
1713}
1714
1715/**
1716 * webkit_settings_get_monospace_font_family:
1717 * @settings: a #WebKitSettings
1718 *
1719 * Gets the #WebKitSettings:monospace-font-family property.
1720 *
1721 * Returns: Default font family used to display content marked with monospace font.
1722 */
1723const gchar* webkit_settings_get_monospace_font_family(WebKitSettings* settings)
1724{
1725    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1726
1727    return settings->priv->monospaceFontFamily.data();
1728}
1729
1730/**
1731 * webkit_settings_set_monospace_font_family:
1732 * @settings: a #WebKitSettings
1733 * @monospace_font_family: the new default monospace font family
1734 *
1735 * Set the #WebKitSettings:monospace-font-family property.
1736 */
1737void webkit_settings_set_monospace_font_family(WebKitSettings* settings, const gchar* monospaceFontFamily)
1738{
1739    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1740    g_return_if_fail(monospaceFontFamily);
1741
1742    WebKitSettingsPrivate* priv = settings->priv;
1743    if (!g_strcmp0(priv->monospaceFontFamily.data(), monospaceFontFamily))
1744        return;
1745
1746    String fixedFontFamily = String::fromUTF8(monospaceFontFamily);
1747    priv->preferences->setFixedFontFamily(fixedFontFamily);
1748    priv->monospaceFontFamily = fixedFontFamily.utf8();
1749    g_object_notify(G_OBJECT(settings), "monospace-font-family");
1750}
1751
1752/**
1753 * webkit_settings_get_serif_font_family:
1754 * @settings: a #WebKitSettings
1755 *
1756 * Gets the #WebKitSettings:serif-font-family property.
1757 *
1758 * Returns: The default font family used to display content marked with serif font.
1759 */
1760const gchar* webkit_settings_get_serif_font_family(WebKitSettings* settings)
1761{
1762    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1763
1764    return settings->priv->serifFontFamily.data();
1765}
1766
1767/**
1768 * webkit_settings_set_serif_font_family:
1769 * @settings: a #WebKitSettings
1770 * @serif_font_family: the new default serif font family
1771 *
1772 * Set the #WebKitSettings:serif-font-family property.
1773 */
1774void webkit_settings_set_serif_font_family(WebKitSettings* settings, const gchar* serifFontFamily)
1775{
1776    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1777    g_return_if_fail(serifFontFamily);
1778
1779    WebKitSettingsPrivate* priv = settings->priv;
1780    if (!g_strcmp0(priv->serifFontFamily.data(), serifFontFamily))
1781        return;
1782
1783    String serifFontFamilyString = String::fromUTF8(serifFontFamily);
1784    priv->preferences->setSerifFontFamily(serifFontFamilyString);
1785    priv->serifFontFamily = serifFontFamilyString.utf8();
1786    g_object_notify(G_OBJECT(settings), "serif-font-family");
1787}
1788
1789/**
1790 * webkit_settings_get_sans_serif_font_family:
1791 * @settings: a #WebKitSettings
1792 *
1793 * Gets the #WebKitSettings:sans-serif-font-family property.
1794 *
1795 * Returns: The default font family used to display content marked with sans-serif font.
1796 */
1797const gchar* webkit_settings_get_sans_serif_font_family(WebKitSettings* settings)
1798{
1799    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1800
1801    return settings->priv->sansSerifFontFamily.data();
1802}
1803
1804/**
1805 * webkit_settings_set_sans_serif_font_family:
1806 * @settings: a #WebKitSettings
1807 * @sans_serif_font_family: the new default sans-serif font family
1808 *
1809 * Set the #WebKitSettings:sans-serif-font-family property.
1810 */
1811void webkit_settings_set_sans_serif_font_family(WebKitSettings* settings, const gchar* sansSerifFontFamily)
1812{
1813    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1814    g_return_if_fail(sansSerifFontFamily);
1815
1816    WebKitSettingsPrivate* priv = settings->priv;
1817    if (!g_strcmp0(priv->sansSerifFontFamily.data(), sansSerifFontFamily))
1818        return;
1819
1820    String sansSerifFontFamilyString = String::fromUTF8(sansSerifFontFamily);
1821    priv->preferences->setSansSerifFontFamily(sansSerifFontFamilyString);
1822    priv->sansSerifFontFamily = sansSerifFontFamilyString.utf8();
1823    g_object_notify(G_OBJECT(settings), "sans-serif-font-family");
1824}
1825
1826/**
1827 * webkit_settings_get_cursive_font_family:
1828 * @settings: a #WebKitSettings
1829 *
1830 * Gets the #WebKitSettings:cursive-font-family property.
1831 *
1832 * Returns: The default font family used to display content marked with cursive font.
1833 */
1834const gchar* webkit_settings_get_cursive_font_family(WebKitSettings* settings)
1835{
1836    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1837
1838    return settings->priv->cursiveFontFamily.data();
1839}
1840
1841/**
1842 * webkit_settings_set_cursive_font_family:
1843 * @settings: a #WebKitSettings
1844 * @cursive_font_family: the new default cursive font family
1845 *
1846 * Set the #WebKitSettings:cursive-font-family property.
1847 */
1848void webkit_settings_set_cursive_font_family(WebKitSettings* settings, const gchar* cursiveFontFamily)
1849{
1850    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1851    g_return_if_fail(cursiveFontFamily);
1852
1853    WebKitSettingsPrivate* priv = settings->priv;
1854    if (!g_strcmp0(priv->cursiveFontFamily.data(), cursiveFontFamily))
1855        return;
1856
1857    String cursiveFontFamilyString = String::fromUTF8(cursiveFontFamily);
1858    priv->preferences->setCursiveFontFamily(cursiveFontFamilyString);
1859    priv->cursiveFontFamily = cursiveFontFamilyString.utf8();
1860    g_object_notify(G_OBJECT(settings), "cursive-font-family");
1861}
1862
1863/**
1864 * webkit_settings_get_fantasy_font_family:
1865 * @settings: a #WebKitSettings
1866 *
1867 * Gets the #WebKitSettings:fantasy-font-family property.
1868 *
1869 * Returns: The default font family used to display content marked with fantasy font.
1870 */
1871const gchar* webkit_settings_get_fantasy_font_family(WebKitSettings* settings)
1872{
1873    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1874
1875    return settings->priv->fantasyFontFamily.data();
1876}
1877
1878/**
1879 * webkit_settings_set_fantasy_font_family:
1880 * @settings: a #WebKitSettings
1881 * @fantasy_font_family: the new default fantasy font family
1882 *
1883 * Set the #WebKitSettings:fantasy-font-family property.
1884 */
1885void webkit_settings_set_fantasy_font_family(WebKitSettings* settings, const gchar* fantasyFontFamily)
1886{
1887    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1888    g_return_if_fail(fantasyFontFamily);
1889
1890    WebKitSettingsPrivate* priv = settings->priv;
1891    if (!g_strcmp0(priv->fantasyFontFamily.data(), fantasyFontFamily))
1892        return;
1893
1894    String fantasyFontFamilyString = String::fromUTF8(fantasyFontFamily);
1895    priv->preferences->setFantasyFontFamily(fantasyFontFamilyString);
1896    priv->fantasyFontFamily = fantasyFontFamilyString.utf8();
1897    g_object_notify(G_OBJECT(settings), "fantasy-font-family");
1898}
1899
1900/**
1901 * webkit_settings_get_pictograph_font_family:
1902 * @settings: a #WebKitSettings
1903 *
1904 * Gets the #WebKitSettings:pictograph-font-family property.
1905 *
1906 * Returns: The default font family used to display content marked with pictograph font.
1907 */
1908const gchar* webkit_settings_get_pictograph_font_family(WebKitSettings* settings)
1909{
1910    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1911
1912    return settings->priv->pictographFontFamily.data();
1913}
1914
1915/**
1916 * webkit_settings_set_pictograph_font_family:
1917 * @settings: a #WebKitSettings
1918 * @pictograph_font_family: the new default pictograph font family
1919 *
1920 * Set the #WebKitSettings:pictograph-font-family property.
1921 */
1922void webkit_settings_set_pictograph_font_family(WebKitSettings* settings, const gchar* pictographFontFamily)
1923{
1924    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1925    g_return_if_fail(pictographFontFamily);
1926
1927    WebKitSettingsPrivate* priv = settings->priv;
1928    if (!g_strcmp0(priv->pictographFontFamily.data(), pictographFontFamily))
1929        return;
1930
1931    String pictographFontFamilyString = String::fromUTF8(pictographFontFamily);
1932    priv->preferences->setPictographFontFamily(pictographFontFamilyString);
1933    priv->pictographFontFamily = pictographFontFamilyString.utf8();
1934    g_object_notify(G_OBJECT(settings), "pictograph-font-family");
1935}
1936
1937/**
1938 * webkit_settings_get_default_font_size:
1939 * @settings: a #WebKitSettings
1940 *
1941 * Gets the #WebKitSettings:default-font-size property.
1942 *
1943 * Returns: The default font size.
1944 */
1945guint32 webkit_settings_get_default_font_size(WebKitSettings* settings)
1946{
1947    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1948
1949    return settings->priv->preferences->defaultFontSize();
1950}
1951
1952/**
1953 * webkit_settings_set_default_font_size:
1954 * @settings: a #WebKitSettings
1955 * @font_size: default font size to be set in pixels
1956 *
1957 * Set the #WebKitSettings:default-font-size property.
1958 */
1959void webkit_settings_set_default_font_size(WebKitSettings* settings, guint32 fontSize)
1960{
1961    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1962
1963    WebKitSettingsPrivate* priv = settings->priv;
1964    uint32_t currentSize = priv->preferences->defaultFontSize();
1965    if (currentSize == fontSize)
1966        return;
1967
1968    priv->preferences->setDefaultFontSize(fontSize);
1969    g_object_notify(G_OBJECT(settings), "default-font-size");
1970}
1971
1972/**
1973 * webkit_settings_get_default_monospace_font_size:
1974 * @settings: a #WebKitSettings
1975 *
1976 * Gets the #WebKitSettings:default-monospace-font-size property.
1977 *
1978 * Returns: Default monospace font size.
1979 */
1980guint32 webkit_settings_get_default_monospace_font_size(WebKitSettings* settings)
1981{
1982    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1983
1984    return settings->priv->preferences->defaultFixedFontSize();
1985}
1986
1987/**
1988 * webkit_settings_set_default_monospace_font_size:
1989 * @settings: a #WebKitSettings
1990 * @font_size: default monospace font size to be set in pixels
1991 *
1992 * Set the #WebKitSettings:default-monospace-font-size property.
1993 */
1994void webkit_settings_set_default_monospace_font_size(WebKitSettings* settings, guint32 fontSize)
1995{
1996    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1997
1998    WebKitSettingsPrivate* priv = settings->priv;
1999    uint32_t currentSize = priv->preferences->defaultFixedFontSize();
2000    if (currentSize == fontSize)
2001        return;
2002
2003    priv->preferences->setDefaultFixedFontSize(fontSize);
2004    g_object_notify(G_OBJECT(settings), "default-monospace-font-size");
2005}
2006
2007/**
2008 * webkit_settings_get_minimum_font_size:
2009 * @settings: a #WebKitSettings
2010 *
2011 * Gets the #WebKitSettings:minimum-font-size property.
2012 *
2013 * Returns: Minimum font size.
2014 */
2015guint32 webkit_settings_get_minimum_font_size(WebKitSettings* settings)
2016{
2017    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2018
2019    return settings->priv->preferences->minimumFontSize();
2020}
2021
2022/**
2023 * webkit_settings_set_minimum_font_size:
2024 * @settings: a #WebKitSettings
2025 * @font_size: minimum font size to be set in points
2026 *
2027 * Set the #WebKitSettings:minimum-font-size property.
2028 */
2029void webkit_settings_set_minimum_font_size(WebKitSettings* settings, guint32 fontSize)
2030{
2031    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2032
2033    WebKitSettingsPrivate* priv = settings->priv;
2034    uint32_t currentSize = priv->preferences->minimumFontSize();
2035    if (currentSize == fontSize)
2036        return;
2037
2038    priv->preferences->setMinimumFontSize(fontSize);
2039    g_object_notify(G_OBJECT(settings), "minimum-font-size");
2040}
2041
2042/**
2043 * webkit_settings_get_default_charset:
2044 * @settings: a #WebKitSettings
2045 *
2046 * Gets the #WebKitSettings:default-charset property.
2047 *
2048 * Returns: Default charset.
2049 */
2050const gchar* webkit_settings_get_default_charset(WebKitSettings* settings)
2051{
2052    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2053
2054    return settings->priv->defaultCharset.data();
2055}
2056
2057/**
2058 * webkit_settings_set_default_charset:
2059 * @settings: a #WebKitSettings
2060 * @default_charset: default charset to be set
2061 *
2062 * Set the #WebKitSettings:default-charset property.
2063 */
2064void webkit_settings_set_default_charset(WebKitSettings* settings, const gchar* defaultCharset)
2065{
2066    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2067    g_return_if_fail(defaultCharset);
2068
2069    WebKitSettingsPrivate* priv = settings->priv;
2070    if (!g_strcmp0(priv->defaultCharset.data(), defaultCharset))
2071        return;
2072
2073    String defaultCharsetString = String::fromUTF8(defaultCharset);
2074    priv->preferences->setDefaultTextEncodingName(defaultCharsetString);
2075    priv->defaultCharset = defaultCharsetString.utf8();
2076    g_object_notify(G_OBJECT(settings), "default-charset");
2077}
2078
2079/**
2080 * webkit_settings_get_enable_private_browsing:
2081 * @settings: a #WebKitSettings
2082 *
2083 * Get the #WebKitSettings:enable-private-browsing property.
2084 *
2085 * Returns: %TRUE If private browsing is enabled or %FALSE otherwise.
2086 */
2087gboolean webkit_settings_get_enable_private_browsing(WebKitSettings* settings)
2088{
2089    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2090
2091    return settings->priv->preferences->privateBrowsingEnabled();
2092}
2093
2094/**
2095 * webkit_settings_set_private_caret_browsing:
2096 * @settings: a #WebKitSettings
2097 * @enabled: Value to be set
2098 *
2099 * Set the #WebKitSettings:enable-private-browsing property.
2100 */
2101void webkit_settings_set_enable_private_browsing(WebKitSettings* settings, gboolean enabled)
2102{
2103    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2104
2105    WebKitSettingsPrivate* priv = settings->priv;
2106    bool currentValue = priv->preferences->privateBrowsingEnabled();
2107    if (currentValue == enabled)
2108        return;
2109
2110    priv->preferences->setPrivateBrowsingEnabled(enabled);
2111    g_object_notify(G_OBJECT(settings), "enable-private-browsing");
2112}
2113
2114/**
2115 * webkit_settings_get_enable_developer_extras:
2116 * @settings: a #WebKitSettings
2117 *
2118 * Get the #WebKitSettings:enable-developer-extras property.
2119 *
2120 * Returns: %TRUE If developer extras is enabled or %FALSE otherwise.
2121 */
2122gboolean webkit_settings_get_enable_developer_extras(WebKitSettings* settings)
2123{
2124    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2125
2126    return settings->priv->preferences->developerExtrasEnabled();
2127}
2128
2129/**
2130 * webkit_settings_set_enable_developer_extras:
2131 * @settings: a #WebKitSettings
2132 * @enabled: Value to be set
2133 *
2134 * Set the #WebKitSettings:enable-developer-extras property.
2135 */
2136void webkit_settings_set_enable_developer_extras(WebKitSettings* settings, gboolean enabled)
2137{
2138    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2139
2140    WebKitSettingsPrivate* priv = settings->priv;
2141    bool currentValue = priv->preferences->developerExtrasEnabled();
2142    if (currentValue == enabled)
2143        return;
2144
2145    priv->preferences->setDeveloperExtrasEnabled(enabled);
2146    g_object_notify(G_OBJECT(settings), "enable-developer-extras");
2147}
2148
2149/**
2150 * webkit_settings_get_enable_resizable_text_areas:
2151 * @settings: a #WebKitSettings
2152 *
2153 * Get the #WebKitSettings:enable-resizable-text-areas property.
2154 *
2155 * Returns: %TRUE If text areas can be resized or %FALSE otherwise.
2156 */
2157gboolean webkit_settings_get_enable_resizable_text_areas(WebKitSettings* settings)
2158{
2159    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2160
2161    return settings->priv->preferences->textAreasAreResizable();
2162}
2163
2164/**
2165 * webkit_settings_set_enable_resizable_text_areas:
2166 * @settings: a #WebKitSettings
2167 * @enabled: Value to be set
2168 *
2169 * Set the #WebKitSettings:enable-resizable-text-areas property.
2170 */
2171void webkit_settings_set_enable_resizable_text_areas(WebKitSettings* settings, gboolean enabled)
2172{
2173    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2174
2175    WebKitSettingsPrivate* priv = settings->priv;
2176    bool currentValue = priv->preferences->textAreasAreResizable();
2177    if (currentValue == enabled)
2178        return;
2179
2180    priv->preferences->setTextAreasAreResizable(enabled);
2181    g_object_notify(G_OBJECT(settings), "enable-resizable-text-areas");
2182}
2183
2184/**
2185 * webkit_settings_get_enable_tabs_to_links:
2186 * @settings: a #WebKitSettings
2187 *
2188 * Get the #WebKitSettings:enable-tabs-to-links property.
2189 *
2190 * Returns: %TRUE If tabs to link is enabled or %FALSE otherwise.
2191 */
2192gboolean webkit_settings_get_enable_tabs_to_links(WebKitSettings* settings)
2193{
2194    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2195
2196    return settings->priv->preferences->tabsToLinks();
2197}
2198
2199/**
2200 * webkit_settings_set_enable_tabs_to_links:
2201 * @settings: a #WebKitSettings
2202 * @enabled: Value to be set
2203 *
2204 * Set the #WebKitSettings:enable-tabs-to-links property.
2205 */
2206void webkit_settings_set_enable_tabs_to_links(WebKitSettings* settings, gboolean enabled)
2207{
2208    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2209
2210    WebKitSettingsPrivate* priv = settings->priv;
2211    bool currentValue = priv->preferences->tabsToLinks();
2212    if (currentValue == enabled)
2213        return;
2214
2215    priv->preferences->setTabsToLinks(enabled);
2216    g_object_notify(G_OBJECT(settings), "enable-tabs-to-links");
2217}
2218
2219/**
2220 * webkit_settings_get_enable_dns_prefetching:
2221 * @settings: a #WebKitSettings
2222 *
2223 * Get the #WebKitSettings:enable-dns-prefetching property.
2224 *
2225 * Returns: %TRUE If DNS prefetching is enabled or %FALSE otherwise.
2226 */
2227gboolean webkit_settings_get_enable_dns_prefetching(WebKitSettings* settings)
2228{
2229    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2230
2231    return settings->priv->preferences->dnsPrefetchingEnabled();
2232}
2233
2234/**
2235 * webkit_settings_set_enable_dns_prefetching:
2236 * @settings: a #WebKitSettings
2237 * @enabled: Value to be set
2238 *
2239 * Set the #WebKitSettings:enable-dns-prefetching property.
2240 */
2241void webkit_settings_set_enable_dns_prefetching(WebKitSettings* settings, gboolean enabled)
2242{
2243    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2244
2245    WebKitSettingsPrivate* priv = settings->priv;
2246    bool currentValue = priv->preferences->dnsPrefetchingEnabled();
2247    if (currentValue == enabled)
2248        return;
2249
2250    priv->preferences->setDNSPrefetchingEnabled(enabled);
2251    g_object_notify(G_OBJECT(settings), "enable-dns-prefetching");
2252}
2253
2254/**
2255 * webkit_settings_get_enable_caret_browsing:
2256 * @settings: a #WebKitSettings
2257 *
2258 * Get the #WebKitSettings:enable-caret-browsing property.
2259 *
2260 * Returns: %TRUE If caret browsing is enabled or %FALSE otherwise.
2261 */
2262gboolean webkit_settings_get_enable_caret_browsing(WebKitSettings* settings)
2263{
2264    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2265
2266    return settings->priv->preferences->caretBrowsingEnabled();
2267}
2268
2269/**
2270 * webkit_settings_set_enable_caret_browsing:
2271 * @settings: a #WebKitSettings
2272 * @enabled: Value to be set
2273 *
2274 * Set the #WebKitSettings:enable-caret-browsing property.
2275 */
2276void webkit_settings_set_enable_caret_browsing(WebKitSettings* settings, gboolean enabled)
2277{
2278    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2279
2280    WebKitSettingsPrivate* priv = settings->priv;
2281    bool currentValue = priv->preferences->caretBrowsingEnabled();
2282    if (currentValue == enabled)
2283        return;
2284
2285    priv->preferences->setCaretBrowsingEnabled(enabled);
2286    g_object_notify(G_OBJECT(settings), "enable-caret-browsing");
2287}
2288
2289/**
2290 * webkit_settings_get_enable_fullscreen:
2291 * @settings: a #WebKitSettings
2292 *
2293 * Get the #WebKitSettings:enable-fullscreen property.
2294 *
2295 * Returns: %TRUE If fullscreen support is enabled or %FALSE otherwise.
2296 */
2297gboolean webkit_settings_get_enable_fullscreen(WebKitSettings* settings)
2298{
2299    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2300
2301    return settings->priv->preferences->fullScreenEnabled();
2302}
2303
2304/**
2305 * webkit_settings_set_enable_fullscreen:
2306 * @settings: a #WebKitSettings
2307 * @enabled: Value to be set
2308 *
2309 * Set the #WebKitSettings:enable-fullscreen property.
2310 */
2311void webkit_settings_set_enable_fullscreen(WebKitSettings* settings, gboolean enabled)
2312{
2313    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2314
2315    WebKitSettingsPrivate* priv = settings->priv;
2316    bool currentValue = priv->preferences->fullScreenEnabled();
2317    if (currentValue == enabled)
2318        return;
2319
2320    priv->preferences->setFullScreenEnabled(enabled);
2321    g_object_notify(G_OBJECT(settings), "enable-fullscreen");
2322}
2323
2324/**
2325 * webkit_settings_get_print_backgrounds:
2326 * @settings: a #WebKitSettings
2327 *
2328 * Get the #WebKitSettings:print-backgrounds property.
2329 *
2330 * Returns: %TRUE If background images should be printed or %FALSE otherwise.
2331 */
2332gboolean webkit_settings_get_print_backgrounds(WebKitSettings* settings)
2333{
2334    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2335
2336    return settings->priv->preferences->shouldPrintBackgrounds();
2337}
2338
2339/**
2340 * webkit_settings_set_print_backgrounds:
2341 * @settings: a #WebKitSettings
2342 * @print_backgrounds: Value to be set
2343 *
2344 * Set the #WebKitSettings:print-backgrounds property.
2345 */
2346void webkit_settings_set_print_backgrounds(WebKitSettings* settings, gboolean printBackgrounds)
2347{
2348    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2349
2350    WebKitSettingsPrivate* priv = settings->priv;
2351    bool currentValue = priv->preferences->shouldPrintBackgrounds();
2352    if (currentValue == printBackgrounds)
2353        return;
2354
2355    priv->preferences->setShouldPrintBackgrounds(printBackgrounds);
2356    g_object_notify(G_OBJECT(settings), "print-backgrounds");
2357}
2358
2359/**
2360 * webkit_settings_get_enable_webaudio:
2361 * @settings: a #WebKitSettings
2362 *
2363 * Get the #WebKitSettings:enable-webaudio property.
2364 *
2365 * Returns: %TRUE If webaudio support is enabled or %FALSE otherwise.
2366 */
2367gboolean webkit_settings_get_enable_webaudio(WebKitSettings* settings)
2368{
2369    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2370
2371    return settings->priv->preferences->webAudioEnabled();
2372}
2373
2374/**
2375 * webkit_settings_set_enable_webaudio:
2376 * @settings: a #WebKitSettings
2377 * @enabled: Value to be set
2378 *
2379 * Set the #WebKitSettings:enable-webaudio property.
2380 */
2381void webkit_settings_set_enable_webaudio(WebKitSettings* settings, gboolean enabled)
2382{
2383    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2384
2385    WebKitSettingsPrivate* priv = settings->priv;
2386    bool currentValue = priv->preferences->webAudioEnabled();
2387    if (currentValue == enabled)
2388        return;
2389
2390    priv->preferences->setWebAudioEnabled(enabled);
2391    g_object_notify(G_OBJECT(settings), "enable-webaudio");
2392}
2393
2394/**
2395 * webkit_settings_get_enable_webgl:
2396 * @settings: a #WebKitSettings
2397 *
2398 * Get the #WebKitSettings:enable-webgl property.
2399 *
2400 * Returns: %TRUE If webgl support is enabled or %FALSE otherwise.
2401 */
2402gboolean webkit_settings_get_enable_webgl(WebKitSettings* settings)
2403{
2404    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2405
2406    return settings->priv->preferences->webGLEnabled();
2407}
2408
2409/**
2410 * webkit_settings_set_enable_webgl:
2411 * @settings: a #WebKitSettings
2412 * @enabled: Value to be set
2413 *
2414 * Set the #WebKitSettings:enable-webgl property.
2415 */
2416void webkit_settings_set_enable_webgl(WebKitSettings* settings, gboolean enabled)
2417{
2418    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2419
2420    WebKitSettingsPrivate* priv = settings->priv;
2421    bool currentValue = priv->preferences->webGLEnabled();
2422    if (currentValue == enabled)
2423        return;
2424
2425    priv->preferences->setWebGLEnabled(enabled);
2426    g_object_notify(G_OBJECT(settings), "enable-webgl");
2427}
2428
2429/**
2430 * webkit_settings_get_allow_modal_dialogs:
2431 * @settings: a #WebKitSettings
2432 *
2433 * Get the #WebKitSettings:allow-modal-dialogs property.
2434 *
2435 * Returns: %TRUE if it's allowed to create and run modal dialogs or %FALSE otherwise.
2436 */
2437gboolean webkit_settings_get_allow_modal_dialogs(WebKitSettings* settings)
2438{
2439    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2440    return settings->priv->allowModalDialogs;
2441}
2442
2443/**
2444 * webkit_settings_set_allow_modal_dialogs:
2445 * @settings: a #WebKitSettings
2446 * @allowed: Value to be set
2447 *
2448 * Set the #WebKitSettings:allow-modal-dialogs property.
2449 */
2450void webkit_settings_set_allow_modal_dialogs(WebKitSettings* settings, gboolean allowed)
2451{
2452    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2453
2454    WebKitSettingsPrivate* priv = settings->priv;
2455    if (priv->allowModalDialogs == allowed)
2456        return;
2457
2458    priv->allowModalDialogs = allowed;
2459    g_object_notify(G_OBJECT(settings), "allow-modal-dialogs");
2460}
2461
2462/**
2463 * webkit_settings_get_zoom_text_only:
2464 * @settings: a #WebKitSettings
2465 *
2466 * Get the #WebKitSettings:zoom-text-only property.
2467 *
2468 * Returns: %TRUE If zoom level of the view should only affect the text
2469 *    or %FALSE if all view contents should be scaled.
2470 */
2471gboolean webkit_settings_get_zoom_text_only(WebKitSettings* settings)
2472{
2473    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2474
2475    return settings->priv->zoomTextOnly;
2476}
2477
2478/**
2479 * webkit_settings_set_zoom_text_only:
2480 * @settings: a #WebKitSettings
2481 * @zoom_text_only: Value to be set
2482 *
2483 * Set the #WebKitSettings:zoom-text-only property.
2484 */
2485void webkit_settings_set_zoom_text_only(WebKitSettings* settings, gboolean zoomTextOnly)
2486{
2487    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2488
2489    WebKitSettingsPrivate* priv = settings->priv;
2490    if (priv->zoomTextOnly == zoomTextOnly)
2491        return;
2492
2493    priv->zoomTextOnly = zoomTextOnly;
2494    g_object_notify(G_OBJECT(settings), "zoom-text-only");
2495}
2496
2497/**
2498 * webkit_settings_get_javascript_can_access_clipboard:
2499 * @settings: a #WebKitSettings
2500 *
2501 * Get the #WebKitSettings:javascript-can-access-clipboard property.
2502 *
2503 * Returns: %TRUE If javascript-can-access-clipboard is enabled or %FALSE otherwise.
2504 */
2505gboolean webkit_settings_get_javascript_can_access_clipboard(WebKitSettings* settings)
2506{
2507    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2508
2509    return settings->priv->preferences->javaScriptCanAccessClipboard()
2510        && settings->priv->preferences->domPasteAllowed();
2511}
2512
2513/**
2514 * webkit_settings_set_javascript_can_access_clipboard:
2515 * @settings: a #WebKitSettings
2516 * @enabled: Value to be set
2517 *
2518 * Set the #WebKitSettings:javascript-can-access-clipboard property.
2519 */
2520void webkit_settings_set_javascript_can_access_clipboard(WebKitSettings* settings, gboolean enabled)
2521{
2522    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2523
2524    WebKitSettingsPrivate* priv = settings->priv;
2525    bool currentValue = priv->preferences->javaScriptCanAccessClipboard() && priv->preferences->domPasteAllowed();
2526    if (currentValue == enabled)
2527        return;
2528
2529    priv->preferences->setJavaScriptCanAccessClipboard(enabled);
2530    priv->preferences->setDOMPasteAllowed(enabled);
2531    g_object_notify(G_OBJECT(settings), "javascript-can-access-clipboard");
2532}
2533
2534/**
2535 * webkit_settings_get_media_playback_requires_user_gesture:
2536 * @settings: a #WebKitSettings
2537 *
2538 * Get the #WebKitSettings:media-playback-requires-user-gesture property.
2539 *
2540 * Returns: %TRUE If an user gesture is needed to play or load media
2541 *    or %FALSE if no user gesture is needed.
2542 */
2543gboolean webkit_settings_get_media_playback_requires_user_gesture(WebKitSettings* settings)
2544{
2545    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2546
2547    return settings->priv->preferences->mediaPlaybackRequiresUserGesture();
2548}
2549
2550/**
2551 * webkit_settings_set_media_playback_requires_user_gesture:
2552 * @settings: a #WebKitSettings
2553 * @enabled: Value to be set
2554 *
2555 * Set the #WebKitSettings:media-playback-requires-user-gesture property.
2556 */
2557void webkit_settings_set_media_playback_requires_user_gesture(WebKitSettings* settings, gboolean enabled)
2558{
2559    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2560
2561    WebKitSettingsPrivate* priv = settings->priv;
2562    bool currentValue = priv->preferences->mediaPlaybackRequiresUserGesture();
2563    if (currentValue == enabled)
2564        return;
2565
2566    priv->preferences->setMediaPlaybackRequiresUserGesture(enabled);
2567    g_object_notify(G_OBJECT(settings), "media-playback-requires-user-gesture");
2568}
2569
2570/**
2571 * webkit_settings_get_media_playback_allows_inline:
2572 * @settings: a #WebKitSettings
2573 *
2574 * Get the #WebKitSettings:media-playback-allows-inline property.
2575 *
2576 * Returns: %TRUE If inline playback is allowed for media
2577 *    or %FALSE if only fullscreen playback is allowed.
2578 */
2579gboolean webkit_settings_get_media_playback_allows_inline(WebKitSettings* settings)
2580{
2581    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), TRUE);
2582
2583    return settings->priv->preferences->mediaPlaybackAllowsInline();
2584}
2585
2586/**
2587 * webkit_settings_set_media_playback_allows_inline:
2588 * @settings: a #WebKitSettings
2589 * @enabled: Value to be set
2590 *
2591 * Set the #WebKitSettings:media-playback-allows-inline property.
2592 */
2593void webkit_settings_set_media_playback_allows_inline(WebKitSettings* settings, gboolean enabled)
2594{
2595    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2596
2597    WebKitSettingsPrivate* priv = settings->priv;
2598    bool currentValue = priv->preferences->mediaPlaybackAllowsInline();
2599    if (currentValue == enabled)
2600        return;
2601
2602    priv->preferences->setMediaPlaybackAllowsInline(enabled);
2603    g_object_notify(G_OBJECT(settings), "media-playback-allows-inline");
2604}
2605
2606/**
2607 * webkit_settings_get_draw_compositing_indicators:
2608 * @settings: a #WebKitSettings
2609 *
2610 * Get the #WebKitSettings:draw-compositing-indicators property.
2611 *
2612 * Returns: %TRUE If compositing borders are drawn or %FALSE otherwise.
2613 */
2614gboolean webkit_settings_get_draw_compositing_indicators(WebKitSettings* settings)
2615{
2616    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2617    return settings->priv->preferences->compositingBordersVisible()
2618        && settings->priv->preferences->compositingRepaintCountersVisible();
2619}
2620
2621/**
2622 * webkit_settings_set_draw_compositing_indicators:
2623 * @settings: a #WebKitSettings
2624 * @enabled: Value to be set
2625 *
2626 * Set the #WebKitSettings:draw-compositing-indicators property.
2627 */
2628void webkit_settings_set_draw_compositing_indicators(WebKitSettings* settings, gboolean enabled)
2629{
2630    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2631
2632    WebKitSettingsPrivate* priv = settings->priv;
2633    if (priv->preferences->compositingBordersVisible() == enabled
2634        && priv->preferences->compositingRepaintCountersVisible() == enabled)
2635        return;
2636
2637    priv->preferences->setCompositingBordersVisible(enabled);
2638    priv->preferences->setCompositingRepaintCountersVisible(enabled);
2639    g_object_notify(G_OBJECT(settings), "draw-compositing-indicators");
2640}
2641
2642/**
2643 * webkit_settings_get_enable_site_specific_quirks:
2644 * @settings: a #WebKitSettings
2645 *
2646 * Get the #WebKitSettings:enable-site-specific-quirks property.
2647 *
2648 * Returns: %TRUE if site specific quirks are enabled or %FALSE otherwise.
2649 */
2650gboolean webkit_settings_get_enable_site_specific_quirks(WebKitSettings* settings)
2651{
2652    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2653
2654    return settings->priv->preferences->needsSiteSpecificQuirks();
2655}
2656
2657/**
2658 * webkit_settings_set_enable_site_specific_quirks:
2659 * @settings: a #WebKitSettings
2660 * @enabled: Value to be set
2661 *
2662 * Set the #WebKitSettings:enable-site-specific-quirks property.
2663 */
2664void webkit_settings_set_enable_site_specific_quirks(WebKitSettings* settings, gboolean enabled)
2665{
2666    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2667
2668    WebKitSettingsPrivate* priv = settings->priv;
2669    bool currentValue = priv->preferences->needsSiteSpecificQuirks();
2670    if (currentValue == enabled)
2671        return;
2672
2673    priv->preferences->setNeedsSiteSpecificQuirks(enabled);
2674    g_object_notify(G_OBJECT(settings), "enable-site-specific-quirks");
2675}
2676
2677/**
2678 * webkit_settings_get_enable_page_cache:
2679 * @settings: a #WebKitSettings
2680 *
2681 * Get the #WebKitSettings:enable-page-cache property.
2682 *
2683 * Returns: %TRUE if page cache enabled or %FALSE otherwise.
2684 */
2685gboolean webkit_settings_get_enable_page_cache(WebKitSettings* settings)
2686{
2687    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2688
2689    return settings->priv->preferences->usesPageCache();
2690}
2691
2692/**
2693 * webkit_settings_set_enable_page_cache:
2694 * @settings: a #WebKitSettings
2695 * @enabled: Value to be set
2696 *
2697 * Set the #WebKitSettings:enable-page-cache property.
2698 */
2699void webkit_settings_set_enable_page_cache(WebKitSettings* settings, gboolean enabled)
2700{
2701    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2702
2703    WebKitSettingsPrivate* priv = settings->priv;
2704    bool currentValue = priv->preferences->usesPageCache();
2705    if (currentValue == enabled)
2706        return;
2707
2708    priv->preferences->setUsesPageCache(enabled);
2709    g_object_notify(G_OBJECT(settings), "enable-page-cache");
2710}
2711
2712/**
2713 * webkit_settings_get_user_agent:
2714 * @settings: a #WebKitSettings
2715 *
2716 * Get the #WebKitSettings:user-agent property.
2717 *
2718 * Returns: The current value of the user-agent property.
2719 */
2720const char* webkit_settings_get_user_agent(WebKitSettings* settings)
2721{
2722    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2723
2724    WebKitSettingsPrivate* priv = settings->priv;
2725    ASSERT(!priv->userAgent.isNull());
2726    return priv->userAgent.data();
2727}
2728
2729/**
2730 * webkit_settings_set_user_agent:
2731 * @settings: a #WebKitSettings
2732 * @user_agent: (allow-none): The new custom user agent string or %NULL to use the default user agent
2733 *
2734 * Set the #WebKitSettings:user-agent property.
2735 */
2736void webkit_settings_set_user_agent(WebKitSettings* settings, const char* userAgent)
2737{
2738    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2739
2740    WebKitSettingsPrivate* priv = settings->priv;
2741    CString newUserAgent = (!userAgent || !strlen(userAgent)) ? WebCore::standardUserAgent("").utf8() : userAgent;
2742    if (newUserAgent == priv->userAgent)
2743        return;
2744
2745    priv->userAgent = newUserAgent;
2746    g_object_notify(G_OBJECT(settings), "user-agent");
2747}
2748
2749/**
2750 * webkit_settings_set_user_agent_with_application_details:
2751 * @settings: a #WebKitSettings
2752 * @application_name: (allow-none): The application name used for the user agent or %NULL to use the default user agent.
2753 * @application_version: (allow-none): The application version for the user agent or %NULL to user the default version.
2754 *
2755 * Set the #WebKitSettings:user-agent property by appending the application details to the default user
2756 * agent. If no application name or version is given, the default user agent used will be used. If only
2757 * the version is given, the default engine version is used with the given application name.
2758 */
2759void webkit_settings_set_user_agent_with_application_details(WebKitSettings* settings, const char* applicationName, const char* applicationVersion)
2760{
2761    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2762
2763    CString newUserAgent = WebCore::standardUserAgent(String::fromUTF8(applicationName), String::fromUTF8(applicationVersion)).utf8();
2764    webkit_settings_set_user_agent(settings, newUserAgent.data());
2765}
2766
2767/**
2768 * webkit_settings_get_enable_smooth_scrolling:
2769 * @settings: a #WebKitSettings
2770 *
2771 * Get the #WebKitSettings:enable-smooth-scrolling property.
2772 *
2773 * Returns: %TRUE if smooth scrolling is enabled or %FALSE otherwise.
2774 */
2775gboolean webkit_settings_get_enable_smooth_scrolling(WebKitSettings* settings)
2776{
2777    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2778
2779    return settings->priv->preferences->scrollAnimatorEnabled();
2780}
2781
2782/**
2783 * webkit_settings_set_enable_smooth_scrolling:
2784 * @settings: a #WebKitSettings
2785 * @enabled: Value to be set
2786 *
2787 * Set the #WebKitSettings:enable-smooth-scrolling property.
2788 */
2789void webkit_settings_set_enable_smooth_scrolling(WebKitSettings* settings, gboolean enabled)
2790{
2791    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2792
2793    WebKitSettingsPrivate* priv = settings->priv;
2794    bool currentValue = priv->preferences->scrollAnimatorEnabled();
2795    if (currentValue == enabled)
2796        return;
2797
2798    priv->preferences->setScrollAnimatorEnabled(enabled);
2799    g_object_notify(G_OBJECT(settings), "enable-smooth-scrolling");
2800}
2801
2802/**
2803 * webkit_settings_get_enable_accelerated_2d_canvas:
2804 * @settings: a #WebKitSettings
2805 *
2806 * Get the #WebKitSettings:enable-accelerated-2d-canvas property.
2807 *
2808 * Returns: %TRUE if accelerated 2D canvas is enabled or %FALSE otherwise.
2809 *
2810 * Since: 2.2
2811 */
2812gboolean webkit_settings_get_enable_accelerated_2d_canvas(WebKitSettings* settings)
2813{
2814    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2815
2816    return settings->priv->preferences->accelerated2dCanvasEnabled();
2817}
2818
2819/**
2820 * webkit_settings_set_enable_accelerated_2d_canvas:
2821 * @settings: a #WebKitSettings
2822 * @enabled: Value to be set
2823 *
2824 * Set the #WebKitSettings:enable-accelerated-2d-canvas property.
2825 *
2826 * Since: 2.2
2827 */
2828void webkit_settings_set_enable_accelerated_2d_canvas(WebKitSettings* settings, gboolean enabled)
2829{
2830    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2831
2832    WebKitSettingsPrivate* priv = settings->priv;
2833    if (priv->preferences->accelerated2dCanvasEnabled() == enabled)
2834        return;
2835
2836    priv->preferences->setAccelerated2dCanvasEnabled(enabled);
2837    g_object_notify(G_OBJECT(settings), "enable-accelerated-2d-canvas");
2838}
2839
2840/**
2841 * webkit_settings_get_enable_write_console_messages_to_stdout:
2842 * @settings: a #WebKitSettings
2843 *
2844 * Get the #WebKitSettings:enable-write-console-messages-to-stdout property.
2845 *
2846 * Returns: %TRUE if writing console messages to stdout is enabled or %FALSE
2847 * otherwise.
2848 *
2849 * Since: 2.2
2850 */
2851gboolean webkit_settings_get_enable_write_console_messages_to_stdout(WebKitSettings* settings)
2852{
2853    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2854
2855    return settings->priv->preferences->logsPageMessagesToSystemConsoleEnabled();
2856}
2857
2858/**
2859 * webkit_settings_set_enable_write_console_messages_to_stdout:
2860 * @settings: a #WebKitSettings
2861 * @enabled: Value to be set
2862 *
2863 * Set the #WebKitSettings:enable-write-console-messages-to-stdout property.
2864 *
2865 * Since: 2.2
2866 */
2867void webkit_settings_set_enable_write_console_messages_to_stdout(WebKitSettings* settings, gboolean enabled)
2868{
2869    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2870
2871    WebKitSettingsPrivate* priv = settings->priv;
2872    bool currentValue = priv->preferences->logsPageMessagesToSystemConsoleEnabled();
2873    if (currentValue == enabled)
2874        return;
2875
2876    priv->preferences->setLogsPageMessagesToSystemConsoleEnabled(enabled);
2877    g_object_notify(G_OBJECT(settings), "enable-write-console-messages-to-stdout");
2878}
2879
2880/**
2881 * webkit_settings_get_enable_media_stream:
2882 * @settings: a #WebKitSettings
2883 *
2884 * Get the #WebKitSettings:enable-media-stream property.
2885 *
2886 * Returns: %TRUE If mediastream support is enabled or %FALSE otherwise.
2887 *
2888 * Since: 2.4
2889 */
2890gboolean webkit_settings_get_enable_media_stream(WebKitSettings* settings)
2891{
2892    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2893
2894    return settings->priv->preferences->mediaStreamEnabled();
2895}
2896
2897/**
2898 * webkit_settings_set_enable_media_stream:
2899 * @settings: a #WebKitSettings
2900 * @enabled: Value to be set
2901 *
2902 * Set the #WebKitSettings:enable-media-stream property.
2903 *
2904 * Since: 2.4
2905 */
2906void webkit_settings_set_enable_media_stream(WebKitSettings* settings, gboolean enabled)
2907{
2908    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2909
2910    WebKitSettingsPrivate* priv = settings->priv;
2911    bool currentValue = priv->preferences->mediaStreamEnabled();
2912    if (currentValue == enabled)
2913        return;
2914
2915    priv->preferences->setMediaStreamEnabled(enabled);
2916    g_object_notify(G_OBJECT(settings), "enable-media-stream");
2917}
2918
2919/**
2920 * webkit_settings_set_enable_spatial_navigation:
2921 * @settings: a #WebKitSettings
2922 * @enabled: Value to be set
2923 *
2924 * Set the #WebKitSettings:enable-spatial-navigation property.
2925 *
2926 * Since: 2.2
2927 */
2928void webkit_settings_set_enable_spatial_navigation(WebKitSettings* settings, gboolean enabled)
2929{
2930    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2931
2932    WebKitSettingsPrivate* priv = settings->priv;
2933    bool currentValue = priv->preferences->spatialNavigationEnabled();
2934
2935    if (currentValue == enabled)
2936        return;
2937
2938    priv->preferences->setSpatialNavigationEnabled(enabled);
2939    g_object_notify(G_OBJECT(settings), "enable-spatial-navigation");
2940}
2941
2942
2943/**
2944 * webkit_settings_get_enable_spatial_navigation:
2945 * @settings: a #WebKitSettings
2946 *
2947 * Get the #WebKitSettings:enable-spatial-navigation property.
2948 *
2949 * Returns: %TRUE If HTML5 spatial navigation support is enabled or %FALSE otherwise.
2950 *
2951 * Since: 2.2
2952 */
2953gboolean webkit_settings_get_enable_spatial_navigation(WebKitSettings* settings)
2954{
2955    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2956
2957    return settings->priv->preferences->spatialNavigationEnabled();
2958}
2959
2960/**
2961 * webkit_settings_get_enable_mediasource:
2962 * @settings: a #WebKitSettings
2963 *
2964 * Get the #WebKitSettings:enable-mediasource property.
2965 *
2966 * Returns: %TRUE If MediaSource support is enabled or %FALSE otherwise.
2967 *
2968 * Since: 2.4
2969 */
2970gboolean webkit_settings_get_enable_mediasource(WebKitSettings* settings)
2971{
2972    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2973
2974    return settings->priv->preferences->mediaSourceEnabled();
2975}
2976
2977/**
2978 * webkit_settings_set_enable_mediasource:
2979 * @settings: a #WebKitSettings
2980 * @enabled: Value to be set
2981 *
2982 * Set the #WebKitSettings:enable-mediasource property.
2983 *
2984 * Since: 2.4
2985 */
2986void webkit_settings_set_enable_mediasource(WebKitSettings* settings, gboolean enabled)
2987{
2988    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2989
2990    WebKitSettingsPrivate* priv = settings->priv;
2991    bool currentValue = priv->preferences->mediaSourceEnabled();
2992    if (currentValue == enabled)
2993        return;
2994
2995    priv->preferences->setMediaSourceEnabled(enabled);
2996    g_object_notify(G_OBJECT(settings), "enable-mediasource");
2997}
Note: See TracBrowser for help on using the repository browser.