WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-102643-20130319172118.patch (text/plain), 26.02 KB, created by
Eunmi Lee
on 2013-03-19 01:25:29 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eunmi Lee
Created:
2013-03-19 01:25:29 PDT
Size:
26.02 KB
patch
obsolete
>Subversion Revision: 146055 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 5b7079cd6639ef339156817d44888ccfa2eea913..099e55b25066e28187bbe88a9b394bc9152e4f2b 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,72 @@ >+2013-03-19 Eunmi Lee <eunmi15.lee@samsung.com> >+ >+ [EFL][WK2] Implement gesture recognizer. >+ https://bugs.webkit.org/show_bug.cgi?id=102643 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Recognize tap, pan and pinch gestures using touch events. >+ The tap gesture is separated into single tap, double tap and >+ 'tap and hold'. >+ >+ This patch references the webkit NIX port. >+ https://github.com/WebKitNix/webkitnix >+ >+ * PlatformEfl.cmake: >+ * UIProcess/API/efl/EwkView.cpp: >+ (EwkView::EwkView): >+ (EwkView::doneWithTouchEvent): >+ * UIProcess/API/efl/EwkView.h: >+ (WebKit): >+ (EwkView): >+ * UIProcess/API/efl/GestureRecognizer.cpp: Added. >+ (WebKit): >+ (WebKit::GestureRecognizer::GestureRecognizer): >+ (WebKit::GestureRecognizer::processTouchEvent): >+ (WebKit::GestureRecognizer::doubleTapTimerCallback): >+ (WebKit::GestureRecognizer::tapAndHoldTimerCallback): >+ (WebKit::getPointAtIndex): >+ (WebKit::createVectorWithWKArray): >+ (WebKit::GestureRecognizer::noGesture): >+ (WebKit::GestureRecognizer::singleTapGesture): >+ (WebKit::GestureRecognizer::doubleTapGesture): >+ (WebKit::GestureRecognizer::panGesture): >+ (WebKit::GestureRecognizer::pinchGesture): >+ (WebKit::GestureRecognizer::reset): >+ (WebKit::GestureRecognizer::stopTapTimers): >+ * UIProcess/API/efl/GestureRecognizer.h: Added. >+ (WebKit): >+ (GestureRecognizerClient): >+ (WebKit::GestureRecognizerClient::handleSingleTap): >+ (WebKit::GestureRecognizerClient::handleDoubleTap): >+ (WebKit::GestureRecognizerClient::handleTapAndHold): >+ (WebKit::GestureRecognizerClient::handlePanStarted): >+ (WebKit::GestureRecognizerClient::handlePan): >+ (WebKit::GestureRecognizerClient::handlePanFinished): >+ (WebKit::GestureRecognizerClient::handlePinchStarted): >+ (WebKit::GestureRecognizerClient::handlePinch): >+ (WebKit::GestureRecognizerClient::handlePinchFinished): >+ (GestureRecognizer): >+ (WebKit::GestureRecognizer::create): >+ * UIProcess/API/efl/GestureRecognizerClientEfl.cpp: Added. >+ (WebKit): >+ (WebKit::GestureRecognizerClientEfl::GestureRecognizerClientEfl): >+ (WebKit::GestureRecognizerClientEfl::handleSingleTap): >+ (WebKit::GestureRecognizerClientEfl::handleDoubleTap): >+ (WebKit::GestureRecognizerClientEfl::handleTapAndHold): >+ (WebKit::GestureRecognizerClientEfl::handlePanStarted): >+ (WebKit::GestureRecognizerClientEfl::handlePan): >+ (WebKit::GestureRecognizerClientEfl::handlePanFinished): >+ (WebKit::GestureRecognizerClientEfl::handlePinchStarted): >+ (WebKit::GestureRecognizerClientEfl::handlePinch): >+ (WebKit::GestureRecognizerClientEfl::handlePinchFinished): >+ * UIProcess/API/efl/GestureRecognizerClientEfl.h: Added. >+ (WebCore): >+ (WebKit): >+ (GestureRecognizerClientEfl): >+ (WebKit::GestureRecognizerClientEfl::create): >+ (WebKit::GestureRecognizerClientEfl::~GestureRecognizerClientEfl): >+ > 2013-03-18 Eunmi Lee <eunmi15.lee@samsung.com> > > [EFL][WK2] Add doneWithTouchEvent callback to the WKViewClient. >diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake >index 3170af11e5997228f6999c1c9075f67561288f4d..b52c74850b692da9f19d72908aec63823ed95668 100644 >--- a/Source/WebKit2/PlatformEfl.cmake >+++ b/Source/WebKit2/PlatformEfl.cmake >@@ -53,6 +53,8 @@ list(APPEND WebKit2_SOURCES > UIProcess/API/efl/EwkView.cpp > UIProcess/API/efl/EvasGLContext.cpp > UIProcess/API/efl/EvasGLSurface.cpp >+ UIProcess/API/efl/GestureRecognizer.cpp >+ UIProcess/API/efl/GestureRecognizerClientEfl.cpp > UIProcess/API/efl/SnapshotImageGL.cpp > UIProcess/API/efl/ewk_auth_request.cpp > UIProcess/API/efl/ewk_back_forward_list.cpp >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >index a99afadfd4327c58a53e6884d1785356cd782e3e..8419288f8ed7151d9da9948a2b211e9537f13f0a 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >@@ -82,6 +82,11 @@ > #include "WebFullScreenManagerProxy.h" > #endif > >+#if ENABLE(TOUCH_EVENTS) >+#include "GestureRecognizer.h" >+#include "GestureRecognizerClientEfl.h" >+#endif >+ > using namespace EwkViewCallbacks; > using namespace WebCore; > using namespace WebKit; >@@ -263,6 +268,8 @@ EwkView::EwkView(Evas_Object* evasObject, PassRefPtr<EwkContext> context, PassRe > , m_mouseEventsEnabled(false) > #if ENABLE(TOUCH_EVENTS) > , m_touchEventsEnabled(false) >+ , m_gestureRecognizerClient(GestureRecognizerClientEfl::create(this)) >+ , m_gestureRecognizer(GestureRecognizer::create(m_gestureRecognizerClient.get())) > #endif > , m_displayTimer(this, &EwkView::displayTimerFired) > , m_inputMethodContext(InputMethodContextEfl::create(this, smartData()->base.evas)) >@@ -794,9 +801,14 @@ void EwkView::setTouchEventsEnabled(bool enabled) > } > } > >-void EwkView::doneWithTouchEvent(WKTouchEventRef, bool /* wasEventHandled */) >+void EwkView::doneWithTouchEvent(WKTouchEventRef event, bool wasEventHandled) > { >- notImplemented(); >+ if (wasEventHandled) { >+ m_gestureRecognizer->reset(); >+ return; >+ } >+ >+ m_gestureRecognizer->processTouchEvent(event); > } > #endif > >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.h b/Source/WebKit2/UIProcess/API/efl/EwkView.h >index 21e0af83ad479585934b542a4eea689d24c0a19c..47108c39b48d60c031bbc9936790358dd84f1e3a 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.h >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.h >@@ -72,6 +72,11 @@ class WebPageProxy; > #if ENABLE(VIBRATION) > class VibrationClientEfl; > #endif >+ >+#if ENABLE(TOUCH_EVENTS) >+class GestureRecognizer; >+class GestureRecognizerClientEfl; >+#endif > } > > namespace WebCore { >@@ -286,6 +291,8 @@ private: > bool m_mouseEventsEnabled; > #if ENABLE(TOUCH_EVENTS) > bool m_touchEventsEnabled; >+ OwnPtr<WebKit::GestureRecognizerClientEfl> m_gestureRecognizerClient; >+ OwnPtr<WebKit::GestureRecognizer> m_gestureRecognizer; > #endif > WebCore::Timer<EwkView> m_displayTimer; > OwnPtr<EwkContextMenu> m_contextMenu; >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..bb268ce36df958b08e6d733e8823ef57dbbd6f31 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp >@@ -0,0 +1,263 @@ >+/* >+ * Copyright (C) 2013 Samsung Electronics. All rights reserved. >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies) >+ * >+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "GestureRecognizer.h" >+ >+#include "EwkView.h" >+#include "WKSharedAPICast.h" >+ >+#if ENABLE(TOUCH_EVENTS) >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+const double GestureRecognizer::s_doubleTapTimeoutInSeconds = 0.4; >+const double GestureRecognizer::s_tapAndHoldTimeoutInSeconds = 1.0; >+const int GestureRecognizer::s_squaredDoubleTapThreshold = 10000; >+const int GestureRecognizer::s_squaredPanThreshold = 100; >+ >+GestureRecognizer::GestureRecognizer(GestureRecognizerClient* client) >+ : m_recognizerFunction(&GestureRecognizer::noGesture) >+ , m_client(client) >+ , m_tapAndHoldTimer(0) >+ , m_doubleTapTimer(0) >+{ >+} >+ >+void GestureRecognizer::processTouchEvent(WKTouchEventRef eventRef) >+{ >+ WKEventType type = WKTouchEventGetType(eventRef); >+ if (type == kWKEventTypeTouchCancel) { >+ reset(); >+ return; >+ } >+ >+ (this->*m_recognizerFunction)(type, WKTouchEventGetTouchPoints(eventRef)); >+} >+ >+Eina_Bool GestureRecognizer::doubleTapTimerCallback(void* data) >+{ >+ GestureRecognizer* gestureRecognizer = static_cast<GestureRecognizer*>(data); >+ gestureRecognizer->m_doubleTapTimer = 0; >+ >+ // If doubleTapTimer is fired we should not process double tap, >+ // so process single tap here if touched point is already released >+ // or do nothing for processing single tap when touch is released. >+ if (gestureRecognizer->m_recognizerFunction == &GestureRecognizer::doubleTapGesture) { >+ gestureRecognizer->m_client->handleSingleTap(gestureRecognizer->m_firstPressedPoint); >+ gestureRecognizer->m_recognizerFunction = &GestureRecognizer::noGesture; >+ } >+ >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+Eina_Bool GestureRecognizer::tapAndHoldTimerCallback(void* data) >+{ >+ GestureRecognizer* gestureRecognizer = static_cast<GestureRecognizer*>(data); >+ gestureRecognizer->m_tapAndHoldTimer = 0; >+ gestureRecognizer->m_client->handleTapAndHold(gestureRecognizer->m_firstPressedPoint); >+ gestureRecognizer->m_recognizerFunction = &GestureRecognizer::noGesture; >+ >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+static inline WKPoint getPointAtIndex(WKArrayRef array, size_t index) >+{ >+ WKTouchPointRef pointRef = static_cast<WKTouchPointRef>(WKArrayGetItemAtIndex(array, index)); >+ ASSERT(pointRef); >+ >+ return WKTouchPointGetPosition(pointRef); >+} >+ >+static inline Vector<IntPoint>* createVectorWithWKArray(WKArrayRef array, size_t size) >+{ >+ Vector<IntPoint>* points = new Vector<IntPoint>(size); >+ for (size_t i = 0; i < size; ++i) >+ points->uncheckedAppend(toIntPoint(getPointAtIndex(array, i))); >+ >+ return points; >+} >+ >+void GestureRecognizer::noGesture(WKEventType type, WKArrayRef touchPoints) >+{ >+ switch (type) { >+ case kWKEventTypeTouchStart: >+ m_recognizerFunction = &GestureRecognizer::singleTapGesture; >+ m_firstPressedPoint = toIntPoint(getPointAtIndex(touchPoints, 0)); >+ ASSERT(m_tapAndHoldTimer); >+ m_tapAndHoldTimer = ecore_timer_add(s_tapAndHoldTimeoutInSeconds, tapAndHoldTimerCallback, this); >+ m_doubleTapTimer = ecore_timer_add(s_doubleTapTimeoutInSeconds, doubleTapTimerCallback, this); >+ break; >+ default: >+ break; >+ } >+} >+ >+void GestureRecognizer::singleTapGesture(WKEventType type, WKArrayRef touchPoints) >+{ >+ switch (type) { >+ case kWKEventTypeTouchStart: >+ stopTapTimers(); >+ m_recognizerFunction = &GestureRecognizer::pinchGesture; >+ m_client->handlePinchStarted(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get()); >+ break; >+ case kWKEventTypeTouchMove: { >+ IntPoint currentPoint = toIntPoint(getPointAtIndex(touchPoints, 0)); >+ if (m_firstPressedPoint.distanceSquaredToPoint(currentPoint) > s_squaredPanThreshold) { >+ stopTapTimers(); >+ m_recognizerFunction = &GestureRecognizer::panGesture; >+ m_client->handlePanStarted(currentPoint); >+ } >+ break; >+ } >+ case kWKEventTypeTouchEnd: >+ if (m_tapAndHoldTimer) { >+ ecore_timer_del(m_tapAndHoldTimer); >+ m_tapAndHoldTimer = 0; >+ } >+ >+ if (m_doubleTapTimer) >+ m_recognizerFunction = &GestureRecognizer::doubleTapGesture; >+ else { >+ m_client->handleSingleTap(m_firstPressedPoint); >+ m_recognizerFunction = &GestureRecognizer::noGesture; >+ } >+ break; >+ default: >+ break; >+ } >+} >+ >+void GestureRecognizer::doubleTapGesture(WKEventType type, WKArrayRef touchPoints) >+{ >+ switch (type) { >+ case kWKEventTypeTouchStart: { >+ if (m_doubleTapTimer) { >+ ecore_timer_del(m_doubleTapTimer); >+ m_doubleTapTimer = 0; >+ } >+ >+ size_t numberOfTouchPoints = WKArrayGetSize(touchPoints); >+ if (numberOfTouchPoints == 1) { >+ if (m_firstPressedPoint.distanceSquaredToPoint(toIntPoint(getPointAtIndex(touchPoints, 0))) > s_squaredDoubleTapThreshold) >+ m_recognizerFunction = &GestureRecognizer::singleTapGesture; >+ } else { >+ m_recognizerFunction = &GestureRecognizer::pinchGesture; >+ m_client->handlePinchStarted(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get()); >+ } >+ break; >+ } >+ case kWKEventTypeTouchMove: { >+ IntPoint currentPoint = toIntPoint(getPointAtIndex(touchPoints, 0)); >+ if (m_firstPressedPoint.distanceSquaredToPoint(currentPoint) > s_squaredPanThreshold) { >+ m_recognizerFunction = &GestureRecognizer::panGesture; >+ m_client->handlePanStarted(currentPoint); >+ } >+ break; >+ } >+ case kWKEventTypeTouchEnd: >+ m_client->handleDoubleTap(m_firstPressedPoint); >+ m_recognizerFunction = &GestureRecognizer::noGesture; >+ break; >+ default: >+ break; >+ } >+} >+ >+void GestureRecognizer::panGesture(WKEventType type, WKArrayRef touchPoints) >+{ >+ switch (type) { >+ case kWKEventTypeTouchStart: >+ m_recognizerFunction = &GestureRecognizer::pinchGesture; >+ m_client->handlePinchStarted(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get()); >+ break; >+ case kWKEventTypeTouchMove: >+ m_client->handlePan(toIntPoint(getPointAtIndex(touchPoints, 0))); >+ break; >+ case kWKEventTypeTouchEnd: >+ m_client->handlePanFinished(); >+ m_recognizerFunction = &GestureRecognizer::noGesture; >+ break; >+ default: >+ break; >+ } >+} >+ >+void GestureRecognizer::pinchGesture(WKEventType type, WKArrayRef touchPoints) >+{ >+ size_t numberOfTouchPoints = WKArrayGetSize(touchPoints); >+ ASSERT(numberOfTouchPoints >= 2); >+ >+ switch (type) { >+ case kWKEventTypeTouchMove: { >+ m_client->handlePinch(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get()); >+ break; >+ } >+ case kWKEventTypeTouchEnd: >+ if (numberOfTouchPoints == 2) { >+ m_client->handlePinchFinished(); >+ m_recognizerFunction = &GestureRecognizer::panGesture; >+ WKTouchPointRef pointRef; >+ for (size_t i = 0; i < numberOfTouchPoints; ++i) { >+ pointRef = static_cast<WKTouchPointRef>(WKArrayGetItemAtIndex(touchPoints, i)); >+ WKTouchPointState state = WKTouchPointGetState(pointRef); >+ if (state != kWKTouchPointStateTouchReleased && state != kWKTouchPointStateTouchCancelled) >+ break; >+ } >+ ASSERT(pointRef); >+ m_client->handlePanStarted(toIntPoint(WKTouchPointGetPosition(pointRef))); >+ } >+ break; >+ default: >+ break; >+ } >+} >+ >+void GestureRecognizer::reset() >+{ >+ stopTapTimers(); >+ >+ m_recognizerFunction = &GestureRecognizer::noGesture; >+} >+ >+void GestureRecognizer::stopTapTimers() >+{ >+ if (m_doubleTapTimer) { >+ ecore_timer_del(m_doubleTapTimer); >+ m_doubleTapTimer = 0; >+ } >+ >+ if (m_tapAndHoldTimer) { >+ ecore_timer_del(m_tapAndHoldTimer); >+ m_tapAndHoldTimer = 0; >+ } >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(TOUCH_EVENTS) >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.h b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.h >new file mode 100644 >index 0000000000000000000000000000000000000000..2e1f2b7139e0cd1c03e789242db4fe4090c1e9e3 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.h >@@ -0,0 +1,98 @@ >+/* >+ * Copyright (C) 2013 Samsung Electronics. All rights reserved. >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies) >+ * >+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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. >+ */ >+ >+#ifndef GestureRecognizer_h >+#define GestureRecognizer_h >+ >+#if ENABLE(TOUCH_EVENTS) >+ >+#include <Ecore.h> >+#include <WebCore/IntPoint.h> >+#include <WebKit2/WKEventEfl.h> >+#include <wtf/PassOwnPtr.h> >+#include <wtf/Vector.h> >+ >+namespace WebKit { >+ >+class GestureRecognizerClient { >+public: >+ virtual void handleSingleTap(const WebCore::IntPoint&) { } >+ virtual void handleDoubleTap(const WebCore::IntPoint&) { } >+ virtual void handleTapAndHold(const WebCore::IntPoint&) { } >+ >+ virtual void handlePanStarted(const WebCore::IntPoint&) { } >+ virtual void handlePan(const WebCore::IntPoint&) { } >+ virtual void handlePanFinished() { } >+ >+ virtual void handlePinchStarted(const Vector<WebCore::IntPoint>&) { } >+ virtual void handlePinch(const Vector<WebCore::IntPoint>&) { } >+ virtual void handlePinchFinished() { } >+}; >+ >+class GestureRecognizer { >+public: >+ static PassOwnPtr<GestureRecognizer> create(GestureRecognizerClient* client) >+ { >+ return adoptPtr(new GestureRecognizer(client)); >+ } >+ >+ void processTouchEvent(WKTouchEventRef); >+ void reset(); >+ >+private: >+ explicit GestureRecognizer(GestureRecognizerClient*); >+ >+ static const double s_doubleTapTimeoutInSeconds; >+ static const double s_tapAndHoldTimeoutInSeconds; >+ static const int s_squaredDoubleTapThreshold; >+ static const int s_squaredPanThreshold; >+ >+ static Eina_Bool doubleTapTimerCallback(void*); >+ static Eina_Bool tapAndHoldTimerCallback(void*); >+ >+ // State functions. >+ void noGesture(WKEventType, WKArrayRef); >+ void singleTapGesture(WKEventType, WKArrayRef); >+ void doubleTapGesture(WKEventType, WKArrayRef); >+ void panGesture(WKEventType, WKArrayRef); >+ void pinchGesture(WKEventType, WKArrayRef); >+ >+ void stopTapTimers(); >+ >+ typedef void (GestureRecognizer::*RecognizerFunction)(WKEventType, WKArrayRef); >+ RecognizerFunction m_recognizerFunction; >+ >+ GestureRecognizerClient* m_client; >+ Ecore_Timer* m_tapAndHoldTimer; >+ Ecore_Timer* m_doubleTapTimer; >+ WebCore::IntPoint m_firstPressedPoint; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(TOUCH_EVENTS) >+ >+#endif // GestureRecognizer_h >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.cpp b/Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..b79f656c438b046ebfbc2a7029d1cf28174e2e7a >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.cpp >@@ -0,0 +1,92 @@ >+/* >+ * Copyright (C) 2013 Samsung Electronics. All rights reserved. >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies) >+ * >+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "GestureRecognizerClientEfl.h" >+ >+#include "EwkView.h" >+#include <WebCore/IntPoint.h> >+#include <WebCore/NotImplemented.h> >+ >+#if ENABLE(TOUCH_EVENTS) >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+GestureRecognizerClientEfl::GestureRecognizerClientEfl(EwkView* view) >+ : m_view(view) >+{ >+} >+ >+void GestureRecognizerClientEfl::handleSingleTap(const IntPoint&) >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handleDoubleTap(const IntPoint&) >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handleTapAndHold(const IntPoint&) >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handlePanStarted(const IntPoint&) >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handlePan(const IntPoint& point) >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handlePanFinished() >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handlePinchStarted(const Vector<IntPoint>&) >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handlePinch(const Vector<IntPoint>&) >+{ >+ notImplemented(); >+} >+ >+void GestureRecognizerClientEfl::handlePinchFinished() >+{ >+ notImplemented(); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(TOUCH_EVENTS) >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.h b/Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.h >new file mode 100644 >index 0000000000000000000000000000000000000000..c832fad9ce2197c7051dfdddb70398ea60980b05 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.h >@@ -0,0 +1,74 @@ >+/* >+ * Copyright (C) 2013 Samsung Electronics. All rights reserved. >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies) >+ * >+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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. >+ */ >+ >+#ifndef GestureRecognizerClientEfl_h >+#define GestureRecognizerClientEfl_h >+ >+#if ENABLE(TOUCH_EVENTS) >+ >+#include "GestureRecognizer.h" >+#include <wtf/PassOwnPtr.h> >+#include <wtf/Vector.h> >+ >+class EwkView; >+ >+namespace WebCore { >+class IntPoint; >+} >+ >+namespace WebKit { >+ >+class GestureRecognizerClientEfl : public GestureRecognizerClient { >+public: >+ static PassOwnPtr<GestureRecognizerClientEfl> create(EwkView* view) >+ { >+ return adoptPtr(new GestureRecognizerClientEfl(view)); >+ } >+ >+ ~GestureRecognizerClientEfl() { } >+ >+ // GestureRecognizerClient. >+ virtual void handleSingleTap(const WebCore::IntPoint&); >+ virtual void handleDoubleTap(const WebCore::IntPoint&); >+ virtual void handleTapAndHold(const WebCore::IntPoint&); >+ virtual void handlePanStarted(const WebCore::IntPoint&); >+ virtual void handlePan(const WebCore::IntPoint&); >+ virtual void handlePanFinished(); >+ virtual void handlePinchStarted(const Vector<WebCore::IntPoint>&); >+ virtual void handlePinch(const Vector<WebCore::IntPoint>&); >+ virtual void handlePinchFinished(); >+ >+private: >+ explicit GestureRecognizerClientEfl(EwkView*); >+ >+ EwkView* m_view; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(TOUCH_EVENTS) >+ >+#endif // GestureRecognizerClientEfl_h
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 102643
:
175595
|
175740
|
177938
|
182520
|
182537
|
182722
|
183716
|
184174
|
189001
|
191401
|
193276
|
193753
|
206052
|
207367
|
207443
|
207509
|
207547
|
207619
|
207650
|
207683
|
207714
|
207717
|
207722
|
207732
|
207909
|
208000