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-20130305151357.patch (text/plain), 34.65 KB, created by
Eunmi Lee
on 2013-03-04 22:17:52 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eunmi Lee
Created:
2013-03-04 22:17:52 PST
Size:
34.65 KB
patch
obsolete
>Subversion Revision: 144260 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index db21765fcfb1e01b9bbdd3a81c1a0dab6b5afd7a..8bfc88d5dc3f2d4686fbf4fdc18aafea13eecf0e 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,5 +1,79 @@ > 2013-03-04 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'. >+ >+ * PlatformEfl.cmake: >+ * UIProcess/API/efl/EwkView.cpp: >+ (EwkView::EwkView): >+ (EwkView::doneWithTouchEvent): >+ * UIProcess/API/efl/EwkView.h: >+ (WebKit): >+ (EwkView): >+ * UIProcess/API/efl/GestureHandler.cpp: Added. >+ (WebKit): >+ (WebKit::GestureHandler::GestureHandler): >+ * UIProcess/API/efl/GestureHandler.h: Added. >+ (WebCore): >+ (WebKit): >+ (GestureHandler): >+ (WebKit::GestureHandler::~GestureHandler): >+ * UIProcess/API/efl/GestureRecognizer.cpp: Added. >+ (WebKit): >+ (WebKit::GestureRecognizer::GestureRecognizer): >+ (WebKit::GestureRecognizer::processTouchEvent): >+ (WebKit::GestureRecognizer::setCurrentHandler): >+ * UIProcess/API/efl/GestureRecognizer.h: Added. >+ (WebCore): >+ (WebKit): >+ (GestureRecognizer): >+ (WebKit::GestureRecognizer::create): >+ * UIProcess/API/efl/PanGestureHandler.cpp: Added. >+ (WebKit): >+ (WebKit::PanGestureHandler::PanGestureHandler): >+ (WebKit::PanGestureHandler::start): >+ (WebKit::PanGestureHandler::update): >+ (WebKit::PanGestureHandler::end): >+ (WebKit::PanGestureHandler::cancel): >+ * UIProcess/API/efl/PanGestureHandler.h: Added. >+ (WebCore): >+ (WebKit): >+ (PanGestureHandler): >+ * UIProcess/API/efl/PinchGestureHandler.cpp: Added. >+ (WebKit): >+ (WebKit::PinchGestureHandler::PinchGestureHandler): >+ (WebKit::PinchGestureHandler::start): >+ (WebKit::PinchGestureHandler::update): >+ (WebKit::PinchGestureHandler::end): >+ (WebKit::PinchGestureHandler::cancel): >+ * UIProcess/API/efl/PinchGestureHandler.h: Added. >+ (WebCore): >+ (WebKit): >+ (PinchGestureHandler): >+ * UIProcess/API/efl/TapGestureHandler.cpp: Added. >+ (WebKit): >+ (WebKit::TapGestureHandler::TapGestureHandler): >+ (WebKit::TapGestureHandler::start): >+ (WebKit::TapGestureHandler::update): >+ (WebKit::TapGestureHandler::end): >+ (WebKit::TapGestureHandler::cancel): >+ (WebKit::TapGestureHandler::processSingleTap): >+ (WebKit::TapGestureHandler::processDoubleTap): >+ (WebKit::TapGestureHandler::processTapAndHold): >+ (WebKit::TapGestureHandler::doubleTapTimerCallback): >+ (WebKit::TapGestureHandler::tapAndHoldTimerCallback): >+ * UIProcess/API/efl/TapGestureHandler.h: Added. >+ (WebKit): >+ (TapGestureHandler): >+ >+2013-03-04 Eunmi Lee <eunmi15.lee@samsung.com> >+ > [EFL][WK2] Add doneWithTouchEvent callback to the WKViewClient. > https://bugs.webkit.org/show_bug.cgi?id=110085 > >diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake >index 19cf7e84992dfb33e34d6133d874ee307fa01c06..548b2641e6de5da9317e978e8b0517bd355d03dc 100644 >--- a/Source/WebKit2/PlatformEfl.cmake >+++ b/Source/WebKit2/PlatformEfl.cmake >@@ -52,7 +52,12 @@ list(APPEND WebKit2_SOURCES > UIProcess/API/efl/EwkView.cpp > UIProcess/API/efl/EvasGLContext.cpp > UIProcess/API/efl/EvasGLSurface.cpp >+ UIProcess/API/efl/GestureHandler.cpp >+ UIProcess/API/efl/GestureRecognizer.cpp >+ UIProcess/API/efl/PanGestureHandler.cpp >+ UIProcess/API/efl/PinchGestureHandler.cpp > UIProcess/API/efl/SnapshotImageGL.cpp >+ UIProcess/API/efl/TapGestureHandler.cpp > UIProcess/API/efl/ewk_auth_request.cpp > UIProcess/API/efl/ewk_back_forward_list.cpp > UIProcess/API/efl/ewk_back_forward_list_item.cpp >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >index 61d17be3d4cef6c6728a98cd1bc89d972e5860c6..c9d5952f97433660c075278cdfffb203472c934d 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >@@ -68,7 +68,6 @@ > #include <Evas_GL.h> > #include <WebCore/CairoUtilitiesEfl.h> > #include <WebCore/Cursor.h> >-#include <WebCore/NotImplemented.h> > #include <WebCore/PlatformContextCairo.h> > #include <WebKit2/WKImageCairo.h> > #include <wtf/MathExtras.h> >@@ -81,6 +80,10 @@ > #include "WebFullScreenManagerProxy.h" > #endif > >+#if ENABLE(TOUCH_EVENTS) >+#include "GestureRecognizer.h" >+#endif >+ > using namespace EwkViewCallbacks; > using namespace WebCore; > using namespace WebKit; >@@ -253,6 +256,7 @@ EwkView::EwkView(Evas_Object* evasObject, PassRefPtr<EwkContext> context, WKPage > , m_mouseEventsEnabled(false) > #if ENABLE(TOUCH_EVENTS) > , m_touchEventsEnabled(false) >+ , m_gestureRecognizer(GestureRecognizer::create(this)) > #endif > , m_displayTimer(this, &EwkView::displayTimerFired) > , m_inputMethodContext(InputMethodContextEfl::create(this, smartData()->base.evas)) >@@ -729,9 +733,9 @@ void EwkView::setTouchEventsEnabled(bool enabled) > } > } > >-void EwkView::doneWithTouchEvent(WKTouchEventRef, bool /* wasEventHandled */) >+void EwkView::doneWithTouchEvent(WKTouchEventRef event, bool wasEventHandled) > { >- notImplemented(); >+ m_gestureRecognizer->processTouchEvent(event, wasEventHandled); > } > #endif > >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.h b/Source/WebKit2/UIProcess/API/efl/EwkView.h >index 6a4199e32dffa1075beff52df53cb41e7ffc903f..c19cf23c73970c62a4e82c0f0daf649c61640633 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.h >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.h >@@ -74,6 +74,10 @@ class WebPageProxy; > #if ENABLE(VIBRATION) > class VibrationClientEfl; > #endif >+ >+#if ENABLE(TOUCH_EVENTS) >+class GestureRecognizer; >+#endif > } > > namespace WebCore { >@@ -284,6 +288,7 @@ private: > bool m_mouseEventsEnabled; > #if ENABLE(TOUCH_EVENTS) > bool m_touchEventsEnabled; >+ OwnPtr<WebKit::GestureRecognizer> m_gestureRecognizer; > #endif > WebCore::Timer<EwkView> m_displayTimer; > OwnPtr<EwkContextMenu> m_contextMenu; >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureHandler.cpp b/Source/WebKit2/UIProcess/API/efl/GestureHandler.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..92747f2c93d7b56b61f79d5fddba96542b7c0c22 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureHandler.cpp >@@ -0,0 +1,39 @@ >+/* >+ * 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 "GestureHandler.h" >+ >+#include "EwkView.h" >+ >+namespace WebKit { >+ >+GestureHandler::GestureHandler(EwkView* ewkView) >+ : m_ewkView(ewkView) >+{ >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureHandler.h b/Source/WebKit2/UIProcess/API/efl/GestureHandler.h >new file mode 100644 >index 0000000000000000000000000000000000000000..a2368fc9112a6e4997fac1862f12e68a3d46c87b >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureHandler.h >@@ -0,0 +1,56 @@ >+/* >+ * 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 GestureHandler_h >+#define GestureHandler_h >+ >+#include <wtf/Vector.h> >+ >+namespace WebCore { >+class IntPoint; >+} >+ >+class EwkView; >+ >+namespace WebKit { >+ >+class GestureHandler { >+public: >+ virtual ~GestureHandler() { } >+ >+ virtual void start(const WTF::Vector<WebCore::IntPoint>&) = 0; >+ virtual void update(const WTF::Vector<WebCore::IntPoint>&) = 0; >+ virtual void end() = 0; >+ virtual void cancel() = 0; >+ >+protected: >+ explicit GestureHandler(EwkView*); >+ EwkView* m_ewkView; >+}; >+ >+} // namespace WebKit >+ >+#endif // GestureHandler_h >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..4216cc14a75f30c50285831b3678c3406ee731a9 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp >@@ -0,0 +1,105 @@ >+/* >+ * 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" >+ >+namespace WebKit { >+ >+GestureRecognizer::GestureRecognizer(EwkView* ewkView) >+ : m_currentHandler(0) >+ , m_tapGestureHandler(ewkView) >+ , m_panGestureHandler(ewkView) >+ , m_pinchGestureHandler(ewkView) >+{ >+} >+ >+void GestureRecognizer::processTouchEvent(WKTouchEventRef eventRef, bool wasEventHandled) >+{ >+ WKTouchEvent event = WKTouchEventGetValue(eventRef); >+ if (wasEventHandled || event.type == kWKEventTypeTouchCancel) { >+ if (m_currentHandler) { >+ m_currentHandler->cancel(); >+ m_currentHandler = 0; >+ } >+ return; >+ } >+ >+ // We don't have to process any gesture if no gesture is recognized and current touch event is >+ // not the start of touch. >+ if (!m_currentHandler && !(event.type == kWKEventTypeTouchStart && event.numTouchPoints == 1)) >+ return; >+ >+ // Update current points. >+ m_currentPoints.clear(); >+ for (unsigned i = 0; i < event.numTouchPoints; ++i) { >+ if (event.touchPoints[i].state != kWKTouchPointStateTouchReleased >+ && event.touchPoints[i].state != kWKTouchPointStateTouchCancelled) >+ m_currentPoints.append(toIntPoint(event.touchPoints[i].screenPosition)); >+ } >+ >+ switch (event.type) { >+ case kWKEventTypeTouchStart: >+ if (event.numTouchPoints == 1) >+ setCurrentHandler(&m_tapGestureHandler); >+ else if (event.numTouchPoints == 2) >+ setCurrentHandler(&m_pinchGestureHandler); >+ break; >+ case kWKEventTypeTouchMove: >+ if (event.numTouchPoints == 1 && m_currentHandler != &m_panGestureHandler) >+ setCurrentHandler(&m_panGestureHandler); >+ else if (m_currentHandler) >+ m_currentHandler->update(m_currentPoints); >+ break; >+ case kWKEventTypeTouchEnd: >+ if (m_currentHandler) { >+ m_currentHandler->end(); >+ m_currentHandler = 0; >+ } >+ break; >+ default: >+ break; >+ } >+} >+ >+void GestureRecognizer::setCurrentHandler(GestureHandler* handler) >+{ >+ if (m_currentHandler == handler) >+ return; >+ >+ if (m_currentHandler) >+ m_currentHandler->cancel(); >+ >+ m_currentHandler = handler; >+ >+ if (m_currentHandler) >+ m_currentHandler->start(m_currentPoints); >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.h b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.h >new file mode 100644 >index 0000000000000000000000000000000000000000..7eb69059b5272d45bfd6b8c6e78206ad34a34e29 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.h >@@ -0,0 +1,67 @@ >+/* >+ * 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 >+ >+#include "PanGestureHandler.h" >+#include "PinchGestureHandler.h" >+#include "TapGestureHandler.h" >+#include <WebKit2/WKEventEfl.h> >+#include <wtf/PassOwnPtr.h> >+#include <wtf/Vector.h> >+ >+namespace WebCore { >+class IntPoint; >+} >+ >+class EwkView; >+ >+namespace WebKit { >+ >+class GestureRecognizer { >+public: >+ static PassOwnPtr<GestureRecognizer> create(EwkView* ewkView) >+ { >+ return adoptPtr(new GestureRecognizer(ewkView)); >+ } >+ >+ void processTouchEvent(WKTouchEventRef, bool wasEventHandled); >+ >+private: >+ explicit GestureRecognizer(EwkView*); >+ void setCurrentHandler(GestureHandler*); >+ >+ GestureHandler* m_currentHandler; >+ Vector<WebCore::IntPoint> m_currentPoints; >+ TapGestureHandler m_tapGestureHandler; >+ PanGestureHandler m_panGestureHandler; >+ PinchGestureHandler m_pinchGestureHandler; >+}; >+ >+} // namespace WebKit >+ >+#endif // GestureRecognizer_h >diff --git a/Source/WebKit2/UIProcess/API/efl/PanGestureHandler.cpp b/Source/WebKit2/UIProcess/API/efl/PanGestureHandler.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..ec4e2e38379ff64406ca65be44e0cf4e0ef81034 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/PanGestureHandler.cpp >@@ -0,0 +1,73 @@ >+/* >+ * 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 "PanGestureHandler.h" >+ >+#include "EwkView.h" >+#include <WebCore/IntPoint.h> >+#include <WebCore/NotImplemented.h> >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+PanGestureHandler::PanGestureHandler(EwkView* ewkView) >+ : GestureHandler(ewkView) >+{ >+} >+ >+void PanGestureHandler::start(const Vector<IntPoint>& points) >+{ >+ if (points.isEmpty()) { >+ cancel(); >+ return; >+ } >+ >+ notImplemented(); >+} >+ >+void PanGestureHandler::update(const Vector<IntPoint>& points) >+{ >+ if (points.isEmpty()) { >+ cancel(); >+ return; >+ } >+ >+ notImplemented(); >+} >+ >+void PanGestureHandler::end() >+{ >+ notImplemented(); >+} >+ >+void PanGestureHandler::cancel() >+{ >+ notImplemented(); >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/API/efl/PanGestureHandler.h b/Source/WebKit2/UIProcess/API/efl/PanGestureHandler.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0267724b9b123aa173d4536921a846904dcd84b1 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/PanGestureHandler.h >@@ -0,0 +1,50 @@ >+/* >+ * 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 PanGestureHandler_h >+#define PanGestureHandler_h >+ >+#include "GestureHandler.h" >+ >+namespace WebCore { >+class IntPoint; >+} >+ >+namespace WebKit { >+ >+class PanGestureHandler : public GestureHandler { >+public: >+ PanGestureHandler(EwkView*); >+ >+ void start(const Vector<WebCore::IntPoint>&); >+ void update(const Vector<WebCore::IntPoint>&); >+ void end(); >+ void cancel(); >+}; >+ >+} // namespace WebKit >+ >+#endif // PanGestureHandler_h >diff --git a/Source/WebKit2/UIProcess/API/efl/PinchGestureHandler.cpp b/Source/WebKit2/UIProcess/API/efl/PinchGestureHandler.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..8889384f475648503f38da2d7389012d86ec5c4c >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/PinchGestureHandler.cpp >@@ -0,0 +1,73 @@ >+/* >+ * 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 "PinchGestureHandler.h" >+ >+#include "EwkView.h" >+#include <WebCore/IntPoint.h> >+#include <WebCore/NotImplemented.h> >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+PinchGestureHandler::PinchGestureHandler(EwkView* ewkView) >+ : GestureHandler(ewkView) >+{ >+} >+ >+void PinchGestureHandler::start(const Vector<IntPoint>& points) >+{ >+ if (points.size() < 2) { >+ cancel(); >+ return; >+ } >+ >+ notImplemented(); >+} >+ >+void PinchGestureHandler::update(const Vector<IntPoint>& points) >+{ >+ if (points.size() < 2) { >+ cancel(); >+ return; >+ } >+ >+ notImplemented(); >+} >+ >+void PinchGestureHandler::end() >+{ >+ notImplemented(); >+} >+ >+void PinchGestureHandler::cancel() >+{ >+ notImplemented(); >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/API/efl/PinchGestureHandler.h b/Source/WebKit2/UIProcess/API/efl/PinchGestureHandler.h >new file mode 100644 >index 0000000000000000000000000000000000000000..697db2d0a817b8b62d524969b659ba2e13446014 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/PinchGestureHandler.h >@@ -0,0 +1,50 @@ >+/* >+ * 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 PinchGestureHandler_h >+#define PinchGestureHandler_h >+ >+#include "GestureHandler.h" >+ >+namespace WebCore { >+class IntPoint; >+} >+ >+namespace WebKit { >+ >+class PinchGestureHandler : public GestureHandler { >+public: >+ PinchGestureHandler(EwkView*); >+ >+ void start(const Vector<WebCore::IntPoint>&); >+ void update(const Vector<WebCore::IntPoint>&); >+ void end(); >+ void cancel(); >+}; >+ >+} // namespace WebKit >+ >+#endif // PinchGestureHandler_h >diff --git a/Source/WebKit2/UIProcess/API/efl/TapGestureHandler.cpp b/Source/WebKit2/UIProcess/API/efl/TapGestureHandler.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..f8f45e44bbfb5674fca2624df927b876f57fc43a >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/TapGestureHandler.cpp >@@ -0,0 +1,153 @@ >+/* >+ * 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 "TapGestureHandler.h" >+ >+#include <WebCore/NotImplemented.h> >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+const double TapGestureHandler::s_doubleTapTimeout = 0.4; >+const double TapGestureHandler::s_tapAndHoldTimeout = 1.0; >+ >+TapGestureHandler::TapGestureHandler(EwkView* ewkView) >+ : GestureHandler(ewkView) >+ , m_state(NoState) >+ , m_tapAndHoldTimer(0) >+ , m_doubleTapTimer(0) >+ , m_firstPressedPoint() >+ , m_secondPressedPoint() >+{ >+} >+ >+void TapGestureHandler::start(const Vector<IntPoint>& points) >+{ >+ if (points.isEmpty()) { >+ cancel(); >+ return; >+ } >+ >+ // If doubleTapTimer does not exist, start to process tap gesture. >+ if (!m_doubleTapTimer) { >+ m_state = NoState; >+ m_firstPressedPoint = points[0]; >+ >+ ASSERT(!m_tapAndHoldTimer); >+ m_tapAndHoldTimer = ecore_timer_add(s_tapAndHoldTimeout, tapAndHoldTimerCallback, this); >+ m_doubleTapTimer = ecore_timer_add(s_doubleTapTimeout, doubleTapTimerCallback, this); >+ } else { >+ m_secondPressedPoint = points[0]; >+ if (m_firstPressedPoint.distanceSquaredToPoint(m_secondPressedPoint) > s_doubleTapDistanceSquareThreshold) >+ m_state = NoState; >+ >+ ecore_timer_del(m_doubleTapTimer); >+ m_doubleTapTimer = 0; >+ } >+} >+ >+void TapGestureHandler::update(const Vector<IntPoint>& points) >+{ >+ if (points.isEmpty()) { >+ cancel(); >+ return; >+ } >+} >+ >+void TapGestureHandler::end() >+{ >+ if (m_tapAndHoldTimer) { >+ ecore_timer_del(m_tapAndHoldTimer); >+ m_tapAndHoldTimer = 0; >+ } >+ >+ if (m_state == SingleTapState) >+ processSingleTap(); >+ else if (m_state == DoubleTapState) >+ processDoubleTap(); >+ // If currentState is NoState and doubleTapTimer is not expired, prepare to process double tap. >+ else if (m_doubleTapTimer) >+ m_state = DoubleTapState; >+} >+ >+void TapGestureHandler::cancel() >+{ >+ if (m_doubleTapTimer) { >+ ecore_timer_del(m_doubleTapTimer); >+ m_doubleTapTimer = 0; >+ } >+ >+ if (m_tapAndHoldTimer) { >+ ecore_timer_del(m_tapAndHoldTimer); >+ m_tapAndHoldTimer = 0; >+ } >+ >+ m_state = NoState; >+} >+ >+void TapGestureHandler::processSingleTap() >+{ >+ notImplemented(); >+} >+ >+void TapGestureHandler::processDoubleTap() >+{ >+ notImplemented(); >+} >+ >+void TapGestureHandler::processTapAndHold() >+{ >+ notImplemented(); >+} >+ >+Eina_Bool TapGestureHandler::doubleTapTimerCallback(void* data) >+{ >+ TapGestureHandler* tapGestureHandler = static_cast<TapGestureHandler*>(data); >+ tapGestureHandler->m_doubleTapTimer = 0; >+ >+ // If doubleTapTimer is fired we should not process double tap, >+ // so process single tap here or set state to SingleTapState for processing single tap in the end(). >+ if (tapGestureHandler->m_state == DoubleTapState) >+ tapGestureHandler->processSingleTap(); >+ else >+ tapGestureHandler->m_state = SingleTapState; >+ >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+Eina_Bool TapGestureHandler::tapAndHoldTimerCallback(void* data) >+{ >+ TapGestureHandler* tapGestureHandler = static_cast<TapGestureHandler*>(data); >+ tapGestureHandler->m_tapAndHoldTimer = 0; >+ tapGestureHandler->m_state = NoState; >+ tapGestureHandler->processTapAndHold(); >+ >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/API/efl/TapGestureHandler.h b/Source/WebKit2/UIProcess/API/efl/TapGestureHandler.h >new file mode 100644 >index 0000000000000000000000000000000000000000..2d715c05dadf89c67ba78b00be7ab05da2ad0067 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/TapGestureHandler.h >@@ -0,0 +1,72 @@ >+/* >+ * 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 TapGestureHandler_h >+#define TapGestureHandler_h >+ >+#include "GestureHandler.h" >+#include <Ecore.h> >+#include <Eina.h> >+#include <WebCore/IntPoint.h> >+ >+namespace WebKit { >+ >+class TapGestureHandler : public GestureHandler { >+public: >+ TapGestureHandler(EwkView*); >+ >+ void start(const Vector<WebCore::IntPoint>&); >+ void update(const Vector<WebCore::IntPoint>&); >+ void end(); >+ void cancel(); >+ >+private: >+ static Eina_Bool doubleTapTimerCallback(void*); >+ static Eina_Bool tapAndHoldTimerCallback(void*); >+ >+ static const double s_doubleTapTimeout; >+ static const double s_tapAndHoldTimeout; >+ static const int s_doubleTapDistanceSquareThreshold = 10000; >+ >+ void processSingleTap(); >+ void processDoubleTap(); >+ void processTapAndHold(); >+ >+ enum { >+ NoState, >+ SingleTapState, >+ DoubleTapState >+ } m_state; >+ >+ Ecore_Timer* m_tapAndHoldTimer; >+ Ecore_Timer* m_doubleTapTimer; >+ WebCore::IntPoint m_firstPressedPoint; >+ WebCore::IntPoint m_secondPressedPoint; >+}; >+ >+} // namespace WebKit >+ >+#endif // TapGestureHandler_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