2011-07-01 Joone Hur <joone.hur@collabora.co.uk>
authorjoone.hur@collabora.co.uk <joone.hur@collabora.co.uk@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jul 2011 16:56:20 +0000 (16:56 +0000)
committerjoone.hur@collabora.co.uk <joone.hur@collabora.co.uk@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jul 2011 16:56:20 +0000 (16:56 +0000)
        Reviewed by Martin Robinson.

        [GTK] Add DeviceOrientation feature
        https://bugs.webkit.org/show_bug.cgi?id=63720

        Add configure option to enable/disable DeviceOrientation feature.

        * configure.ac:
2011-07-01  Joone Hur  <joone.hur@collabora.co.uk>

        Reviewed by Martin Robinson.

        [GTK] Add DeviceOrientation feature
        https://bugs.webkit.org/show_bug.cgi?id=63720

        Add DeviceMotionClientGtk.cpp and DeviceOrientationClientGtk.cpp to WebKitGtk+ build.

        * GNUmakefile.am: Add DeviceMotionClientGtk.cpp, DeviceOrientationClientGtk.cpp.
2011-07-01  Joone Hur  <joone.hur@collabora.co.uk>

        Reviewed by Martin Robinson.

        [GTK] Add DeviceOrientation feature
        https://bugs.webkit.org/show_bug.cgi?id=63720

        Add empty implementation of DeviceMotionClient and DeviceOrientationClient callback methods.

        * GNUmakefile.am:
        * WebCoreSupport/DeviceMotionClientGtk.cpp: Added.
        (WebCore::DeviceMotionClientGtk::DeviceMotionClientGtk):
        (WebCore::DeviceMotionClientGtk::~DeviceMotionClientGtk):
        (WebCore::DeviceMotionClientGtk::deviceMotionControllerDestroyed):
        (WebCore::DeviceMotionClientGtk::setController):
        (WebCore::DeviceMotionClientGtk::startUpdating):
        (WebCore::DeviceMotionClientGtk::stopUpdating):
        (WebCore::DeviceMotionClientGtk::currentDeviceMotion):
        * WebCoreSupport/DeviceMotionClientGtk.h: Added.
        * WebCoreSupport/DeviceOrientationClientGtk.cpp: Added.
        (WebCore::DeviceOrientationClientGtk::DeviceOrientationClientGtk):
        (WebCore::DeviceOrientationClientGtk::~DeviceOrientationClientGtk):
        (WebCore::DeviceOrientationClientGtk::deviceOrientationControllerDestroyed):
        (WebCore::DeviceOrientationClientGtk::setController):
        (WebCore::DeviceOrientationClientGtk::startUpdating):
        (WebCore::DeviceOrientationClientGtk::stopUpdating):
        (WebCore::DeviceOrientationClientGtk::lastOrientation):
        * WebCoreSupport/DeviceOrientationClientGtk.h: Added.
        * webkit/webkitwebview.cpp:
        (webkit_web_view_init):

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

ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.cpp [new file with mode: 0644]
Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.h [new file with mode: 0644]
Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.cpp [new file with mode: 0644]
Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h [new file with mode: 0644]
Source/WebKit/gtk/webkit/webkitwebview.cpp
configure.ac

index a184e05b444c7646f6be92559529881a041bf9e6..9c39f1396a6d6b870283ddf11282f13b831fc96b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-07-01  Joone Hur  <joone.hur@collabora.co.uk>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Add DeviceOrientation feature
+        https://bugs.webkit.org/show_bug.cgi?id=63720
+
+        Add configure option to enable/disable DeviceOrientation feature.
+
+        * configure.ac:
+
 2011-06-28  Joone Hur  <joone.hur@collabora.co.uk>
 
         Reviewed by Martin Robinson.
index 1d502e9313bbb3303143c8678048b39715926a44..bcceb32c81f58cdf2febd8cc1abaf61de1455476 100644 (file)
@@ -1,3 +1,14 @@
+2011-07-01  Joone Hur  <joone.hur@collabora.co.uk>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Add DeviceOrientation feature
+        https://bugs.webkit.org/show_bug.cgi?id=63720
+
+        Add DeviceMotionClientGtk.cpp and DeviceOrientationClientGtk.cpp to WebKitGtk+ build.
+
+        * GNUmakefile.am: Add DeviceMotionClientGtk.cpp, DeviceOrientationClientGtk.cpp.
+
 2011-07-01  Kentaro Hara  <haraken@google.com>
 
         Reviewed by Kent Tamura.
index 5786961f6890c588604a94519fb01ebfb366a4a3..baecd37e7931528589f4a3e4bf0e1d5841c1adee 100644 (file)
@@ -603,6 +603,14 @@ FEATURE_DEFINES += ENABLE_REGISTER_PROTOCOL_HANDLER=1
 webcore_cppflags += -DENABLE_REGISTER_PROTOCOL_HANDLER=1
 endif  # END ENABLE_REGISTER_PROTOCOL_HANDLER
 
+# ---
+# DeviceOrientation support
+# ---
+if ENABLE_DEVICE_ORIENTATION
+FEATURE_DEFINES += ENABLE_DEVICE_ORIENTATION=1
+webcore_cppflags += -DENABLE_DEVICE_ORIENTATION=1
+endif  # END ENABLE_DEVICE_ORIENTATION
+
 DerivedSources/WebCore/CSSPropertyNames.cpp: DerivedSources/WebCore/CSSPropertyNames.h
 DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
        cat $(WEBCORE_CSS_PROPERTY_NAMES) > CSSPropertyNames.in
index d3f6d3e22ed765088bed283d89b5324ecfe7e38e..3559a3354aac6a19883c8aed4cf9ad1e12cce598 100644 (file)
@@ -1,3 +1,34 @@
+2011-07-01  Joone Hur  <joone.hur@collabora.co.uk>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Add DeviceOrientation feature
+        https://bugs.webkit.org/show_bug.cgi?id=63720
+
+        Add empty implementation of DeviceMotionClient and DeviceOrientationClient callback methods.
+
+        * GNUmakefile.am:
+        * WebCoreSupport/DeviceMotionClientGtk.cpp: Added.
+        (WebCore::DeviceMotionClientGtk::DeviceMotionClientGtk):
+        (WebCore::DeviceMotionClientGtk::~DeviceMotionClientGtk):
+        (WebCore::DeviceMotionClientGtk::deviceMotionControllerDestroyed):
+        (WebCore::DeviceMotionClientGtk::setController):
+        (WebCore::DeviceMotionClientGtk::startUpdating):
+        (WebCore::DeviceMotionClientGtk::stopUpdating):
+        (WebCore::DeviceMotionClientGtk::currentDeviceMotion):
+        * WebCoreSupport/DeviceMotionClientGtk.h: Added.
+        * WebCoreSupport/DeviceOrientationClientGtk.cpp: Added.
+        (WebCore::DeviceOrientationClientGtk::DeviceOrientationClientGtk):
+        (WebCore::DeviceOrientationClientGtk::~DeviceOrientationClientGtk):
+        (WebCore::DeviceOrientationClientGtk::deviceOrientationControllerDestroyed):
+        (WebCore::DeviceOrientationClientGtk::setController):
+        (WebCore::DeviceOrientationClientGtk::startUpdating):
+        (WebCore::DeviceOrientationClientGtk::stopUpdating):
+        (WebCore::DeviceOrientationClientGtk::lastOrientation):
+        * WebCoreSupport/DeviceOrientationClientGtk.h: Added.
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_init):
+
 2011-06-28  Joone Hur  <joone.hur@collabora.co.uk>
 
         Reviewed by Martin Robinson.
index a2850aae84856e7d8e2e04b8f980bd65e675649b..51c7c7f4e68e6b20d5c4e0e2f83912a14025ca1f 100644 (file)
@@ -182,6 +182,10 @@ webkitgtk_sources += \
        Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
        Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
        Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
+       Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.cpp \
+       Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.h \
+       Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.cpp \
+       Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h \
        Source/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp \
        Source/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.h \
        Source/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
diff --git a/Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.cpp
new file mode 100644 (file)
index 0000000..c993524
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2011 Collabora Ltd.
+ *
+ * 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"
+
+#if ENABLE(DEVICE_ORIENTATION)
+#include "DeviceMotionClientGtk.h"
+
+#include "NotImplemented.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+DeviceMotionClientGtk::DeviceMotionClientGtk()
+{
+}
+
+DeviceMotionClientGtk::~DeviceMotionClientGtk()
+{
+}
+
+void DeviceMotionClientGtk::deviceMotionControllerDestroyed()
+{
+    delete this;
+}
+
+void DeviceMotionClientGtk::setController(DeviceMotionController* controller)
+{
+    m_controller = controller;
+}
+
+void DeviceMotionClientGtk::startUpdating()
+{
+    notImplemented();
+}
+
+void DeviceMotionClientGtk::stopUpdating()
+{
+    notImplemented();
+}
+
+DeviceMotionData* DeviceMotionClientGtk::currentDeviceMotion() const
+{
+    notImplemented();
+    return 0;
+}
+
+} // namespece WebKit
+
+#endif
diff --git a/Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/DeviceMotionClientGtk.h
new file mode 100644 (file)
index 0000000..17cc79e
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2011 Collabora Ltd.
+ *
+ * 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 DeviceMotionClientGtk_h
+#define DeviceMotionClientGtk_h
+
+#include "DeviceMotionClient.h"
+#include "DeviceMotionData.h"
+
+namespace WebKit {
+
+class DeviceMotionClientGtk : public WebCore::DeviceMotionClient {
+public:
+    DeviceMotionClientGtk();
+    virtual ~DeviceMotionClientGtk();
+
+    virtual void setController(WebCore::DeviceMotionController*);
+    virtual void startUpdating();
+    virtual void stopUpdating();
+    virtual WebCore::DeviceMotionData* currentDeviceMotion() const;
+    virtual void deviceMotionControllerDestroyed();
+
+private:
+    WebCore::DeviceMotionController* m_controller;
+};
+
+} // namespece WebKit
+
+#endif // DeviceMotionClientGtk_h
diff --git a/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.cpp
new file mode 100644 (file)
index 0000000..6e000d2
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2011 Collabora Ltd.
+ *
+ * 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"
+
+#if ENABLE(DEVICE_ORIENTATION)
+#include "DeviceOrientationClientGtk.h"
+
+#include "NotImplemented.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+DeviceOrientationClientGtk::DeviceOrientationClientGtk()
+{
+}
+
+DeviceOrientationClientGtk::~DeviceOrientationClientGtk()
+{
+}
+
+void DeviceOrientationClientGtk::deviceOrientationControllerDestroyed()
+{
+    delete this;
+}
+
+void DeviceOrientationClientGtk::setController(DeviceOrientationController* controller)
+{
+    m_controller = controller;
+}
+
+void DeviceOrientationClientGtk::startUpdating()
+{
+    notImplemented();
+}
+
+void DeviceOrientationClientGtk::stopUpdating()
+{
+    notImplemented();
+}
+
+DeviceOrientation* DeviceOrientationClientGtk::lastOrientation() const
+{
+    notImplemented();
+    return 0;
+}
+
+} // namespace WebKit
+#endif
diff --git a/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h
new file mode 100644 (file)
index 0000000..2c52949
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2011 Collabora Ltd.
+ *
+ * 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 DeviceOrientationClientGtk_h
+#define DeviceOrientationClientGtk_h
+
+#include "DeviceOrientation.h"
+#include "DeviceOrientationClient.h"
+
+namespace WebKit {
+
+class DeviceOrientationClientGtk : public WebCore::DeviceOrientationClient {
+public:
+    DeviceOrientationClientGtk();
+    virtual ~DeviceOrientationClientGtk();
+
+    virtual void setController(WebCore::DeviceOrientationController*);
+    virtual void startUpdating();
+    virtual void stopUpdating();
+    virtual WebCore::DeviceOrientation* lastOrientation() const;
+    virtual void deviceOrientationControllerDestroyed();
+
+private:
+    WebCore::DeviceOrientationController* m_controller;
+};
+
+} // namespace WebKit
+
+#endif // DeviceOrientationClientGtk_h
index 9171fb24c5637e3e788fe269aa1c23b2ed52d805..7e1d46df2cc2adc72063e1d6a88ee9860e0f513b 100644 (file)
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/text/CString.h>
 
+#if ENABLE(DEVICE_ORIENTATION)
+#include "DeviceMotionClientGtk.h"
+#include "DeviceOrientationClientGtk.h"
+#endif
+
 /**
  * SECTION:webkitwebview
  * @short_description: The central class of the WebKitGTK+ API
@@ -3375,6 +3380,12 @@ static void webkit_web_view_init(WebKitWebView* webView)
     pageClients.editorClient = new WebKit::EditorClient(webView);
     pageClients.dragClient = new WebKit::DragClient(webView);
     pageClients.inspectorClient = new WebKit::InspectorClient(webView);
+
+#if ENABLE(DEVICE_ORIENTATION)
+    pageClients.deviceMotionClient = static_cast<WebCore::DeviceMotionClient*>(new DeviceMotionClientGtk);
+    pageClients.deviceOrientationClient = static_cast<WebCore::DeviceOrientationClient*>(new DeviceOrientationClientGtk);
+#endif
+
     priv->corePage = new Page(pageClients);
 
     // Pages within a same session need to be linked together otherwise some functionalities such
index 8d4221304f91b2a45bb846cfc1b0fa5f7b186f72..9d8ad90c31ab5a0498697aeb8d376d20057bcbee 100644 (file)
@@ -928,6 +928,14 @@ AC_ARG_ENABLE(register_protocol_handler,
               [],[enable_register_protocol_handler="no"])
 AC_MSG_RESULT([$enable_register_protocol_handler])
 
+# check whether to enable DeviceOrientation support
+AC_MSG_CHECKING([whether to enable DeviceOrientation])
+AC_ARG_ENABLE(device_orientation,
+              AC_HELP_STRING([--enable-device-orientation],
+                             [enable support for DeviceOrientation (experimental and incomplete) [default=no]]),
+              [],[enable_device_orientation="no"])
+AC_MSG_RESULT([$enable_device_orientation])
+
 G_IR_SCANNER=
 G_IR_COMPILER=
 G_IR_GENERATE=
@@ -1195,6 +1203,7 @@ AM_CONDITIONAL([ENABLE_SPELLCHECK],[test "$enable_spellcheck" = "yes"])
 AM_CONDITIONAL([ENABLE_ANIMATION_API],[test "$enable_animation_api" = "yes"])
 AM_CONDITIONAL([ENABLE_TOUCH_ICON_LOADING],[test "$enable_touch_icon_loading" = "yes"])
 AM_CONDITIONAL([ENABLE_REGISTER_PROTOCOL_HANDLER],[test "$enable_register_protocol_handler" = "yes"])
+AM_CONDITIONAL([ENABLE_DEVICE_ORIENTATION],[test "$enable_device_orientation" = "yes"])
 
 # Gtk conditionals
 AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
@@ -1245,6 +1254,7 @@ Features:
  3D Rendering                                             : $enable_3d_rendering
  WebGL                                                    : $enable_webgl
  Blob support                                             : $enable_blob
+ DeviceOrientation support                                : $enable_device_orientation
  Directory upload                                         : $enable_directory_upload
  Fast Mobile Scrolling                                    : $enable_fast_mobile_scrolling
  JIT compilation                                          : $enable_jit