Changeset 109229 in webkit
- Timestamp:
- Feb 29, 2012, 10:45:14 AM (15 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/gtk/WebKitSettings.cpp (modified) (6 diffs)
-
UIProcess/API/gtk/WebKitSettings.h (modified) (1 diff)
-
UIProcess/API/gtk/docs/webkit2gtk-sections.txt (modified) (1 diff)
-
UIProcess/API/gtk/tests/TestWebKitSettings.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r109228 r109229 1 2012-02-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add zoom-text-only setting to WebKit2 GTK+ API 4 https://bugs.webkit.org/show_bug.cgi?id=75249 5 6 Reviewed by Gustavo Noronha Silva. 7 8 To set whether zoom level of web view should affect only the text 9 or all page contents. It's disabled by default. 10 11 * UIProcess/API/gtk/WebKitSettings.cpp: 12 (webKitSettingsSetProperty): 13 (webKitSettingsGetProperty): 14 (webkit_settings_class_init): Add WebKitSettings:zoom-text-only 15 property. 16 (webkit_settings_set_zoom_text_only): Set 17 WebKitSettings:zoom-text-only. 18 (webkit_settings_get_zoom_text_only): Get 19 WebKitSettings:zoom-text-only. 20 * UIProcess/API/gtk/WebKitSettings.h: 21 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new 22 symbols. 23 * UIProcess/API/gtk/tests/TestWebKitSettings.cpp: 24 (testWebKitSettings): 25 1 26 2012-02-29 Sergio Villar Senin <svillar@igalia.com> 2 27 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
r108512 r109229 47 47 CString pictographFontFamily; 48 48 CString defaultCharset; 49 bool zoomTextOnly; 49 50 }; 50 51 … … 104 105 PROP_PRINT_BACKGROUNDS, 105 106 PROP_ENABLE_WEBAUDIO, 106 PROP_ENABLE_WEBGL 107 PROP_ENABLE_WEBGL, 108 PROP_ZOOM_TEXT_ONLY 107 109 }; 108 110 … … 211 213 webkit_settings_set_enable_webgl(settings, g_value_get_boolean(value)); 212 214 break; 215 case PROP_ZOOM_TEXT_ONLY: 216 webkit_settings_set_zoom_text_only(settings, g_value_get_boolean(value)); 217 break; 213 218 default: 214 219 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec); … … 320 325 case PROP_ENABLE_WEBGL: 321 326 g_value_set_boolean(value, webkit_settings_get_enable_webgl(settings)); 327 break; 328 case PROP_ZOOM_TEXT_ONLY: 329 g_value_set_boolean(value, webkit_settings_get_zoom_text_only(settings)); 322 330 break; 323 331 default: … … 817 825 readWriteConstructParamFlags)); 818 826 827 /** 828 * WebKitSettings:zoom-text-only: 829 * 830 * Whether #WebKitWebView:zoom-level affects only the 831 * text of the page or all the contents. Other contents containing text 832 * like form controls will be also affected by zoom factor when 833 * this property is enabled. 834 */ 835 g_object_class_install_property(gObjectClass, 836 PROP_ZOOM_TEXT_ONLY, 837 g_param_spec_boolean("zoom-text-only", 838 _("Zoom Text Only"), 839 _("Whether zoom level of web view changes only the text size"), 840 FALSE, 841 readWriteConstructParamFlags)); 842 819 843 g_type_class_add_private(klass, sizeof(WebKitSettingsPrivate)); 820 844 } … … 2074 2098 g_object_notify(G_OBJECT(settings), "enable-webgl"); 2075 2099 } 2100 2101 /** 2102 * webkit_settings_set_zoom_text_only: 2103 * @settings: a #WebKitSettings 2104 * @zoom_text_only: Value to be set 2105 * 2106 * Set the #WebKitSettings:zoom-text-only property. 2107 */ 2108 void webkit_settings_set_zoom_text_only(WebKitSettings* settings, gboolean zoomTextOnly) 2109 { 2110 g_return_if_fail(WEBKIT_IS_SETTINGS(settings)); 2111 2112 WebKitSettingsPrivate* priv = settings->priv; 2113 if (priv->zoomTextOnly == zoomTextOnly) 2114 return; 2115 2116 priv->zoomTextOnly = zoomTextOnly; 2117 g_object_notify(G_OBJECT(settings), "zoom-text-only"); 2118 } 2119 2120 /** 2121 * webkit_settings_get_zoom_text_only: 2122 * @settings: a #WebKitSettings 2123 * 2124 * Get the #WebKitSettings:zoom-text-only property. 2125 * 2126 * Returns: %TRUE If zoom level of the view should only affect the text 2127 * or %FALSE if all view contents should be scaled. 2128 */ 2129 gboolean webkit_settings_get_zoom_text_only(WebKitSettings* settings) 2130 { 2131 g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE); 2132 2133 return settings->priv->zoomTextOnly; 2134 } 2135 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
r108512 r109229 308 308 gboolean enabled); 309 309 310 WEBKIT_API void 311 webkit_settings_set_zoom_text_only (WebKitSettings *settings, 312 gboolean zoom_text_only); 313 314 WEBKIT_API gboolean 315 webkit_settings_get_zoom_text_only (WebKitSettings *settings); 316 310 317 G_END_DECLS 311 318 -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
r109222 r109229 222 222 webkit_settings_get_enable_webgl 223 223 webkit_settings_set_enable_webgl 224 webkit_settings_get_zoom_text_only 225 webkit_settings_set_zoom_text_only 224 226 225 227 <SUBSECTION Standard> -
trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
r108512 r109229 200 200 g_assert(webkit_settings_get_enable_webgl(settings)); 201 201 202 // Zoom text only is disabled by default. 203 g_assert(!webkit_settings_get_zoom_text_only(settings)); 204 webkit_settings_set_zoom_text_only(settings, TRUE); 205 g_assert(webkit_settings_get_zoom_text_only(settings)); 206 202 207 g_object_unref(G_OBJECT(settings)); 203 208 }
Note:
See TracChangeset
for help on using the changeset viewer.