From: minkyu kim Date: Wed, 27 Mar 2013 01:24:04 +0000 (+0900) Subject: modify preview event, drag/drop, add evas touch log X-Git-Tag: accepted/tizen_2.1/20130425.033138~695^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=955bfdf3dcb314496d77c762c5707c54789e2711;p=platform%2Fframework%2Fnative%2Fuifw.git modify preview event, drag/drop, add evas touch log Change-Id: Ic9d365cc7bd20b6e73cb4701359253c016f8bae4 --- diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index 8fc1cfa..56d6ea9 100644 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -3687,7 +3687,6 @@ _Control::_Control(void) , __focusable(true) , __nativeObjectFocusable(true) , __enabledState(true) - , __inputLockRefCount(0) , __visibleState(true) , __initVisibleState(false) , __clipToParent(true) @@ -3736,6 +3735,7 @@ _Control::_Control(void) , __pPreviousFocus(null) , __pNextFocus(null) , __pFocusVisualElement(null) + , __inputLockRefCount(0) { ClearLastResult(); diff --git a/src/ui/FUi_ControlImpl.cpp b/src/ui/FUi_ControlImpl.cpp index 147b1e3..b9dc937 100755 --- a/src/ui/FUi_ControlImpl.cpp +++ b/src/ui/FUi_ControlImpl.cpp @@ -1349,25 +1349,25 @@ public: Control& control = static_cast(pControlImpl->GetPublic()); - TouchEventInfo publicTouchInfo; + TouchEventInfo publicTouchInfo; - _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); SysTryReturn(NID_UI, pEventArg, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - publicTouchInfo.Construct(*pEventArg); + publicTouchInfo.Construct(*pEventArg); - if (pEventArg) - { - delete pEventArg; - pEventArg = null; - } + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } isFiltered = __impl.__pPublicPropagatedTouchEventListener->OnTouchPressed(control, publicTouchInfo); - if (isFiltered) - { - return true; - } + if (isFiltered) + { + return true; } + } return __impl.CallOnTouchPressed(source, touchInfo); } @@ -1499,22 +1499,22 @@ public: } if (__impl.__pPublicPropagatedTouchEventListener->OnPreviewTouchPressed(control, publicTouchInfo) == true) - { - return _UI_TOUCH_EVENT_DELIVERY_YES; - } + { + return _UI_TOUCH_EVENT_DELIVERY_NO; } + } // 3. Impl isFiltered = __impl.OnPreviewTouchPressed(__impl, touchInfo); - if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_YES) + if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_NO) { - return _UI_TOUCH_EVENT_DELIVERY_YES; + return _UI_TOUCH_EVENT_DELIVERY_NO; } // 4. Core isFiltered = __core.OnPreviewTouchPressed(source, touchInfo); - return _UI_TOUCH_EVENT_DELIVERY_NO; + return isFiltered; } virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchInfo) @@ -1528,36 +1528,36 @@ public: Control& control = static_cast(pControlImpl->GetPublic()); - TouchEventInfo publicTouchInfo; + TouchEventInfo publicTouchInfo; - _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); - SysTryReturn(NID_UI, pEventArg, _UI_TOUCH_EVENT_DELIVERY_YES, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, _UI_TOUCH_EVENT_DELIVERY_YES, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - publicTouchInfo.Construct(*pEventArg); + publicTouchInfo.Construct(*pEventArg); - if (pEventArg) - { - delete pEventArg; - pEventArg = null; - } + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } if (__impl.__pPublicPropagatedTouchEventListener->OnPreviewTouchReleased(control, publicTouchInfo) == true) - { - return _UI_TOUCH_EVENT_DELIVERY_YES; - } + { + return _UI_TOUCH_EVENT_DELIVERY_NO; } + } // 3. Impl isFiltered = __impl.OnPreviewTouchReleased(__impl, touchInfo); - if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_YES) + if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_NO) { - return _UI_TOUCH_EVENT_DELIVERY_YES; + return _UI_TOUCH_EVENT_DELIVERY_NO; } // 4. Core isFiltered = __core.OnPreviewTouchReleased(source, touchInfo); - return _UI_TOUCH_EVENT_DELIVERY_NO; + return isFiltered; } virtual _UiTouchEventDelivery OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchInfo) @@ -1571,41 +1571,41 @@ public: Control& control = static_cast(pControlImpl->GetPublic()); - TouchEventInfo publicTouchInfo; + TouchEventInfo publicTouchInfo; - _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); - SysTryReturn(NID_UI, pEventArg, _UI_TOUCH_EVENT_DELIVERY_YES, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, _UI_TOUCH_EVENT_DELIVERY_YES, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - publicTouchInfo.Construct(*pEventArg); + publicTouchInfo.Construct(*pEventArg); - if (pEventArg) - { - delete pEventArg; - pEventArg = null; - } + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } if (__impl.__pPublicPropagatedTouchEventListener->OnPreviewTouchMoved(control, publicTouchInfo) == true) - { - return _UI_TOUCH_EVENT_DELIVERY_YES; - } + { + return _UI_TOUCH_EVENT_DELIVERY_NO; } + } // 3. Impl isFiltered = __impl.OnPreviewTouchMoved(__impl, touchInfo); - if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_YES) + if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_NO) { - return _UI_TOUCH_EVENT_DELIVERY_YES; + return _UI_TOUCH_EVENT_DELIVERY_NO; } // 4. Core isFiltered = __core.OnPreviewTouchMoved(source, touchInfo); - return _UI_TOUCH_EVENT_DELIVERY_NO; + return isFiltered; } virtual _UiTouchEventDelivery OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) { - return _UI_TOUCH_EVENT_DELIVERY_NO; + return _UI_TOUCH_EVENT_DELIVERY_YES; } virtual void OnTouchPressHandled(const _Control& source) @@ -1810,15 +1810,15 @@ public: Control& control = static_cast(pControlImpl->GetPublic()); - KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), - static_cast(keyInfo.GetKeyModifier())); + KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), + static_cast(keyInfo.GetKeyModifier())); isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyPressed(control, *pKeyEventInfo); - if (isFiltered) - { - return true; - } + if (isFiltered) + { + return true; } + } // 3. Impl isFiltered = __impl.OnPreviewKeyPressed(__impl, keyInfo); @@ -1844,15 +1844,15 @@ public: Control& control = static_cast(pControlImpl->GetPublic()); - KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), - static_cast(keyInfo.GetKeyModifier())); + KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), + static_cast(keyInfo.GetKeyModifier())); isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyReleased(control, *pKeyEventInfo); - if (isFiltered) - { - return true; - } + if (isFiltered) + { + return true; } + } // 3. Impl isFiltered = __impl.OnPreviewKeyReleased(__impl, keyInfo); @@ -2792,16 +2792,16 @@ _ControlImpl::CallOnTouchReleased(const _Control& source, const _TouchInfo& touc { return true; } - - __pCoreTouchEvent->ProcessDropListener(touchinfo); } + __pCoreTouchEvent->ProcessDropListener(touchinfo); + _TouchManager* __pTouchManager = _TouchManager::GetInstance(); SysTryReturn(NID_UI, __pTouchManager, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] __pTouchManager == null."); if (!__pTouchManager->IsTouchAllowed()) { - return true; + return true; } // 3. Impl @@ -2842,6 +2842,8 @@ _ControlImpl::CallOnTouchMoved(const _Control& source, const _TouchInfo& touchin { return true; } + + __pCoreTouchEvent->ProcessDragListener(touchinfo); } _TouchManager* __pTouchManager = _TouchManager::GetInstance(); @@ -2952,25 +2954,25 @@ _ControlImpl::OnTouchMoved(const _ControlImpl& source, const _TouchInfo& touchin _UiTouchEventDelivery _ControlImpl::OnPreviewTouchPressed(const _ControlImpl& source, const _TouchInfo& touchInfo) { - return _UI_TOUCH_EVENT_DELIVERY_NO; + return _UI_TOUCH_EVENT_DELIVERY_YES; } _UiTouchEventDelivery _ControlImpl::OnPreviewTouchReleased(const _ControlImpl& source, const _TouchInfo& touchInfo) { - return _UI_TOUCH_EVENT_DELIVERY_NO; + return _UI_TOUCH_EVENT_DELIVERY_YES; } _UiTouchEventDelivery _ControlImpl::OnPreviewTouchMoved(const _ControlImpl& source, const _TouchInfo& touchInfo) { - return _UI_TOUCH_EVENT_DELIVERY_NO; + return _UI_TOUCH_EVENT_DELIVERY_YES; } _UiTouchEventDelivery _ControlImpl::OnPreviewTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchInfo) { - return _UI_TOUCH_EVENT_DELIVERY_NO; + return _UI_TOUCH_EVENT_DELIVERY_YES; } bool diff --git a/src/ui/FUi_EflUiEventManager.cpp b/src/ui/FUi_EflUiEventManager.cpp index 0332129..a29da72 100644 --- a/src/ui/FUi_EflUiEventManager.cpp +++ b/src/ui/FUi_EflUiEventManager.cpp @@ -848,7 +848,7 @@ OnTouchReleased(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) result r = GetLastResult(); if (r!= E_SUCCESS) { - SysLogException(NID_UI, E_SUCCESS, "ResetTouchInfo"); + SysLog(NID_UI, "ResetTouchInfo [%s] Propagating.", GetErrorMessage(r)); pTouchManager->SetTouchAllowed(false); pTouchManager->ResetTouchInfo(); @@ -1064,6 +1064,7 @@ OnEvasTouchPressed(void* pData, Evas* pEvas, Evas_Object* pEvasObject, void* pEv _Control* pControl = static_cast<_Control*>(pData); SysTryReturnVoidResult(NID_UI, pControl, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysLog(NID_UI, "OnEvasTouchPressed - x(%d), y(%d)", pEv->canvas.x, pEv->canvas.y); _TouchEvent event(0, _TOUCH_PRESSED, pEv->canvas.x, pEv->canvas.y, pEv->timestamp, pControl); result r = GetLastResult(); @@ -1087,6 +1088,7 @@ OnEvasTouchReleased(void* pData, Evas* pEvas, Evas_Object* pEvasObject, void* pE _Control* pControl = static_cast<_Control*>(pData); SysTryReturnVoidResult(NID_UI, pControl, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysLog(NID_UI, "OnEvasTouchReleased - x(%d), y(%d)", pEv->canvas.x, pEv->canvas.y); _TouchEvent event(0, _TOUCH_RELEASED, pEv->canvas.x, pEv->canvas.y, pEv->timestamp, pControl); result r = GetLastResult(); @@ -1110,6 +1112,7 @@ OnEvasTouchMoved(void* pData, Evas* pEvas, Evas_Object* pEvasObject, void* pEven _Control* pControl = static_cast<_Control*>(pData); SysTryReturnVoidResult(NID_UI, pControl, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysLog(NID_UI, "OnEvasTouchMoved - x(%d), y(%d)", pEv->cur.canvas.x, pEv->cur.canvas.x); _TouchEvent event(0, _TOUCH_MOVED, pEv->cur.canvas.x, pEv->cur.canvas.y, pEv->timestamp, pControl); result r = GetLastResult(); diff --git a/src/ui/FUi_UiKeyEvent.cpp b/src/ui/FUi_UiKeyEvent.cpp index 85ad689..b11693c 100644 --- a/src/ui/FUi_UiKeyEvent.cpp +++ b/src/ui/FUi_UiKeyEvent.cpp @@ -217,7 +217,7 @@ _UiKeyEvent::OnPreviewEventProcessing(const _Control& control, bool& isFiltered) { result r = E_SUCCESS; - _IKeyEventPreviewer* pKeyEventPreviewer = control.GetEventPreviewer<_UI_EVENT_KEY, _IKeyEventPreviewer*>(); + _IKeyEventPreviewer* pKeyEventPreviewer = control.GetPropagatedKeyEventListener(); SysTryReturn(NID_UI, pKeyEventPreviewer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); const _Control* pTarget = GetControl(GetDestination()); diff --git a/src/ui/FUi_UiTouchEvent.cpp b/src/ui/FUi_UiTouchEvent.cpp index c1621ab..37862c3 100644 --- a/src/ui/FUi_UiTouchEvent.cpp +++ b/src/ui/FUi_UiTouchEvent.cpp @@ -227,7 +227,7 @@ _UiTouchEvent::OnPreviewEventProcessing(const _Control& control, bool& isFiltere if ((!ExistGlobalGesture() || GetAccessibilityEvent()) && !isFiltered) { - _ITouchEventPreviewer* pTouchEventPreviewer = control.GetEventPreviewer<_UI_EVENT_TOUCH, _ITouchEventPreviewer*>(); + _ITouchEventPreviewer* pTouchEventPreviewer = control.GetPropagatedTouchEventListener(); SysTryReturn(NID_UI, pTouchEventPreviewer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); r = FirePreviewListener(pTouchEventPreviewer, &control, isFiltered); diff --git a/src/ui/inc/FUi_Control.h b/src/ui/inc/FUi_Control.h index 92c7818..32aefe9 100644 --- a/src/ui/inc/FUi_Control.h +++ b/src/ui/inc/FUi_Control.h @@ -118,6 +118,7 @@ public: class _IPropagatedTouchEventListener : public _ITouchEventListener + , public _ITouchEventPreviewer { public: virtual ~_IPropagatedTouchEventListener(void){} @@ -126,19 +127,24 @@ public: virtual void OnTouchReleaseHandled(const _Control& control) = 0; virtual void OnTouchMoveHandled(const _Control& control) = 0; virtual void OnTouchCancelHandled(const _Control& control) = 0; + virtual _UiTouchEventDelivery OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo) = 0; + virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo) = 0; + virtual _UiTouchEventDelivery OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo) = 0; + virtual _UiTouchEventDelivery OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) = 0; }; class _IPropagatedKeyEventListener : public _IKeyEventListener + , public _IKeyEventPreviewer { public: virtual ~_IPropagatedKeyEventListener(void){} + virtual bool OnPreviewKeyPressed(const _Control& source, const _KeyInfo& keyInfo) = 0; + virtual bool OnPreviewKeyReleased(const _Control& source, const _KeyInfo& keyInfo) = 0; }; class _OSP_EXPORT_ _Control // Temp: export only for test : public _IControlDelegate - , public _ITouchEventPreviewer - , public _IKeyEventPreviewer , public _IFocusEventListener , public _INotificationEventPreviewer , public _INotificationEventListener