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-20130304193404.patch (text/plain), 12.76 KB, created by
Eunmi Lee
on 2013-03-04 02:37:57 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eunmi Lee
Created:
2013-03-04 02:37:57 PST
Size:
12.76 KB
patch
obsolete
>Subversion Revision: 144260 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 539163f884147ef441eb16ebb71d0fdc7cdf7ac2..db21765fcfb1e01b9bbdd3a81c1a0dab6b5afd7a 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,39 @@ >+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 >+ >+ 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. >+ >+ * UIProcess/API/C/efl/WKAPICastEfl.h: >+ (WebKit::toAPI): >+ (WebKit): >+ * UIProcess/API/C/efl/WKEventEfl.cpp: >+ (WKTouchEventGetValue): >+ * 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-02-28 Eunmi Lee <eunmi15.lee@samsung.com> > > [EFL][WK2] Add WK2 C API to handle touch events. >diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h b/Source/WebKit2/UIProcess/API/C/efl/WKAPICastEfl.h >index 4a814f3d02df656d327b62790aefdd0b654b0fcc..a946771c35db65bdeafe2743ac69a3a987c423af 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; >@@ -58,6 +63,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 6114217f455ce28dfda2cdfec1b963548f575435..1803ac1a50b023817c89b24ca186d61f894bfd9c 100644 >--- a/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.cpp >+++ b/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.cpp >@@ -106,3 +106,37 @@ WKTouchEventRef WKTouchEventCreate(WKTouchEvent* event) > return 0; > #endif > } >+ >+WKTouchEvent WKTouchEventGetValue(WKTouchEventRef event) >+{ >+#if ENABLE(TOUCH_EVENTS) >+ WKTouchEvent wkTouchEvent; >+ if (!event) >+ return wkTouchEvent; >+ >+ WebTouchEvent* webTouchEvent = toImpl(event); >+ wkTouchEvent.type = toAPI(webTouchEvent->eventType()); >+ wkTouchEvent.modifiers = toAPI(webTouchEvent->modifiers()); >+ wkTouchEvent.timestamp = webTouchEvent->timestamp(); >+ Vector<WebPlatformTouchPoint> touchPoints = webTouchEvent->touchPoints(); >+ wkTouchEvent.numTouchPoints = touchPoints.size(); >+ if (wkTouchEvent.numTouchPoints > kWKMaximumTouchPointsPerTouchEvent) >+ wkTouchEvent.numTouchPoints = kWKMaximumTouchPointsPerTouchEvent; >+ >+ for (unsigned i = 0; i < wkTouchEvent.numTouchPoints; ++i) { >+ const WebPlatformTouchPoint& point = touchPoints[i]; >+ wkTouchEvent.touchPoints[i].id = point.id(); >+ wkTouchEvent.touchPoints[i].state = toAPI(point.state()); >+ wkTouchEvent.touchPoints[i].position = toAPI(point.position()); >+ wkTouchEvent.touchPoints[i].screenPosition = toAPI(point.screenPosition()); >+ wkTouchEvent.touchPoints[i].radius = toAPI(point.radius()); >+ wkTouchEvent.touchPoints[i].rotationAngle = point.rotationAngle(); >+ wkTouchEvent.touchPoints[i].force = point.force(); >+ } >+ >+ return wkTouchEvent; >+#else >+ UNUSED_PARAM(event); >+ return 0; >+#endif >+} >diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h b/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h >index e943f54385dbc2e637b31d6c51c5fd673a1018af..557f82b771ba947a1b8261412d218a1ad8a0ea87 100644 >--- a/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h >+++ b/Source/WebKit2/UIProcess/API/C/efl/WKEventEfl.h >@@ -75,6 +75,7 @@ struct WKTouchEvent { > typedef struct WKTouchEvent WKTouchEvent; > > WK_EXPORT WKTouchEventRef WKTouchEventCreate(WKTouchEvent* event); >+WK_EXPORT WKTouchEvent WKTouchEventGetValue(WKTouchEventRef event); > > #ifdef __cplusplus > } >diff --git a/Source/WebKit2/UIProcess/API/C/efl/WKView.h b/Source/WebKit2/UIProcess/API/C/efl/WKView.h >index f230f84544474bbd3b18d338ff20ee6fe0fe03c0..a7e4d055106512890d8e4d0181eae3df0e5e442c 100644 >--- a/Source/WebKit2/UIProcess/API/C/efl/WKView.h >+++ b/Source/WebKit2/UIProcess/API/C/efl/WKView.h >@@ -22,6 +22,7 @@ > #define WKView_h > > #include <WebKit2/WKBase.h> >+#include <WebKit2/WKEventEfl.h> > #include <WebKit2/WKGeometry.h> > > #if USE(EO) >@@ -40,6 +41,7 @@ extern "C" { > > typedef void (*WKViewViewNeedsDisplayCallback)(WKViewRef view, WKRect area, const void* clientInfo); > typedef void (*WKViewPageDidChangeContentsSizeCallback)(WKViewRef view, WKSize size, const void* clientInfo); >+typedef void (*WKViewDoneWithTouchEventCallback)(WKViewRef view, WKTouchEventRef touchEvent, bool wasEventHandled, const void* clientInfo); > > struct WKViewClient { > int version; >@@ -48,6 +50,7 @@ struct WKViewClient { > // Version 0 > WKViewViewNeedsDisplayCallback viewNeedsDisplay; > WKViewPageDidChangeContentsSizeCallback didChangeContentsSize; >+ 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 c2a52bba127c4500c08ad2c7ea1f5e35edb80ddb..61d17be3d4cef6c6728a98cd1bc89d972e5860c6 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp >@@ -68,6 +68,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> >@@ -727,6 +728,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 4ab8add1c355f7d3f5f349832892946b4779994f..6a4199e32dffa1075beff52df53cb41e7ffc903f 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkView.h >+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.h >@@ -46,6 +46,7 @@ > > #if ENABLE(TOUCH_EVENTS) > #include "ewk_touch.h" >+#include <WebKit2/WKEventEfl.h> > #endif > > #include "WebContext.h" >@@ -152,6 +153,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 77f8bf38f32b0c11333ddd6bba5acb3403177dba..e1ac99f7117014b37473a304a47182d1daf6b029 100644 >--- a/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >+++ b/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp >@@ -50,6 +50,17 @@ void ViewClientEfl::didChangeContentsSize(WKViewRef, WKSize size, const void* cl > ewkView->smartCallback<ContentsSizeChanged>().call(size); > } > >+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) > { >@@ -60,6 +71,7 @@ ViewClientEfl::ViewClientEfl(EwkView* view) > viewClient.version = kWKViewClientCurrentVersion; > viewClient.clientInfo = this; > viewClient.didChangeContentsSize = didChangeContentsSize; >+ viewClient.doneWithTouchEvent = doneWithTouchEvent; > viewClient.viewNeedsDisplay = viewNeedsDisplay; > > WKViewSetViewClient(m_view->wkView(), &viewClient); >diff --git a/Source/WebKit2/UIProcess/efl/ViewClientEfl.h b/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >index 2ebd3a2966ef3c8a2cd731a761c77ab6391f1b97..1de74894a4daa64107a5abb125fd63fe2a7ecdec 100644 >--- a/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >+++ b/Source/WebKit2/UIProcess/efl/ViewClientEfl.h >@@ -49,6 +49,7 @@ private: > static EwkView* toEwkView(const void* clientInfo); > static void viewNeedsDisplay(WKViewRef, WKRect area, const void* clientInfo); > static void didChangeContentsSize(WKViewRef, WKSize, 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 c2626f86b38b00d9ae5fec59498910a12908bba9..2e7c7d6964e6ed78f1fa93fc3745cd3d58f73f91 100644 >--- a/Source/WebKit2/UIProcess/efl/WebView.cpp >+++ b/Source/WebKit2/UIProcess/efl/WebView.cpp >@@ -386,9 +386,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 05fc80cf4de0eae54658d2390d26508f3b4c029f..f9f1602f67277c526a6fe235599f5280a5fe8ffa 100644 >--- a/Source/WebKit2/UIProcess/efl/WebViewClient.cpp >+++ b/Source/WebKit2/UIProcess/efl/WebViewClient.cpp >@@ -48,4 +48,14 @@ void WebViewClient::didChangeContentsSize(WebView* view, const IntSize& size) > m_client.didChangeContentsSize(toAPI(view), toAPI(size), m_client.clientInfo); > } > >+#if ENABLE(TOUCH_EVENTS) >+void WebViewClient::doneWithTouchEvent(WebView* view, const WebTouchEvent* event, bool wasEventHandled) >+{ >+ if (!m_client.doneWithTouchEvent) >+ return; >+ >+ m_client.doneWithTouchEvent(toAPI(view), toAPI(const_cast<WebTouchEvent*>(event)), wasEventHandled, m_client.clientInfo); >+} >+#endif >+ > } // namespace WebKit >diff --git a/Source/WebKit2/UIProcess/efl/WebViewClient.h b/Source/WebKit2/UIProcess/efl/WebViewClient.h >index d5e82dd001ffa33461241477522e8128cad548fc..a2733b769bf82bade6020ac9ec04d8de8a6e5e01 100644 >--- a/Source/WebKit2/UIProcess/efl/WebViewClient.h >+++ b/Source/WebKit2/UIProcess/efl/WebViewClient.h >@@ -38,10 +38,17 @@ namespace WebKit { > > class WebView; > >+#if ENABLE(TOUCH_EVENTS) >+class WebTouchEvent; >+#endif >+ > class WebViewClient: public APIClient<WKViewClient, kWKViewClientCurrentVersion> { > public: > void viewNeedsDisplay(WebView*, const WebCore::IntRect&); > void didChangeContentsSize(WebView*, const WebCore::IntSize&); >+#if ENABLE(TOUCH_EVENTS) >+ void doneWithTouchEvent(WebView*, const WebTouchEvent*, 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