2010-12-24 Ryuan Choi <ryuan.choi@samsung.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Dec 2010 11:27:55 +0000 (11:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Dec 2010 11:27:55 +0000 (11:27 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add option to enable Touch Events.
        https://bugs.webkit.org/show_bug.cgi?id=49125

        Add ENABLE_TOUCH_EVENTS option.

        * cmake/OptionsEfl.cmake:
        * cmakeconfig.h.cmake:
2010-12-24  Ryuan Choi  <ryuan.choi@samsung.com>

        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add option to enable Touch Events.
        https://bugs.webkit.org/show_bug.cgi?id=49125

        Add files for EFL to support TOUCH_EVENTS.

        * CMakeLists.txt:
        * CMakeListsEfl.txt:
        * platform/PlatformTouchEvent.h: Add EFL related constructor.
        * platform/PlatformTouchPoint.h: ditto.
        * platform/efl/PlatformTouchEventEfl.cpp: Added.
        (WebCore::PlatformTouchEvent::PlatformTouchEvent):
        * platform/efl/PlatformTouchPointEfl.cpp: Added.
        (WebCore::PlatformTouchPoint::PlatformTouchPoint):
2010-12-24  Ryuan Choi  <ryuan.choi@samsung.com>

        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add option to enable Touch Events.
        https://bugs.webkit.org/show_bug.cgi?id=49125

        Implement ewk_frame_feed_touch_event to feed touch events. Because EFL
        doesn't have touch events, Application should generate and pass it.

        * WebCoreSupport/ChromeClientEfl.h:
        (WebCore::ChromeClientEfl::needTouchEvents):
        * ewk/ewk_frame.cpp:
        (ewk_frame_feed_touch_event):
        * ewk/ewk_frame.h:

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

14 files changed:
ChangeLog
WebCore/CMakeLists.txt
WebCore/CMakeListsEfl.txt
WebCore/ChangeLog
WebCore/platform/PlatformTouchEvent.h
WebCore/platform/PlatformTouchPoint.h
WebCore/platform/efl/PlatformTouchEventEfl.cpp [new file with mode: 0644]
WebCore/platform/efl/PlatformTouchPointEfl.cpp [new file with mode: 0644]
WebKit/efl/ChangeLog
WebKit/efl/WebCoreSupport/ChromeClientEfl.h
WebKit/efl/ewk/ewk_frame.cpp
WebKit/efl/ewk/ewk_frame.h
cmake/OptionsEfl.cmake
cmakeconfig.h.cmake

index 4c12db36eba6818f29f48be0c94a5c0ae972ca16..f8fcecdd51505d24a33dbd3ada445ada7d4ec297 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-24  Ryuan Choi  <ryuan.choi@samsung.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Add option to enable Touch Events.
+        https://bugs.webkit.org/show_bug.cgi?id=49125
+
+        Add ENABLE_TOUCH_EVENTS option.
+
+        * cmake/OptionsEfl.cmake:
+        * cmakeconfig.h.cmake:
+
 2010-12-23  Adam Barth  <abarth@webkit.org>
 
         Rubber-stamped by Eric Seidel.
index 334d56ab6b23bc4623f03a1fce3fc4bfd919b1b8..7c6e3e59a4d45fdf99a22af402f99a28bd431a50 100644 (file)
@@ -898,6 +898,9 @@ SET(WebCore_SOURCES
     dom/TagNodeList.cpp
     dom/Text.cpp
     dom/TextEvent.cpp
+    dom/Touch.cpp
+    dom/TouchEvent.cpp
+    dom/TouchList.cpp
     dom/TransformSourceLibxslt.cpp
     dom/Traversal.cpp
     dom/TreeWalker.cpp
index 9613c8ee9b3054068b037ea54648abd916912a62..4c50d61c8a2870b36b1e7520d6e3f2aa7c98f770 100644 (file)
@@ -39,6 +39,8 @@ LIST(APPEND WebCore_SOURCES
   platform/efl/PlatformKeyboardEventEfl.cpp
   platform/efl/PlatformMouseEventEfl.cpp
   platform/efl/PlatformScreenEfl.cpp
+  platform/efl/PlatformTouchEventEfl.cpp
+  platform/efl/PlatformTouchPointEfl.cpp
   platform/efl/PlatformWheelEventEfl.cpp
   platform/efl/PopupMenuEfl.cpp
   platform/efl/RenderThemeEfl.cpp
index b8fa0f69830d2a38dde73380fbc316f7bf195d83..ee69b8674f8a45514a2822d746d30f4c1e0e35c1 100644 (file)
@@ -1,3 +1,21 @@
+2010-12-24  Ryuan Choi  <ryuan.choi@samsung.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Add option to enable Touch Events.
+        https://bugs.webkit.org/show_bug.cgi?id=49125
+
+        Add files for EFL to support TOUCH_EVENTS.
+
+        * CMakeLists.txt:
+        * CMakeListsEfl.txt:
+        * platform/PlatformTouchEvent.h: Add EFL related constructor.
+        * platform/PlatformTouchPoint.h: ditto.
+        * platform/efl/PlatformTouchEventEfl.cpp: Added.
+        (WebCore::PlatformTouchEvent::PlatformTouchEvent):
+        * platform/efl/PlatformTouchPointEfl.cpp: Added.
+        (WebCore::PlatformTouchPoint::PlatformTouchPoint):
+
 2010-12-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index 69786a8efb842e429c9be17907126cac4308e1d7..c6d677c2ac678bf52ff974c8bffa9e5bed8f2622 100644 (file)
@@ -41,6 +41,10 @@ typedef unsigned long int uint32;
 #define AEEEvent uint16
 #endif
 
+#if PLATFORM(EFL)
+typedef struct _Eina_List Eina_List;
+#endif
+
 namespace WebCore {
 
 enum TouchEventType {
@@ -65,6 +69,8 @@ public:
     PlatformTouchEvent(const Vector<IntPoint>&, TouchEventType, PlatformTouchPoint::State, int metaState);
 #elif PLATFORM(BREWMP)
     PlatformTouchEvent(AEEEvent, uint16 wParam, uint32 dwParam);
+#elif PLATFORM(EFL)
+    PlatformTouchEvent(Eina_List*, const IntPoint, TouchEventType, int metaState);
 #endif
 
     TouchEventType type() const { return m_type; }
index 5746b18941007e92bfd4a0f98052dc4609eceee3..bc19f806a8fd3a8706eed06bd65371b58a7ddcf1 100644 (file)
@@ -51,6 +51,8 @@ public:
     PlatformTouchPoint(unsigned id, const IntPoint& windowPos, State);
 #elif PLATFORM(BREWMP)
     PlatformTouchPoint(int id, const IntPoint& windowPos, State);
+#elif PLATFORM(EFL)
+    PlatformTouchPoint(unsigned id, const IntPoint& windowPos, State);
 #endif
 
     unsigned id() const { return m_id; }
diff --git a/WebCore/platform/efl/PlatformTouchEventEfl.cpp b/WebCore/platform/efl/PlatformTouchEventEfl.cpp
new file mode 100644 (file)
index 0000000..80dfe6f
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformTouchEvent.h"
+
+#include "ewk_frame.h"
+
+#if ENABLE(TOUCH_EVENTS)
+
+namespace WebCore {
+
+PlatformTouchEvent::PlatformTouchEvent(Eina_List* points, const IntPoint pos, TouchEventType type, int metaState)
+    : m_type(type)
+    , m_ctrlKey(false)
+    , m_altKey(false)
+    , m_shiftKey(false)
+    , m_metaKey(false)
+{
+    void* point;
+
+    EINA_LIST_FREE(points, point) {
+        Ewk_Touch_Point* p = static_cast<Ewk_Touch_Point*>(point);
+        IntPoint pnt = IntPoint(p->x - pos.x(), p->y - pos.y());
+
+        PlatformTouchPoint::State state = PlatformTouchPoint::TouchPressed;
+        switch (p->state) {
+        case EWK_TOUCH_POINT_PRESSED:
+            state = PlatformTouchPoint::TouchPressed;
+            break;
+        case EWK_TOUCH_POINT_RELEASED:
+            state = PlatformTouchPoint::TouchReleased;
+            break;
+        case EWK_TOUCH_POINT_MOVED:
+            state = PlatformTouchPoint::TouchMoved;
+            break;
+        case EWK_TOUCH_POINT_CANCELLED:
+            state = PlatformTouchPoint::TouchCancelled;
+            break;
+        }
+
+        m_touchPoints.append(PlatformTouchPoint(p->id, pnt, state));
+    }
+
+    // FIXME: We don't support metaState for now.
+}
+
+}
+
+#endif
diff --git a/WebCore/platform/efl/PlatformTouchPointEfl.cpp b/WebCore/platform/efl/PlatformTouchPointEfl.cpp
new file mode 100644 (file)
index 0000000..b181f68
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformTouchPoint.h"
+
+#if ENABLE(TOUCH_EVENTS)
+
+namespace WebCore {
+
+PlatformTouchPoint::PlatformTouchPoint(unsigned id, const IntPoint& windowPos, State state)
+    : m_id(id)
+    , m_state(state)
+    , m_screenPos(windowPos)
+    , m_pos(windowPos) { }
+
+}
+
+#endif
index f60f64eaf4087b5a197696a40b292e08ba2b7b9f..3f6d6e8e7f5f754f459dff1a0299d6ef9ba0b500 100644 (file)
@@ -1,3 +1,19 @@
+2010-12-24  Ryuan Choi  <ryuan.choi@samsung.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Add option to enable Touch Events.
+        https://bugs.webkit.org/show_bug.cgi?id=49125
+
+        Implement ewk_frame_feed_touch_event to feed touch events. Because EFL
+        doesn't have touch events, Application should generate and pass it.
+
+        * WebCoreSupport/ChromeClientEfl.h:
+        (WebCore::ChromeClientEfl::needTouchEvents):
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_feed_touch_event):
+        * ewk/ewk_frame.h:
+
 2010-12-22  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Darin Adler.
index c6c82d4b824f5b331d5ea18077db00739083c25a..a714dd424714c6567d0b0444f13a25a292823488 100644 (file)
@@ -120,6 +120,10 @@ public:
     virtual void showContextMenu() { }
 #endif
 
+#if ENABLE(TOUCH_EVENTS)
+    virtual void needTouchEvents(bool) { }
+#endif
+
     virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
     virtual void chooseIconForFiles(const Vector<String>&, FileChooser*);
     virtual void formStateDidChange(const Node*);
index 5076be5d944dc8426bd3597615b53c0a6ff6eaa2..c6d9068127e2a8c6adcebe6821e8157bce6787bb 100644 (file)
@@ -36,6 +36,7 @@
 #include "KURL.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformMouseEvent.h"
+#include "PlatformTouchEvent.h"
 #include "PlatformWheelEvent.h"
 #include "ProgressTracker.h"
 #include "RefPtr.h"
@@ -1474,6 +1475,42 @@ Eina_Bool ewk_frame_feed_mouse_move(Evas_Object* o, const Evas_Event_Mouse_Move*
     return sd->frame->eventHandler()->mouseMoved(event);
 }
 
+Eina_Bool ewk_frame_feed_touch_event(Evas_Object* o, Ewk_Touch_Event_Type action, Eina_List* points, int metaState)
+{
+    Eina_Bool ret = EINA_FALSE;
+
+#if ENABLE(TOUCH_EVENTS)
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(points, EINA_FALSE);
+
+    Evas_Coord x, y;
+    evas_object_geometry_get(sd->view, &x, &y, 0, 0);
+
+    WebCore::TouchEventType type = WebCore::TouchStart;
+    switch (action) {
+    case EWK_TOUCH_START:
+        type = WebCore::TouchStart;
+        break;
+    case EWK_TOUCH_END:
+        type = WebCore::TouchEnd;
+        break;
+    case EWK_TOUCH_MOVE:
+        type = WebCore::TouchMove;
+        break;
+    case EWK_TOUCH_CANCEL:
+        type = WebCore::TouchCancel;
+        break;
+    default:
+        return EINA_FALSE;
+    }
+
+    WebCore::PlatformTouchEvent te(points, WebCore::IntPoint(x, y), type, metaState);
+    ret = sd->frame->eventHandler()->handleTouchEvent(te);
+#endif
+    return ret;
+}
+
 static inline Eina_Bool _ewk_frame_handle_key_scrolling(WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent &event)
 {
     WebCore::ScrollDirection direction;
index 156bd823e65fd50a8cd505b00004556fb7282217..63936f3f9f1a9c2d33342db2d19e8766bfda603d 100644 (file)
@@ -130,6 +130,26 @@ struct _Ewk_Hit_Test {
     } flags;
 };
 
+typedef enum {
+    EWK_TOUCH_START,
+    EWK_TOUCH_END,
+    EWK_TOUCH_MOVE,
+    EWK_TOUCH_CANCEL
+} Ewk_Touch_Event_Type;
+
+typedef enum {
+    EWK_TOUCH_POINT_PRESSED,
+    EWK_TOUCH_POINT_RELEASED,
+    EWK_TOUCH_POINT_MOVED,
+    EWK_TOUCH_POINT_CANCELLED
+} Ewk_Touch_Point_Type;
+
+typedef struct _Ewk_Touch_Point Ewk_Touch_Point;
+struct _Ewk_Touch_Point {
+    unsigned int id;
+    int x, y;
+    Ewk_Touch_Point_Type state;
+};
 
 EAPI Evas_Object *ewk_frame_view_get(const Evas_Object *o);
 EAPI void         ewk_frame_theme_set(Evas_Object *o, const char *path);
@@ -200,6 +220,7 @@ EAPI Eina_Bool    ewk_frame_feed_mouse_wheel(Evas_Object *o, const Evas_Event_Mo
 EAPI Eina_Bool    ewk_frame_feed_mouse_down(Evas_Object *o, const Evas_Event_Mouse_Down *ev);
 EAPI Eina_Bool    ewk_frame_feed_mouse_up(Evas_Object *o, const Evas_Event_Mouse_Up *ev);
 EAPI Eina_Bool    ewk_frame_feed_mouse_move(Evas_Object *o, const Evas_Event_Mouse_Move *ev);
+EAPI Eina_Bool    ewk_frame_feed_touch_event(Evas_Object* o, Ewk_Touch_Event_Type action, Eina_List* points, int metaState);
 EAPI Eina_Bool    ewk_frame_feed_key_down(Evas_Object *o, const Evas_Event_Key_Down *ev);
 EAPI Eina_Bool    ewk_frame_feed_key_up(Evas_Object *o, const Evas_Event_Key_Up *ev);
 
index 93b2f374e19baf13eb1f20be44259ea4433f8b7e..6632a439ed22caddf2edd345509f4ecacaa71212 100644 (file)
@@ -90,6 +90,7 @@ WEBKIT_FEATURE(ENABLE_SVG_ANIMATION "Enable SVG animation" DEFAULT ON SVG)
 WEBKIT_FEATURE(ENABLE_SVG_FONTS "Enable SVG fonts" DEFAULT ON SVG)
 WEBKIT_FEATURE(ENABLE_SVG_FOREIGN_OBJECT "Enable SVG foreign object" DEFAULT ON SVG)
 WEBKIT_FEATURE(ENABLE_SVG_USE "Enable SVG use" DEFAULT ON SVG)
+WEBKIT_FEATURE(ENABLE_TOUCH_EVENTS "Enable Touch Events" DEFAULT OFF)
 WEBKIT_FEATURE(ENABLE_VIDEO "Enable video" DEFAULT ON HTML)
 WEBKIT_FEATURE(ENABLE_WEB_SOCKETS "Enable web sockets" DEFAULT OFF)
 WEBKIT_FEATURE(ENABLE_WML "Enable WML" DEFAULT OFF)
index 5a3d69c497e25ffe10a9133e2862ad69c13584bb..f92fda577be76dfaa1b558a7f21d90fc1c085525 100644 (file)
@@ -33,6 +33,7 @@
 #define ENABLE_SVG_FONTS @ENABLE_SVG_FONTS_VALUE@
 #define ENABLE_SVG_FOREIGN_OBJECT @ENABLE_SVG_FOREIGN_OBJECT_VALUE@
 #define ENABLE_SVG_USE @ENABLE_SVG_USE_VALUE@
+#define ENABLE_TOUCH_EVENTS @ENABLE_TOUCH_EVENTS_VALUE@
 #define ENABLE_VIDEO @ENABLE_VIDEO_VALUE@
 #define ENABLE_WEB_SOCKETS @ENABLE_WEB_SOCKETS_VALUE@
 #define ENABLE_WML @ENABLE_WML_VALUE@