END_TEST;
}
-
int UtcDaliGeoTouchEventGetRadius(void)
{
TestApplication application;
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/events/long-press-gesture-detector-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
#include <dali/integration-api/input-options.h>
#include <dali/integration-api/render-task-list-integ.h>
-#include <dali/internal/event/events/touch-event-impl.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/public-api/dali-core.h>
#include <stdlib.h>
#include <test-touch-event-utils.h>
}
};
-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
///////////////////////////////////////////////////////////////////////////////
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;
-}
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/events/pan-gesture-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
#include <dali/integration-api/input-options.h>
#include <dali/integration-api/profiling.h>
#include <dali/integration-api/render-task-list-integ.h>
-#include <dali/internal/event/events/touch-event-impl.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/public-api/dali-core.h>
#include <stdlib.h>
#include <test-touch-event-utils.h>
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
///////////////////////////////////////////////////////////////////////////////
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
#include <dali-test-suite-utils.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
#include <dali/integration-api/render-task-list-integ.h>
-#include <dali/internal/event/events/touch-event-impl.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/public-api/dali-core.h>
#include <stdlib.h>
#include <test-touch-event-utils.h>
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
///////////////////////////////////////////////////////////////////////////////
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
#include <dali-test-suite-utils.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
#include <dali/integration-api/render-task-list-integ.h>
-#include <dali/internal/event/events/touch-event-impl.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/public-api/dali-core.h>
#include <stdlib.h>
#include <test-touch-event-utils.h>
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
///////////////////////////////////////////////////////////////////////////////
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
#include <dali-test-suite-utils.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
#include <dali/integration-api/render-task-list-integ.h>
-#include <dali/internal/event/events/touch-event-impl.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/public-api/dali-core.h>
#include <stdlib.h>
#include <test-touch-event-utils.h>
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;
-}
#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/events/actor-gesture-data.h>
#include <dali/internal/event/events/gesture-event-processor.h>
-#include <dali/internal/event/events/touch-event-impl.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
namespace Dali
{
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
mRotationGestureProcessor(),
mRenderController(renderController),
envOptionMinimumPanDistance(-1),
- envOptionMinimumPanEvents(-1),
- mIsProcessingFeedTouch(false)
+ envOptionMinimumPanEvents(-1)
{
}
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)
*/
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.
int32_t envOptionMinimumPanDistance;
int32_t envOptionMinimumPanEvents;
- bool mIsProcessingFeedTouch; // Whether the gesture is being recognized via FeedTouch in gestureDetector
};
} // namespace Internal
// INTERNAL INCLUDES
#include <dali/integration-api/events/event.h>
#include <dali/internal/event/events/gesture-impl.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
namespace Dali
{
mCurrentGesturedActor(nullptr),
mPoint(),
mEventTime(0u),
- mGesturedActorDisconnected(false),
- mFeededActor(nullptr),
- mRenderTask(),
- mGestureDetector(nullptr)
+ mGesturedActorDisconnected(false)
{
}
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)
}
}
-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);
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
*/
// 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.
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.
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
// EXTERNAL INCLUDES
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/internal/event/events/actor-observer.h>
#include <dali/internal/event/events/gesture-event.h>
-#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/events/gesture.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/object/ref-object.h>
-#include <dali/public-api/events/gesture-detector.h>
namespace Dali
{
~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<GestureRecognizer>;
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));
}
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
// 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)
{
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.
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;
// 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)
{
// 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
{
// 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;
}
{
// 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)
{
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);
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;
// 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())
{
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;
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;
{
// 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());
{
// 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;
}
return mRenderTask;
}
- Dali::RenderTask& GetRenderTaskPtr()
- {
- return mRenderTask;
- }
-
// Setters
/**