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-110085-20130723203333.patch (text/plain), 16.00 KB, created by
Eunmi Lee
on 2013-07-23 04:33:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eunmi Lee
Created:
2013-07-23 04:33:35 PDT
Size:
16.00 KB
patch
obsolete
>Subversion Revision: 153043 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index f4fa8b6d241041cbb4008407cbdb572d9dfb95ee..c8668acfe56f5a467977c2e0008b85c13130980a 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,46 @@ >+2013-07-23 Eunmi Lee <eunmi15.lee@samsung.com> >+ >+ [EFL][WK2] Add doneWithTouchEvent callback to the WKViewClient. >+ https://bugs.webkit.org/show_bug.cgi?id=110085 >+ >+ Reviewed by Kenneth Rohde Christiansen. >+ >+ Add doneWithTouchEvent callback to the WKViewClient in order to get the >+ result of touch events in the EwkView. The result will be used to >+ recognize gestures in the Bug 102643. >+ >+ APIs to get values from WKTouchEventRef and WKTouchPointRef are added >+ because WKTypeRef is opaque to the applications. >+ >+ * UIProcess/API/C/CoordinatedGraphics/WKView.h: >+ * UIProcess/API/C/efl/WKAPICastEfl.h: >+ (WebKit::toAPI): >+ * UIProcess/API/C/efl/WKEventEfl.cpp: >+ (WKTouchEventGetType): >+ (WKTouchEventGetTouchPoints): >+ (WKTouchEventGetModifiers): >+ (WKTouchEventGetTimestamp): >+ (WKTouchPointGetID): >+ (WKTouchPointGetState): >+ (WKTouchPointGetScreenPosition): >+ (WKTouchPointGetPosition): >+ (WKTouchPointGetRadius): >+ (WKTouchPointGetRotationAngle): >+ (WKTouchPointGetForceFactor): >+ * UIProcess/API/C/efl/WKEventEfl.h: >+ * UIProcess/API/efl/EwkView.cpp: >+ (EwkView::doneWithTouchEvent): >+ * UIProcess/API/efl/EwkView.h: >+ * UIProcess/CoordinatedGraphics/WebView.cpp: >+ (WebKit::WebView::doneWithTouchEvent): >+ * UIProcess/CoordinatedGraphics/WebViewClient.cpp: >+ (WebKit::WebViewClient::doneWithTouchEvent): >+ * UIProcess/CoordinatedGraphics/WebViewClient.h: >+ * UIProcess/efl/ViewClientEfl.cpp: >+ (WebKit::ViewClientEfl::doneWithTouchEvent): >+ (WebKit::ViewClientEfl::ViewClientEfl): >+ * UIProcess/efl/ViewClientEfl.h: >+ > 2013-07-22 Alexey Proskuryakov <ap@apple.com> > > Frequent MESSAGE_CHECK failures in WebPageProxy::didReceiveEvent >diff --git a/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h b/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h >index d8bc781b9b19e5ef47fbbb72c35d7ae8ba231441..1ee55ea34542236477b15d6b96adb50f9aeb0a88 100644 >--- a/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h >+++ b/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h >@@ -24,6 +24,10 @@ > #include <WebKit2/WKBase.h> > #include <WebKit2/WKGeometry.h> > >+#ifndef __cplusplus >+#include <stdbool.h> >+#endif >+ > #ifdef __cplusplus > extern "C" { > #endif >@@ -37,6 +41,7 @@ typedef void (*WKViewPageDidRenderFrameCallback)(WKViewRef view, WKSize contents > typedef void (*WKViewPageDidChangeViewportAttributesCallback)(WKViewRef view, WKViewportAttributesRef, const void* clientInfo); > typedef void (*WKViewPageDidChangeTooltipCallback)(WKViewRef view, WKStringRef newTooltip, const void* clientInfo); > typedef void (*WKViewDidFindZoomableAreaCallback)(WKViewRef view, WKPoint point, WKRect area, const void* clientInfo); >+typedef void (*WKViewDoneWithTouchEventCallback)(WKViewRef view, WKTouchEventRef touchEvent, bool wasEventHandled, const void* clientInfo); > > struct WKViewClient { > int version; >@@ -53,6 +58,7 @@ struct WKViewClient { > WKViewPageDidChangeViewportAttributesCallback didChangeViewportAttributes; > WKViewPageDidChangeTooltipCallback didChangeTooltip; > WKViewDidFindZoomableAreaCallback didFindZoomableArea; >+ WKViewDoneWithTouchEventCallback doneWithTouchEvent; > }; > typedef struct WKViewClient WKViewClient; > >diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h b/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h >index 351a19ffe527c1258d5d3add0995066d0c8619de..87c5f5efbd6be562d79bec3fd70915cd079cd2d3 100644 >--- a/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h >+++ b/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h >@@ -27,6 +27,11 @@ > #include <WebCore/TextDirection.h> > #include <WebKit2/WKPopupItem.h> > >+#if ENABLE(TOUCH_EVENTS) >+#include "WebEvent.h" >+#include <WebKit2/WKEventEfl.h> >+#endif >+ > namespace WebKit { > > class WebView; >@@ -62,6 +67,43 @@ inline WKPopupItemTextDirection toAPI(WebCore::TextDirection direction) > return wkDirection; > } > >+#if ENABLE(TOUCH_EVENTS) >+inline WKEventType toAPI(WebEvent::Type type) >+{ >+ switch (type) { >+ case WebEvent::TouchStart: >+ return kWKEventTypeTouchStart; >+ case WebEvent::TouchMove: >+ return kWKEventTypeTouchMove; >+ case WebEvent::TouchEnd: >+ return kWKEventTypeTouchEnd; >+ case WebEvent::TouchCancel: >+ return kWKEventTypeTouchCancel; >+ default: >+ return kWKEventTypeNoType; >+ } >+} >+ >+inline WKTouchPointState toAPI(WebPlatformTouchPoint::TouchPointState state) >+{ >+ switch (state) { >+ case WebPlatformTouchPoint::TouchReleased: >+ return kWKTouchPointStateTouchReleased; >+ case WebPlatformTouchPoint::TouchPressed: >+ return kWKTouchPointStateTouchPressed; >+ case WebPlatformTouchPoint::TouchMoved: >+ return kWKTouchPointStateTouchMoved; >+ case WebPlatformTouchPoint::TouchStationary: >+ return kWKTouchPointStateTouchStationary; >+ case WebPlatformTouchPoint::TouchCancelled: >+ return kWKTouchPointStateTouchCancelled; >+ } >+ >+ ASSERT_NOT_REACHED(); >+ return kWKTouchPointStateTouchCancelled; >+} >+#endif >+ > } > > #endif // WKAPICastEfl_h >diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.cpp b/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.cpp >index 6d5071f90bd5b7c608c64af6d2df0043d8705223..843aeb0dd3326d4eadd7cf95b2f9e5589782a110 100644 >--- a/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.cpp >+++ b/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.cpp >@@ -62,3 +62,113 @@ WKTouchEventRef WKTouchEventCreate(WKEventType type, WKArrayRef wkTouchPoints, W > return 0; > #endif > } >+ >+WKEventType WKTouchEventGetType(WKTouchEventRef event) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(event)->eventType(); >+#else >+ UNUSED_PARAM(event); >+ return kWKEventTypeNoType; >+#endif >+} >+ >+WKArrayRef WKTouchEventGetTouchPoints(WKTouchEventRef event) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(event)->touchPoints(); >+#else >+ UNUSED_PARAM(event); >+ return 0; >+#endif >+} >+ >+WKEventModifiers WKTouchEventGetModifiers(WKTouchEventRef event) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(event)->modifiers(); >+#else >+ UNUSED_PARAM(event); >+ return 0; >+#endif >+} >+ >+double WKTouchEventGetTimestamp(WKTouchEventRef event) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(event)->timestamp(); >+#else >+ UNUSED_PARAM(event); >+ return 0; >+#endif >+} >+ >+uint32_t WKTouchPointGetID(WKTouchPointRef point) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(point)->id(); >+#else >+ UNUSED_PARAM(point); >+ return 0; >+#endif >+} >+ >+WKTouchPointState WKTouchPointGetState(WKTouchPointRef point) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(point)->state(); >+#else >+ UNUSED_PARAM(point); >+ return kWKTouchPointStateTouchCancelled; >+#endif >+} >+ >+WKPoint WKTouchPointGetScreenPosition(WKTouchPointRef point) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(point)->screenPosition(); >+#else >+ UNUSED_PARAM(point); >+ return WKPointMake(0, 0); >+#endif >+} >+ >+WKPoint WKTouchPointGetPosition(WKTouchPointRef point) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(point)->position(); >+#else >+ UNUSED_PARAM(point); >+ return WKPointMake(0, 0); >+#endif >+} >+ >+WKSize WKTouchPointGetRadius(WKTouchPointRef point) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(point)->radius(); >+#else >+ UNUSED_PARAM(point); >+ return WKSizeMake(0, 0); >+#endif >+} >+ >+float WKTouchPointGetRotationAngle(WKTouchPointRef point) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(point)->rotationAngle(); >+#else >+ UNUSED_PARAM(point); >+ return 0; >+#endif >+} >+ >+float WKTouchPointGetForceFactor(WKTouchPointRef point) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ return toImpl(point)->forceFactor(); >+#else >+ UNUSED_PARAM(point); >+ return 0; >+#endif >+} >diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h b/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h >index cda2636e65171c8b93bc74245fd3cb9a772c92c3..b5439219e8ad1b8b54035e9b0926ca1a49dc0277 100644 >--- a/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h >+++ b/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h >@@ -55,6 +55,19 @@ typedef enum WKTouchPointState WKTouchPointState; > WK_EXPORT WKTouchPointRef WKTouchPointCreate(int id, WKPoint position, WKPoint screenPosition, WKTouchPointState, WKSize radius, float rotationAngle, float forceFactor); > WK_EXPORT WKTouchEventRef WKTouchEventCreate(WKEventType, WKArrayRef, WKEventModifiers, double timestamp); > >+WK_EXPORT WKEventType WKTouchEventGetType(WKTouchEventRef); >+WK_EXPORT WKArrayRef WKTouchEventGetTouchPoints(WKTouchEventRef); >+WK_EXPORT WKEventModifiers WKTouchEventGetModifiers(WKTouchEventRef); >+WK_EXPORT double WKTouchEventGetTimestamp(WKTouchEventRef); >+ >+WK_EXPORT uint32_t WKTouchPointGetID(WKTouchPointRef); >+WK_EXPORT WKTouchPointState WKTouchPointGetState(WKTouchPointRef); >+WK_EXPORT WKPoint WKTouchPointGetScreenPosition(WKTouchPointRef); >+WK_EXPORT WKPoint WKTouchPointGetPosition(WKTouchPointRef); >+WK_EXPORT WKSize WKTouchPointGetRadius(WKTouchPointRef); >+WK_EXPORT float WKTouchPointGetRotationAngle(WKTouchPointRef); >+WK_EXPORT float WKTouchPointGetForceFactor(WKTouchPointRef); >+ > #ifdef __cplusplus > } > #endif >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >index 0681d88a813e088968a3f586076d27d5d94df5e0..457c86163fcf4f0d528291d12d568ee4635e3039 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >@@ -74,6 +74,7 @@ > #endif > #include <WebCore/CairoUtilitiesEfl.h> > #include <WebCore/Cursor.h> >+#include <WebCore/NotImplemented.h> > #include <WebCore/PlatformContextCairo.h> > #include <WebKit2/WKImageCairo.h> > #include <wtf/MathExtras.h> >@@ -791,6 +792,11 @@ void EwkView::setTouchEventsEnabled(bool enabled) > evas_object_event_callback_del(m_evasObject, EVAS_CALLBACK_MULTI_MOVE, handleTouchMove); > } > } >+ >+void EwkView::doneWithTouchEvent(WKTouchEventRef, bool /* wasEventHandled */) >+{ >+ notImplemented(); >+} > #endif > > #if USE(ACCELERATED_COMPOSITING) >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.h b/Source/WebKit2/UIProcess/API/efl/EwkView.h >index 67a468d4183cb90f33be740ab9efa1433d32eaa3..a9f011716bb45839f466f8524b5203fec13d9c9b 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.h >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.h >@@ -146,6 +146,7 @@ public: > void feedTouchEvent(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers); > bool touchEventsEnabled() const { return m_touchEventsEnabled; } > void setTouchEventsEnabled(bool enabled); >+ void doneWithTouchEvent(WKTouchEventRef, bool); > #endif > > void setCursor(const WebCore::Cursor& cursor); >diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp >index 668347e867b815ced4ee3ba40d1b2e95800f763f..7fbf812a64a5d027645ce3a9c6561957083c7853 100644 >--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp >+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp >@@ -393,9 +393,9 @@ void WebView::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool) > } > > #if ENABLE(TOUCH_EVENTS) >-void WebView::doneWithTouchEvent(const NativeWebTouchEvent&, bool /*wasEventHandled*/) >+void WebView::doneWithTouchEvent(const NativeWebTouchEvent& event, bool wasEventHandled) > { >- notImplemented(); >+ m_client.doneWithTouchEvent(this, event, wasEventHandled); > } > #endif > >diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp >index c1ead360f4f9aea12b8218e2a6222b96d2cb7c42..f75de5023a4e80e0c2d6c410fd692194b4d9d475 100644 >--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp >+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp >@@ -29,11 +29,16 @@ > > #include "WebViewClient.h" > >+#include "NotImplemented.h" > #include "WKAPICast.h" > #include "WKBase.h" > #include "WKRetainPtr.h" > #include "WebViewportAttributes.h" > >+#if ENABLE(TOUCH_EVENTS) >+#include "NativeWebTouchEvent.h" >+#endif >+ > using namespace WebCore; > > namespace WebKit { >@@ -119,6 +124,23 @@ void WebViewClient::didFindZoomableArea(WebView* view, const IntPoint& target, c > m_client.didFindZoomableArea(toAPI(view), toAPI(target), toAPI(area), m_client.clientInfo); > } > >+#if ENABLE(TOUCH_EVENTS) >+void WebViewClient::doneWithTouchEvent(WebView* view, const NativeWebTouchEvent& event, bool wasEventHandled) >+{ >+#if PLATFORM(EFL) >+ if (!m_client.doneWithTouchEvent) >+ return; >+ >+ m_client.doneWithTouchEvent(toAPI(view), toAPI(const_cast<EwkTouchEvent*>(event.nativeEvent())), wasEventHandled, m_client.clientInfo); >+#else >+ notImplemented(); >+ UNUSED_PARAM(view); >+ UNUSED_PARAM(event); >+ UNUSED_PARAM(wasEventHandled); >+#endif >+} >+#endif >+ > } // namespace WebKit > > #endif // USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h >index 62223295b824bdb21979d53255db699e7f7753e8..51979e9c7a00f829fe679142446f0408402dd455 100644 >--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h >+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h >@@ -43,6 +43,10 @@ namespace WebKit { > > class WebView; > >+#if ENABLE(TOUCH_EVENTS) >+class NativeWebTouchEvent; >+#endif >+ > class WebViewClient: public APIClient<WKViewClient, kWKViewClientCurrentVersion> { > public: > void viewNeedsDisplay(WebView*, const WebCore::IntRect&); >@@ -55,6 +59,9 @@ public: > void didChangeViewportAttributes(WebView*, const WebCore::ViewportAttributes&); > void didChangeTooltip(WebView*, const String& tooltip); > void didFindZoomableArea(WebView*, const WebCore::IntPoint&, const WebCore::IntRect&); >+#if ENABLE(TOUCH_EVENTS) >+ void doneWithTouchEvent(WebView*, const NativeWebTouchEvent&, bool); >+#endif > }; > > } // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp b/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >index f1289107f19ad1d7ddce4336724a238b0410cfda..e14214fa49cc3cd7b78dd4c2ee5bba3e4413c1e6 100644 >--- a/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >+++ b/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >@@ -159,6 +159,13 @@ void ViewClientEfl::didFindZoomableArea(WKViewRef, WKPoint point, WKRect area, c > toEwkView(clientInfo)->didFindZoomableArea(point, area); > } > >+#if ENABLE(TOUCH_EVENTS) >+void ViewClientEfl::doneWithTouchEvent(WKViewRef, WKTouchEventRef event, bool wasEventHandled, const void* clientInfo) >+{ >+ toEwkView(clientInfo)->doneWithTouchEvent(event, wasEventHandled); >+} >+#endif >+ > ViewClientEfl::ViewClientEfl(EwkView* view) > : m_view(view) > { >@@ -178,6 +185,9 @@ ViewClientEfl::ViewClientEfl(EwkView* view) > viewClient.didCompletePageTransition = didCompletePageTransition; > viewClient.didChangeViewportAttributes = didChangeViewportAttributes; > viewClient.didChangeTooltip = didChangeTooltip; >+#if ENABLE(TOUCH_EVENTS) >+ viewClient.doneWithTouchEvent = doneWithTouchEvent; >+#endif > > WKViewSetViewClient(m_view->wkView(), &viewClient); > } >diff --git a/Source/WebKit2/UIProcess/efl/ViewClientEfl.h b/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >index 1bee369396e8c9ce8af574cab6f452cbfd23ef41..a384cf597d4a9d0fb2e9ee0ffeb5fa01a3a84d64 100644 >--- a/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >+++ b/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >@@ -57,6 +57,9 @@ private: > static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo); > static void didChangeTooltip(WKViewRef, WKStringRef, const void* clientInfo); > static void didFindZoomableArea(WKViewRef, WKPoint, WKRect, const void* clientInfo); >+#if ENABLE(TOUCH_EVENTS) >+ static void doneWithTouchEvent(WKViewRef, WKTouchEventRef, bool, const void* clientInfo); >+#endif > > EwkView* m_view; > };
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 110085
:
188814
|
191184
|
193077
|
193742
|
206049
|
206292
|
206545
| 207319