Title: [163284] trunk/Source/WebKit2
Revision
163284
Author
commit-qu...@webkit.org
Date
2014-02-02 20:54:26 -0800 (Sun, 02 Feb 2014)

Log Message

[EFL][WK2] Add a logic for checking multi touch in GestureRecognizer::noGesture
https://bugs.webkit.org/show_bug.cgi?id=127675

Patch by Sanghyup Lee <sh53....@samsung.com> on 2014-02-02
Reviewed by Gyuyoung Kim.

When processing TouchStart event in GestureRecognizer::noGesture(), we should
check the number of touch points to distinguish if the gesture is single tap
or pinch zoom. Current logic only considers the event as single tap.

* UIProcess/API/efl/GestureRecognizer.cpp:
(WebKit::GestureRecognizer::noGesture):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163283 => 163284)


--- trunk/Source/WebKit2/ChangeLog	2014-02-03 04:50:00 UTC (rev 163283)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-03 04:54:26 UTC (rev 163284)
@@ -1,3 +1,17 @@
+2014-02-02  Sanghyup Lee  <sh53....@samsung.com>
+
+        [EFL][WK2] Add a logic for checking multi touch in GestureRecognizer::noGesture
+        https://bugs.webkit.org/show_bug.cgi?id=127675
+
+        Reviewed by Gyuyoung Kim.
+
+        When processing TouchStart event in GestureRecognizer::noGesture(), we should
+        check the number of touch points to distinguish if the gesture is single tap
+        or pinch zoom. Current logic only considers the event as single tap.
+
+        * UIProcess/API/efl/GestureRecognizer.cpp:
+        (WebKit::GestureRecognizer::noGesture):
+
 2014-02-02  Enrica Casucci  <enr...@apple.com>
 
         WK2: Selection is non editable content is not cleared when navigating to a different page.

Modified: trunk/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp (163283 => 163284)


--- trunk/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp	2014-02-03 04:50:00 UTC (rev 163283)
+++ trunk/Source/WebKit2/UIProcess/API/efl/GestureRecognizer.cpp	2014-02-03 04:54:26 UTC (rev 163284)
@@ -355,15 +355,28 @@
 void GestureRecognizer::noGesture(WKTouchEventRef eventRef)
 {
     switch (WKTouchEventGetType(eventRef)) {
-    case kWKEventTypeTouchStart:
-        m_gestureHandler->reset();
-
-        m_recognizerFunction = &GestureRecognizer::singleTapGesture;
-        m_firstPressedPoint = toIntPoint(getPointAtIndex(WKTouchEventGetTouchPoints(eventRef), 0));
-        ASSERT(!m_tapAndHoldTimer);
-        m_tapAndHoldTimer = ecore_timer_add(s_tapAndHoldTimeoutInSeconds, tapAndHoldTimerCallback, this);
-        m_doubleTapTimer = ecore_timer_add(s_doubleTapTimeoutInSeconds, doubleTapTimerCallback, this);
+    case kWKEventTypeTouchStart: {
+        WKArrayRef touchPoints = WKTouchEventGetTouchPoints(eventRef);
+        switch (WKArrayGetSize(touchPoints)) {
+        case 1:
+            m_gestureHandler->reset();
+            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;
+        case 2:
+            m_recognizerFunction = &GestureRecognizer::pinchGesture;
+            m_gestureHandler->handlePinchStarted(createVectorWithWKArray(touchPoints, 2));
+            break;
+        default:
+            // There's no defined gesture when we touch three or more points.
+            notImplemented();
+            break;
+        }
         break;
+    }
     case kWKEventTypeTouchMove:
     case kWKEventTypeTouchEnd:
         break;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to