Source/WebKit2/ChangeLog

 12013-03-19 Eunmi Lee <eunmi15.lee@samsung.com>
 2
 3 [EFL][WK2] Implement gesture recognizer.
 4 https://bugs.webkit.org/show_bug.cgi?id=102643
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Recognize tap, pan and pinch gestures using touch events.
 9 The tap gesture is separated into single tap, double tap and
 10 'tap and hold'.
 11
 12 This patch references the webkit NIX port.
 13 https://github.com/WebKitNix/webkitnix
 14
 15 * PlatformEfl.cmake:
 16 * UIProcess/API/efl/EwkView.cpp:
 17 (EwkView::EwkView):
 18 (EwkView::doneWithTouchEvent):
 19 * UIProcess/API/efl/EwkView.h:
 20 (WebKit):
 21 (EwkView):
 22 * UIProcess/API/efl/GestureRecognizer.cpp: Added.
 23 (WebKit):
 24 (WebKit::GestureRecognizer::GestureRecognizer):
 25 (WebKit::GestureRecognizer::processTouchEvent):
 26 (WebKit::GestureRecognizer::doubleTapTimerCallback):
 27 (WebKit::GestureRecognizer::tapAndHoldTimerCallback):
 28 (WebKit::getPointAtIndex):
 29 (WebKit::createVectorWithWKArray):
 30 (WebKit::GestureRecognizer::noGesture):
 31 (WebKit::GestureRecognizer::singleTapGesture):
 32 (WebKit::GestureRecognizer::doubleTapGesture):
 33 (WebKit::GestureRecognizer::panGesture):
 34 (WebKit::GestureRecognizer::pinchGesture):
 35 (WebKit::GestureRecognizer::reset):
 36 (WebKit::GestureRecognizer::stopTapTimers):
 37 * UIProcess/API/efl/GestureRecognizer.h: Added.
 38 (WebKit):
 39 (GestureRecognizerClient):
 40 (WebKit::GestureRecognizerClient::handleSingleTap):
 41 (WebKit::GestureRecognizerClient::handleDoubleTap):
 42 (WebKit::GestureRecognizerClient::handleTapAndHold):
 43 (WebKit::GestureRecognizerClient::handlePanStarted):
 44 (WebKit::GestureRecognizerClient::handlePan):
 45 (WebKit::GestureRecognizerClient::handlePanFinished):
 46 (WebKit::GestureRecognizerClient::handlePinchStarted):
 47 (WebKit::GestureRecognizerClient::handlePinch):
 48 (WebKit::GestureRecognizerClient::handlePinchFinished):
 49 (GestureRecognizer):
 50 (WebKit::GestureRecognizer::create):
 51 * UIProcess/API/efl/GestureRecognizerClientEfl.cpp: Added.
 52 (WebKit):
 53 (WebKit::GestureRecognizerClientEfl::GestureRecognizerClientEfl):
 54 (WebKit::GestureRecognizerClientEfl::handleSingleTap):
 55 (WebKit::GestureRecognizerClientEfl::handleDoubleTap):
 56 (WebKit::GestureRecognizerClientEfl::handleTapAndHold):
 57 (WebKit::GestureRecognizerClientEfl::handlePanStarted):
 58 (WebKit::GestureRecognizerClientEfl::handlePan):
 59 (WebKit::GestureRecognizerClientEfl::handlePanFinished):
 60 (WebKit::GestureRecognizerClientEfl::handlePinchStarted):
 61 (WebKit::GestureRecognizerClientEfl::handlePinch):
 62 (WebKit::GestureRecognizerClientEfl::handlePinchFinished):
 63 * UIProcess/API/efl/GestureRecognizerClientEfl.h: Added.
 64 (WebCore):
 65 (WebKit):
 66 (GestureRecognizerClientEfl):
 67 (WebKit::GestureRecognizerClientEfl::create):
 68 (WebKit::GestureRecognizerClientEfl::~GestureRecognizerClientEfl):
 69
1702013-03-18 Eunmi Lee <eunmi15.lee@samsung.com>
271
372 [EFL][WK2] Add doneWithTouchEvent callback to the WKViewClient.

Source/WebKit2/PlatformEfl.cmake

@@list(APPEND WebKit2_SOURCES
5353 UIProcess/API/efl/EwkView.cpp
5454 UIProcess/API/efl/EvasGLContext.cpp
5555 UIProcess/API/efl/EvasGLSurface.cpp
 56 UIProcess/API/efl/GestureRecognizer.cpp
 57 UIProcess/API/efl/GestureRecognizerClientEfl.cpp
5658 UIProcess/API/efl/SnapshotImageGL.cpp
5759 UIProcess/API/efl/ewk_auth_request.cpp
5860 UIProcess/API/efl/ewk_back_forward_list.cpp

Source/WebKit2/UIProcess/API/efl/EwkView.cpp

8282#include "WebFullScreenManagerProxy.h"
8383#endif
8484
 85#if ENABLE(TOUCH_EVENTS)
 86#include "GestureRecognizer.h"
 87#include "GestureRecognizerClientEfl.h"
 88#endif
 89
8590using namespace EwkViewCallbacks;
8691using namespace WebCore;
8792using namespace WebKit;

@@EwkView::EwkView(Evas_Object* evasObject, PassRefPtr<EwkContext> context, PassRe
263268 , m_mouseEventsEnabled(false)
264269#if ENABLE(TOUCH_EVENTS)
265270 , m_touchEventsEnabled(false)
 271 , m_gestureRecognizerClient(GestureRecognizerClientEfl::create(this))
 272 , m_gestureRecognizer(GestureRecognizer::create(m_gestureRecognizerClient.get()))
266273#endif
267274 , m_displayTimer(this, &EwkView::displayTimerFired)
268275 , m_inputMethodContext(InputMethodContextEfl::create(this, smartData()->base.evas))

@@void EwkView::setTouchEventsEnabled(bool enabled)
794801 }
795802}
796803
797 void EwkView::doneWithTouchEvent(WKTouchEventRef, bool /* wasEventHandled */)
 804void EwkView::doneWithTouchEvent(WKTouchEventRef event, bool wasEventHandled)
798805{
799  notImplemented();
 806 if (wasEventHandled) {
 807 m_gestureRecognizer->reset();
 808 return;
 809 }
 810
 811 m_gestureRecognizer->processTouchEvent(event);
800812}
801813#endif
802814

Source/WebKit2/UIProcess/API/efl/EwkView.h

@@class WebPageProxy;
7272#if ENABLE(VIBRATION)
7373class VibrationClientEfl;
7474#endif
 75
 76#if ENABLE(TOUCH_EVENTS)
 77class GestureRecognizer;
 78class GestureRecognizerClientEfl;
 79#endif
7580}
7681
7782namespace WebCore {

@@private:
286291 bool m_mouseEventsEnabled;
287292#if ENABLE(TOUCH_EVENTS)
288293 bool m_touchEventsEnabled;
 294 OwnPtr<WebKit::GestureRecognizerClientEfl> m_gestureRecognizerClient;
 295 OwnPtr<WebKit::GestureRecognizer> m_gestureRecognizer;
289296#endif
290297 WebCore::Timer<EwkView> m_displayTimer;
291298 OwnPtr<EwkContextMenu> m_contextMenu;

Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp

 1/*
 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 */
 26
 27#include "config.h"
 28#include "GestureRecognizer.h"
 29
 30#include "EwkView.h"
 31#include "WKSharedAPICast.h"
 32
 33#if ENABLE(TOUCH_EVENTS)
 34
 35using namespace WebCore;
 36
 37namespace WebKit {
 38
 39const double GestureRecognizer::s_doubleTapTimeoutInSeconds = 0.4;
 40const double GestureRecognizer::s_tapAndHoldTimeoutInSeconds = 1.0;
 41const int GestureRecognizer::s_squaredDoubleTapThreshold = 10000;
 42const int GestureRecognizer::s_squaredPanThreshold = 100;
 43
 44GestureRecognizer::GestureRecognizer(GestureRecognizerClient* client)
 45 : m_recognizerFunction(&GestureRecognizer::noGesture)
 46 , m_client(client)
 47 , m_tapAndHoldTimer(0)
 48 , m_doubleTapTimer(0)
 49{
 50}
 51
 52void GestureRecognizer::processTouchEvent(WKTouchEventRef eventRef)
 53{
 54 WKEventType type = WKTouchEventGetType(eventRef);
 55 if (type == kWKEventTypeTouchCancel) {
 56 reset();
 57 return;
 58 }
 59
 60 (this->*m_recognizerFunction)(type, WKTouchEventGetTouchPoints(eventRef));
 61}
 62
 63Eina_Bool GestureRecognizer::doubleTapTimerCallback(void* data)
 64{
 65 GestureRecognizer* gestureRecognizer = static_cast<GestureRecognizer*>(data);
 66 gestureRecognizer->m_doubleTapTimer = 0;
 67
 68 // If doubleTapTimer is fired we should not process double tap,
 69 // so process single tap here if touched point is already released
 70 // or do nothing for processing single tap when touch is released.
 71 if (gestureRecognizer->m_recognizerFunction == &GestureRecognizer::doubleTapGesture) {
 72 gestureRecognizer->m_client->handleSingleTap(gestureRecognizer->m_firstPressedPoint);
 73 gestureRecognizer->m_recognizerFunction = &GestureRecognizer::noGesture;
 74 }
 75
 76 return ECORE_CALLBACK_CANCEL;
 77}
 78
 79Eina_Bool GestureRecognizer::tapAndHoldTimerCallback(void* data)
 80{
 81 GestureRecognizer* gestureRecognizer = static_cast<GestureRecognizer*>(data);
 82 gestureRecognizer->m_tapAndHoldTimer = 0;
 83 gestureRecognizer->m_client->handleTapAndHold(gestureRecognizer->m_firstPressedPoint);
 84 gestureRecognizer->m_recognizerFunction = &GestureRecognizer::noGesture;
 85
 86 return ECORE_CALLBACK_CANCEL;
 87}
 88
 89static inline WKPoint getPointAtIndex(WKArrayRef array, size_t index)
 90{
 91 WKTouchPointRef pointRef = static_cast<WKTouchPointRef>(WKArrayGetItemAtIndex(array, index));
 92 ASSERT(pointRef);
 93
 94 return WKTouchPointGetPosition(pointRef);
 95}
 96
 97static inline Vector<IntPoint>* createVectorWithWKArray(WKArrayRef array, size_t size)
 98{
 99 Vector<IntPoint>* points = new Vector<IntPoint>(size);
 100 for (size_t i = 0; i < size; ++i)
 101 points->uncheckedAppend(toIntPoint(getPointAtIndex(array, i)));
 102
 103 return points;
 104}
 105
 106void GestureRecognizer::noGesture(WKEventType type, WKArrayRef touchPoints)
 107{
 108 switch (type) {
 109 case kWKEventTypeTouchStart:
 110 m_recognizerFunction = &GestureRecognizer::singleTapGesture;
 111 m_firstPressedPoint = toIntPoint(getPointAtIndex(touchPoints, 0));
 112 ASSERT(m_tapAndHoldTimer);
 113 m_tapAndHoldTimer = ecore_timer_add(s_tapAndHoldTimeoutInSeconds, tapAndHoldTimerCallback, this);
 114 m_doubleTapTimer = ecore_timer_add(s_doubleTapTimeoutInSeconds, doubleTapTimerCallback, this);
 115 break;
 116 default:
 117 break;
 118 }
 119}
 120
 121void GestureRecognizer::singleTapGesture(WKEventType type, WKArrayRef touchPoints)
 122{
 123 switch (type) {
 124 case kWKEventTypeTouchStart:
 125 stopTapTimers();
 126 m_recognizerFunction = &GestureRecognizer::pinchGesture;
 127 m_client->handlePinchStarted(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get());
 128 break;
 129 case kWKEventTypeTouchMove: {
 130 IntPoint currentPoint = toIntPoint(getPointAtIndex(touchPoints, 0));
 131 if (m_firstPressedPoint.distanceSquaredToPoint(currentPoint) > s_squaredPanThreshold) {
 132 stopTapTimers();
 133 m_recognizerFunction = &GestureRecognizer::panGesture;
 134 m_client->handlePanStarted(currentPoint);
 135 }
 136 break;
 137 }
 138 case kWKEventTypeTouchEnd:
 139 if (m_tapAndHoldTimer) {
 140 ecore_timer_del(m_tapAndHoldTimer);
 141 m_tapAndHoldTimer = 0;
 142 }
 143
 144 if (m_doubleTapTimer)
 145 m_recognizerFunction = &GestureRecognizer::doubleTapGesture;
 146 else {
 147 m_client->handleSingleTap(m_firstPressedPoint);
 148 m_recognizerFunction = &GestureRecognizer::noGesture;
 149 }
 150 break;
 151 default:
 152 break;
 153 }
 154}
 155
 156void GestureRecognizer::doubleTapGesture(WKEventType type, WKArrayRef touchPoints)
 157{
 158 switch (type) {
 159 case kWKEventTypeTouchStart: {
 160 if (m_doubleTapTimer) {
 161 ecore_timer_del(m_doubleTapTimer);
 162 m_doubleTapTimer = 0;
 163 }
 164
 165 size_t numberOfTouchPoints = WKArrayGetSize(touchPoints);
 166 if (numberOfTouchPoints == 1) {
 167 if (m_firstPressedPoint.distanceSquaredToPoint(toIntPoint(getPointAtIndex(touchPoints, 0))) > s_squaredDoubleTapThreshold)
 168 m_recognizerFunction = &GestureRecognizer::singleTapGesture;
 169 } else {
 170 m_recognizerFunction = &GestureRecognizer::pinchGesture;
 171 m_client->handlePinchStarted(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get());
 172 }
 173 break;
 174 }
 175 case kWKEventTypeTouchMove: {
 176 IntPoint currentPoint = toIntPoint(getPointAtIndex(touchPoints, 0));
 177 if (m_firstPressedPoint.distanceSquaredToPoint(currentPoint) > s_squaredPanThreshold) {
 178 m_recognizerFunction = &GestureRecognizer::panGesture;
 179 m_client->handlePanStarted(currentPoint);
 180 }
 181 break;
 182 }
 183 case kWKEventTypeTouchEnd:
 184 m_client->handleDoubleTap(m_firstPressedPoint);
 185 m_recognizerFunction = &GestureRecognizer::noGesture;
 186 break;
 187 default:
 188 break;
 189 }
 190}
 191
 192void GestureRecognizer::panGesture(WKEventType type, WKArrayRef touchPoints)
 193{
 194 switch (type) {
 195 case kWKEventTypeTouchStart:
 196 m_recognizerFunction = &GestureRecognizer::pinchGesture;
 197 m_client->handlePinchStarted(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get());
 198 break;
 199 case kWKEventTypeTouchMove:
 200 m_client->handlePan(toIntPoint(getPointAtIndex(touchPoints, 0)));
 201 break;
 202 case kWKEventTypeTouchEnd:
 203 m_client->handlePanFinished();
 204 m_recognizerFunction = &GestureRecognizer::noGesture;
 205 break;
 206 default:
 207 break;
 208 }
 209}
 210
 211void GestureRecognizer::pinchGesture(WKEventType type, WKArrayRef touchPoints)
 212{
 213 size_t numberOfTouchPoints = WKArrayGetSize(touchPoints);
 214 ASSERT(numberOfTouchPoints >= 2);
 215
 216 switch (type) {
 217 case kWKEventTypeTouchMove: {
 218 m_client->handlePinch(*adoptPtr(createVectorWithWKArray(touchPoints, 2)).get());
 219 break;
 220 }
 221 case kWKEventTypeTouchEnd:
 222 if (numberOfTouchPoints == 2) {
 223 m_client->handlePinchFinished();
 224 m_recognizerFunction = &GestureRecognizer::panGesture;
 225 WKTouchPointRef pointRef;
 226 for (size_t i = 0; i < numberOfTouchPoints; ++i) {
 227 pointRef = static_cast<WKTouchPointRef>(WKArrayGetItemAtIndex(touchPoints, i));
 228 WKTouchPointState state = WKTouchPointGetState(pointRef);
 229 if (state != kWKTouchPointStateTouchReleased && state != kWKTouchPointStateTouchCancelled)
 230 break;
 231 }
 232 ASSERT(pointRef);
 233 m_client->handlePanStarted(toIntPoint(WKTouchPointGetPosition(pointRef)));
 234 }
 235 break;
 236 default:
 237 break;
 238 }
 239}
 240
 241void GestureRecognizer::reset()
 242{
 243 stopTapTimers();
 244
 245 m_recognizerFunction = &GestureRecognizer::noGesture;
 246}
 247
 248void GestureRecognizer::stopTapTimers()
 249{
 250 if (m_doubleTapTimer) {
 251 ecore_timer_del(m_doubleTapTimer);
 252 m_doubleTapTimer = 0;
 253 }
 254
 255 if (m_tapAndHoldTimer) {
 256 ecore_timer_del(m_tapAndHoldTimer);
 257 m_tapAndHoldTimer = 0;
 258 }
 259}
 260
 261} // namespace WebKit
 262
 263#endif // ENABLE(TOUCH_EVENTS)

Source/WebKit2/UIProcess/API/efl/GestureRecognizer.h

 1/*
 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 */
 26
 27#ifndef GestureRecognizer_h
 28#define GestureRecognizer_h
 29
 30#if ENABLE(TOUCH_EVENTS)
 31
 32#include <Ecore.h>
 33#include <WebCore/IntPoint.h>
 34#include <WebKit2/WKEventEfl.h>
 35#include <wtf/PassOwnPtr.h>
 36#include <wtf/Vector.h>
 37
 38namespace WebKit {
 39
 40class GestureRecognizerClient {
 41public:
 42 virtual void handleSingleTap(const WebCore::IntPoint&) { }
 43 virtual void handleDoubleTap(const WebCore::IntPoint&) { }
 44 virtual void handleTapAndHold(const WebCore::IntPoint&) { }
 45
 46 virtual void handlePanStarted(const WebCore::IntPoint&) { }
 47 virtual void handlePan(const WebCore::IntPoint&) { }
 48 virtual void handlePanFinished() { }
 49
 50 virtual void handlePinchStarted(const Vector<WebCore::IntPoint>&) { }
 51 virtual void handlePinch(const Vector<WebCore::IntPoint>&) { }
 52 virtual void handlePinchFinished() { }
 53};
 54
 55class GestureRecognizer {
 56public:
 57 static PassOwnPtr<GestureRecognizer> create(GestureRecognizerClient* client)
 58 {
 59 return adoptPtr(new GestureRecognizer(client));
 60 }
 61
 62 void processTouchEvent(WKTouchEventRef);
 63 void reset();
 64
 65private:
 66 explicit GestureRecognizer(GestureRecognizerClient*);
 67
 68 static const double s_doubleTapTimeoutInSeconds;
 69 static const double s_tapAndHoldTimeoutInSeconds;
 70 static const int s_squaredDoubleTapThreshold;
 71 static const int s_squaredPanThreshold;
 72
 73 static Eina_Bool doubleTapTimerCallback(void*);
 74 static Eina_Bool tapAndHoldTimerCallback(void*);
 75
 76 // State functions.
 77 void noGesture(WKEventType, WKArrayRef);
 78 void singleTapGesture(WKEventType, WKArrayRef);
 79 void doubleTapGesture(WKEventType, WKArrayRef);
 80 void panGesture(WKEventType, WKArrayRef);
 81 void pinchGesture(WKEventType, WKArrayRef);
 82
 83 void stopTapTimers();
 84
 85 typedef void (GestureRecognizer::*RecognizerFunction)(WKEventType, WKArrayRef);
 86 RecognizerFunction m_recognizerFunction;
 87
 88 GestureRecognizerClient* m_client;
 89 Ecore_Timer* m_tapAndHoldTimer;
 90 Ecore_Timer* m_doubleTapTimer;
 91 WebCore::IntPoint m_firstPressedPoint;
 92};
 93
 94} // namespace WebKit
 95
 96#endif // ENABLE(TOUCH_EVENTS)
 97
 98#endif // GestureRecognizer_h

Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.cpp

 1/*
 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 */
 26
 27#include "config.h"
 28#include "GestureRecognizerClientEfl.h"
 29
 30#include "EwkView.h"
 31#include <WebCore/IntPoint.h>
 32#include <WebCore/NotImplemented.h>
 33
 34#if ENABLE(TOUCH_EVENTS)
 35
 36using namespace WebCore;
 37
 38namespace WebKit {
 39
 40GestureRecognizerClientEfl::GestureRecognizerClientEfl(EwkView* view)
 41 : m_view(view)
 42{
 43}
 44
 45void GestureRecognizerClientEfl::handleSingleTap(const IntPoint&)
 46{
 47 notImplemented();
 48}
 49
 50void GestureRecognizerClientEfl::handleDoubleTap(const IntPoint&)
 51{
 52 notImplemented();
 53}
 54
 55void GestureRecognizerClientEfl::handleTapAndHold(const IntPoint&)
 56{
 57 notImplemented();
 58}
 59
 60void GestureRecognizerClientEfl::handlePanStarted(const IntPoint&)
 61{
 62 notImplemented();
 63}
 64
 65void GestureRecognizerClientEfl::handlePan(const IntPoint& point)
 66{
 67 notImplemented();
 68}
 69
 70void GestureRecognizerClientEfl::handlePanFinished()
 71{
 72 notImplemented();
 73}
 74
 75void GestureRecognizerClientEfl::handlePinchStarted(const Vector<IntPoint>&)
 76{
 77 notImplemented();
 78}
 79
 80void GestureRecognizerClientEfl::handlePinch(const Vector<IntPoint>&)
 81{
 82 notImplemented();
 83}
 84
 85void GestureRecognizerClientEfl::handlePinchFinished()
 86{
 87 notImplemented();
 88}
 89
 90} // namespace WebKit
 91
 92#endif // ENABLE(TOUCH_EVENTS)

Source/WebKit2/UIProcess/API/efl/GestureRecognizerClientEfl.h

 1/*
 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 */
 26
 27#ifndef GestureRecognizerClientEfl_h
 28#define GestureRecognizerClientEfl_h
 29
 30#if ENABLE(TOUCH_EVENTS)
 31
 32#include "GestureRecognizer.h"
 33#include <wtf/PassOwnPtr.h>
 34#include <wtf/Vector.h>
 35
 36class EwkView;
 37
 38namespace WebCore {
 39class IntPoint;
 40}
 41
 42namespace WebKit {
 43
 44class GestureRecognizerClientEfl : public GestureRecognizerClient {
 45public:
 46 static PassOwnPtr<GestureRecognizerClientEfl> create(EwkView* view)
 47 {
 48 return adoptPtr(new GestureRecognizerClientEfl(view));
 49 }
 50
 51 ~GestureRecognizerClientEfl() { }
 52
 53 // GestureRecognizerClient.
 54 virtual void handleSingleTap(const WebCore::IntPoint&);
 55 virtual void handleDoubleTap(const WebCore::IntPoint&);
 56 virtual void handleTapAndHold(const WebCore::IntPoint&);
 57 virtual void handlePanStarted(const WebCore::IntPoint&);
 58 virtual void handlePan(const WebCore::IntPoint&);
 59 virtual void handlePanFinished();
 60 virtual void handlePinchStarted(const Vector<WebCore::IntPoint>&);
 61 virtual void handlePinch(const Vector<WebCore::IntPoint>&);
 62 virtual void handlePinchFinished();
 63
 64private:
 65 explicit GestureRecognizerClientEfl(EwkView*);
 66
 67 EwkView* m_view;
 68};
 69
 70} // namespace WebKit
 71
 72#endif // ENABLE(TOUCH_EVENTS)
 73
 74#endif // GestureRecognizerClientEfl_h