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-20130319152604.patch (text/plain), 15.49 KB, created by
Eunmi Lee
on 2013-03-18 23:30:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eunmi Lee
Created:
2013-03-18 23:30:14 PDT
Size:
15.49 KB
patch
obsolete
>Subversion Revision: 146055 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 099cca45a00d3427204f6f4f51f0668fadaa2b80..5b7079cd6639ef339156817d44888ccfa2eea913 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,5 +1,54 @@ > 2013-03-18 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 NOBODY (OOPS!). >+ >+ 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/efl/WKAPICastEfl.h: >+ (WebKit::toAPI): >+ (WebKit): >+ * 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/C/efl/WKView.h: >+ * UIProcess/API/efl/EwkView.cpp: >+ (EwkView::doneWithTouchEvent): >+ * UIProcess/API/efl/EwkView.h: >+ (EwkView): >+ * UIProcess/efl/ViewClientEfl.cpp: >+ (WebKit::ViewClientEfl::doneWithTouchEvent): >+ (WebKit): >+ (WebKit::ViewClientEfl::ViewClientEfl): >+ * UIProcess/efl/ViewClientEfl.h: >+ (ViewClientEfl): >+ * UIProcess/efl/WebView.cpp: >+ (WebKit::WebView::doneWithTouchEvent): >+ * UIProcess/efl/WebViewClient.cpp: >+ (WebKit): >+ (WebKit::WebViewClient::doneWithTouchEvent): >+ * UIProcess/efl/WebViewClient.h: >+ (WebKit): >+ >+2013-03-18 Eunmi Lee <eunmi15.lee@samsung.com> >+ > [EFL][WK2] Add WK2 C API to handle touch events. > https://bugs.webkit.org/show_bug.cgi?id=108915 > >diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h b/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h >index 351a19ffe527c1258d5d3add0995066d0c8619de..bf9d1d7a4c3ad38e77231b2b91f34c1bd4905d10 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; > } > >+inline WKEventType toAPI(WebEvent::Type type) >+{ >+ switch (type) { >+#if ENABLE(TOUCH_EVENTS) >+ case WebEvent::TouchStart: >+ return kWKEventTypeTouchStart; >+ case WebEvent::TouchMove: >+ return kWKEventTypeTouchMove; >+ case WebEvent::TouchEnd: >+ return kWKEventTypeTouchEnd; >+ case WebEvent::TouchCancel: >+ return kWKEventTypeTouchCancel; >+#endif >+ default: >+ return kWKEventTypeNoType; >+ } >+} >+ >+#if ENABLE(TOUCH_EVENTS) >+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: >+ default: >+ 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/C/efl/WKView.h b/Source/WebKit2/UIProcess/API/C/efl/WKView.h >index 6f9ed0ce03acc60605f264e16241af9a274018f5..2d1c0041fcd0e49f099925bc9d900dc8d8d7d67d 100644 >--- a/Source/WebKit2/UIProcess/API/C/efl/WKView.h >+++ b/Source/WebKit2/UIProcess/API/C/efl/WKView.h >@@ -22,8 +22,13 @@ > #define WKView_h > > #include <WebKit2/WKBase.h> >+#include <WebKit2/WKEventEfl.h> > #include <WebKit2/WKGeometry.h> > >+#ifndef __cplusplus >+#include <stdbool.h> >+#endif >+ > #if USE(EO) > typedef struct _Eo Evas; > typedef struct _Eo Evas_Object; >@@ -42,6 +47,7 @@ typedef void (*WKViewCallback)(WKViewRef view, const void* clientInfo); > typedef void (*WKViewViewNeedsDisplayCallback)(WKViewRef view, WKRect area, const void* clientInfo); > typedef void (*WKViewPageDidChangeContentsSizeCallback)(WKViewRef view, WKSize size, const void* clientInfo); > typedef void (*WKViewWebProcessCrashedCallback)(WKViewRef view, WKURLRef url, const void* clientInfo); >+typedef void (*WKViewDoneWithTouchEventCallback)(WKViewRef view, WKTouchEventRef touchEvent, bool wasEventHandled, const void* clientInfo); > > struct WKViewClient { > int version; >@@ -52,6 +58,7 @@ struct WKViewClient { > WKViewPageDidChangeContentsSizeCallback didChangeContentsSize; > WKViewWebProcessCrashedCallback webProcessCrashed; > WKViewCallback webProcessDidRelaunch; >+ WKViewDoneWithTouchEventCallback doneWithTouchEvent; > }; > typedef struct WKViewClient WKViewClient; > >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >index 1e643ee1a119eedd660599d3c21101b8bb89a132..a99afadfd4327c58a53e6884d1785356cd782e3e 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >@@ -69,6 +69,7 @@ > #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> >@@ -792,6 +793,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 > > bool EwkView::createGLSurface() >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.h b/Source/WebKit2/UIProcess/API/efl/EwkView.h >index af79f5854ecc6ffa4f1c708bdb5759a73a70f23a..21e0af83ad479585934b542a4eea689d24c0a19c 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.h >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.h >@@ -154,6 +154,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/efl/ViewClientEfl.cpp b/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >index d9ebb32cf563717706e0bd6f37136e24d9b00ac9..c2529457bd06f888848ccaef0c062a3a258b1513 100644 >--- a/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >+++ b/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >@@ -87,6 +87,17 @@ void ViewClientEfl::webProcessDidRelaunch(WKViewRef viewRef, const void* clientI > WKViewSetThemePath(viewRef, adoptWK(WKStringCreateWithUTF8CString(themePath)).get()); > } > >+void ViewClientEfl::doneWithTouchEvent(WKViewRef, WKTouchEventRef event, bool wasEventHandled, const void* clientInfo) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ toEwkView(clientInfo)->doneWithTouchEvent(event, wasEventHandled); >+#else >+ UNUSED_PARAM(event); >+ UNUSED_PARAM(wasEventHandled); >+ UNUSED_PARAM(clientInfo); >+#endif >+} >+ > ViewClientEfl::ViewClientEfl(EwkView* view) > : m_view(view) > { >@@ -97,6 +108,7 @@ ViewClientEfl::ViewClientEfl(EwkView* view) > viewClient.version = kWKViewClientCurrentVersion; > viewClient.clientInfo = this; > viewClient.didChangeContentsSize = didChangeContentsSize; >+ viewClient.doneWithTouchEvent = doneWithTouchEvent; > viewClient.viewNeedsDisplay = viewNeedsDisplay; > viewClient.webProcessCrashed = webProcessCrashed; > viewClient.webProcessDidRelaunch = webProcessDidRelaunch; >diff --git a/Source/WebKit2/UIProcess/efl/ViewClientEfl.h b/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >index 6baaf09ba32bc5cfc6ae16f54eabb3393dd26705..36742ab26e1a123d903156298d654b7fc6df3ecb 100644 >--- a/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >+++ b/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >@@ -51,6 +51,7 @@ private: > static void didChangeContentsSize(WKViewRef, WKSize, const void* clientInfo); > static void webProcessCrashed(WKViewRef, WKURLRef, const void* clientInfo); > static void webProcessDidRelaunch(WKViewRef, const void* clientInfo); >+ static void doneWithTouchEvent(WKViewRef, WKTouchEventRef, bool, const void* clientInfo); > > EwkView* m_view; > }; >diff --git a/Source/WebKit2/UIProcess/efl/WebView.cpp b/Source/WebKit2/UIProcess/efl/WebView.cpp >index a1784158c4bc52024ade004d58736813d3e770e5..648de6f4db2874dfd8055b66221e1ca123bf48da 100644 >--- a/Source/WebKit2/UIProcess/efl/WebView.cpp >+++ b/Source/WebKit2/UIProcess/efl/WebView.cpp >@@ -365,9 +365,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/efl/WebViewClient.cpp b/Source/WebKit2/UIProcess/efl/WebViewClient.cpp >index ffca09325e460b7bcd2f7749bf442ac7f4006c9a..a56e2faba98e01b916ef30da2737b02e0027f2fb 100644 >--- a/Source/WebKit2/UIProcess/efl/WebViewClient.cpp >+++ b/Source/WebKit2/UIProcess/efl/WebViewClient.cpp >@@ -29,6 +29,10 @@ > #include "WKAPICast.h" > #include "WKRetainPtr.h" > >+#if ENABLE(TOUCH_EVENTS) >+#include "NativeWebTouchEvent.h" >+#endif >+ > using namespace WebCore; > > namespace WebKit { >@@ -65,4 +69,14 @@ void WebViewClient::webProcessDidRelaunch(WebView* view) > m_client.webProcessDidRelaunch(toAPI(view), m_client.clientInfo); > } > >+#if ENABLE(TOUCH_EVENTS) >+void WebViewClient::doneWithTouchEvent(WebView* view, const NativeWebTouchEvent& event, bool wasEventHandled) >+{ >+ if (!m_client.doneWithTouchEvent) >+ return; >+ >+ m_client.doneWithTouchEvent(toAPI(view), toAPI(const_cast<EwkTouchEvent*>(event.nativeEvent())), wasEventHandled, m_client.clientInfo); >+} >+#endif >+ > } // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/efl/WebViewClient.h b/Source/WebKit2/UIProcess/efl/WebViewClient.h >index 10cf92daecd8e685291bfdec3319756a79eefbe1..fdd417326db2703f7676826fe17b65a2e3888353 100644 >--- a/Source/WebKit2/UIProcess/efl/WebViewClient.h >+++ b/Source/WebKit2/UIProcess/efl/WebViewClient.h >@@ -39,12 +39,19 @@ namespace WebKit { > > class WebView; > >+#if ENABLE(TOUCH_EVENTS) >+class NativeWebTouchEvent; >+#endif >+ > class WebViewClient: public APIClient<WKViewClient, kWKViewClientCurrentVersion> { > public: > void viewNeedsDisplay(WebView*, const WebCore::IntRect&); > void didChangeContentsSize(WebView*, const WebCore::IntSize&); > void webProcessCrashed(WebView*, const String& url); > void webProcessDidRelaunch(WebView*); >+#if ENABLE(TOUCH_EVENTS) >+ void doneWithTouchEvent(WebView*, const NativeWebTouchEvent&, bool); >+#endif > }; > > } // namespace WebKit
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