4
4
* Copyright (C) 2008 Collabora Ltd.
5
5
* Copyright (C) 2008 Holger Hans Peter Freyther
6
6
* Copyright (C) 2009 Jan Michael Alonzo
7
* Copyright (C) 2009 Movial Creative Technologies Inc.
8
* Copyright (C) 2009 Igalia S.L.
8
10
* This library is free software; you can redistribute it and/or
9
11
* modify it under the terms of the GNU Library General Public
98
100
gboolean enable_universal_access_from_file_uris;
99
101
gboolean enable_dom_paste;
100
102
gboolean tab_key_cycles_through_elements;
103
gboolean enable_default_context_menu;
104
gboolean enable_site_specific_quirks;
105
gboolean enable_page_cache;
103
108
#define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
139
144
PROP_EDITING_BEHAVIOR,
140
145
PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS,
141
146
PROP_ENABLE_DOM_PASTE,
142
PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS
147
PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS,
148
PROP_ENABLE_DEFAULT_CONTEXT_MENU,
149
PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
150
PROP_ENABLE_PAGE_CACHE
145
153
// Create a default user agent string
165
173
// FIXME: platform/version detection can be shared.
169
177
osVersion = g_strdup("Intel Mac OS X");
171
179
osVersion = g_strdup("PPC Mac OS X");
175
183
struct utsname name;
176
184
if (uname(&name) != -1)
177
185
osVersion = g_strdup_printf("%s %s", name.sysname, name.machine);
179
187
osVersion = g_strdup("Unknown");
181
#elif PLATFORM(WIN_OS)
182
190
// FIXME: Compute the Windows version
183
191
osVersion = g_strdup("Windows");
698
* WebKitWebSettings:enable-default-context-menu:
700
* Whether right-clicks should be handled automatically to create,
701
* and display the context menu. Turning this off will make
702
* WebKitGTK+ not emit the populate-popup signal. Notice that the
703
* default button press event handler may still handle right
704
* clicks for other reasons, such as in-page context menus, or
705
* right-clicks that are handled by the page itself.
709
g_object_class_install_property(gobject_class,
710
PROP_ENABLE_DEFAULT_CONTEXT_MENU,
711
g_param_spec_boolean(
712
"enable-default-context-menu",
713
_("Enable Default Context Menu"),
714
_("Enables the handling of right-clicks for the creation of the default context menu"),
719
* WebKitWebSettings::enable-site-specific-quirks
721
* Whether to turn on site-specific hacks. Turning this on will
722
* tell WebKitGTK+ to use some site-specific workarounds for
723
* better web compatibility. For example, older versions of
724
* MediaWiki will incorrectly send WebKit a css file with KHTML
725
* workarounds. By turning on site-specific quirks, WebKit will
726
* special-case this and other cases to make the sites work.
730
g_object_class_install_property(gobject_class,
731
PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
732
g_param_spec_boolean(
733
"enable-site-specific-quirks",
734
_("Enable Site Specific Quirks"),
735
_("Enables the site-specific compatibility workarounds"),
740
* WebKitWebSettings:enable-page-cache:
742
* Enable or disable the page cache. Disabling the page cache is
743
* generally only useful for special circumstances like low-memory
744
* scenarios or special purpose applications like static HTML
745
* viewers. This setting only controls the Page Cache, this cache
746
* is different than the disk-based or memory-based traditional
747
* resource caches, its point is to make going back and forth
748
* between pages much faster. For details about the different types
749
* of caches and their purposes see:
750
* http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
754
g_object_class_install_property(gobject_class,
755
PROP_ENABLE_PAGE_CACHE,
756
g_param_spec_boolean("enable-page-cache",
757
_("Enable page cache"),
758
_("Whether the page cache should be used"),
689
762
g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
883
956
priv->enable_dom_paste = g_value_get_boolean(value);
885
958
case PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS:
886
priv->tab_key_cycles_through_elements = g_value_get_boolean(value);
959
priv->tab_key_cycles_through_elements = g_value_get_boolean(value);
961
case PROP_ENABLE_DEFAULT_CONTEXT_MENU:
962
priv->enable_default_context_menu = g_value_get_boolean(value);
964
case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
965
priv->enable_site_specific_quirks = g_value_get_boolean(value);
967
case PROP_ENABLE_PAGE_CACHE:
968
priv->enable_page_cache = g_value_get_boolean(value);
889
971
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
1002
1084
case PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS:
1003
1085
g_value_set_boolean(value, priv->tab_key_cycles_through_elements);
1087
case PROP_ENABLE_DEFAULT_CONTEXT_MENU:
1088
g_value_set_boolean(value, priv->enable_default_context_menu);
1090
case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
1091
g_value_set_boolean(value, priv->enable_site_specific_quirks);
1093
case PROP_ENABLE_PAGE_CACHE:
1094
g_value_set_boolean(value, priv->enable_page_cache);
1006
1097
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
1067
1158
"editing-behavior", priv->editing_behavior,
1068
1159
"enable-universal-access-from-file-uris", priv->enable_universal_access_from_file_uris,
1069
1160
"enable-dom-paste", priv->enable_dom_paste,
1161
"tab-key-cycles-through-elements", priv->tab_key_cycles_through_elements,
1162
"enable-default-context-menu", priv->enable_default_context_menu,
1163
"enable-site-specific-quirks", priv->enable_site_specific_quirks,
1164
"enable-page-cache", priv->enable_page_cache,