From: Seongjun Yim Date: Fri, 12 Jul 2013 07:55:55 +0000 (+0900) Subject: fix logic for OnWebPageBlockSelected() X-Git-Tag: submit/tizen_2.2/20130714.153306~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a25a45ece74a16a687447db5aff31f33264f200;p=framework%2Fosp%2Fweb.git fix logic for OnWebPageBlockSelected() Change-Id: I34ab9aac631325640973ea844a3ff8a3fd8c2a3d Signed-off-by: Seongjun Yim --- diff --git a/src/controls/FWebCtrl_GestureState.cpp b/src/controls/FWebCtrl_GestureState.cpp old mode 100644 new mode 100755 index 7b43683..c17df52 --- a/src/controls/FWebCtrl_GestureState.cpp +++ b/src/controls/FWebCtrl_GestureState.cpp @@ -31,12 +31,14 @@ #include #include "FWebCtrl_GestureState.h" #include "FWebCtrl_Web.h" +#include "FWebCtrl_WebImpl.h" #include "FWebCtrl_WebSettingImpl.h" using namespace Tizen::Base; using namespace Tizen::Graphics; using namespace Tizen::Ui; +using namespace Tizen::Web::Controls; namespace Tizen { namespace Web { namespace Controls @@ -74,18 +76,40 @@ _TapGestureState::_TapGestureState(_Web* pWeb) _TapGestureState::~_TapGestureState(void) { } - + bool _TapGestureState::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - + //To disable focus ring Ewk_Event_Gesture gestureEvent; SetGestureEvent(gestureEvent, EWK_GESTURE_LONG_PRESS, Point(0, 0), Point(0, 0), 0.0, 0); - pSmartData->api->gesture_move(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_move(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); + + //To delete magnifier + _TouchManager* pTouchManager = _TouchManager::GetInstance(); + SysAssertf(pTouchManager, "Failed to get touch manager."); + + Point absPoint(_CoordinateSystemUtils::ConvertToInteger(pTouchManager->GetPosition(pTouchManager->GetCurrentPointId()))); + + Ewk_Touch_Point* pPoint = static_cast< Ewk_Touch_Point* >(calloc(1, sizeof(Ewk_Touch_Point))); + pPoint->id = 0; + pPoint->x = absPoint.x; + pPoint->y = absPoint.y; + pPoint->state = EVAS_TOUCH_POINT_UP; + + Eina_List* pPointList = null; + pPointList = eina_list_append(pPointList, pPoint); + + ewk_view_feed_touch_event(__pWebCore->GetWebNativeNode(), EWK_TOUCH_END, pPointList, null); + + void* pData = null; + EINA_LIST_FREE(pPointList, pData) + free(pData); __longPressed = true; @@ -105,16 +129,15 @@ _TapGestureState::OnTapGestureDetected(_TouchTapGestureDetector& gesture) bool _TapGestureState::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - + Ewk_Event_Gesture gestureEvent; __pressedPosition = touchInfo.GetCurrentPosition(); Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(__pressedPosition))); - Ewk_Event_Gesture gestureEvent; - SetGestureEvent(gestureEvent, EWK_GESTURE_TAP, absPoint, Point(0, 0), 0.0, 1); - pSmartData->api->gesture_start(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = static_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_start(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); __longPressed = false; __doubleTapped = false; @@ -126,15 +149,14 @@ _TapGestureState::OnTouchPressed(const _Control& source, const _TouchInfo& touch bool _TapGestureState::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - Ewk_Event_Gesture gestureEvent; - Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition()))); SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0.0, 0); - pSmartData->api->gesture_start(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_start(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); __pWebCore->ChangeGesture(WEB_GESTURE_TYPE_PANNING); @@ -145,18 +167,14 @@ _TapGestureState::OnTouchMoved(const _Control& source, const _TouchInfo& touchIn bool _TapGestureState::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - - Ewk_Event_Gesture gestureEvent; - if (__pWebCore->Contains(__pressedPosition)) { + Evas_Object* pView = __pWebCore->GetWebNativeNode(); Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(__pressedPosition))); if (__longPressed) { - Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(__pWebCore->GetWebNativeNode(), absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL); + Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(pView, absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL); SysTryReturn(NID_WEB_CTRL, pEwkHitTest, true, E_SYSTEM, "Failed to get hit test."); String tagName(ewk_hit_test_tag_name_get(pEwkHitTest)); @@ -168,23 +186,39 @@ _TapGestureState::OnTouchReleased(const _Control& source, const _TouchInfo& touc Eina_Rectangle leftHandle; Eina_Rectangle rightHandle; - ewk_view_text_selection_range_get(__pWebCore->GetWebNativeNode(), &leftHandle, &rightHandle); + ewk_view_text_selection_range_get(pView, &leftHandle, &rightHandle); if (((rightHandle.x + rightHandle.w) == 0) && ((rightHandle.y + rightHandle.h) == 0)) { + Ewk_Event_Gesture gestureEvent; + SetGestureEvent(gestureEvent, EWK_GESTURE_LONG_PRESS, absPoint, Point(0, 0), 0.0, 1); - pSmartData->api->gesture_end(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_end(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); } } } - else if (__doubleTapped) + else { - SetGestureEvent(gestureEvent, EWK_GESTURE_TAP, absPoint, Point(0, 0), 0.0, 2); - pSmartData->api->gesture_end(const_cast(pSmartData), &gestureEvent); + Ewk_Event_Gesture gestureEvent; + int touchCount = 1; + if (__doubleTapped) + { + touchCount = 2; + } + + SetGestureEvent(gestureEvent, EWK_GESTURE_TAP, absPoint, Point(0, 0), 0.0, touchCount); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_end(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); } - else + + String selectedText(ewk_view_text_selection_text_get(pView)); + if (selectedText.GetLength() > 0) { - SetGestureEvent(gestureEvent, EWK_GESTURE_TAP, absPoint, Point(0, 0), 0.0, 1); - pSmartData->api->gesture_end(const_cast(pSmartData), &gestureEvent); + evas_object_smart_callback_call(pView, "text,selected", NULL); } } else @@ -199,13 +233,13 @@ _TapGestureState::OnTouchReleased(const _Control& source, const _TouchInfo& touc bool _TapGestureState::OnTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - Ewk_Event_Gesture gestureEvent; SetGestureEvent(gestureEvent, EWK_GESTURE_LONG_PRESS, Point(0, 0), Point(0, 0), 0.0, 0); - pSmartData->api->gesture_move(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_move(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); return true; } @@ -213,6 +247,9 @@ _TapGestureState::OnTouchCanceled(const _Control& source, const _TouchInfo& touc _PanningGestureState::_PanningGestureState(_Web* pWeb) : __pWebCore(pWeb) + , __textSelected(false) + , __textChanged(false) + , __selectedText(L"") { } @@ -222,6 +259,22 @@ _PanningGestureState::~_PanningGestureState(void) } +void +_PanningGestureState::InitializeTextSelectionStatus(void) +{ + __selectedText = String(ewk_view_text_selection_text_get(__pWebCore->GetWebNativeNode())); + if (__selectedText.GetLength() > 0) + { + __textSelected = true; + } + else + { + __textSelected = false; + } + __textChanged = false; +} + + bool _PanningGestureState::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { @@ -232,17 +285,25 @@ _PanningGestureState::OnTouchPressed(const _Control& source, const _TouchInfo& t bool _PanningGestureState::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo) { + Evas_Object* pView = __pWebCore->GetWebNativeNode(); if (_WebSettingImpl::GetInstance(__pWebCore->GetSetting())->IsScrollEnabled()) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - Ewk_Event_Gesture gestureEvent; - Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition()))); SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0.0, 0); - pSmartData->api->gesture_move(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(pView)); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_move(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); + } + + if (__textSelected && !__textChanged) + { + if (!__selectedText.Equals(String(ewk_view_text_selection_text_get(pView)))) + { + __textChanged = true; + } } return true; @@ -252,15 +313,20 @@ _PanningGestureState::OnTouchMoved(const _Control& source, const _TouchInfo& tou bool _PanningGestureState::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - Ewk_Event_Gesture gestureEvent; - Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition()))); SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0.0, 0); - pSmartData->api->gesture_end(const_cast(pSmartData), &gestureEvent); + + Evas_Object* pView = __pWebCore->GetWebNativeNode(); + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(pView)); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_end(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); + + if (__textChanged) + { + evas_object_smart_callback_call(pView, "text,selected", NULL); + } __pWebCore->ChangeGesture(WEB_GESTURE_TYPE_TAP); @@ -319,18 +385,18 @@ _FlickGestureState::OnTouchMoved(const _Control& source, const _TouchInfo& touch bool _FlickGestureState::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - Ewk_Event_Gesture gestureEvent; - Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition()))); SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0.0, 0); - pSmartData->api->gesture_end(const_cast(pSmartData), &gestureEvent); - SetGestureEvent(gestureEvent, EWK_GESTURE_FLICK, absPoint, __velocity, 0, 0); - pSmartData->api->gesture_start(const_cast(pSmartData), &gestureEvent); + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_end(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); + + SetGestureEvent(gestureEvent, EWK_GESTURE_FLICK, absPoint, __velocity, 0.0, 0); + + pSmartData->api->gesture_start(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); __pWebCore->ChangeGesture(WEB_GESTURE_TYPE_TAP); @@ -362,16 +428,15 @@ _PinchGestureState::OnPinchGestureStarted(_TouchPinchGestureDetector& gesture) { __pWebCore->ChangeGesture(WEB_GESTURE_TYPE_PINCH); - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - + Ewk_Event_Gesture gestureEvent; Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(gesture.GetCenterPointF()))); __standardScale = static_cast< double >(gesture.GetScaleF()); - Ewk_Event_Gesture gestureEvent; - SetGestureEvent(gestureEvent, EWK_GESTURE_PINCH, absPoint, Point(0, 0), 1.0, 0); - pSmartData->api->gesture_start(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_start(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); return true; } @@ -380,16 +445,15 @@ _PinchGestureState::OnPinchGestureStarted(_TouchPinchGestureDetector& gesture) bool _PinchGestureState::OnPinchGestureChanged(_TouchPinchGestureDetector& gesture) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - + Ewk_Event_Gesture gestureEvent; Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(gesture.GetCenterPointF()))); double relScale = static_cast< double >(gesture.GetScaleF()) /__standardScale; - Ewk_Event_Gesture gestureEvent; - SetGestureEvent(gestureEvent, EWK_GESTURE_PINCH, absPoint, Point(0, 0), relScale, 0); - pSmartData->api->gesture_move(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_move(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); return true; } @@ -398,12 +462,12 @@ _PinchGestureState::OnPinchGestureChanged(_TouchPinchGestureDetector& gesture) bool _PinchGestureState::OnPinchGestureFinished(_TouchPinchGestureDetector& gesture) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - Ewk_Event_Gesture gestureEvent; SetGestureEvent(gestureEvent, EWK_GESTURE_PINCH, Point(0, 0), Point(0, 0), 0.0, 0); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); pSmartData->api->gesture_end(const_cast(pSmartData), &gestureEvent); return true; @@ -429,7 +493,6 @@ _PinchGestureState::OnTouchReleased(const _Control& source, const _TouchInfo& to { _TouchManager* pTouchManager = _TouchManager::GetInstance(); SysAssertf(pTouchManager, "Failed to get touch manager."); - if(pTouchManager->GetPointCount() == 0) { __pWebCore->ChangeGesture(WEB_GESTURE_TYPE_TAP); @@ -442,13 +505,13 @@ _PinchGestureState::OnTouchReleased(const _Control& source, const _TouchInfo& to bool _PinchGestureState::OnTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) { - const Ewk_View_Smart_Data* pSmartData = static_cast(evas_object_smart_data_get( __pWebCore->GetWebNativeNode())); - SysAssertf(pSmartData, "Failed to get webkit smart data."); - Ewk_Event_Gesture gestureEvent; SetGestureEvent(gestureEvent, EWK_GESTURE_PINCH, Point(0, 0), Point(0, 0), 0.0, 0); - pSmartData->api->gesture_end(const_cast(pSmartData), &gestureEvent); + + const Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(__pWebCore->GetWebNativeNode())); + SysAssertf(pSmartData, "Failed to get webkit smart data."); + pSmartData->api->gesture_end(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent); __pWebCore->ChangeGesture(WEB_GESTURE_TYPE_TAP); diff --git a/src/controls/FWebCtrl_GestureState.h b/src/controls/FWebCtrl_GestureState.h old mode 100644 new mode 100755 index 9c77f24..0758025 --- a/src/controls/FWebCtrl_GestureState.h +++ b/src/controls/FWebCtrl_GestureState.h @@ -85,6 +85,8 @@ public: virtual ~_PanningGestureState(void); + void InitializeTextSelectionStatus(void); + virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); @@ -95,6 +97,12 @@ public: private: _Web* __pWebCore; + + bool __textSelected; + + bool __textChanged; + + Tizen::Base::String __selectedText; }; class _FlickGestureState diff --git a/src/controls/FWebCtrl_Web.cpp b/src/controls/FWebCtrl_Web.cpp index f92d336..74782d2 100755 --- a/src/controls/FWebCtrl_Web.cpp +++ b/src/controls/FWebCtrl_Web.cpp @@ -49,7 +49,6 @@ #include "FWebCtrl_EflWebkit.h" #include "FWebCtrl_GestureState.h" #include "FWebCtrl_Web.h" -#include "FWebCtrl_WebImpl.h" #include "FWebCtrl_WebSettingImpl.h" #include "FWebCtrl_Utility.h" @@ -286,9 +285,6 @@ namespace Tizen { namespace Web { namespace Controls { -static const char WEB_CTRL[] = "webcontrol"; - - void OnEdgeLeft(void* pUserData, Evas_Object* pView, void* pEventInfo) { @@ -717,6 +713,11 @@ _Web::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo) { if (__pEflWebkit.get()) { + if (__gestureType == WEB_GESTURE_TYPE_TAP) + { + __pPanningGestureHandler->InitializeTextSelectionStatus(); + } + SendTouchEventForJavaScript(touchInfo); __pGestureHandler->OnTouchMoved(source, touchInfo); @@ -803,14 +804,6 @@ _Web::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { SendTouchEventForJavaScript(touchInfo); - Evas_Object* pView = GetWebNativeNode(); - _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(evas_object_data_get(pView, WEB_CTRL)); - - if (pImpl && pImpl->GetTextFromBlock().GetLength() > 0) - { - evas_object_smart_callback_call(pView, "text,selected", NULL); - } - return __pGestureHandler->OnTouchReleased(source, touchInfo); } @@ -1050,26 +1043,10 @@ _Web::OnCaptureAcquire(BufferInfo& output) void -_Web::DumpPointList(void* pData) -{ - Eina_List* pList = reinterpret_cast< Eina_List* >(pData); - - for(; pList; pList = eina_list_next(pList)) - { - Ewk_Touch_Point* pPointDump = static_cast(eina_list_data_get(pList)); - SysSecureLog(NID_WEB_CTRL, "The current value of id is %lu, x is %d, y is %d, state is %d", pPointDump->id, pPointDump->x, pPointDump->y, pPointDump->state); - } -} - - -void _Web::SendTouchEventForJavaScript(const _TouchInfo& touchInfo) { result r = E_SUCCESS; - Eina_List* pPointList = null; - Ewk_Touch_Point* pPoint = null; - _TouchManager* pTouchManager = _TouchManager::GetInstance(); SysAssertf(pTouchManager, "Failed to get touch manager."); @@ -1079,7 +1056,7 @@ _Web::SendTouchEventForJavaScript(const _TouchInfo& touchInfo) std::unique_ptr > pTouchListEnum(pTouchList->GetBidirectionalEnumeratorN()); SysAssertf(pTouchListEnum.get() != null, "Failed to get enumerator of touch list."); - FloatPoint currentPoint; + Eina_List* pPointList = null; _FingerInfo* pFingerInfo = null; while(pTouchListEnum->MoveNext() == E_SUCCESS) { @@ -1089,26 +1066,22 @@ _Web::SendTouchEventForJavaScript(const _TouchInfo& touchInfo) _TouchStatus state = pFingerInfo->GetStatus(); if(state == _TOUCH_PRESSED || state == _TOUCH_MOVED || state == _TOUCH_RELEASED || state == _TOUCH_CANCELED) { - currentPoint = GetAbsoluteCoordinate(pFingerInfo->GetPoint()); - Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(currentPoint)); - - pPoint = static_cast(calloc(1, sizeof(Ewk_Touch_Point))); + Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(GetAbsoluteCoordinate(pFingerInfo->GetPoint()))); + Ewk_Touch_Point* pPoint = static_cast(calloc(1, sizeof(Ewk_Touch_Point))); pPoint->id = pFingerInfo->GetPointId(); pPoint->x = integerPoint.x; pPoint->y = integerPoint.y; pPoint->state = GetEvasTouchState((TouchStatus)pFingerInfo->GetStatus()); + SysSecureLog(NID_WEB_CTRL, "The current value of id is %lu, x is %d, y is %d, state is %d", pPoint->id, pPoint->x, pPoint->y, pPoint->state); pPointList = eina_list_append(pPointList, pPoint); } } - DumpPointList(pPointList); - Eina_Bool ret = ewk_view_feed_touch_event(__pEflWebkit->GetWebEvasObject(), GetEwkTouchEvent(touchInfo.GetTouchStatus()), pPointList, null); - SysTryReturnVoidResult(NID_WEB_CTRL, ret == EINA_TRUE, E_SYSTEM, "[%s] A system error has been occurred. Failed to deliver touch event to javascript.", GetErrorMessage(E_SYSTEM)); + ewk_view_feed_touch_event(__pEflWebkit->GetWebEvasObject(), GetEwkTouchEvent(touchInfo.GetTouchStatus()), pPointList, null); void* pData = null; - EINA_LIST_FREE(pPointList, pData) free(pData); } diff --git a/src/controls/FWebCtrl_Web.h b/src/controls/FWebCtrl_Web.h index 0c10d30..a1878ae 100755 --- a/src/controls/FWebCtrl_Web.h +++ b/src/controls/FWebCtrl_Web.h @@ -164,8 +164,6 @@ private: Ewk_Touch_Event_Type GetEwkTouchEvent(Tizen::Ui::_TouchStatus touchStatus); Evas_Touch_Point_State GetEvasTouchState(Tizen::Ui::TouchStatus touchStatus); - void DumpPointList(void* pData); - private: Tizen::Ui::_ITouchEventListener* __pGestureHandler;