SignalData()
: functorCalled( false ),
voidFunctorCalled( false ),
- receivedGesture( Gesture::Clear ),
+ receivedGesture(),
pressedActor()
{}
functorCalled = false;
voidFunctorCalled = false;
- receivedGesture.numberOfTouches = 0u;
- receivedGesture.screenPoint = Vector2(0.0f, 0.0f);
- receivedGesture.localPoint = Vector2(0.0f, 0.0f);
+ receivedGesture.Reset();
pressedActor.Reset();
}
{
GestureReceivedFunctor::operator()( actor, longPress );
- if ( longPress.state == stateToUnstage )
+ if ( longPress.GetState() == stateToUnstage )
{
scene.Remove( actor );
}
// Do a long press inside actor's area
TestGenerateLongPress( application, 50.0f, 50.0f );
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
- DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+ DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+ DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
TestEndLongPress( application, 50.0f, 50.0f);
END_TEST;
}
// Start long press within the actor's area
TestGenerateLongPress( application, 20.0f, 20.0f );
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
- DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+ DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+ DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
TestEndLongPress( application, 20.0f, 20.0f);
// repeat the long press within the actor's area - we should still receive the signal
data.Reset();
TestGenerateLongPress( application, 50.0f, 50.0f );
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
- DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+ DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+ DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
TestEndLongPress( application, 50.0f, 50.0f);
// Detach actor
TestGenerateLongPress( application, 5.0f, 5.0f );
TestEndLongPress( application, 5.0f, 5.0f);
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
- DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+ DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+ DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
// Rotate actor again and render
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
TestGenerateLongPress( application, 5.0f, 5.0f );
TestEndLongPress( application, 5.0f, 5.0f);
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
- DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+ DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+ DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
// Rotate actor again and render
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) );
TestEndLongPress( application, 50.0f, 50.0f);
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, parent == data.pressedActor, TEST_LOCATION);
- DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+ DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
// Attach child and generate same touch points
// (Also proves that you can detach and then re-attach another actor)
TestEndLongPress( application, 51.0f, 51.0f);
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, child == data.pressedActor, TEST_LOCATION);
- DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+ DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
END_TEST;
}
&application,
[&detector, &functorCalled](Actor actor, const LongPressGesture& gesture)
{
- if( gesture.state == Gesture::Finished )
+ if( gesture.GetState() == Gesture::Finished )
{
detector.Detach(actor);
functorCalled = true;