try
{
// Emit an empty TouchEvent
- Integration::TouchEvent event;
- application.ProcessEvent(event);
+ Integration::TouchEvent touchEvent;
+ application.ProcessEvent(touchEvent);
tet_result(TET_FAIL);
}
catch(Dali::DaliException& e)
{
- DALI_TEST_ASSERT(e, "!event.points.empty()", TEST_LOCATION);
+ DALI_TEST_ASSERT(e, "!touchEvent.points.empty()", TEST_LOCATION);
}
END_TEST;
}
DALI_TEST_EQUALS(true, rootData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedTouch.GetPointCount(), TEST_LOCATION);
DALI_TEST_EQUALS(1u, rootData.receivedTouch.GetPointCount(), TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_EQUALS(PointState::DOWN, rootData.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_EQUALS(screenCoordinates, data.receivedTouch.points[0].screen, TEST_LOCATION);
DALI_TEST_EQUALS(screenCoordinates, rootData.receivedTouch.points[0].screen, TEST_LOCATION);
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, rootData.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_EQUALS(PointState::DOWN, rootData.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_CHECK(actor == data.receivedTouch.points[0].hitActor);
DALI_TEST_CHECK(actor == rootData.receivedTouch.points[0].hitActor);
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, rootData.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_EQUALS(PointState::DOWN, rootData.receivedTouch.points[0].state, TEST_LOCATION);
data.Reset();
rootData.Reset();
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, rootData.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_EQUALS(PointState::DOWN, rootData.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_CHECK(actor == data.receivedTouch.points[0].hitActor);
DALI_TEST_CHECK(actor == rootData.receivedTouch.points[0].hitActor);
// Change actor to disable user interaction.
actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, false);
- // Emit a motion signal, signalled with an interrupted
+ // Emit a motion signal, shouldn't receive a signal.
application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(200.0f, 200.0f)));
- DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
END_TEST;
}
// Emit a down signal
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_CHECK(actor == data.receivedTouch.points[0].hitActor);
DALI_TEST_CHECK(actor == data.touchedActor);
DALI_TEST_EQUALS(true, parentData.functorCalled, TEST_LOCATION);
// Emit a down signal
application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
DALI_TEST_CHECK(actor == data.receivedTouch.points[0].hitActor);
DALI_TEST_CHECK(actor == data.touchedActor);
DALI_TEST_EQUALS(true, parentData.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, parentData.receivedTouch.points[0].state, TEST_LOCATION);
- DALI_TEST_CHECK(actor == parentData.receivedTouch.points[0].hitActor);
+ DALI_TEST_EQUALS(PointState::INTERRUPTED, parentData.receivedTouch.points[0].state, TEST_LOCATION);
+ DALI_TEST_CHECK(parent == parentData.receivedTouch.points[0].hitActor);
DALI_TEST_CHECK(parent == parentData.touchedActor);
DALI_TEST_EQUALS(true, rootData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(PointState::DOWN, rootData.receivedTouch.points[0].state, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliGeoTouchEventGetRadius(void)
{
TestApplication application;
END_TEST;
}
-
-int UtcDaliGeoTouchDownDifferentUp(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
- actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- application.GetScene().Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Connect to actor's touched signal
- SignalData data;
- TouchEventFunctor functor(data);
- actor.TouchedSignal().Connect(&application, functor);
-
- // Emit a down signal
- application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(10.0f, 10.0f)));
- DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
- data.Reset();
-
- // Emit a signal outside the actor, we should NOT be signalled.
- application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(200.0f, 200.0f /* Outside actor */)));
- application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(210.0f, 200.0f /* Outside actor */)));
- application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(220.0f, 200.0f /* Outside actor */)));
- DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- data.Reset();
-
- // Set the geometry hit test on
- application.GetScene().SetGeometryHittestEnabled(true);
-
- // ...and emit an up event outside of the actor's bounds, we should get an interrupted signal
- application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(200.0f, 200.0f)));
- DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION);
- END_TEST;
-}
bool ShouldEmitInterceptTouchEvent(const Actor& actorImpl, const Dali::TouchEvent& event)
{
PointState::Type state = event.GetState(0);
- return actorImpl.GetInterceptTouchRequired() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion());
+ return actorImpl.GetInterceptTouchRequired() && actorImpl.IsUserInteractionEnabled() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion());
}
bool ShouldEmitTouchEvent(const Actor& actorImpl, const Dali::TouchEvent& event)
{
PointState::Type state = event.GetState(0);
- return actorImpl.GetTouchRequired() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion());
+ return actorImpl.GetTouchRequired() && actorImpl.IsUserInteractionEnabled() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion());
}
// child -> parent
for(; rIter != processor.mCandidateActorLists.rend(); rIter++)
{
Actor* actorImpl(*rIter);
+ if(actorImpl == interceptedActor)
+ {
+ break;
+ }
EmitTouchSignals(actorImpl, *processor.mLastRenderTask.Get(), localVars.touchEventImpl, PointState::INTERRUPTED, localVars.isGeometry);
}
}
// Let's propagate touch events from the intercepted actor or start propagating touch events from the leaf actor.
localVars.consumedActor = EmitGeoTouchSignals(interceptedActor ? processor.mInterceptedActorLists : processor.mCandidateActorLists, localVars.touchEventHandle);
- // If consumed, the actors who previously received the touch are interrupted, indicating that the touch has been consumed by another actor.
- if(localVars.consumedActor && localVars.primaryPointState != PointState::DOWN)
+ if(localVars.consumedActor)
{
- std::list<Dali::Internal::Actor*>::reverse_iterator rIter = std::find(processor.mCandidateActorLists.rbegin(), processor.mCandidateActorLists.rend(), localVars.consumedActor);
- for(++rIter; rIter != processor.mCandidateActorLists.rend(); ++rIter)
+ // If consumed, the actors who previously received the touch are interrupted, indicating that the touch has been consumed by another actor.
+ // backworkd
+ if(localVars.primaryPointState != PointState::DOWN)
{
- Actor* actorImpl(*rIter);
- EmitTouchSignals(actorImpl, *processor.mLastRenderTask.Get(), localVars.touchEventImpl, PointState::INTERRUPTED, localVars.isGeometry);
+ std::list<Dali::Internal::Actor*>::reverse_iterator rIter = std::find(processor.mCandidateActorLists.rbegin(), processor.mCandidateActorLists.rend(), localVars.consumedActor);
+ if(rIter != processor.mCandidateActorLists.rend())
+ {
+ for(++rIter; rIter != processor.mCandidateActorLists.rend(); ++rIter)
+ {
+ Actor* actorImpl(*rIter);
+ EmitTouchSignals(actorImpl, *processor.mLastRenderTask.Get(), localVars.touchEventImpl, PointState::INTERRUPTED, localVars.isGeometry);
+ }
+ }
+ }
+
+ //forward
+ std::list<Dali::Internal::Actor*>::iterator iter = std::find(processor.mCandidateActorLists.begin(), processor.mCandidateActorLists.end(), localVars.consumedActor);
+ if(iter != processor.mCandidateActorLists.end())
+ {
+ for(++iter; iter != processor.mCandidateActorLists.end(); ++iter)
+ {
+ Actor* actorImpl(*iter);
+ EmitTouchSignals(actorImpl, *localVars.currentRenderTask.Get(), localVars.touchEventImpl, PointState::INTERRUPTED, localVars.isGeometry);
+ }
}
}
}