Changeset 128853 in webkit
- Timestamp:
- Sep 17, 2012 11:45:09 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r128851 r128853 1 2012-09-17 Eunmi Lee <eunmi15.lee@samsung.com> 2 3 [EFL][WK2] Add NativeWebTouchEvent and handle the Touch event. 4 https://bugs.webkit.org/show_bug.cgi?id=90662 5 6 Reviewed by Gyuyoung Kim. 7 8 Implement codes to handle touch event for WebKit2 EFL port. 9 Additionally, types and structure for touch event are defined because 10 they are not in the Evas. 11 12 * PlatformEfl.cmake: 13 * Shared/NativeWebTouchEvent.h: 14 (NativeWebTouchEvent): 15 * Shared/efl/NativeWebTouchEventEfl.cpp: Added. 16 (WebKit): 17 (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): 18 * Shared/efl/WebEventFactory.cpp: 19 (WebKit): 20 (WebKit::typeForTouchEvent): 21 (WebKit::WebEventFactory::createWebTouchEvent): 22 * Shared/efl/WebEventFactory.h: 23 (WebEventFactory): 24 * UIProcess/API/efl/ewk_touch.h: Added. 25 1 26 2012-09-17 Csaba Osztrogonác <ossy@webkit.org> 2 27 -
trunk/Source/WebKit2/PlatformEfl.cmake
r128610 r128853 18 18 Shared/efl/NativeWebWheelEventEfl.cpp 19 19 Shared/efl/NativeWebMouseEventEfl.cpp 20 Shared/efl/NativeWebTouchEventEfl.cpp 20 21 Shared/efl/ProcessExecutablePathEfl.cpp 21 22 Shared/efl/WebEventFactory.cpp -
trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h
r104450 r128853 31 31 #if PLATFORM(QT) 32 32 #include <QTouchEvent> 33 #elif PLATFORM(EFL) 34 #include "ewk_touch.h" 35 #include <Evas.h> 33 36 #endif 34 37 … … 39 42 #if PLATFORM(QT) 40 43 explicit NativeWebTouchEvent(const QTouchEvent*, const QTransform& fromItemTransform); 44 #elif PLATFORM(EFL) 45 NativeWebTouchEvent(Ewk_Touch_Event_Type, const Eina_List*, const Evas_Modifier*, const Evas_Point*, double timestamp); 41 46 #endif 42 47 -
trunk/Source/WebKit2/Shared/efl/NativeWebTouchEventEfl.cpp
r128852 r128853 1 1 /* 2 * Copyright (C) 201 1 Benjamin Poulain <benjamin@webkit.org>2 * Copyright (C) 2012 Samsung Electronics 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #i fndef NativeWebTouchEvent_h27 # define NativeWebTouchEvent_h26 #include "config.h" 27 #include "NativeWebTouchEvent.h" 28 28 29 #include "WebEvent .h"29 #include "WebEventFactory.h" 30 30 31 #if PLATFORM(QT) 32 #include <QTouchEvent> 33 #endif 31 #if ENABLE(TOUCH_EVENTS) 34 32 35 33 namespace WebKit { 36 34 37 class NativeWebTouchEvent : public WebTouchEvent { 38 public: 39 #if PLATFORM(QT) 40 explicit NativeWebTouchEvent(const QTouchEvent*, const QTransform& fromItemTransform); 41 #endif 42 43 #if PLATFORM(QT) 44 const QTouchEvent* nativeEvent() const { return &m_nativeEvent; } 45 #endif 46 47 private: 48 #if PLATFORM(QT) 49 const QTouchEvent m_nativeEvent; 50 #endif 51 }; 35 NativeWebTouchEvent::NativeWebTouchEvent(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers, const Evas_Point* position, double timestamp) 36 : WebTouchEvent(WebEventFactory::createWebTouchEvent(type, points, modifiers, position, timestamp)) 37 { 38 } 52 39 53 40 } // namespace WebKit 54 41 55 #endif // NativeWebTouchEvent_h42 #endif -
trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp
r123860 r128853 193 193 } 194 194 195 #if ENABLE(TOUCH_EVENTS) 196 static inline WebEvent::Type typeForTouchEvent(Ewk_Touch_Event_Type type) 197 { 198 if (type == EWK_TOUCH_START) 199 return WebEvent::TouchStart; 200 if (type == EWK_TOUCH_MOVE) 201 return WebEvent::TouchMove; 202 if (type == EWK_TOUCH_END) 203 return WebEvent::TouchEnd; 204 if (type == EWK_TOUCH_CANCEL) 205 return WebEvent::TouchCancel; 206 207 return WebEvent::NoType; 208 } 209 210 WebTouchEvent WebEventFactory::createWebTouchEvent(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers, const Evas_Point* position, double timestamp) 211 { 212 Vector<WebPlatformTouchPoint> touchPoints; 213 WebPlatformTouchPoint::TouchPointState state; 214 const Eina_List* list; 215 void* item; 216 EINA_LIST_FOREACH(points, list, item) { 217 Ewk_Touch_Point* point = static_cast<Ewk_Touch_Point*>(item); 218 219 switch (point->state) { 220 case EVAS_TOUCH_POINT_UP: 221 state = WebPlatformTouchPoint::TouchReleased; 222 break; 223 case EVAS_TOUCH_POINT_MOVE: 224 state = WebPlatformTouchPoint::TouchMoved; 225 break; 226 case EVAS_TOUCH_POINT_DOWN: 227 state = WebPlatformTouchPoint::TouchPressed; 228 break; 229 case EVAS_TOUCH_POINT_STILL: 230 state = WebPlatformTouchPoint::TouchStationary; 231 break; 232 case EVAS_TOUCH_POINT_CANCEL: 233 state = WebPlatformTouchPoint::TouchCancelled; 234 break; 235 default: 236 ASSERT_NOT_REACHED(); 237 break; 238 } 239 240 touchPoints.append(WebPlatformTouchPoint(point->id, state, IntPoint(point->x, point->y), IntPoint(point->x - position->x, point->y - position->y))); 241 } 242 243 return WebTouchEvent(typeForTouchEvent(type), touchPoints, modifiersForEvent(modifiers), timestamp); 244 } 245 #endif 246 195 247 } // namespace WebKit -
trunk/Source/WebKit2/Shared/efl/WebEventFactory.h
r89211 r128853 28 28 29 29 #include "WebEvent.h" 30 #include "ewk_touch.h" 30 31 #include <Evas.h> 31 32 … … 40 41 static WebKeyboardEvent createWebKeyboardEvent(const Evas_Event_Key_Down*); 41 42 static WebKeyboardEvent createWebKeyboardEvent(const Evas_Event_Key_Up*); 43 #if ENABLE(TOUCH_EVENTS) 44 static WebTouchEvent createWebTouchEvent(Ewk_Touch_Event_Type, const Eina_List*, const Evas_Modifier*, const Evas_Point*, double timestamp); 45 #endif 42 46 }; 43 47 -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_touch.h
r128852 r128853 1 1 /* 2 * Copyright (C) 201 1 Benjamin Poulain <benjamin@webkit.org>2 * Copyright (C) 2012 Samsung Electronics 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef NativeWebTouchEvent_h27 #define NativeWebTouchEvent_h26 #ifndef ewk_touch_h 27 #define ewk_touch_h 28 28 29 #include "WebEvent.h"29 #include <Evas.h> 30 30 31 #if PLATFORM(QT)32 #include <QTouchEvent> 31 #ifdef __cplusplus 32 extern "C" { 33 33 #endif 34 34 35 namespace WebKit { 35 /// Represents types of touch event. 36 typedef enum { 37 EWK_TOUCH_START, 38 EWK_TOUCH_MOVE, 39 EWK_TOUCH_END, 40 EWK_TOUCH_CANCEL 41 } Ewk_Touch_Event_Type; 36 42 37 class NativeWebTouchEvent : public WebTouchEvent { 38 public: 39 #if PLATFORM(QT) 40 explicit NativeWebTouchEvent(const QTouchEvent*, const QTransform& fromItemTransform); 43 /// Creates a type name for _Ewk_Touch_Point. 44 typedef struct _Ewk_Touch_Point Ewk_Touch_Point; 45 46 /// Represents a touch point. 47 struct _Ewk_Touch_Point { 48 int id; /**< identifier of the touch event */ 49 int x; /**< the horizontal position of the touch event */ 50 int y; /**< the vertical position of the touch event */ 51 Evas_Touch_Point_State state; /**< state of the touch event */ 52 }; 53 54 #ifdef __cplusplus 55 } 41 56 #endif 42 57 43 #if PLATFORM(QT) 44 const QTouchEvent* nativeEvent() const { return &m_nativeEvent; } 45 #endif 46 47 private: 48 #if PLATFORM(QT) 49 const QTouchEvent m_nativeEvent; 50 #endif 51 }; 52 53 } // namespace WebKit 54 55 #endif // NativeWebTouchEvent_h 58 #endif // ewk_touch_h
Note: See TracChangeset
for help on using the changeset viewer.