2008-01-22 Christian Dywan <christian@imendio.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2008 20:45:18 +0000 (20:45 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2008 20:45:18 +0000 (20:45 +0000)
        Reviewed by Alp Toker.

        [GTK] API: WebKitWebSettings is not usable
        http://bugs.webkit.org/show_bug.cgi?id=16219

        Implement WebKitWebSettings.

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

13 files changed:
ChangeLog
GNUmakefile.am
WebKit/gtk/ChangeLog
WebKit/gtk/WebView/headers.pri
WebKit/gtk/WebView/webkit.h
WebKit/gtk/WebView/webkitprivate.cpp
WebKit/gtk/WebView/webkitprivate.h
WebKit/gtk/WebView/webkitsettings.cpp [deleted file]
WebKit/gtk/WebView/webkitsettings.h [deleted file]
WebKit/gtk/WebView/webkitwebsettings.cpp [new file with mode: 0644]
WebKit/gtk/WebView/webkitwebsettings.h [new file with mode: 0644]
WebKit/gtk/WebView/webkitwebview.cpp
WebKit/gtk/WebView/webkitwebview.h

index 21c4fda..560555c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-01-22  Christian Dywan  <christian@imendio.com>
+
+        Reviewed by Alp Toker.
+
+        [GTK] API: WebKitWebSettings is not usable
+        http://bugs.webkit.org/show_bug.cgi?id=16219
+
+        Implement WebKitWebSettings.
+
+        * GNUmakefile.am:
+
 2008-01-22  Simon Hausmann  <hausmann@webkit.org>
 
         Reviewed by Lars.
index 2cb342f..3442c41 100644 (file)
@@ -238,6 +238,7 @@ webkitgtk_h_api += \
        WebKit/gtk/WebView/webkitdefines.h \
        WebKit/gtk/WebView/webkitnetworkrequest.h \
        WebKit/gtk/WebView/webkitwebframe.h \
+       WebKit/gtk/WebView/webkitwebsettings.h \
        WebKit/gtk/WebView/webkitwebview.h 
 
 webkitgtk_built_sources += \
@@ -246,7 +247,6 @@ webkitgtk_built_sources += \
 
 webkitgtk_headers += \
        WebKit/gtk/WebView/webkitprivate.h \
-       WebKit/gtk/WebView/webkitsettings.h \
        WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
        WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
        WebKit/gtk/WebCoreSupport/DragClientGtk.h \
@@ -258,8 +258,8 @@ webkitgtk_headers += \
 webkitgtk_sources += \
        WebKit/gtk/WebView/webkitnetworkrequest.cpp \
        WebKit/gtk/WebView/webkitprivate.cpp \
-       WebKit/gtk/WebView/webkitsettings.cpp \
        WebKit/gtk/WebView/webkitwebframe.cpp \
+       WebKit/gtk/WebView/webkitwebsettings.cpp \
        WebKit/gtk/WebView/webkitwebview.cpp \
        WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
        WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
index e69098c..599e8e5 100644 (file)
@@ -1,3 +1,23 @@
+2008-01-22  Christian Dywan  <christian@imendio.com>
+
+        Reviewed by Alp Toker.
+
+        [GTK] API: WebKitWebSettings is not usable
+        http://bugs.webkit.org/show_bug.cgi?id=16219
+
+        Implement WebKitWebSettings.
+
+        * WebView/headers.pri:
+        * WebView/webkit.h:
+        * WebView/webkitprivate.cpp:
+        * WebView/webkitprivate.h:
+        * WebView/webkitsettings.cpp: Removed.
+        * WebView/webkitsettings.h: Removed.
+        * WebView/webkitwebsettings.cpp: Added.
+        * WebView/webkitwebsettings.h: Added.
+        * WebView/webkitwebview.cpp:
+        * WebView/webkitwebview.h:
+
 2008-01-21  Alp Toker  <alp@atoker.com>
 
         GTK+ build fix for breakage introduced in r29698.
index 4b2eb21..e99765a 100644 (file)
@@ -2,4 +2,5 @@ WEBKIT_API_HEADERS = $$PWD/webkit.h \
                      $$PWD/webkitdefines.h \
                      $$PWD/webkitnetworkrequest.h \
                      $$PWD/webkitwebframe.h \
+                     $$PWD/webkitwebsettings.h \
                      $$PWD/webkitwebview.h
index b6a3c0e..2e7cd9d 100644 (file)
@@ -23,6 +23,7 @@
 #include <webkitdefines.h>
 #include <webkitnetworkrequest.h>
 #include <webkitwebframe.h>
+#include <webkitwebsettings.h>
 #include <webkitwebview.h>
 
 #endif /* __WEBKIT_H__ */
index dd4e34c..dc2b6f7 100644 (file)
 using namespace WebCore;
 
 namespace WebKit {
-void apply(WebKitSettings*, WebCore::Settings*)
-{
-    notImplemented();
-}
-
-WebKitSettings* create(WebCore::Settings*)
-{
-    notImplemented();
-    return 0;
-}
 
 WebKitWebView* getViewFromFrame(WebKitWebFrame* frame)
 {
index 611ae08..3e1aee7 100644 (file)
@@ -27,9 +27,9 @@
  */
 
 #include "webkitdefines.h"
-#include "webkitsettings.h"
 #include "webkitwebview.h"
 #include "webkitwebframe.h"
+#include "webkitwebsettings.h"
 #include "webkitnetworkrequest.h"
 
 #include "Settings.h"
@@ -38,8 +38,6 @@
 #include "FrameLoaderClient.h"
 
 namespace WebKit {
-    void apply(WebKitSettings*,WebCore::Settings*);
-    WebKitSettings* create(WebCore::Settings*);
     WebKitWebView* getViewFromFrame(WebKitWebFrame*);
 
     WebCore::Frame* core(WebKitWebFrame*);
@@ -58,7 +56,7 @@ extern "C" {
     typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate;
     struct _WebKitWebViewPrivate {
         WebCore::Page* corePage;
-        WebCore::Settings* settings;
+        WebKitWebSettings* webSettings;
 
         WebKitWebFrame* mainFrame;
         WebCore::String applicationNameForUserAgent;
diff --git a/WebKit/gtk/WebView/webkitsettings.cpp b/WebKit/gtk/WebView/webkitsettings.cpp
deleted file mode 100644 (file)
index 2512875..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 Holger Hans Peter Freyther
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "webkitsettings.h"
-
-extern "C" {
-GType webkit_web_settings_get_type(void)
-{
-    return GType();
-}
-
-WebKitSettings* webkit_web_settings_copy(WebKitSettings* setting)
-{
-    return 0;
-}
-
-void webkit_web_settings_free(WebKitSettings* setting)
-{
-}
-
-WebKitSettings* webkit_web_settings_get_global(void)
-{
-    return 0;
-}
-
-void webkit_web_settings_set_global (WebKitSettings* setting)
-{
-}
-
-void webkit_web_settings_set_font_family(WebKitSettings*, WebKitFontFamily family, gchar* family_name)
-{
-}
-
-const gchar* webkit_web_settings_get_font_family(WebKitSettings*, WebKitFontFamily family)
-{
-    return 0;
-}
-
-void webkit_web_settings_set_user_style_sheet_location(WebKitSettings*, gchar*)
-{
-}
-
-void webkit_set_ftp_directory_template_path(WebKitSettings*, gchar*)
-{
-}
-}
diff --git a/WebKit/gtk/WebView/webkitsettings.h b/WebKit/gtk/WebView/webkitsettings.h
deleted file mode 100644 (file)
index a0f3423..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2007 Holger Hans Peter Freyther
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef WEBKIT_SETTINGS_H
-#define WEBKIT_SETTINGS_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include "webkitdefines.h"
-
-G_BEGIN_DECLS
-
-typedef enum {
-    WEBKIT_FONT_FAMILY_STANDARD,
-    WEBKIT_FONT_FAMILY_FIXED,
-    WEBKIT_FONT_FAMILY_SERIF,
-    WEBKIT_FONT_FAMILY_SANS_SERIF,
-    WEBKIT_FONT_FAMILY_CURSIVE,
-    WEBKIT_FONT_FAMILY_FANTASY,
-    WEBKIT_FONT_FAMILY_LAST_ENTRY
-} WebKitFontFamily;
-
-typedef enum {
-    WEBKIT_EDITABLE_LINK_DEFAULT_BEHAVIOUR,
-    WEBKIT_EDITABLE_LINK_ALWAYS_LIVE,
-    WEBKIT_EDITABLE_LINK_ONLY_WITH_SHIFT_KEY,
-    WEBKIT_EDITABLE_LINK_LIVE_WHEN_NOT_FOCUSED,
-    WEBKIT_EDITABLE_LINK_NEVER_LIVE
-} WebKitEditableLinkBehaviour;
-
-typedef struct _WebKitSettings WebKitSettings;
-typedef struct _WebKitSettingsPrivate WebKitSettingsPrivate;
-
-struct _WebKitSettings {
-    gchar* font_name[WEBKIT_FONT_FAMILY_LAST_ENTRY];
-    gint   minimum_font_size;
-    gint   minimum_logical_font_size;
-    gint   default_font_size;
-    gint   default_fixed_font_size;
-    gboolean load_images_automatically;
-    gboolean is_java_script_enabled;
-    gboolean java_script_can_open_windows_automatically;
-    gboolean plugins_enabled;
-    gboolean private_browsing;
-    gchar* user_style_sheet_location;
-    gboolean should_print_backgrounds;
-    gboolean text_areas_are_resizable;
-    WebKitEditableLinkBehaviour editable_link_behaviour;
-    gboolean uses_web_view_cache;
-    gboolean shrink_standalone_images_to_fit;
-    gboolean show_uris_in_tool_tips;
-    gchar* ftp_directory_template_path;
-    gboolean force_ftp_directory_listings;
-    gboolean developer_extras_enabled;
-
-
-    WebKitSettingsPrivate *private_data;
-};
-
-GType
-webkit_web_settings_get_type (void);
-
-WebKitSettings*
-webkit_web_settings_copy (WebKitSettings* setting);
-
-void
-webkit_web_settings_free (WebKitSettings* setting);
-
-WebKitSettings*
-webkit_web_settings_get_global (void);
-
-void
-webkit_web_settings_set_global (WebKitSettings* setting);
-
-void
-webkit_web_settings_set_font_family(WebKitSettings*, WebKitFontFamily family, gchar *family_name);
-
-const gchar*
-webkit_web_settings_get_font_family(WebKitSettings*, WebKitFontFamily family);
-
-void
-webkit_web_settings_set_user_style_sheet_location(WebKitSettings*, gchar*);
-
-void
-webkit_set_ftp_directory_template_path(WebKitSettings*, gchar*);
-
-
-G_END_DECLS
-
-
-#endif
diff --git a/WebKit/gtk/WebView/webkitwebsettings.cpp b/WebKit/gtk/WebView/webkitwebsettings.cpp
new file mode 100644 (file)
index 0000000..43b2209
--- /dev/null
@@ -0,0 +1,464 @@
+/*
+ * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "webkitwebsettings.h"
+#include "webkitprivate.h"
+
+extern "C" {
+
+G_DEFINE_TYPE(WebKitWebSettings, webkit_web_settings, G_TYPE_OBJECT)
+
+struct _WebKitWebSettingsPrivate {
+    gchar* default_encoding;
+    gchar* cursive_font_family;
+    gchar* default_font_family;
+    gchar* fantasy_font_family;
+    gchar* monospace_font_family;
+    gchar* sans_serif_font_family;
+    gchar* serif_font_family;
+    guint default_font_size;
+    guint default_monospace_font_size;
+    guint minimum_font_size;
+    guint minimum_logical_font_size;
+    gboolean auto_load_images;
+    gboolean auto_shrink_images;
+    gboolean print_backgrounds;
+    gboolean enable_scripts;
+    gboolean enable_plugins;
+    gboolean resizable_text_areas;
+    gchar* user_stylesheet_uri;
+};
+
+#define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
+
+enum {
+    PROP_0,
+
+    PROP_DEFAULT_ENCODING,
+    PROP_CURSIVE_FONT_FAMILY,
+    PROP_DEFAULT_FONT_FAMILY,
+    PROP_FANTASY_FONT_FAMILY,
+    PROP_MONOSPACE_FONT_FAMILY,
+    PROP_SANS_SERIF_FONT_FAMILY,
+    PROP_SERIF_FONT_FAMILY,
+    PROP_DEFAULT_FONT_SIZE,
+    PROP_DEFAULT_MONOSPACE_FONT_SIZE,
+    PROP_MINIMUM_FONT_SIZE,
+    PROP_MINIMUM_LOGICAL_FONT_SIZE,
+    PROP_AUTO_LOAD_IMAGES,
+    PROP_AUTO_SHRINK_IMAGES,
+    PROP_PRINT_BACKGROUNDS,
+    PROP_ENABLE_SCRIPTS,
+    PROP_ENABLE_PLUGINS,
+    PROP_RESIZABLE_TEXT_AREAS,
+    PROP_USER_STYLESHEET_URI
+};
+
+static void webkit_web_settings_finalize(GObject* object);
+
+static void webkit_web_settings_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec);
+
+static void webkit_web_settings_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec);
+
+static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
+{
+    GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
+    gobject_class->finalize = webkit_web_settings_finalize;
+    gobject_class->set_property = webkit_web_settings_set_property;
+    gobject_class->get_property = webkit_web_settings_get_property;
+
+    GParamFlags flags = (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_DEFAULT_ENCODING,
+                                    g_param_spec_string(
+                                    "default-encoding",
+                                    "Default Encoding",
+                                    "The default encoding used to display text.",
+                                    "iso-8859-1",
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_CURSIVE_FONT_FAMILY,
+                                    g_param_spec_string(
+                                    "cursive-font-family",
+                                    "Cursive Font Family",
+                                    "The default Cursive font family used to display text.",
+                                    "serif",
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_DEFAULT_FONT_FAMILY,
+                                    g_param_spec_string(
+                                    "default-font-family",
+                                    "Default Font Family",
+                                    "The default font family used to display text.",
+                                    "sans-serif",
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_FANTASY_FONT_FAMILY,
+                                    g_param_spec_string(
+                                    "fantasy-font-family",
+                                    "Fantasy Font Family",
+                                    "The default Fantasy font family used to display text.",
+                                    "serif",
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_MONOSPACE_FONT_FAMILY,
+                                    g_param_spec_string(
+                                    "monospace-font-family",
+                                    "Monospace Font Family",
+                                    "The default font family used to display monospace text.",
+                                    "monospace",
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_SANS_SERIF_FONT_FAMILY,
+                                    g_param_spec_string(
+                                    "sans-serif-font-family",
+                                    "Sans Serif Font Family",
+                                    "The default Sans Serif font family used to display text.",
+                                    "sans-serif",
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_SERIF_FONT_FAMILY,
+                                    g_param_spec_string(
+                                    "serif-font-family",
+                                    "Serif Font Family",
+                                    "The default Serif font family used to display text.",
+                                    "serif",
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_DEFAULT_FONT_SIZE,
+                                    g_param_spec_int(
+                                    "default-font-size",
+                                    "Default Font Size",
+                                    "The default font size used to display text.",
+                                    5, G_MAXINT, 10,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_DEFAULT_MONOSPACE_FONT_SIZE,
+                                    g_param_spec_int(
+                                    "default-monospace-font-size",
+                                    "Default Monospace Font Size",
+                                    "The default font size used to display monospace text.",
+                                    5, G_MAXINT, 10,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_MINIMUM_FONT_SIZE,
+                                    g_param_spec_int(
+                                    "minimum-font-size",
+                                    "Minimum Font Size",
+                                    "The minimum font size used to display text.",
+                                    1, G_MAXINT, 5,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_MINIMUM_LOGICAL_FONT_SIZE,
+                                    g_param_spec_int(
+                                    "minimum-logical-font-size",
+                                    "Minimum Logical Font Size",
+                                    "The minimum logical font size used to display text.",
+                                    1, G_MAXINT, 5,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_AUTO_LOAD_IMAGES,
+                                    g_param_spec_boolean(
+                                    "auto-load-images",
+                                    "Auto Load Images",
+                                    "Load images automatically.",
+                                    TRUE,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_AUTO_SHRINK_IMAGES,
+                                    g_param_spec_boolean(
+                                    "auto-shrink-images",
+                                    "Auto Shrink Images",
+                                    "Automatically shrink standalone images to fit.",
+                                    TRUE,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_PRINT_BACKGROUNDS,
+                                    g_param_spec_boolean(
+                                    "print-backgrounds",
+                                    "Print Backgrounds",
+                                    "Whether background images should be printed.",
+                                    TRUE,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_ENABLE_SCRIPTS,
+                                    g_param_spec_boolean(
+                                    "enable-scripts",
+                                    "Enable Scripts",
+                                    "Enable embedded scripting languages.",
+                                    TRUE,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_ENABLE_PLUGINS,
+                                    g_param_spec_boolean(
+                                    "enable-plugins",
+                                    "Enable Plugins",
+                                    "Enable embedded plugin objects.",
+                                    TRUE,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_RESIZABLE_TEXT_AREAS,
+                                    g_param_spec_boolean(
+                                    "resizable-text-areas",
+                                    "Resizable Text Areas",
+                                    "Whether text areas are resizable.",
+                                    TRUE,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
+                                    PROP_USER_STYLESHEET_URI,
+                                    g_param_spec_string("user-stylesheet-uri",
+                                    "User Stylesheet URI",
+                                    "The URI of a stylesheet that is applied to every page.",
+                                    0,
+                                    flags));
+
+    g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
+}
+
+static void webkit_web_settings_init(WebKitWebSettings* web_settings)
+{
+    web_settings->priv = WEBKIT_WEB_SETTINGS_GET_PRIVATE(web_settings);
+}
+
+static void webkit_web_settings_finalize(GObject* object)
+{
+    WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
+    WebKitWebSettingsPrivate* priv = web_settings->priv;
+
+    g_free(priv->default_encoding);
+    g_free(priv->cursive_font_family);
+    g_free(priv->default_font_family);
+    g_free(priv->fantasy_font_family);
+    g_free(priv->monospace_font_family);
+    g_free(priv->sans_serif_font_family);
+    g_free(priv->serif_font_family);
+    g_free(priv->user_stylesheet_uri);
+
+    G_OBJECT_CLASS(webkit_web_settings_parent_class)->finalize(object);
+}
+
+static void webkit_web_settings_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+    WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
+    WebKitWebSettingsPrivate* priv = web_settings->priv;
+
+    switch(prop_id) {
+    case PROP_DEFAULT_ENCODING:
+        g_free(priv->default_encoding);
+        priv->default_encoding = g_strdup(g_value_get_string(value));
+        break;
+    case PROP_CURSIVE_FONT_FAMILY:
+        g_free(priv->cursive_font_family);
+        priv->cursive_font_family = g_strdup(g_value_get_string(value));
+        break;
+    case PROP_DEFAULT_FONT_FAMILY:
+        g_free(priv->default_font_family);
+        priv->default_font_family = g_strdup(g_value_get_string(value));
+        break;
+    case PROP_FANTASY_FONT_FAMILY:
+        g_free(priv->fantasy_font_family);
+        priv->fantasy_font_family = g_strdup(g_value_get_string(value));
+        break;
+    case PROP_MONOSPACE_FONT_FAMILY:
+        g_free(priv->monospace_font_family);
+        priv->monospace_font_family = g_strdup(g_value_get_string(value));
+        break;
+    case PROP_SANS_SERIF_FONT_FAMILY:
+        g_free(priv->sans_serif_font_family);
+        priv->sans_serif_font_family = g_strdup(g_value_get_string(value));
+        break;
+    case PROP_SERIF_FONT_FAMILY:
+        g_free(priv->serif_font_family);
+        priv->serif_font_family = g_strdup(g_value_get_string(value));
+        break;
+    case PROP_DEFAULT_FONT_SIZE:
+        priv->default_font_size = g_value_get_int(value);
+        break;
+    case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
+        priv->default_monospace_font_size = g_value_get_int(value);
+        break;
+    case PROP_MINIMUM_FONT_SIZE:
+        priv->minimum_font_size = g_value_get_int(value);
+        break;
+    case PROP_MINIMUM_LOGICAL_FONT_SIZE:
+        priv->minimum_logical_font_size = g_value_get_int(value);
+        break;
+    case PROP_AUTO_LOAD_IMAGES:
+        priv->auto_load_images = g_value_get_boolean(value);
+        break;
+    case PROP_AUTO_SHRINK_IMAGES:
+        priv->auto_shrink_images = g_value_get_boolean(value);
+        break;
+    case PROP_PRINT_BACKGROUNDS:
+        priv->print_backgrounds = g_value_get_boolean(value);
+        break;
+    case PROP_ENABLE_SCRIPTS:
+        priv->enable_scripts = g_value_get_boolean(value);
+        break;
+    case PROP_ENABLE_PLUGINS:
+        priv->enable_plugins = g_value_get_boolean(value);
+        break;
+    case PROP_RESIZABLE_TEXT_AREAS:
+        priv->resizable_text_areas = g_value_get_boolean(value);
+        break;
+    case PROP_USER_STYLESHEET_URI:
+        g_free(priv->user_stylesheet_uri);
+        priv->user_stylesheet_uri = g_strdup(g_value_get_string(value));
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+
+static void webkit_web_settings_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+    WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
+    WebKitWebSettingsPrivate* priv = web_settings->priv;
+
+    switch (prop_id) {
+    case PROP_DEFAULT_ENCODING:
+        g_value_set_string(value, priv->default_encoding);
+        break;
+    case PROP_CURSIVE_FONT_FAMILY:
+        g_value_set_string(value, priv->cursive_font_family);
+        break;
+    case PROP_DEFAULT_FONT_FAMILY:
+        g_value_set_string(value, priv->default_font_family);
+        break;
+    case PROP_FANTASY_FONT_FAMILY:
+        g_value_set_string(value, priv->fantasy_font_family);
+        break;
+    case PROP_MONOSPACE_FONT_FAMILY:
+        g_value_set_string(value, priv->monospace_font_family);
+        break;
+    case PROP_SANS_SERIF_FONT_FAMILY:
+        g_value_set_string(value, priv->sans_serif_font_family);
+        break;
+    case PROP_SERIF_FONT_FAMILY:
+        g_value_set_string(value, priv->serif_font_family);
+        break;
+    case PROP_DEFAULT_FONT_SIZE:
+        g_value_set_int(value, priv->default_font_size);
+        break;
+    case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
+        g_value_set_int(value, priv->default_monospace_font_size);
+        break;
+    case PROP_MINIMUM_FONT_SIZE:
+        g_value_set_int(value, priv->minimum_font_size);
+        break;
+    case PROP_MINIMUM_LOGICAL_FONT_SIZE:
+        g_value_set_int(value, priv->minimum_logical_font_size);
+        break;
+    case PROP_AUTO_LOAD_IMAGES:
+        g_value_set_boolean(value, priv->auto_load_images);
+        break;
+    case PROP_AUTO_SHRINK_IMAGES:
+        g_value_set_boolean(value, priv->auto_shrink_images);
+        break;
+    case PROP_PRINT_BACKGROUNDS:
+        g_value_set_boolean(value, priv->print_backgrounds);
+        break;
+    case PROP_ENABLE_SCRIPTS:
+        g_value_set_boolean(value, priv->enable_scripts);
+        break;
+    case PROP_ENABLE_PLUGINS:
+        g_value_set_boolean(value, priv->enable_plugins);
+        break;
+    case PROP_RESIZABLE_TEXT_AREAS:
+        g_value_set_boolean(value, priv->resizable_text_areas);
+        break;
+    case PROP_USER_STYLESHEET_URI:
+        g_value_set_string(value, priv->user_stylesheet_uri);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+
+/**
+ * webkit_web_settings_new:
+ *
+ * Creates a new #WebKitWebSettings instance with default values. It must
+ * be manually attached to a WebView.
+ *
+ * Returns: a new #WebKitWebSettings instance
+ **/
+WebKitWebSettings* webkit_web_settings_new()
+{
+    return WEBKIT_WEB_SETTINGS(g_object_new(WEBKIT_TYPE_WEB_SETTINGS, NULL));
+}
+
+/**
+ * webkit_web_settings_copy:
+ *
+ * Copies an existing #WebKitWebSettings instance.
+ *
+ * Returns: a new #WebKitWebSettings instance
+ **/
+WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
+{
+    WebKitWebSettingsPrivate* priv = web_settings->priv;
+
+    WebKitWebSettings* copy = WEBKIT_WEB_SETTINGS(g_object_new(WEBKIT_TYPE_WEB_SETTINGS,
+                 "default-encoding", priv->default_encoding,
+                 "cursive-font-family", priv->cursive_font_family,
+                 "default-font-family", priv->default_font_family,
+                 "fantasy-font-family", priv->fantasy_font_family,
+                 "monospace-font-family", priv->monospace_font_family,
+                 "sans-serif-font-family", priv->sans_serif_font_family,
+                 "serif-font-family", priv->serif_font_family,
+                 "default-font-size", priv->default_font_size,
+                 "default-monospace-font-size", priv->default_monospace_font_size,
+                 "minimum-font-size", priv->minimum_font_size,
+                 "minimum-logical-font-size", priv->minimum_logical_font_size,
+                 "auto-load-images", priv->auto_load_images,
+                 "auto-shrink-images", priv->auto_shrink_images,
+                 "print-backgrounds", priv->print_backgrounds,
+                 "enable-scripts", priv->enable_scripts,
+                 "enable-plugins", priv->enable_plugins,
+                 "resizable-text-areas", priv->resizable_text_areas,
+                 "user-stylesheet-uri", priv->user_stylesheet_uri,
+                 NULL));
+
+    return copy;
+}
+
+}
diff --git a/WebKit/gtk/WebView/webkitwebsettings.h b/WebKit/gtk/WebView/webkitwebsettings.h
new file mode 100644 (file)
index 0000000..b5db920
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __WEBKIT_WEB_SETTINGS_H__
+#define __WEBKIT_WEB_SETTINGS_H__
+
+#include <glib-object.h>
+
+#include "webkitdefines.h"
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_WEB_SETTINGS            (webkit_web_settings_get_type())
+#define WEBKIT_WEB_SETTINGS(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettings))
+#define WEBKIT_WEB_SETTINGS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsClass))
+#define WEBKIT_IS_WEB_SETTINGS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_SETTINGS))
+#define WEBKIT_IS_WEB_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_WEB_SETTINGS))
+#define WEBKIT_WEB_SETTINGS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsClass))
+
+typedef struct _WebKitWebSettings                WebKitWebSettings;
+typedef struct _WebKitWebSettingsPrivate         WebKitWebSettingsPrivate;
+typedef struct _WebKitWebSettingsClass           WebKitWebSettingsClass;
+
+struct _WebKitWebSettings {
+    GObject parent_instance;
+    WebKitWebSettingsPrivate* priv;
+};
+
+struct _WebKitWebSettingsClass {
+    GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+    void (*_webkit_reserved4) (void);
+};
+
+WEBKIT_API GType
+webkit_web_settings_get_type(void);
+
+WEBKIT_API WebKitWebSettings*
+webkit_web_settings_new(void);
+
+WEBKIT_API WebKitWebSettings*
+webkit_web_settings_copy(WebKitWebSettings* web_settings);
+
+G_END_DECLS
+
+#endif /* __WEBKIT_WEB_SETTINGS_H__ */
index 02cc22b..eee1c7c 100644 (file)
@@ -85,7 +85,8 @@ enum {
 
     PROP_COPY_TARGET_LIST,
     PROP_PASTE_TARGET_LIST,
-    PROP_EDITABLE
+    PROP_EDITABLE,
+    PROP_SETTINGS
 };
 
 static guint webkit_web_view_signals[LAST_SIGNAL] = { 0, };
@@ -192,9 +193,11 @@ static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue*
     case PROP_EDITABLE:
         g_value_set_boolean(value, webkit_web_view_get_editable(webView));
         break;
+    case PROP_SETTINGS:
+        g_value_set_object(value, webkit_web_view_get_settings(webView));
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-        break;
     }
 }
 
@@ -206,9 +209,11 @@ static void webkit_web_view_set_property(GObject* object, guint prop_id, const G
     case PROP_EDITABLE:
         webkit_web_view_set_editable(webView, g_value_get_boolean(value));
         break;
-    default:
-        g_assert_not_reached();
+    case PROP_SETTINGS:
+        webkit_web_view_set_settings(webView, WEBKIT_WEB_SETTINGS(g_value_get_object(value)));
         break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
     }
 }
 
@@ -575,7 +580,7 @@ static void webkit_web_view_finalize(GObject* object)
 
     WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(WEBKIT_WEB_VIEW(object));
     delete webViewData->corePage;
-    delete webViewData->settings;
+    g_object_unref(webViewData->webSettings);
     g_object_unref(webViewData->mainFrame);
     g_object_unref(webViewData->imContext);
     gtk_target_list_unref(webViewData->copy_target_list);
@@ -1007,6 +1012,13 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
                                                        GTK_TYPE_TARGET_LIST,
                                                        WEBKIT_PARAM_READABLE));
 
+    g_object_class_install_property(objectClass, PROP_SETTINGS,
+                                    g_param_spec_object("settings",
+                                                        "Settings",
+                                                        "An associated WebKitWebSettings instance",
+                                                        WEBKIT_TYPE_WEB_SETTINGS,
+                                                        WEBKIT_PARAM_READWRITE));
+
     g_object_class_install_property(objectClass, PROP_EDITABLE,
                                     g_param_spec_boolean("editable",
                                                          "Editable",
@@ -1015,25 +1027,148 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
                                                          WEBKIT_PARAM_READWRITE));
 }
 
+static void webkit_web_view_screen_changed(WebKitWebView* webView, GdkScreen* previousScreen, gpointer userdata)
+{
+    WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
+    WebKitWebSettings* webSettings = webViewData->webSettings;
+    Settings* settings = webViewData->corePage->settings();
+
+    guint defaultFontSize, defaultMonospaceFontSize, minimumFontSize, minimumLogicalFontSize;
+
+    g_object_get(G_OBJECT(webSettings),
+                 "default-font-size", &defaultFontSize,
+                 "default-monospace-font-size", &defaultMonospaceFontSize,
+                 "minimum-font-size", &minimumFontSize,
+                 "minimum-logical-font-size", &minimumLogicalFontSize,
+                 NULL);
+
+#if GTK_CHECK_VERSION(2, 10, 0)
+    GdkScreen* screen = gtk_widget_has_screen(GTK_WIDGET(webView)) ? gtk_widget_get_screen(GTK_WIDGET(webView)) : gdk_screen_get_default();
+    guint DPI = gdk_screen_get_resolution(screen);
+#else
+    guint DPI = 96;
+    g_warning("Cannot retrieve resolution, falling back to 96 DPI");
+#endif
+    settings->setDefaultFontSize(defaultFontSize / 72.0 * DPI);
+    settings->setDefaultFixedFontSize(defaultMonospaceFontSize / 72.0 * DPI);
+    settings->setMinimumFontSize(minimumFontSize / 72.0 * DPI);
+    settings->setMinimumLogicalFontSize(minimumLogicalFontSize / 72.0 * DPI);
+}
+
+static void webkit_web_view_update_settings(WebKitWebView* webView)
+{
+    WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
+    WebKitWebSettings* webSettings = webViewData->webSettings;
+    Settings* settings = webViewData->corePage->settings();
+
+    gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri;
+    gboolean autoLoadImages, autoShrinkImages, printBackgrounds, enableScripts, enablePlugins, resizableTextAreas;
+
+    g_object_get(G_OBJECT(webSettings),
+                 "default-encoding", &defaultEncoding,
+                 "cursive-font-family", &cursiveFontFamily,
+                 "default-font-family", &defaultFontFamily,
+                 "fantasy-font-family", &fantasyFontFamily,
+                 "monospace-font-family", &monospaceFontFamily,
+                 "sans-serif-font-family", &sansSerifFontFamily,
+                 "serif-font-family", &serifFontFamily,
+                 "auto-load-images", &autoLoadImages,
+                 "auto-shrink-images", &autoShrinkImages,
+                 "print-backgrounds", &printBackgrounds,
+                 "enable-scripts", &enableScripts,
+                 "enable-plugins", &enablePlugins,
+                 "resizable-text-areas", &resizableTextAreas,
+                 "user-stylesheet-uri", &userStylesheetUri,
+                 NULL);
+
+    settings->setDefaultTextEncodingName(defaultEncoding);
+    settings->setCursiveFontFamily(cursiveFontFamily);
+    settings->setStandardFontFamily(defaultFontFamily);
+    settings->setFantasyFontFamily(fantasyFontFamily);
+    settings->setFixedFontFamily(monospaceFontFamily);
+    settings->setSansSerifFontFamily(sansSerifFontFamily);
+    settings->setSerifFontFamily(serifFontFamily);
+    settings->setLoadsImagesAutomatically(autoLoadImages);
+    settings->setShrinksStandaloneImagesToFit(autoShrinkImages);
+    settings->setShouldPrintBackgrounds(printBackgrounds);
+    settings->setJavaScriptEnabled(enableScripts);
+    settings->setPluginsEnabled(enablePlugins);
+    settings->setTextAreasAreResizable(resizableTextAreas);
+    settings->setUserStyleSheetLocation(userStylesheetUri);
+
+    g_free(defaultEncoding);
+    g_free(cursiveFontFamily);
+    g_free(defaultFontFamily);
+    g_free(fantasyFontFamily);
+    g_free(monospaceFontFamily);
+    g_free(sansSerifFontFamily);
+    g_free(serifFontFamily);
+    g_free(userStylesheetUri);
+
+    webkit_web_view_screen_changed(webView, NULL, NULL);
+}
+
+static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GParamSpec* pspec, WebKitWebView* webView)
+{
+    WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
+    Settings* settings = webViewData->corePage->settings();
+
+    const gchar* name = g_intern_string(pspec->name);
+    GValue value = {0, 0};
+    g_value_init(&value, pspec->value_type);
+    g_object_get_property(G_OBJECT(webSettings), name, &value);
+
+    if (name == g_intern_string("default-encoding"))
+        settings->setDefaultTextEncodingName(g_value_get_string(&value));
+    else if (name == g_intern_string("cursive-font-family"))
+        settings->setCursiveFontFamily(g_value_get_string(&value));
+    else if (name == g_intern_string("default-font-family"))
+        settings->setStandardFontFamily(g_value_get_string(&value));
+    else if (name == g_intern_string("fantasy-font-family"))
+        settings->setFantasyFontFamily(g_value_get_string(&value));
+    else if (name == g_intern_string("monospace-font-family"))
+        settings->setFixedFontFamily(g_value_get_string(&value));
+    else if (name == g_intern_string("sans-serif-font-family"))
+        settings->setSansSerifFontFamily(g_value_get_string(&value));
+    else if (name == g_intern_string("serif-font-family"))
+        settings->setSerifFontFamily(g_value_get_string(&value)); 
+    else if (name == g_intern_string("default-font-size"))
+        settings->setDefaultFontSize(g_value_get_int(&value));
+    else if (name == g_intern_string("default-monospace-font-size"))
+        settings->setDefaultFixedFontSize(g_value_get_int(&value));
+    else if (name == g_intern_string("minimum-font-size"))
+        settings->setMinimumFontSize(g_value_get_int(&value));
+    else if (name == g_intern_string("minimum-logical-font-size"))
+        settings->setMinimumLogicalFontSize(g_value_get_int(&value));
+    else if (name == g_intern_string("auto-load-images"))
+        settings->setLoadsImagesAutomatically(g_value_get_boolean(&value));
+    else if (name == g_intern_string("auto-shrink-images"))
+        settings->setShrinksStandaloneImagesToFit(g_value_get_boolean(&value));
+    else if (name == g_intern_string("print-backgrounds"))
+        settings->setShouldPrintBackgrounds(g_value_get_boolean(&value));
+    else if (name == g_intern_string("enable-scripts"))
+        settings->setJavaScriptEnabled(g_value_get_boolean(&value));
+    else if (name == g_intern_string("enable-plugins"))
+        settings->setPluginsEnabled(g_value_get_boolean(&value));
+    else if (name == g_intern_string("resizable-text-areas"))
+        settings->setTextAreasAreResizable(g_value_get_boolean(&value));
+    else if (name == g_intern_string("user-stylesheet-uri"))
+        settings->setUserStyleSheetLocation(g_value_get_string(&value));
+    else
+        g_warning("Unexpected setting '%s'", name);
+    g_value_unset(&value);
+}
+
 static void webkit_web_view_init(WebKitWebView* webView)
 {
-    WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(WEBKIT_WEB_VIEW(webView));
+    WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
     webViewData->imContext = gtk_im_multicontext_new();
     webViewData->corePage = new Page(new WebKit::ChromeClient(webView), new WebKit::ContextMenuClient, new WebKit::EditorClient(webView), new WebKit::DragClient, new WebKit::InspectorClient);
 
-    Settings* settings = webViewData->corePage->settings();
-    settings->setLoadsImagesAutomatically(true);
-    settings->setMinimumFontSize(5);
-    settings->setDOMPasteAllowed(true);
-    settings->setMinimumLogicalFontSize(5);
-    settings->setShouldPrintBackgrounds(true);
-    settings->setJavaScriptEnabled(true);
-    settings->setDefaultFixedFontSize(14);
-    settings->setDefaultFontSize(14);
-    settings->setSerifFontFamily("Times New Roman");
-    settings->setSansSerifFontFamily("Arial");
-    settings->setFixedFontFamily("Courier New");
-    settings->setStandardFontFamily("Arial");
+    webViewData->webSettings = webkit_web_settings_new();
+    webkit_web_view_update_settings(webView);
+    g_signal_connect(webView, "screen-changed", G_CALLBACK(webkit_web_view_screen_changed), NULL);
+    g_signal_connect(webViewData->webSettings, "notify", G_CALLBACK(webkit_web_view_settings_notify), webView);
 
     GTK_WIDGET_SET_FLAGS(webView, GTK_CAN_FOCUS);
     webViewData->mainFrame = WEBKIT_WEB_FRAME(webkit_web_frame_new(webView));
@@ -1064,20 +1199,26 @@ GtkWidget* webkit_web_view_new(void)
     return GTK_WIDGET(webView);
 }
 
-void webkit_web_view_set_settings(WebKitWebView* webView, WebKitSettings* settings)
+void webkit_web_view_set_settings(WebKitWebView* webView, WebKitWebSettings* webSettings)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
-    g_return_if_fail(settings);
+    g_return_if_fail(WEBKIT_IS_WEB_SETTINGS(webSettings));
 
-    notImplemented();
+    WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
+    g_signal_handlers_disconnect_by_func(webViewData->webSettings, (gpointer)webkit_web_view_settings_notify, webView);
+    g_object_unref(webViewData->webSettings);
+    g_object_ref(webSettings);
+    webViewData->webSettings = webSettings;
+    webkit_web_view_update_settings(webView);
+    g_signal_connect(webSettings, "notify", G_CALLBACK(webkit_web_view_settings_notify), webView);
 }
 
-WebKitSettings* webkit_web_view_get_settings(WebKitWebView* webView)
+WebKitWebSettings* webkit_web_view_get_settings(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
 
-    notImplemented();
-    return NULL;
+    WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
+    return webViewData->webSettings;
 }
 
 void webkit_web_view_go_backward(WebKitWebView* webView)
index 7c4aaf7..ab2f5c0 100644 (file)
@@ -24,6 +24,7 @@
 #include <JavaScriptCore/JSBase.h>
 
 #include "webkitdefines.h"
+#include "webkitwebsettings.h"
 
 G_BEGIN_DECLS
 
@@ -181,10 +182,16 @@ WEBKIT_API void
 webkit_web_view_set_editable (WebKitWebView* web_view, gboolean flag);
 
 WEBKIT_API GtkTargetList*
-webkit_web_view_get_copy_target_list (WebKitWebView* webView);
+webkit_web_view_get_copy_target_list (WebKitWebView* web_view);
 
 WEBKIT_API GtkTargetList*
-webkit_web_view_get_paste_target_list (WebKitWebView* webView);
+webkit_web_view_get_paste_target_list (WebKitWebView* web_view);
+
+WEBKIT_API void
+webkit_web_view_set_settings (WebKitWebView* web_view, WebKitWebSettings* settings);
+
+WEBKIT_API WebKitWebSettings*
+webkit_web_view_get_settings (WebKitWebView* web_view);
 
 G_END_DECLS