[Webkit-unassigned] [Bug 68371] [GTK][WEBKIT2] Add WebKitWebSettings GTK+ API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 21 00:20:14 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=68371





--- Comment #9 from Nayan Kumar K <nayankk at motorola.com>  2011-09-21 00:20:14 PST ---
(In reply to comment #8)
> (In reply to comment #7)
> > >  - It would be nice to have getters and setters for all properties
> > I will submit another patch with remaining properties (to match with the preferences exposed in WKPreferences.h), since the size of this patch is already ~35K.
> 
> I meant having webkit_web_settings_get_foo() and webkit_web_settings_set_foo() for the properties already added. Using g_object_get/set is convenient when getting/setting more than one property at the same time, but they are more inefficient and error prone (you can mispell the property name and it would still build).

It would be something like this then,

void webkit_web_setting_set_scripts_enabled(gobject, value)
{
    WebKitWebSettings* webSettings = WEBKIT_WEB_SETTINGS(object);
    WebKitWebSettingsPrivate* priv = webSettings->priv;
    WKPreferencesSetJavaScriptEnabled(priv->preferences, (bool)g_value_get_boolean(value));
}

static void webkitWebSettingsSetProperty(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
{   ....
    switch(prop_id) {
    case PROP_ENABLE_SCRIPTS:
         webkit_web_setting_set_scripts_enabled(gobject, value);
         break;
    ....
}

This would expose many API's for get/set properties. Should that be fine?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list