diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
commit | 43a42f108af6bcbd91f2672731c3047c26213af1 (patch) | |
tree | 7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp | |
parent | d9cf437c840c6eb7417bdd97e6c40979255d3158 (diff) | |
download | qtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz |
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp index 242b753e8..930cf8676 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp @@ -20,12 +20,17 @@ #include "config.h" #include "WebKitWindowProperties.h" +#include "ImmutableDictionary.h" #include "WebKitPrivate.h" #include "WebKitWindowPropertiesPrivate.h" +#include "WebNumber.h" #include "WebURLRequest.h" #include <WebCore/IntRect.h> #include <glib/gi18n-lib.h> +using namespace WebKit; +using namespace WebCore; + /** * SECTION: WebKitWindowProperties * @short_description: Window properties of a #WebKitWebView @@ -101,8 +106,6 @@ enum { PROP_FULLSCREEN }; -using namespace WebCore; - G_DEFINE_TYPE(WebKitWindowProperties, webkit_window_properties, G_TYPE_OBJECT) struct _WebKitWindowPropertiesPrivate { @@ -388,56 +391,54 @@ void webkitWindowPropertiesSetFullscreen(WebKitWindowProperties* windowPropertie g_object_notify(G_OBJECT(windowProperties), "fullscreen"); } -void webkitWindowPropertiesUpdateFromWKWindowFeatures(WebKitWindowProperties* windowProperties, WKDictionaryRef wkFeatures) +void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties* windowProperties, ImmutableDictionary* features) { GdkRectangle geometry = windowProperties->priv->geometry; - WKDoubleRef doubleValue; - WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("x")); - if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, xKey.get()))) - geometry.x = WKDoubleGetValue(doubleValue); + WebDouble* doubleValue = static_cast<WebDouble*>(features->get("x")); + if (doubleValue) + geometry.x = doubleValue->value(); - WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("y")); - if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, yKey.get()))) - geometry.y = WKDoubleGetValue(doubleValue); + doubleValue = static_cast<WebDouble*>(features->get("y")); + if (doubleValue) + geometry.y = doubleValue->value(); - WKRetainPtr<WKStringRef> widthKey(AdoptWK, WKStringCreateWithUTF8CString("width")); - if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, widthKey.get()))) - geometry.width = WKDoubleGetValue(doubleValue); + doubleValue = static_cast<WebDouble*>(features->get("width")); + if (doubleValue) + geometry.width = doubleValue->value(); - WKRetainPtr<WKStringRef> heightKey(AdoptWK, WKStringCreateWithUTF8CString("height")); - if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, heightKey.get()))) - geometry.height = WKDoubleGetValue(doubleValue); + doubleValue = static_cast<WebDouble*>(features->get("height")); + if (doubleValue) + geometry.height = doubleValue->value(); webkitWindowPropertiesSetGeometry(windowProperties, &geometry); - WKBooleanRef booleanValue; - WKRetainPtr<WKStringRef> menuBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("menuBarVisible")); - if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, menuBarVisibleKey.get()))) - webkitWindowPropertiesSetMenubarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + WebBoolean* booleanValue = static_cast<WebBoolean*>(features->get("menuBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetMenubarVisible(windowProperties, booleanValue->value()); - WKRetainPtr<WKStringRef> statusBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("statusBarVisible")); - if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, statusBarVisibleKey.get()))) - webkitWindowPropertiesSetStatusbarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast<WebBoolean*>(features->get("statusBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetStatusbarVisible(windowProperties, booleanValue->value()); - WKRetainPtr<WKStringRef> toolBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("toolBarVisible")); - if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, toolBarVisibleKey.get()))) - webkitWindowPropertiesSetToolbarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast<WebBoolean*>(features->get("toolBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetToolbarVisible(windowProperties, booleanValue->value()); - WKRetainPtr<WKStringRef> locationBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("locationBarVisible")); - if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, locationBarVisibleKey.get()))) - webkitWindowPropertiesSetLocationbarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast<WebBoolean*>(features->get("locationBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetLocationbarVisible(windowProperties, booleanValue->value()); - WKRetainPtr<WKStringRef> scrollbarsVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("scrollbarsVisible")); - if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, scrollbarsVisibleKey.get()))) - webkitWindowPropertiesSetScrollbarsVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast<WebBoolean*>(features->get("scrollbarsVisible")); + if (booleanValue) + webkitWindowPropertiesSetScrollbarsVisible(windowProperties, booleanValue->value()); - WKRetainPtr<WKStringRef> resizableKey(AdoptWK, WKStringCreateWithUTF8CString("resizable")); - if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, resizableKey.get()))) - webkitWindowPropertiesSetResizable(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast<WebBoolean*>(features->get("resizable")); + if (booleanValue) + webkitWindowPropertiesSetResizable(windowProperties, booleanValue->value()); - WKRetainPtr<WKStringRef> fullscreenKey(AdoptWK, WKStringCreateWithUTF8CString("fullscreen")); - if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, fullscreenKey.get()))) - webkitWindowPropertiesSetFullscreen(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast<WebBoolean*>(features->get("fullscreen")); + if (booleanValue) + webkitWindowPropertiesSetFullscreen(windowProperties, booleanValue->value()); } /** |