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-102643-20121206151837.patch (text/plain), 13.42 KB, created by
Eunmi Lee
on 2012-12-05 22:21:13 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eunmi Lee
Created:
2012-12-05 22:21:13 PST
Size:
13.42 KB
patch
obsolete
>Subversion Revision: 136793 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index ec792554be1ca2b130330705b5e0234c7d333b02..b63b70c5c73b9db69fa870a4a5cf14d250a91847 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,37 @@ >+2012-12-05 Eunmi Lee <eunmi15.lee@samsung.com> >+ >+ [EFL][WK2] Add smart class APIs for gesture. >+ https://bugs.webkit.org/show_bug.cgi?id=102643 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add initial codes to process gestures in the WebKit2 EFL. >+ Applications can request processing gestures by calling smart class APIs. >+ >+ * PlatformEfl.cmake: >+ * UIProcess/API/efl/EwkViewImpl.cpp: >+ (EwkViewImpl::EwkViewImpl): >+ * UIProcess/API/efl/EwkViewImpl.h: >+ (WebKit): >+ (EwkViewImpl): >+ (EwkViewImpl::gestureHandler): >+ * UIProcess/API/efl/GestureHandler.cpp: Added. >+ (WebKit): >+ (WebKit::GestureHandler::GestureHandler): >+ (WebKit::GestureHandler::start): >+ (WebKit::GestureHandler::end): >+ (WebKit::GestureHandler::move): >+ * UIProcess/API/efl/GestureHandler.h: Added. >+ (WebKit): >+ (GestureHandler): >+ (WebKit::GestureHandler::create): >+ * UIProcess/API/efl/ewk_view.cpp: >+ (_ewk_view_smart_gesture_start): >+ (_ewk_view_smart_gesture_end): >+ (_ewk_view_smart_gesture_move): >+ (ewk_view_smart_class_set): >+ * UIProcess/API/efl/ewk_view.h: >+ > 2012-12-05 Brent Fulgham <bfulgham@webkit.org> > > [Windows, WinCairo] Regenerate .def files on changes >diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake >index 56019b6f9a3c86bab827980b06befda61a592064..69405bc3bc5c9bdbd4cb2226161fe435251d5f85 100644 >--- a/Source/WebKit2/PlatformEfl.cmake >+++ b/Source/WebKit2/PlatformEfl.cmake >@@ -44,6 +44,7 @@ list(APPEND WebKit2_SOURCES > UIProcess/API/efl/EwkViewImpl.cpp > UIProcess/API/efl/EvasGLContext.cpp > UIProcess/API/efl/EvasGLSurface.cpp >+ UIProcess/API/efl/GestureHandler.cpp > UIProcess/API/efl/SnapshotImageGL.cpp > UIProcess/API/efl/ewk_auth_request.cpp > UIProcess/API/efl/ewk_back_forward_list.cpp >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp b/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp >index 0d5d8997dd749c2f87db1bdb6a1fde65a9e37ac8..a83bb2a1feb2839e055196c781075a18bd572a51 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp >@@ -78,6 +78,10 @@ > #include <Evas_GL.h> > #endif > >+#if USE(TILED_BACKING_STORE) >+#include "GestureHandler.h" >+#endif >+ > using namespace EwkViewCallbacks; > using namespace WebCore; > using namespace WebKit; >@@ -131,6 +135,7 @@ EwkViewImpl::EwkViewImpl(Evas_Object* view, PassRefPtr<EwkContext> context, Pass > #endif > , m_backForwardList(EwkBackForwardList::create(toAPI(m_pageProxy->backForwardList()))) > #if USE(TILED_BACKING_STORE) >+ , m_gestureHandler(GestureHandler::create(this)) > , m_scaleFactor(1) > #endif > , m_settings(EwkSettings::create(this)) >diff --git a/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h b/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h >index a0a928924dd8e8a7d2481054d4571c48aaa023af..1ca9085fcedf9c47a17d4f75d8db407183969392 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h >+++ b/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h >@@ -71,6 +71,10 @@ class VibrationClientEfl; > #if USE(COORDINATED_GRAPHICS) > class LayerTreeRenderer; > #endif >+ >+#if USE(TILED_BACKING_STORE) >+class GestureHandler; >+#endif > } > > namespace WebCore { >@@ -113,6 +117,9 @@ public: > EwkContext* ewkContext() { return m_context.get(); } > EwkSettings* settings() { return m_settings.get(); } > EwkBackForwardList* backForwardList() { return m_backForwardList.get(); } >+#if USE(TILED_BACKING_STORE) >+ WebKit::GestureHandler* gestureHandler() { return m_gestureHandler.get(); } >+#endif > EwkWindowFeatures* windowFeatures(); > > WebCore::IntSize size() const; >@@ -262,6 +269,7 @@ private: > #endif > OwnPtr<EwkBackForwardList> m_backForwardList; > #if USE(TILED_BACKING_STORE) >+ OwnPtr<WebKit::GestureHandler> m_gestureHandler; > float m_scaleFactor; > WebCore::FloatPoint m_pagePosition; > #endif >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureHandler.cpp b/Source/WebKit2/UIProcess/API/efl/GestureHandler.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..f8b9625294b49d64b8589dd7732bef2717419d4a >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureHandler.cpp >@@ -0,0 +1,64 @@ >+/* >+ * Copyright (C) 2012 Samsung Electronics. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "GestureHandler.h" >+ >+#if USE(TILED_BACKING_STORE) >+ >+#include "EwkViewImpl.h" >+#include "ewk_view.h" >+#include <WebCore/NotImplemented.h> >+ >+namespace WebKit { >+ >+GestureHandler::GestureHandler(EwkViewImpl* viewImpl) >+ : m_viewImpl(viewImpl) >+{ >+} >+ >+bool GestureHandler::start(const Ewk_Event_Gesture*) >+{ >+ notImplemented(); >+ >+ return false; >+} >+ >+bool GestureHandler::end(const Ewk_Event_Gesture*) >+{ >+ notImplemented(); >+ >+ return false; >+} >+ >+bool GestureHandler::move(const Ewk_Event_Gesture*) >+{ >+ notImplemented(); >+ >+ return false; >+} >+ >+} // namespace WebKit >+#endif // USE(TILED_BACKING_STORE) >diff --git a/Source/WebKit2/UIProcess/API/efl/GestureHandler.h b/Source/WebKit2/UIProcess/API/efl/GestureHandler.h >new file mode 100644 >index 0000000000000000000000000000000000000000..288abf624ec6c72f3e0d8e811fc2415464b73582 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/GestureHandler.h >@@ -0,0 +1,60 @@ >+/* >+ * Copyright (C) 2012 Samsung Electronics. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef GestureHandler_h >+#define GestureHandler_h >+ >+#if USE(TILED_BACKING_STORE) >+ >+#include <wtf/PassOwnPtr.h> >+ >+class EwkViewImpl; >+ >+typedef struct _Ewk_Event_Gesture Ewk_Event_Gesture; >+ >+namespace WebKit { >+ >+class GestureHandler { >+public: >+ static PassOwnPtr<GestureHandler> create(EwkViewImpl* viewImpl) >+ { >+ return adoptPtr(new GestureHandler(viewImpl)); >+ } >+ >+ bool start(const Ewk_Event_Gesture*); >+ bool end(const Ewk_Event_Gesture*); >+ bool move(const Ewk_Event_Gesture*); >+ >+private: >+ explicit GestureHandler(EwkViewImpl*); >+ >+ EwkViewImpl* m_viewImpl; >+}; >+ >+} // namespace WebKit >+ >+#endif // USE(TILED_BACKING_STORE) >+ >+#endif // GestureHandler_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp >index 46c3fb3a1fea3bf72947a694390baaa3a09af1ff..db8c43083ae2e0cfcc50ad0e4fac4cf2c70a4875 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp >@@ -59,6 +59,7 @@ > #endif > > #if USE(TILED_BACKING_STORE) >+#include "GestureHandler.h" > #include "PageViewportController.h" > #include "PageViewportControllerClientEfl.h" > #endif >@@ -227,6 +228,45 @@ static Eina_Bool _ewk_view_smart_key_up(Ewk_View_Smart_Data* smartData, const Ev > return true; > } > >+static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, const Ewk_Event_Gesture* event) >+{ >+#if USE(TILED_BACKING_STORE) >+ EWK_VIEW_IMPL_GET_BY_SD_OR_RETURN(smartData, impl, false); >+ >+ return impl->gestureHandler()->start(event); >+#else >+ UNUSED_PARAM(smartData); >+ UNUSED_PARAM(event); >+ return false; >+#endif >+} >+ >+static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, const Ewk_Event_Gesture* event) >+{ >+#if USE(TILED_BACKING_STORE) >+ EWK_VIEW_IMPL_GET_BY_SD_OR_RETURN(smartData, impl, false); >+ >+ return impl->gestureHandler()->end(event); >+#else >+ UNUSED_PARAM(smartData); >+ UNUSED_PARAM(event); >+ return false; >+#endif >+} >+ >+static Eina_Bool _ewk_view_smart_gesture_move(Ewk_View_Smart_Data* smartData, const Ewk_Event_Gesture* event) >+{ >+#if USE(TILED_BACKING_STORE) >+ EWK_VIEW_IMPL_GET_BY_SD_OR_RETURN(smartData, impl, false); >+ >+ return impl->gestureHandler()->move(event); >+#else >+ UNUSED_PARAM(smartData); >+ UNUSED_PARAM(event); >+ return false; >+#endif >+} >+ > // Event Handling. > static void _ewk_view_on_focus_in(void* data, Evas*, Evas_Object*, void* /*eventInfo*/) > { >@@ -474,6 +514,9 @@ Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class* api) > api->mouse_move = _ewk_view_smart_mouse_move; > api->key_down = _ewk_view_smart_key_down; > api->key_up = _ewk_view_smart_key_up; >+ api->gesture_start = _ewk_view_smart_gesture_start; >+ api->gesture_end = _ewk_view_smart_gesture_end; >+ api->gesture_move = _ewk_view_smart_gesture_move; > > return true; > } >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h >index 5322d7cead315ad495a33c4ae650d36b825cd9c3..ff3231650b15df8a81f4e1e340ad20ccf9c7df8b 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h >@@ -107,6 +107,28 @@ typedef enum { > EWK_TEXT_DIRECTION_LEFT_TO_RIGHT > } Ewk_Text_Direction; > >+/// Represents types of gesture. >+typedef enum { >+ EWK_GESTURE_TAP, >+ EWK_GESTURE_LONG_PRESS, >+ EWK_GESTURE_PAN, >+ EWK_GESTURE_FLICK, >+ EWK_GESTURE_PINCH >+} Ewk_Gesture_Type; >+ >+/// Creates a type name for _Ewk_Event_Gesture. >+typedef struct _Ewk_Event_Gesture Ewk_Event_Gesture; >+ >+/// Represents a gesture event. >+struct _Ewk_Event_Gesture { >+ Ewk_Gesture_Type type; /**< type of the gesture event */ >+ Evas_Coord_Point position; /**< position of the gesture event */ >+ Evas_Point velocity; /**< velocity of the gesture event. The unit is pixel per second. */ >+ double scale; /**< scale of the gesture event */ >+ int count; /**< count of the gesture */ >+ unsigned timestamp; /**< timestamp of the gesture */ >+}; >+ > typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data; > typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class; > >@@ -156,6 +178,12 @@ struct Ewk_View_Smart_Class { > // - Create a new window with specified features and close window. > Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, const Ewk_Window_Features *window_features); > void (*window_close)(Ewk_View_Smart_Data *sd); >+ >+ // gesture handling: >+ // - Process gestures which are defined as Ewk_Event_Gesture. >+ Eina_Bool (*gesture_start)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev); >+ Eina_Bool (*gesture_end)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev); >+ Eina_Bool (*gesture_move)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev); > }; > > /** >@@ -174,7 +202,7 @@ struct Ewk_View_Smart_Class { > * @see EWK_VIEW_SMART_CLASS_INIT_VERSION > * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION > */ >-#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} >+#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} > > /** > * Initializer to zero a whole Ewk_View_Smart_Class structure.
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 102643
:
175595
|
175740
|
177938
|
182520
|
182537
|
182722
|
183716
|
184174
|
189001
|
191401
|
193276
|
193753
|
206052
|
207367
|
207443
|
207509
|
207547
|
207619
|
207650
|
207683
|
207714
|
207717
|
207722
|
207732
|
207909
|
208000