2009-04-28 Xan Lopez <xlopez@igalia.com>
authorxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2009 08:44:54 +0000 (08:44 +0000)
committerxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2009 08:44:54 +0000 (08:44 +0000)
        Reviewed by Gustavo Noronha.

        https://bugs.webkit.org/show_bug.cgi?id=16135
        [GTK] Support caret browsing

        Based on a patch by Alp Toker.

        Add enable-caret-browsing setting to WebKitWebView.

        * webkit/webkitwebsettings.cpp:
        (_WebKitWebSettingsPrivate::):
        (_WebKitWebSettingsPrivate::webkit_web_settings_class_init):
        (_WebKitWebSettingsPrivate::webkit_web_settings_set_property):
        (_WebKitWebSettingsPrivate::webkit_web_settings_get_property):
        (_WebKitWebSettingsPrivate::webkit_web_settings_copy):
        * webkit/webkitwebview.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@42925 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/gtk/ChangeLog
WebKit/gtk/webkit/webkitwebsettings.cpp
WebKit/gtk/webkit/webkitwebview.cpp

index 934fb9e..c44a098 100644 (file)
@@ -1,3 +1,22 @@
+2009-04-28  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        https://bugs.webkit.org/show_bug.cgi?id=16135
+        [GTK] Support caret browsing
+
+        Based on a patch by Alp Toker.
+
+        Add enable-caret-browsing setting to WebKitWebView.
+
+        * webkit/webkitwebsettings.cpp:
+        (_WebKitWebSettingsPrivate::):
+        (_WebKitWebSettingsPrivate::webkit_web_settings_class_init):
+        (_WebKitWebSettingsPrivate::webkit_web_settings_set_property):
+        (_WebKitWebSettingsPrivate::webkit_web_settings_get_property):
+        (_WebKitWebSettingsPrivate::webkit_web_settings_copy):
+        * webkit/webkitwebview.cpp:
+
 2009-04-27  Gustavo Noronha Silva  <gns@gnome.org>
 
         Reviewed by Xan Lopez.
index ed57ac0..5945f23 100644 (file)
@@ -79,6 +79,7 @@ struct _WebKitWebSettingsPrivate {
     gboolean enable_spell_checking;
     gchar* spell_checking_languages;
     GSList* spell_checking_languages_list;
+    gboolean enable_caret_browsing;
 };
 
 #define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
@@ -109,7 +110,8 @@ enum {
     PROP_ENABLE_DEVELOPER_EXTRAS,
     PROP_ENABLE_PRIVATE_BROWSING,
     PROP_ENABLE_SPELL_CHECKING,
-    PROP_SPELL_CHECKING_LANGUAGES
+    PROP_SPELL_CHECKING_LANGUAGES,
+    PROP_ENABLE_CARET_BROWSING
 };
 
 static void webkit_web_settings_finalize(GObject* object);
@@ -404,6 +406,21 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
                                     0,
                                     flags));
 
+    /**
+    * WebKitWebSettings:enable-caret-browsing:
+    *
+    * Whether to enable caret browsing mode.
+    *
+    * Since 1.1.6
+    */
+    g_object_class_install_property(gobject_class,
+                                    PROP_ENABLE_CARET_BROWSING,
+                                    g_param_spec_boolean("enable-caret-browsing",
+                                                         _("Enable Caret Browsing"),
+                                                         _("Whether to enable accesibility enhanced keyboard navigation"),
+                                                         FALSE,
+                                                         flags));
+
     g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
 }
 
@@ -513,6 +530,8 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
         break;
     case PROP_ENABLE_PRIVATE_BROWSING:
         priv->enable_private_browsing = g_value_get_boolean(value);
+    case PROP_ENABLE_CARET_BROWSING:
+        priv->enable_caret_browsing = g_value_get_boolean(value);
         break;
     case PROP_ENABLE_SPELL_CHECKING:
         priv->enable_spell_checking = g_value_get_boolean(value);
@@ -620,6 +639,8 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
         break;
     case PROP_ENABLE_PRIVATE_BROWSING:
         g_value_set_boolean(value, priv->enable_private_browsing);
+    case PROP_ENABLE_CARET_BROWSING:
+        g_value_set_boolean(value, priv->enable_caret_browsing);
         break;
     case PROP_ENABLE_SPELL_CHECKING:
         g_value_set_boolean(value, priv->enable_spell_checking);
@@ -682,6 +703,7 @@ WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
                  "enable-spell-checking", priv->enable_spell_checking,
                  "spell-checking-languages", priv->spell_checking_languages,
                  "spell-checking-languages-list", priv->spell_checking_languages_list,
+                 "enable-caret-browsing", priv->enable_caret_browsing,
                  NULL));
 
     return copy;
index 24b3537..6a369d6 100644 (file)
@@ -1927,7 +1927,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
     gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri;
     gboolean autoLoadImages, autoShrinkImages, printBackgrounds,
         enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas,
-        enablePrivateBrowsing;
+        enablePrivateBrowsing, enableCaretBrowsing;
 
     g_object_get(webSettings,
                  "default-encoding", &defaultEncoding,
@@ -1946,6 +1946,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
                  "user-stylesheet-uri", &userStylesheetUri,
                  "enable-developer-extras", &enableDeveloperExtras,
                  "enable-private-browsing", &enablePrivateBrowsing,
+                 "enable-caret-browsing", &enableCaretBrowsing,
                  NULL);
 
     settings->setDefaultTextEncodingName(defaultEncoding);
@@ -1964,6 +1965,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
     settings->setUserStyleSheetLocation(KURL(KURL(), userStylesheetUri));
     settings->setDeveloperExtrasEnabled(enableDeveloperExtras);
     settings->setPrivateBrowsingEnabled(enablePrivateBrowsing);
+    settings->setCaretBrowsingEnabled(enableCaretBrowsing);
 
     g_free(defaultEncoding);
     g_free(cursiveFontFamily);
@@ -2034,6 +2036,8 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
         settings->setDeveloperExtrasEnabled(g_value_get_boolean(&value));
     else if (name == g_intern_string("enable-private-browsing"))
         settings->setPrivateBrowsingEnabled(g_value_get_boolean(&value));
+    else if (name == g_intern_string("enable-caret-browsing"))
+        settings->setCaretBrowsingEnabled(g_value_get_boolean(&value));
     else if (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name))
         g_warning("Unexpected setting '%s'", name);
     g_value_unset(&value);