From 7483d4f51e208940c05f691cb3c960c90af74515 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Mon, 15 Apr 2024 14:52:37 +0900 Subject: [PATCH] Reverts the previously implemented FeedTouch. The new Logic FeedTouch is coming soon. Revert "1. Fixes a bug where events do not occur when longPressGestures overlap. This is when using gestures with FeedTouch." This reverts commit b0516efeefaff68139bee29a7317eccd3729adbb. Revert "actorCoordinates were missing from TapGesture when FeedTouch was used" This reverts commit 9e32a10a253c53d66ec41fe915d6d378bf2d8aa4. Revert "Touch and Hover event propagrated by geometry way.(5)" This reverts commit c1ead670ee0d10718449be889b6bdacf98d93a60. Revert "Add FeedTouch api to GestureDetector." This reverts commit 54e52fd9d4556e19b2e97082b057ad886952e55e. Change-Id: Iffe838047df670006ad23f7c5d46eb7f938cd16c --- .../src/dali/utc-Dali-GeoTouchProcessing.cpp | 1 - .../src/dali/utc-Dali-LongPressGestureDetector.cpp | 66 ------ .../src/dali/utc-Dali-PanGestureDetector.cpp | 234 --------------------- .../src/dali/utc-Dali-PinchGestureDetector.cpp | 105 +-------- .../src/dali/utc-Dali-RotationGestureDetector.cpp | 104 +-------- .../src/dali/utc-Dali-TapGestureDetector.cpp | 51 ----- .../event/events/gesture-detector-impl.cpp | 50 +---- .../event/events/gesture-event-processor.cpp | 54 +---- .../event/events/gesture-event-processor.h | 11 - dali/internal/event/events/gesture-event.h | 1 - dali/internal/event/events/gesture-processor.cpp | 54 +---- dali/internal/event/events/gesture-processor.h | 43 ---- dali/internal/event/events/gesture-recognizer.h | 13 +- .../long-press-gesture-processor.cpp | 37 +--- .../long-press-gesture-recognizer.cpp | 1 + .../events/pan-gesture/pan-gesture-processor.cpp | 58 +---- .../pinch-gesture/pinch-gesture-processor.cpp | 23 +- .../rotation-gesture-processor.cpp | 25 +-- .../events/tap-gesture/tap-gesture-processor.cpp | 45 +--- dali/internal/event/events/touch-event-impl.h | 5 - 20 files changed, 40 insertions(+), 941 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp index 0e0793f..4d02050 100644 --- a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp @@ -1816,7 +1816,6 @@ int UtcDaliGeoTouchEventInterruptedDifferentConsumer02(void) END_TEST; } - int UtcDaliGeoTouchEventGetRadius(void) { TestApplication application; diff --git a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp index 54d5556..3ed67dd 100644 --- a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp @@ -19,11 +19,8 @@ #include #include #include -#include #include #include -#include -#include #include #include #include @@ -134,19 +131,6 @@ struct TouchEventFunctor } }; -Integration::TouchEvent GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition, uint32_t time) -{ - Integration::TouchEvent touchEvent; - Integration::Point point; - point.SetState(state); - point.SetDeviceId(4); - point.SetScreenPosition(screenPosition); - point.SetDeviceClass(Device::Class::TOUCH); - point.SetDeviceSubclass(Device::Subclass::NONE); - touchEvent.points.push_back(point); - touchEvent.time = time; - return touchEvent; -} } // namespace /////////////////////////////////////////////////////////////////////////////// @@ -1137,53 +1121,3 @@ int UtcDaliLongPressGestureWhenGesturePropargation(void) END_TEST; } - -int UtcDaliLongPressGestureFeedTouch(void) -{ - TestApplication application; - Integration::Scene scene = application.GetScene(); - RenderTaskList taskList = scene.GetRenderTaskList(); - Dali::RenderTask task = taskList.GetTask(0); - - Actor parentActor = Actor::New(); - parentActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - parentActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - Actor childActor = Actor::New(); - childActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - childActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - parentActor.Add(childActor); - application.GetScene().Add(parentActor); - - // Render and notify - application.SendNotification(); - application.Render(); - - SignalData pData; - GestureReceivedFunctor pFunctor(pData); - - LongPressGestureDetector parentDetector = LongPressGestureDetector::New(); - parentDetector.DetectedSignal().Connect(&application, pFunctor); - - Integration::TouchEvent tp = GenerateSingleTouch(PointState::DOWN, Vector2(50.0f, 50.0f), 100); - Internal::TouchEventPtr touchEventImpl(new Internal::TouchEvent(100)); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - Dali::TouchEvent touchEventHandle(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - TestTriggerLongPress(application); - - tp = GenerateSingleTouch(PointState::UP, Vector2(50.0f, 50.0f), 150); - touchEventImpl = new Internal::TouchEvent(150); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - DALI_TEST_EQUALS(true, pData.functorCalled, TEST_LOCATION); - pData.Reset(); - - END_TEST; -} diff --git a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp index 2d31057..a1d4483 100644 --- a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp @@ -19,12 +19,9 @@ #include #include #include -#include #include #include #include -#include -#include #include #include #include @@ -202,19 +199,6 @@ PanGesture GeneratePan(unsigned int time, return pan; } -Integration::TouchEvent GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition, uint32_t time) -{ - Integration::TouchEvent touchEvent; - Integration::Point point; - point.SetState(state); - point.SetDeviceId(4); - point.SetScreenPosition(screenPosition); - point.SetDeviceClass(Device::Class::TOUCH); - point.SetDeviceSubclass(Device::Subclass::NONE); - touchEvent.points.push_back(point); - touchEvent.time = time; - return touchEvent; -} } // namespace /////////////////////////////////////////////////////////////////////////////// @@ -3058,221 +3042,3 @@ int UtcDaliPanGestureWhenGesturePropargation(void) END_TEST; } - -int UtcDaliPanGestureFeedTouch(void) -{ - TestApplication application; - Integration::Scene scene = application.GetScene(); - RenderTaskList taskList = scene.GetRenderTaskList(); - Dali::RenderTask task = taskList.GetTask(0); - - Actor parentActor = Actor::New(); - parentActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - parentActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - Actor childActor = Actor::New(); - childActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - childActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - parentActor.Add(childActor); - application.GetScene().Add(parentActor); - - // Render and notify - application.SendNotification(); - application.Render(); - - SignalData pData; - GestureReceivedFunctor pFunctor(pData); - - PanGestureDetector parentDetector = PanGestureDetector::New(); - parentDetector.DetectedSignal().Connect(&application, pFunctor); - - - Integration::TouchEvent tp = GenerateSingleTouch(PointState::DOWN, Vector2(50.0f, 50.0f), 100); - Internal::TouchEventPtr touchEventImpl(new Internal::TouchEvent(100)); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - Dali::TouchEvent touchEventHandle(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(70.0f, 70.0f), 150); - touchEventImpl = new Internal::TouchEvent(150); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(90.0f, 90.0f), 200); - touchEventImpl = new Internal::TouchEvent(200); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateSingleTouch(PointState::UP, Vector2(100.0f, 100.0f), 250); - touchEventImpl = new Internal::TouchEvent(250); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - - DALI_TEST_EQUALS(true, pData.functorCalled, TEST_LOCATION); - pData.Reset(); - - END_TEST; -} - -int UtcDaliPanGestureFeedTouchWhenGesturePropargation(void) -{ - TestApplication application; - Integration::Scene scene = application.GetScene(); - RenderTaskList taskList = scene.GetRenderTaskList(); - Dali::RenderTask task = taskList.GetTask(0); - - Actor parentActor = Actor::New(); - parentActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - parentActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - Actor childActor = Actor::New(); - childActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - childActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - parentActor.Add(childActor); - application.GetScene().Add(parentActor); - - // Render and notify - application.SendNotification(); - application.Render(); - - SignalData pData; - GestureReceivedFunctor pFunctor(pData); - - PanGestureDetector parentDetector = PanGestureDetector::New(); - parentDetector.DetectedSignal().Connect(&application, pFunctor); - - SignalData cData; - GestureReceivedFunctor cFunctor(cData); - - PanGestureDetector childDetector = PanGestureDetector::New(); - childDetector.DetectedSignal().Connect(&application, cFunctor); - - // Start gesture within the actor's area, we receive the gesture not parent actor but child actor. - Integration::TouchEvent tp = GenerateSingleTouch(PointState::DOWN, Vector2(50.0f, 50.0f), 100); - Internal::TouchEventPtr touchEventImpl(new Internal::TouchEvent(100)); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - Dali::TouchEvent touchEventHandle(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(60.0f, 60.0f), 150); - touchEventImpl = new Internal::TouchEvent(150); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(70.0f, 70.0f), 200); - touchEventImpl = new Internal::TouchEvent(200); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(80.0f, 80.0f), 250); - touchEventImpl = new Internal::TouchEvent(200); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::UP, Vector2(100.0f, 100.0f), 300); - touchEventImpl = new Internal::TouchEvent(250); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - DALI_TEST_EQUALS(true, cData.functorCalled, TEST_LOCATION); - DALI_TEST_EQUALS(false, pData.functorCalled, TEST_LOCATION); - cData.Reset(); - pData.Reset(); - - // If GesturePropargation is set, a gesture event is to pass over to the parent. - Dali::DevelActor::SetNeedGesturePropagation(childActor, true); - - // So now the parent got the gesture event. - tp = GenerateSingleTouch(PointState::DOWN, Vector2(50.0f, 50.0f), 100); - touchEventImpl = new Internal::TouchEvent(100); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(60.0f, 60.0f), 150); - touchEventImpl = new Internal::TouchEvent(150); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(70.0f, 70.0f), 200); - touchEventImpl = new Internal::TouchEvent(200); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::MOTION, Vector2(80.0f, 80.0f), 250); - touchEventImpl = new Internal::TouchEvent(200); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - tp = GenerateSingleTouch(PointState::UP, Vector2(100.0f, 100.0f), 300); - touchEventImpl = new Internal::TouchEvent(250); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - if(!childDetector.FeedTouch(childActor, touchEventHandle)) - { - parentDetector.FeedTouch(parentActor, touchEventHandle); - } - - DALI_TEST_EQUALS(true, cData.functorCalled, TEST_LOCATION); - DALI_TEST_EQUALS(true, pData.functorCalled, TEST_LOCATION); - cData.Reset(); - pData.Reset(); - - END_TEST; -} \ No newline at end of file diff --git a/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp index 2937a40..2c45979 100644 --- a/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp @@ -18,10 +18,7 @@ #include #include #include -#include #include -#include -#include #include #include #include @@ -116,23 +113,6 @@ struct UnstageActorFunctor : public GestureReceivedFunctor Integration::Scene scene; }; - -Integration::TouchEvent GenerateDoubleTouch(PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time) -{ - Integration::TouchEvent touchEvent; - Integration::Point point; - point.SetState(stateA); - point.SetScreenPosition(screenPositionA); - point.SetDeviceClass(Device::Class::TOUCH); - point.SetDeviceSubclass(Device::Subclass::NONE); - touchEvent.points.push_back(point); - point.SetScreenPosition(screenPositionB); - point.SetState(stateB); - touchEvent.points.push_back(point); - touchEvent.time = time; - return touchEvent; -} - } // namespace /////////////////////////////////////////////////////////////////////////////// @@ -1225,87 +1205,4 @@ int UtcDaliPinchGestureWhenGesturePropargation(void) pData.Reset(); END_TEST; -} - -int UtcDaliPinchGestureFeedTouch(void) -{ - TestApplication application; - Integration::Scene scene = application.GetScene(); - RenderTaskList taskList = scene.GetRenderTaskList(); - Dali::RenderTask task = taskList.GetTask(0); - - Actor parentActor = Actor::New(); - parentActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - parentActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - Actor childActor = Actor::New(); - childActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - childActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - parentActor.Add(childActor); - application.GetScene().Add(parentActor); - - // Render and notify - application.SendNotification(); - application.Render(); - - SignalData pData; - GestureReceivedFunctor pFunctor(pData); - - PinchGestureDetector parentDetector = PinchGestureDetector::New(); - parentDetector.DetectedSignal().Connect(&application, pFunctor); - - Integration::TouchEvent tp = GenerateDoubleTouch(PointState::DOWN, Vector2(2.0f, 20.0f), PointState::DOWN, Vector2(38.0f, 20.0f), 100); - Internal::TouchEventPtr touchEventImpl(new Internal::TouchEvent(100)); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - Dali::TouchEvent touchEventHandle(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 150); - touchEventImpl = new Internal::TouchEvent(150); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 200); - touchEventImpl = new Internal::TouchEvent(200); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 250); - touchEventImpl = new Internal::TouchEvent(250); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 300); - touchEventImpl = new Internal::TouchEvent(300); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::UP, Vector2(10.0f, 20.0f), PointState::UP, Vector2(30.0f, 20.0f), 350); - touchEventImpl = new Internal::TouchEvent(350); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - - DALI_TEST_EQUALS(true, pData.functorCalled, TEST_LOCATION); - pData.Reset(); - - END_TEST; -} +} \ No newline at end of file diff --git a/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp index 6b5b333..8c1d929 100644 --- a/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp @@ -18,10 +18,7 @@ #include #include #include -#include #include -#include -#include #include #include #include @@ -116,21 +113,6 @@ struct UnstageActorFunctor : public GestureReceivedFunctor Integration::Scene scene; }; -Integration::TouchEvent GenerateDoubleTouch(PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time) -{ - Integration::TouchEvent touchEvent; - Integration::Point point; - point.SetState(stateA); - point.SetScreenPosition(screenPositionA); - point.SetDeviceClass(Device::Class::TOUCH); - point.SetDeviceSubclass(Device::Subclass::NONE); - touchEvent.points.push_back(point); - point.SetScreenPosition(screenPositionB); - point.SetState(stateB); - touchEvent.points.push_back(point); - touchEvent.time = time; - return touchEvent; -} } // namespace /////////////////////////////////////////////////////////////////////////////// @@ -1189,88 +1171,4 @@ int UtcDaliRotationGestureWhenGesturePropargation(void) pData.Reset(); END_TEST; -} - - -int UtcDaliRotationGestureFeedTouch(void) -{ - TestApplication application; - Integration::Scene scene = application.GetScene(); - RenderTaskList taskList = scene.GetRenderTaskList(); - Dali::RenderTask task = taskList.GetTask(0); - - Actor parentActor = Actor::New(); - parentActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - parentActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - Actor childActor = Actor::New(); - childActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - childActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - parentActor.Add(childActor); - application.GetScene().Add(parentActor); - - // Render and notify - application.SendNotification(); - application.Render(); - - SignalData pData; - GestureReceivedFunctor pFunctor(pData); - - RotationGestureDetector parentDetector = RotationGestureDetector::New(); - parentDetector.DetectedSignal().Connect(&application, pFunctor); - - Integration::TouchEvent tp = GenerateDoubleTouch(PointState::DOWN, Vector2(2.0f, 20.0f), PointState::DOWN, Vector2(38.0f, 20.0f), 100); - Internal::TouchEventPtr touchEventImpl(new Internal::TouchEvent(100)); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - Dali::TouchEvent touchEventHandle(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 150); - touchEventImpl = new Internal::TouchEvent(150); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 200); - touchEventImpl = new Internal::TouchEvent(200); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 250); - touchEventImpl = new Internal::TouchEvent(250); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::MOTION, Vector2(6.0f, 6.0f), PointState::MOTION, Vector2(18.0f, 18.0f), 300); - touchEventImpl = new Internal::TouchEvent(300); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateDoubleTouch(PointState::UP, Vector2(10.0f, 8.0f), PointState::UP, Vector2(14.0f, 16.0f), 350); - touchEventImpl = new Internal::TouchEvent(350); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->AddPoint(tp.GetPoint(1)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - - DALI_TEST_EQUALS(true, pData.functorCalled, TEST_LOCATION); - pData.Reset(); - - END_TEST; -} +} \ No newline at end of file diff --git a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp index 09f176f..5c15b92 100644 --- a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp @@ -18,10 +18,7 @@ #include #include #include -#include #include -#include -#include #include #include #include @@ -1334,51 +1331,3 @@ int UtcDaliTapGestureDetectorCheck(void) END_TEST; } - -int UtcDaliTapGestureFeedTouch(void) -{ - TestApplication application; - Integration::Scene scene = application.GetScene(); - RenderTaskList taskList = scene.GetRenderTaskList(); - Dali::RenderTask task = taskList.GetTask(0); - - Actor parentActor = Actor::New(); - parentActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - parentActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - Actor childActor = Actor::New(); - childActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); - childActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - - parentActor.Add(childActor); - application.GetScene().Add(parentActor); - - // Render and notify - application.SendNotification(); - application.Render(); - - SignalData pData; - GestureReceivedFunctor pFunctor(pData); - - TapGestureDetector parentDetector = TapGestureDetector::New(); - parentDetector.DetectedSignal().Connect(&application, pFunctor); - - Integration::TouchEvent tp = GenerateSingleTouch(PointState::DOWN, Vector2(50.0f, 50.0f), 1, 100); - Internal::TouchEventPtr touchEventImpl(new Internal::TouchEvent(100)); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - Dali::TouchEvent touchEventHandle(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - tp = GenerateSingleTouch(PointState::UP, Vector2(50.0f, 50.0f), 1, 150); - touchEventImpl = new Internal::TouchEvent(150); - touchEventImpl->AddPoint(tp.GetPoint(0)); - touchEventImpl->SetRenderTask(task); - touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); - parentDetector.FeedTouch(parentActor, touchEventHandle); - - DALI_TEST_EQUALS(true, pData.functorCalled, TEST_LOCATION); - pData.Reset(); - - END_TEST; -} diff --git a/dali/internal/event/events/gesture-detector-impl.cpp b/dali/internal/event/events/gesture-detector-impl.cpp index 12bbbc1..1e98cb7 100644 --- a/dali/internal/event/events/gesture-detector-impl.cpp +++ b/dali/internal/event/events/gesture-detector-impl.cpp @@ -27,8 +27,6 @@ #include #include #include -#include -#include namespace Dali { @@ -262,52 +260,8 @@ Dali::Actor GestureDetector::GetAttachedActor(size_t index) const bool GestureDetector::FeedTouch(Dali::Actor& actor, Dali::TouchEvent& touch) { - bool ret = false; - if(touch.GetPointCount() > 0) - { - const PointState::Type state = touch.GetState(0); - Dali::Internal::Actor& actorImpl(GetImplementation(actor)); - if(state == PointState::DOWN) - { - //TODO We need to find a better way to add detectors to the processor other than detach and attach. - Detach(actorImpl); - Attach(actorImpl); - mIsDetected = false; - } - - Integration::TouchEvent touchEvent(touch.GetTime()); - for(std::size_t i = 0; i< touch.GetPointCount(); i++) - { - Integration::Point point; - point.SetState(touch.GetState(i)); - point.SetDeviceId(touch.GetDeviceId(i)); - point.SetScreenPosition(touch.GetScreenPosition(i)); - point.SetRadius(touch.GetRadius(i)); - point.SetPressure(touch.GetPressure(i)); - point.SetAngle(touch.GetAngle(i)); - point.SetDeviceClass(touch.GetDeviceClass(i)); - point.SetDeviceSubclass(touch.GetDeviceSubclass(i)); - point.SetMouseButton(touch.GetMouseButton(i)); - point.SetHitActor(touch.GetHitActor(i)); - point.SetLocalPosition(touch.GetLocalPosition(i)); - touchEvent.points.push_back(point); - } - - Dali::Internal::TouchEvent& touchEventImpl(GetImplementation(touch)); - mGestureEventProcessor.ProcessTouchEvent(this, actorImpl, GetImplementation(touchEventImpl.GetRenderTaskPtr()), actorImpl.GetScene(), touchEvent); - - if(IsDetected()) - { - ret = !actorImpl.NeedGesturePropagation(); - } - - if(state == PointState::FINISHED || state == PointState::INTERRUPTED || state == PointState::LEAVE) - { - //TODO We need to find a better way to remove detectors to the processor other than detach. - Detach(actorImpl); - } - } - return ret; + //TODO + return false; } bool GestureDetector::IsDetected() const diff --git a/dali/internal/event/events/gesture-event-processor.cpp b/dali/internal/event/events/gesture-event-processor.cpp index 85abccc..1240148 100644 --- a/dali/internal/event/events/gesture-event-processor.cpp +++ b/dali/internal/event/events/gesture-event-processor.cpp @@ -42,8 +42,7 @@ GestureEventProcessor::GestureEventProcessor(SceneGraph::UpdateManager& updateMa mRotationGestureProcessor(), mRenderController(renderController), envOptionMinimumPanDistance(-1), - envOptionMinimumPanEvents(-1), - mIsProcessingFeedTouch(false) + envOptionMinimumPanEvents(-1) { } @@ -51,52 +50,11 @@ GestureEventProcessor::~GestureEventProcessor() = default; void GestureEventProcessor::ProcessTouchEvent(Scene& scene, const Integration::TouchEvent& event) { - if(!mIsProcessingFeedTouch) - { - mLongPressGestureProcessor.ProcessTouch(scene, event); - mPanGestureProcessor.ProcessTouch(scene, event); - mPinchGestureProcessor.ProcessTouch(scene, event); - mTapGestureProcessor.ProcessTouch(scene, event); - mRotationGestureProcessor.ProcessTouch(scene, event); - } - mIsProcessingFeedTouch = false; -} - -void GestureEventProcessor::ProcessTouchEvent(GestureDetector* gestureDetector, Actor& actor, Dali::Internal::RenderTask& renderTask, Scene& scene, const Integration::TouchEvent& event) -{ - mIsProcessingFeedTouch = true; - switch(gestureDetector->GetType()) - { - case GestureType::LONG_PRESS: - { - mLongPressGestureProcessor.ProcessTouch(gestureDetector, actor, renderTask, scene, event); - break; - } - - case GestureType::PAN: - { - mPanGestureProcessor.ProcessTouch(gestureDetector, actor, renderTask, scene, event); - break; - } - - case GestureType::PINCH: - { - mPinchGestureProcessor.ProcessTouch(gestureDetector, actor, renderTask, scene, event); - break; - } - - case GestureType::TAP: - { - mTapGestureProcessor.ProcessTouch(gestureDetector, actor, renderTask, scene, event); - break; - } - - case GestureType::ROTATION: - { - mRotationGestureProcessor.ProcessTouch(gestureDetector, actor, renderTask, scene, event); - break; - } - } + mLongPressGestureProcessor.ProcessTouch(scene, event); + mPanGestureProcessor.ProcessTouch(scene, event); + mPinchGestureProcessor.ProcessTouch(scene, event); + mTapGestureProcessor.ProcessTouch(scene, event); + mRotationGestureProcessor.ProcessTouch(scene, event); } void GestureEventProcessor::AddGestureDetector(GestureDetector* gestureDetector, Scene& scene) diff --git a/dali/internal/event/events/gesture-event-processor.h b/dali/internal/event/events/gesture-event-processor.h index 8f3431f..b54ea9d 100644 --- a/dali/internal/event/events/gesture-event-processor.h +++ b/dali/internal/event/events/gesture-event-processor.h @@ -74,16 +74,6 @@ public: // To be called by EventProcessor */ void ProcessTouchEvent(Scene& scene, const Integration::TouchEvent& event); - /** - * This function is called by gesture detector whenever a touch event occurs - * @param[in] gestureDetector The gesture detector - * @param[in] actor The actor - * @param[in] renderTask The renderTask - * @param[in] scene The scene - * @param[in] event The event that has occurred - */ - void ProcessTouchEvent(GestureDetector* gestureDetector, Actor& actor, Dali::Internal::RenderTask& renderTask, Scene& scene, const Integration::TouchEvent& event); - public: // To be called by gesture detectors /** * This method adds the specified gesture detector to the relevant gesture processor. @@ -345,7 +335,6 @@ private: int32_t envOptionMinimumPanDistance; int32_t envOptionMinimumPanEvents; - bool mIsProcessingFeedTouch; // Whether the gesture is being recognized via FeedTouch in gestureDetector }; } // namespace Internal diff --git a/dali/internal/event/events/gesture-event.h b/dali/internal/event/events/gesture-event.h index 93923c4..d803dcf 100644 --- a/dali/internal/event/events/gesture-event.h +++ b/dali/internal/event/events/gesture-event.h @@ -21,7 +21,6 @@ // INTERNAL INCLUDES #include #include -#include namespace Dali { diff --git a/dali/internal/event/events/gesture-processor.cpp b/dali/internal/event/events/gesture-processor.cpp index 3169495..a2d581c 100644 --- a/dali/internal/event/events/gesture-processor.cpp +++ b/dali/internal/event/events/gesture-processor.cpp @@ -78,10 +78,7 @@ GestureProcessor::GestureProcessor(GestureType::Value type) mCurrentGesturedActor(nullptr), mPoint(), mEventTime(0u), - mGesturedActorDisconnected(false), - mFeededActor(nullptr), - mRenderTask(), - mGestureDetector(nullptr) + mGesturedActorDisconnected(false) { } @@ -99,43 +96,10 @@ void GestureProcessor::ProcessTouch(Scene& scene, const Integration::TouchEvent& mPoint = event.points[0]; mEventTime = event.time; } - mFeededActor = nullptr; - mGestureDetector = nullptr; mGestureRecognizer->SendEvent(scene, event); } } -void GestureProcessor::ProcessTouch(GestureDetector* gestureDetector, Actor& actor, Dali::Internal::RenderTask& renderTask, Scene& scene, const Integration::TouchEvent& event) -{ - if(mGestureRecognizer) - { - if(!event.points.empty()) - { - mPoint = event.points[0]; - mEventTime = event.time; - } - mGestureDetector = gestureDetector; - mFeededActor.SetActor(&actor); - mRenderTask = &renderTask; - mGestureRecognizer->SendEvent(scene, event); - } -} - -Actor* GestureProcessor::GetFeededActor() -{ - return mFeededActor.GetActor(); -} - -GestureDetector* GestureProcessor::GetFeededGestureDetector() -{ - return mGestureDetector; -} - -RenderTaskPtr GestureProcessor::GetFeededRenderTask() -{ - return mRenderTask; -} - void GestureProcessor::GetGesturedActor(Actor*& actor, GestureDetectorContainer& gestureDetectors) { while(actor) @@ -237,22 +201,6 @@ void GestureProcessor::ProcessAndEmit(HitTestAlgorithm::Results& hitTestResults) } } -void GestureProcessor::ProcessAndEmitActor(HitTestAlgorithm::Results& hitTestResults, GestureDetector* gestureDetector) -{ - if(hitTestResults.actor && gestureDetector) - { - Actor* actor(&GetImplementation(hitTestResults.actor)); - GestureDetectorContainer gestureDetectors; - // Check deriving class for whether the current gesture satisfies the gesture detector's parameters. - if(actor && actor->IsVisible() && gestureDetector && CheckGestureDetector(gestureDetector, actor)) - { - gestureDetectors.push_back(gestureDetector); - gestureDetector->SetDetected(true); - EmitGestureSignal(actor, gestureDetectors, hitTestResults.actorCoordinates); - } - } -} - bool GestureProcessor::HitTest(Scene& scene, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults) { GestureHitTestCheck hitCheck(mType); diff --git a/dali/internal/event/events/gesture-processor.h b/dali/internal/event/events/gesture-processor.h index b1874b4..e2015f3 100644 --- a/dali/internal/event/events/gesture-processor.h +++ b/dali/internal/event/events/gesture-processor.h @@ -44,16 +44,6 @@ public: void ProcessTouch(Scene& scene, const Integration::TouchEvent& event); /** - * Process the touch event in the attached recognizer - * @param[in] gestureDetector The gesture detector which gesture want to recognize. - * @param[in] actor The actor which gesture want to recognize. - * @param[in] renderTask RenderTask. - * @param[in] scene Scene. - * @param[in] event Touch event to process - */ - void ProcessTouch(GestureDetector* gestureDetector, Actor& actor, Dali::Internal::RenderTask& renderTask, Scene& scene, const Integration::TouchEvent& event); - - /** * Returns whether any GestureDetector requires a Core::Update * @return true if update required */ @@ -80,24 +70,6 @@ protected: // Methods to be used by deriving classes /** - * @brief Gets the Feeded actor - * @return The actor which gesture want to recognize. - */ - Actor* GetFeededActor(); - - /** - * @brief Gets the Feeded Gesture Detector. - * @return The gesture detector which gesture want to recognize. - */ - GestureDetector* GetFeededGestureDetector(); - - /** - * @brief Get the Feeded Render Task object - * @return RenderTaskPtr - */ - RenderTaskPtr GetFeededRenderTask(); - - /** * Given the hit actor, this walks up the actor tree to determine the actor that is connected to one (or several) gesture detectors. * * @param[in,out] actor The gestured actor. When this function returns, this is the actor that has been hit by the gesture. @@ -120,17 +92,6 @@ protected: void ProcessAndEmit(HitTestAlgorithm::Results& hitTestResults); /** - * Calls the emission method in the deriving class for actor - * - * @param[in] hitTestResults The Hit Test Results. - * - * @note Uses the CheckGestureDetector() to check if the gesture matches the criteria of the given gesture detector - * and EmitGestureSignal() to emit the signal. - * @pre Hit Testing should already be done. - */ - void ProcessAndEmitActor(HitTestAlgorithm::Results& hitTestResults, GestureDetector* gestureDetector); - - /** * Hit test the screen coordinates, and place the results in hitTestResults. * @param[in] scene Scene. * @param[in] screenCoordinates The screen coordinates to test. @@ -228,10 +189,6 @@ private: // Data Integration::Point mPoint; ///< The point of event touched. uint32_t mEventTime; ///< The time the event occurred. bool mGesturedActorDisconnected : 1; ///< Indicates whether the gestured actor has been disconnected from the scene - ActorObserver mFeededActor; ///< The actor used to generate this touch event. - RenderTaskPtr mRenderTask; ///< The render task used to generate this touch event. - GestureDetector* mGestureDetector; ///< The gesture detector which gesture want to recognize. - }; } // namespace Internal diff --git a/dali/internal/event/events/gesture-recognizer.h b/dali/internal/event/events/gesture-recognizer.h index d2c5e93..0bc013d 100644 --- a/dali/internal/event/events/gesture-recognizer.h +++ b/dali/internal/event/events/gesture-recognizer.h @@ -20,14 +20,11 @@ // EXTERNAL INCLUDES #include -#include #include -#include #include #include #include #include -#include namespace Dali { @@ -165,11 +162,11 @@ protected: ~GestureRecognizer() override = default; protected: - Vector2 mScreenSize; - GestureType::Value mType; - Scene* mScene; - GestureSourceType mSourceType; /// < Gesture input source type. - GestureSourceData mSourceData; /// < Gesture input source data. + Vector2 mScreenSize; + GestureType::Value mType; + Scene* mScene; + GestureSourceType mSourceType; /// < Gesture input source type. + GestureSourceData mSourceData; /// < Gesture input source data. }; using GestureRecognizerPtr = IntrusivePtr; diff --git a/dali/internal/event/events/long-press-gesture/long-press-gesture-processor.cpp b/dali/internal/event/events/long-press-gesture/long-press-gesture-processor.cpp index 19b772d..6b680ae 100644 --- a/dali/internal/event/events/long-press-gesture/long-press-gesture-processor.cpp +++ b/dali/internal/event/events/long-press-gesture/long-press-gesture-processor.cpp @@ -135,11 +135,7 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven ResetActor(); HitTestAlgorithm::Results hitTestResults; - if(GetFeededActor()) - { - SetActor(GetFeededActor()); - } - else if(HitTest(scene, longPressEvent.point, hitTestResults)) + if(HitTest(scene, longPressEvent.point, hitTestResults)) { SetActor(&GetImplementation(hitTestResults.actor)); } @@ -148,40 +144,20 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven case GestureState::STARTED: { - if(GetCurrentGesturedActor()) + Actor* currentGesturedActor = GetCurrentGesturedActor(); + if(currentGesturedActor) { HitTestAlgorithm::Results hitTestResults; - Actor* feededActor = GetFeededActor(); - if(feededActor) - { - SetActor(feededActor); - hitTestResults.actor = Dali::Actor(feededActor); - hitTestResults.renderTask = GetFeededRenderTask(); + HitTest(scene, longPressEvent.point, hitTestResults); - Vector2 actorCoords; - feededActor->ScreenToLocal(*hitTestResults.renderTask.Get(), actorCoords.x, actorCoords.y, longPressEvent.point.x, longPressEvent.point.y); - hitTestResults.actorCoordinates = actorCoords; - } - else - { - HitTest(scene, longPressEvent.point, hitTestResults); - } - - if(hitTestResults.actor && (GetCurrentGesturedActor() == &GetImplementation(hitTestResults.actor))) + if(hitTestResults.actor && (currentGesturedActor == &GetImplementation(hitTestResults.actor))) { // Record the current render-task for Screen->Actor coordinate conversions mCurrentRenderTask = hitTestResults.renderTask; // Set mCurrentLongPressEvent to use inside overridden methods called from ProcessAndEmit() mCurrentLongPressEvent = &longPressEvent; - if(feededActor) - { - ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector()); - } - else - { - ProcessAndEmit(hitTestResults); - } + ProcessAndEmit(hitTestResults); mCurrentLongPressEvent = nullptr; } else @@ -200,6 +176,7 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven // Only send subsequent long press gesture signals if we processed the gesture when it started. // Check if actor is still touchable. + Actor* currentGesturedActor = GetCurrentGesturedActor(); if(currentGesturedActor) { diff --git a/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp b/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp index 85d10bb..eac654b 100644 --- a/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp +++ b/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp @@ -66,6 +66,7 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event) unsigned int pointCount(event.GetPointCount()); Dali::Integration::PlatformAbstraction& platformAbstraction = ThreadLocalStorage::Get().GetPlatformAbstraction(); GestureRecognizerPtr ptr(this); // To keep us from being destroyed during the life-time of this method + switch(mState) { // CLEAR: Wait till one point touches the screen before starting timer. diff --git a/dali/internal/event/events/pan-gesture/pan-gesture-processor.cpp b/dali/internal/event/events/pan-gesture/pan-gesture-processor.cpp index a495995..4df4ee7 100644 --- a/dali/internal/event/events/pan-gesture/pan-gesture-processor.cpp +++ b/dali/internal/event/events/pan-gesture/pan-gesture-processor.cpp @@ -163,12 +163,7 @@ void PanGestureProcessor::Process(Scene& scene, const PanGestureEvent& panEvent) ResetActor(); HitTestAlgorithm::Results hitTestResults; - if(GetFeededActor()) - { - SetActor(GetFeededActor()); - mPossiblePanPosition = panEvent.currentPosition; - } - else if(HitTest(scene, panEvent.currentPosition, hitTestResults)) + if(HitTest(scene, panEvent.currentPosition, hitTestResults)) { SetActor(&GetImplementation(hitTestResults.actor)); mPossiblePanPosition = panEvent.currentPosition; @@ -185,19 +180,7 @@ void PanGestureProcessor::Process(Scene& scene, const PanGestureEvent& panEvent) // it can be told when the gesture ends as well. HitTestAlgorithm::Results hitTestResults; - if(GetFeededActor()) - { - hitTestResults.actor = Dali::Actor(GetFeededActor()); - hitTestResults.renderTask = GetFeededRenderTask(); - - Vector2 actorCoords; - GetFeededActor()->ScreenToLocal(*hitTestResults.renderTask.Get(), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y); - hitTestResults.actorCoordinates = actorCoords; - } - else - { - HitTest(scene, panEvent.previousPosition, hitTestResults); // Hit Test previous position - } + HitTest(scene, panEvent.previousPosition, hitTestResults); // Hit Test previous position if(hitTestResults.actor) { @@ -213,14 +196,7 @@ void PanGestureProcessor::Process(Scene& scene, const PanGestureEvent& panEvent) // Set mCurrentPanEvent to use inside overridden methods called in ProcessAndEmit() mCurrentPanEvent = &panEvent; - if(GetFeededActor()) - { - ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector()); - } - else - { - ProcessAndEmit(hitTestResults); - } + ProcessAndEmit(hitTestResults); mCurrentPanEvent = nullptr; } else @@ -235,32 +211,7 @@ void PanGestureProcessor::Process(Scene& scene, const PanGestureEvent& panEvent) { // Requires a core update mNeedsUpdate = true; - Actor* currentGesturedActor = GetCurrentGesturedActor(); - if(GetFeededActor() && GetFeededActor() != currentGesturedActor && (mCurrentPanEmitters.empty() || (currentGesturedActor && currentGesturedActor->NeedGesturePropagation())) && GetFeededGestureDetector()) - { - if(currentGesturedActor) - { - currentGesturedActor->SetNeedGesturePropagation(false); - } - mCurrentPanEvent = &panEvent; - if(GetFeededActor()->IsHittable() && CheckGestureDetector(GetFeededGestureDetector(), GetFeededActor())) - { - mCurrentPanEmitters.clear(); - ResetActor(); - // Record the current render-task for Screen->Actor coordinate conversions - mCurrentRenderTask = GetFeededRenderTask(); - - Vector2 actorCoords; - GetFeededActor()->ScreenToLocal(*mCurrentRenderTask.Get(), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y); - - mCurrentPanEmitters.push_back(GetFeededGestureDetector()); - SetActor(GetFeededActor()); - GetFeededGestureDetector()->SetDetected(true); - EmitPanSignal(GetFeededActor(), mCurrentPanEmitters, panEvent, actorCoords, GestureState::STARTED, mCurrentRenderTask); - } - mCurrentPanEvent = nullptr; - } DALI_FALLTHROUGH; } @@ -269,6 +220,7 @@ void PanGestureProcessor::Process(Scene& scene, const PanGestureEvent& panEvent) { // Only send subsequent pan gesture signals if we processed the pan gesture when it started. // Check if actor is still touchable. + Actor* currentGesturedActor = GetCurrentGesturedActor(); if(currentGesturedActor) { @@ -282,9 +234,11 @@ void PanGestureProcessor::Process(Scene& scene, const PanGestureEvent& panEvent) mCurrentPanEmitters.erase(endIter, mCurrentPanEmitters.end()); Vector2 actorCoords; + if(!outsideTouchesRangeEmitters.empty() || !mCurrentPanEmitters.empty()) { currentGesturedActor->ScreenToLocal(*mCurrentRenderTask.Get(), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y); + // EmitPanSignal checks whether we have a valid actor and whether the container we are passing in has emitters before it emits the pan. EmitPanSignal(currentGesturedActor, outsideTouchesRangeEmitters, panEvent, actorCoords, GestureState::FINISHED, mCurrentRenderTask); EmitPanSignal(currentGesturedActor, mCurrentPanEmitters, panEvent, actorCoords, panEvent.state, mCurrentRenderTask); diff --git a/dali/internal/event/events/pinch-gesture/pinch-gesture-processor.cpp b/dali/internal/event/events/pinch-gesture/pinch-gesture-processor.cpp index 6018eb5..73e8dcd 100644 --- a/dali/internal/event/events/pinch-gesture/pinch-gesture-processor.cpp +++ b/dali/internal/event/events/pinch-gesture/pinch-gesture-processor.cpp @@ -189,24 +189,7 @@ void PinchGestureProcessor::Process(Scene& scene, const PinchGestureEvent& pinch ResetActor(); HitTestAlgorithm::Results hitTestResults; - if(GetFeededActor()) - { - hitTestResults.actor = Dali::Actor(GetFeededActor()); - hitTestResults.renderTask = GetFeededRenderTask(); - - // Record the current render-task for Screen->Actor coordinate conversions - mCurrentRenderTask = hitTestResults.renderTask; - - Vector2 actorCoords; - GetFeededActor()->ScreenToLocal(*mCurrentRenderTask.Get(), actorCoords.x, actorCoords.y, pinchEvent.centerPoint.x, pinchEvent.centerPoint.y); - hitTestResults.actorCoordinates = actorCoords; - - // Set mCurrentPinchEvent to use inside overridden methods called from ProcessAndEmit() - mCurrentPinchEvent = &pinchEvent; - ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector()); - mCurrentPinchEvent = nullptr; - } - else if(HitTest(scene, pinchEvent.centerPoint, hitTestResults)) + if(HitTest(scene, pinchEvent.centerPoint, hitTestResults)) { // Record the current render-task for Screen->Actor coordinate conversions mCurrentRenderTask = hitTestResults.renderTask; @@ -234,10 +217,6 @@ void PinchGestureProcessor::Process(Scene& scene, const PinchGestureEvent& pinch // Ensure actor is still attached to the emitters, if it is not then remove the emitter. GestureDetectorContainer::iterator endIter = std::remove_if(mCurrentPinchEmitters.begin(), mCurrentPinchEmitters.end(), IsNotAttachedFunctor(currentGesturedActor)); mCurrentPinchEmitters.erase(endIter, mCurrentPinchEmitters.end()); - if(GetFeededActor() && GetFeededGestureDetector()) - { - mCurrentPinchEmitters.push_back(GetFeededGestureDetector()); - } if(!mCurrentPinchEmitters.empty()) { diff --git a/dali/internal/event/events/rotation-gesture/rotation-gesture-processor.cpp b/dali/internal/event/events/rotation-gesture/rotation-gesture-processor.cpp index 7f4eaf1..a83b1b2 100644 --- a/dali/internal/event/events/rotation-gesture/rotation-gesture-processor.cpp +++ b/dali/internal/event/events/rotation-gesture/rotation-gesture-processor.cpp @@ -135,25 +135,7 @@ void RotationGestureProcessor::Process(Scene& scene, const RotationGestureEvent& ResetActor(); HitTestAlgorithm::Results hitTestResults; - if(GetFeededActor()) - { - hitTestResults.actor = Dali::Actor(GetFeededActor()); - hitTestResults.renderTask = GetFeededRenderTask(); - - // Record the current render-task for Screen->Actor coordinate conversions - mCurrentRenderTask = hitTestResults.renderTask; - - Vector2 actorCoords; - GetFeededActor()->ScreenToLocal(*mCurrentRenderTask.Get(), actorCoords.x, actorCoords.y, rotationEvent.centerPoint.x, rotationEvent.centerPoint.y); - hitTestResults.actorCoordinates = actorCoords; - - // Set mCurrentRotationEvent to use inside overridden methods called from ProcessAndEmit() - mCurrentRotationEvent = &rotationEvent; - ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector()); - mCurrentRotationEvent = nullptr; - - } - else if(HitTest(scene, rotationEvent.centerPoint, hitTestResults)) + if(HitTest(scene, rotationEvent.centerPoint, hitTestResults)) { // Record the current render-task for Screen->Actor coordinate conversions mCurrentRenderTask = hitTestResults.renderTask; @@ -182,11 +164,6 @@ void RotationGestureProcessor::Process(Scene& scene, const RotationGestureEvent& GestureDetectorContainer::iterator endIter = std::remove_if(mCurrentRotationEmitters.begin(), mCurrentRotationEmitters.end(), IsNotAttachedFunctor(currentGesturedActor)); mCurrentRotationEmitters.erase(endIter, mCurrentRotationEmitters.end()); - if(GetFeededActor() && GetFeededGestureDetector()) - { - mCurrentRotationEmitters.push_back(GetFeededGestureDetector()); - } - if(!mCurrentRotationEmitters.empty()) { Vector2 actorCoords; diff --git a/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp b/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp index c2dc673..e15e4c7 100644 --- a/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp +++ b/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp @@ -112,15 +112,7 @@ void TapGestureProcessor::Process(Scene& scene, const TapGestureEvent& tapEvent) { // Do a hit test and if an actor has been hit then save to see if tap event is still valid on a tap( same actor being hit ) HitTestAlgorithm::Results hitTestResults; - if(GetFeededActor()) - { - SetActor(GetFeededActor()); - mCurrentTapActor.SetActor(GetCurrentGesturedActor()); - - // Indicate that we've processed a touch down. Bool should be sufficient as a change in actor will result in a cancellation - mPossibleProcessed = true; - } - else if(HitTest(scene, tapEvent.point, hitTestResults)) + if(HitTest(scene, tapEvent.point, hitTestResults)) { SetActor(&GetImplementation(hitTestResults.actor)); mCurrentTapActor.SetActor(GetCurrentGesturedActor()); @@ -139,37 +131,16 @@ void TapGestureProcessor::Process(Scene& scene, const TapGestureEvent& tapEvent) { // Ensure that we're processing a hit on the current actor and that we've already processed a touch down HitTestAlgorithm::Results hitTestResults; - if(GetCurrentGesturedActor()) + if(GetCurrentGesturedActor() && HitTest(scene, tapEvent.point, hitTestResults) && mPossibleProcessed) { - if(GetFeededActor()) - { - hitTestResults.actor = Dali::Actor(GetFeededActor()); - hitTestResults.renderTask = GetFeededRenderTask(); - - Vector2 actorCoords; - GetFeededActor()->ScreenToLocal(*hitTestResults.renderTask.Get(), actorCoords.x, actorCoords.y, tapEvent.point.x, tapEvent.point.y); - hitTestResults.actorCoordinates = actorCoords; - - // Check that this actor is still the one that was used for the last touch down ? - if(mCurrentTapActor.GetActor() == &GetImplementation(hitTestResults.actor)) - { - mCurrentTapEvent = &tapEvent; - ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector()); - } - mCurrentTapEvent = nullptr; - mPossibleProcessed = false; - } - else if(HitTest(scene, tapEvent.point, hitTestResults) && mPossibleProcessed) + // Check that this actor is still the one that was used for the last touch down ? + if(mCurrentTapActor.GetActor() == &GetImplementation(hitTestResults.actor)) { - // Check that this actor is still the one that was used for the last touch down ? - if(mCurrentTapActor.GetActor() == &GetImplementation(hitTestResults.actor)) - { - mCurrentTapEvent = &tapEvent; - ProcessAndEmit(hitTestResults); - } - mCurrentTapEvent = nullptr; - mPossibleProcessed = false; + mCurrentTapEvent = &tapEvent; + ProcessAndEmit(hitTestResults); } + mCurrentTapEvent = nullptr; + mPossibleProcessed = false; } break; } diff --git a/dali/internal/event/events/touch-event-impl.h b/dali/internal/event/events/touch-event-impl.h index 7e2c472..6c1abf3 100644 --- a/dali/internal/event/events/touch-event-impl.h +++ b/dali/internal/event/events/touch-event-impl.h @@ -183,11 +183,6 @@ public: return mRenderTask; } - Dali::RenderTask& GetRenderTaskPtr() - { - return mRenderTask; - } - // Setters /** -- 2.7.4