#include "test-gl-sync-abstraction.h"
#include "test-gl-abstraction.h"
#include "test-render-controller.h"
-#include <dali/integration-api/events/notification-event.h>
#include <dali/public-api/common/dali-common.h>
namespace Dali
return mGestureManager;
}
+ void ProcessEvent(const Integration::Event& event)
+ {
+ mCore->QueueEvent(event);
+ mCore->ProcessEvents();
+ }
+
void SendNotification()
{
- Integration::NotificationEvent event;
- mCore->SendEvent(event);
+ mCore->ProcessEvents();
}
void SetSurfaceWidth( unsigned int width, unsigned height )
mRequestUpdateCalled = true;
}
- virtual void RequestNotificationEventOnIdle()
+ virtual void RequestProcessEventsOnIdle()
{
- mRequestNotificationEventOnIdleCalled = true;
+ mRequestProcessEventsOnIdle = true;
}
typedef enum
switch(func)
{
case RequestUpdateFunc: return mRequestUpdateCalled;
- case RequestNotificationEventOnIdleFunc: return mRequestNotificationEventOnIdleCalled;
+ case RequestNotificationEventOnIdleFunc: return mRequestProcessEventsOnIdle;
}
return false;
void Initialize()
{
mRequestUpdateCalled = false;
- mRequestNotificationEventOnIdleCalled = false;
+ mRequestProcessEventsOnIdle = false;
}
private:
bool mRequestUpdateCalled;
- bool mRequestNotificationEventOnIdleCalled;
+ bool mRequestProcessEventsOnIdle;
};
} // Dali
Dali::TouchPoint point( 1, TouchPoint::Down, touchPoint.x, touchPoint.y );
Dali::Integration::TouchEvent event;
event.AddPoint( point );
- application.GetCore().SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_CHECK( gTouchCallBackCalled == true );
}
// flush the queue and render once
application.SendNotification();
application.Render();
- application.GetCore().SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_CHECK( gTouchCallBackCalled == hitTestData[index]->mResult );
Dali::TouchPoint point( 0, TouchPoint::Down, 25.0f, 25.0f );
Dali::Integration::TouchEvent event;
event.AddPoint( point );
- app.GetCore().SendEvent( event );
+ app.ProcessEvent( event );
app.SendNotification();
app.Render(1);
Dali::TouchPoint point( 0, TouchPoint::Down, 240, 400 );
Dali::Integration::TouchEvent event;
event.AddPoint( point );
- application.GetCore().SendEvent( event );
+ application.ProcessEvent( event );
application.SendNotification();
application.Render(1000);
application.DisconnectAll();
// simulate another touch event
- application.GetCore().SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_CHECK( gTouchCallBackCalled == false );
}
Dali::TouchPoint point( 0, TouchPoint::Down, 1, 1 );
Dali::Integration::TouchEvent event;
event.AddPoint( point );
- application.GetCore().SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnTouchEvent", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
// simulate a mouse wheel event
Vector2 screenCoordinates( 10.0f, 10.0f );
Integration::MouseWheelEvent event(0, 0u, screenCoordinates, 1, 1000u);
- application.GetCore().SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnMouseWheelEvent", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
{
TestApplication application;
Stage stage = Stage::GetCurrent();
- Dali::Integration::Core& core ( application.GetCore() );
KeyEventSignalData data;
KeyEventReceivedFunctor functor( data );
stage.KeyEventSignal().Connect( &application, functor );
Integration::KeyEvent event( "i","i", 0, 0, 0, Integration::KeyEvent::Down );
- core.SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
data.Reset();
Integration::KeyEvent event2( "i","i", 0, 0, 0, Integration::KeyEvent::Up );
- core.SendEvent( event2 );
+ application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
data.Reset();
Integration::KeyEvent event3( "a","a", 0, 0, 0, Integration::KeyEvent::Down );
- core.SendEvent( event3 );
+ application.ProcessEvent( event3 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
data.Reset();
Integration::KeyEvent event4( "a","a", 0, 0, 0, Integration::KeyEvent::Up );
- core.SendEvent( event4 );
+ application.ProcessEvent( event4 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
{
TestApplication application;
Stage stage = Stage::GetCurrent();
- Dali::Integration::Core& core ( application.GetCore() );
TouchedSignalData data;
TouchedFunctor functor( data );
{
Integration::TouchEvent touchEvent;
touchEvent.points.push_back( TouchPoint( 0, TouchPoint::Down, 10.0f, 10.0f ) );
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0 );
touchEvent.points[0].state = TouchPoint::Motion;
touchEvent.points[0].screen.x = 12.0f; // Some motion
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
touchEvent.points[0].state = TouchPoint::Up;
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0 );
{
Integration::TouchEvent touchEvent;
touchEvent.points.push_back( TouchPoint( 0, TouchPoint::Down, 10.0f, 10.0f ) );
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0 );
touchEvent.points[0].state = TouchPoint::Motion;
touchEvent.points[0].screen.x = 150.0f; // Some motion
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
touchEvent.points[0].state = TouchPoint::Up;
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0 );
{
Integration::TouchEvent touchEvent;
touchEvent.points.push_back( TouchPoint( 0, TouchPoint::Interrupted, 10.0f, 10.0f ) );
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0 );
data.Reset();
touchEvent.points[0].state = TouchPoint::Down;
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0 );
data.Reset();
touchEvent.points[0].state = TouchPoint::Interrupted;
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0 );
// 1st point
touchEvent.points.push_back( TouchPoint( 0, TouchPoint::Down, 10.0f, 10.0f ) );
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
// 2nd point
touchEvent.points[0].state = TouchPoint::Stationary;
touchEvent.points.push_back( TouchPoint( 1, TouchPoint::Down, 50.0f, 50.0f ) );
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
// Primary point is up
touchEvent.points[0].state = TouchPoint::Up;
touchEvent.points[1].state = TouchPoint::Stationary;
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
touchEvent.points.erase( touchEvent.points.begin() );
touchEvent.points[0].state = TouchPoint::Motion;
touchEvent.points[0].screen.x = 150.0f;
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
// Final point Up
touchEvent.points[0].state = TouchPoint::Up;
- core.SendEvent( touchEvent );
+ application.ProcessEvent( touchEvent );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliInvalidEvent()
{
TestApplication application;
- Dali::Integration::Core& core ( application.GetCore() );
try
{
InvalidEvent event;
- core.SendEvent( event );
+ application.ProcessEvent( event );
tet_result( TET_FAIL );
}
catch ( Dali::DaliException& e )
void UtcDaliInvalidGesture()
{
TestApplication application;
- Dali::Integration::Core& core ( application.GetCore() );
try
{
InvalidGesture event;
- core.SendEvent( event );
+ application.ProcessEvent( event );
tet_result( TET_FAIL );
}
catch ( Dali::DaliException& e )
const std::string keyString("keyString");
const int keyCode(333);
const int keyModifier(312);
- const int offset(29);
- const int characters(80);
const unsigned long timeStamp(132);
const Integration::KeyEvent::State keyState(Integration::KeyEvent::Up);
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
- application.GetCore().SendEvent(touchEvent);
+ application.ProcessEvent(touchEvent);
// Render and notify
application.SendNotification();
static void UtcDaliLongPressGestureSignalReceptionNegative()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do a long press outside actor's area
- core.SendEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2(112.0f, 112.0f ) ) );
- core.SendEvent( GenerateLongPress( Gesture::Started, 1u, Vector2(112.0f, 112.0f ) ) );
- core.SendEvent( GenerateLongPress( Gesture::Finished, 1u, Vector2(112.0f, 112.0f ) ) );
+ application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2(112.0f, 112.0f ) ) );
+ application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, Vector2(112.0f, 112.0f ) ) );
+ application.ProcessEvent( GenerateLongPress( Gesture::Finished, 1u, Vector2(112.0f, 112.0f ) ) );
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliLongPressGestureSignalReceptionPositive()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do a long press inside actor's area
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(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);
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 50.0f)));
}
static void UtcDaliLongPressGestureSignalReceptionDetach()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start long press within the actor's area
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 20.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(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);
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 20.0f)));
// repeat the long press within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(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);
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 50.0f)));
// Detach actor
detector.DetachAll();
// Ensure we are no longer signalled
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 20.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 50.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliLongPressGestureSignalReceptionActorDestroyedDuringLongPress()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
SignalData data;
GestureReceivedFunctor functor(data);
detector.Attach(actor);
// Start long press within the actor's area
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 20.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Remove the actor from stage and reset the data
// Actor should now have been destroyed
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliLongPressGestureSignalReceptionRotatedActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do a long press
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(5.0f, 5.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(5.0f, 5.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(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);
// Do another long press, should still receive event
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(5.0f, 5.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(5.0f, 5.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(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);
// Do a long press, inside where the actor used to be, Should not receive the event
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(70.0f, 70.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(70.0f, 70.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(70.0f, 70.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(70.0f, 70.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(70.0f, 70.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(70.0f, 70.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliLongPressGestureSignalReceptionChildHit()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor parent = Actor::New();
parent.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do long press - hits child area but parent should still receive it
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(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);
// Do an entire long press, only check finished value
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(51.0f, 51.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(51.0f, 51.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(51.0f, 51.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(51.0f, 51.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(51.0f, 51.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(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);
static void UtcDaliLongPressGestureSignalReceptionAttachDetachMany()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor first = Actor::New();
first.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// LongPress within second actor's area
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(120.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(120.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(120.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pressedActor, TEST_LOCATION);
// LongPress within first actor's area
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, first == data.pressedActor, TEST_LOCATION);
// second actor shouldn't receive event
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(120.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(120.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(120.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// first actor should continue receiving event
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliLongPressGestureSignalReceptionActorBecomesUntouchable()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// LongPress in actor's area
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Actor becomes invisible - actor should not receive the next long press
// LongPress in the same area, shouldn't receive event
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliLongPressGestureSignalReceptionMultipleGestureDetectors()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Dali::TestGestureManager& gestureManager = application.GetGestureManager();
Actor first = Actor::New();
DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
// LongPress within second actor's area
- core.SendEvent(GenerateLongPress(Gesture::Possible, 2u, Vector2(150.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 2u, Vector2(150.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 2u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 2u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 2u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 2u, Vector2(150.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pressedActor, TEST_LOCATION);
// LongPress continues as single touch gesture - we should not receive any gesture
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(150.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(150.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(150.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Single touch long press starts - first actor should receive gesture
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, first == data.pressedActor, TEST_LOCATION);
// long press changes to double-touch - we shouldn't receive event
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Possible, 2u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 2u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 2u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 2u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 2u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 2u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Reset gesture manager statistics
void UtcDaliLongPressGestureSignalReceptionMultipleDetectorsOnActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
secondDetector.DetectedSignal().Connect(&application, secondFunctor);
// LongPress in actor's area - both detector's functors should be called
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
}
void UtcDaliLongPressGestureSignalReceptionDifferentPossible()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// LongPress possible in actor's area.
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Move actor somewhere else
application.Render();
// Emit Started event, we should not receive the long press.
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// LongPress possible in empty area.
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Move actor in to the long press position.
application.Render();
// Emit Started event, we should not receive the long press.
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Normal long press in actor's area for completeness.
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
}
void UtcDaliLongPressGestureEmitIncorrectStateClear()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Clear state
try
{
- core.SendEvent(GenerateLongPress(Gesture::Clear, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Clear, 1u, Vector2(50.0f, 10.0f)));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliLongPressGestureEmitIncorrectStateContinuing()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Continuing state
try
{
- core.SendEvent(GenerateLongPress(Gesture::Continuing, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Continuing, 1u, Vector2(50.0f, 10.0f)));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliLongPressGestureDetectorTypeRegistry()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
application.Render();
// Emit gesture
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
}
void UtcDaliLongPressGestureRepeatedState()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Two possibles
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// ... Send some finished states, still no signal
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Send two Started states, should be signalled
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
// Send two cancelled states, should not be signalled
- core.SendEvent(GenerateLongPress(Gesture::Cancelled, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Cancelled, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- core.SendEvent(GenerateLongPress(Gesture::Cancelled, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Cancelled, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliLongPressGesturePossibleCancelled()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Send a possible followed by a cancel, we should not be signalled
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- core.SendEvent(GenerateLongPress(Gesture::Cancelled, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Cancelled, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliLongPressGestureDetachAfterStarted()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit initial signal
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
detector.Detach(actor);
// Emit Finished, no signal
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliLongPressGestureActorUnstaged()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit signals
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Render and notify
stateToUnstage = Gesture::Finished;
// Emit signals
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
tet_result( TET_PASS ); // If we get here then we have handled actor stage removal gracefully.
}
void UtcDaliLongPressGestureActorStagedAndDestroyed()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// position, we should still not be signalled.
// Emit signals
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
application.Render();
// Continue signal emission
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
// Here we delete an actor in started, we should not receive any subsequent signalling.
// Emit signals
- core.SendEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
application.Render();
// Continue signal emission
- core.SendEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliLongPressGestureSystemOverlay()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
+ Dali::Integration::SystemOverlay& systemOverlay( application.GetCore().GetSystemOverlay() );
systemOverlay.GetOverlayRenderTasks().CreateTask();
Actor actor = Actor::New();
// Do a long press inside actor's area
Vector2 screenCoords( 50.0f, 50.0f );
- core.SendEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
- core.SendEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
+ application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
+ application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
}
void UtcDaliMouseWheelEventSignalling()
{
TestApplication application; // Reset all test adapter return codes
- Dali::Integration::Core& core ( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
Integration::MouseWheelEvent event(0, SHIFT_MODIFIER, screenCoordinates, 1, 1000u);
// Emit a mouse wheel signal
- core.SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( actor == data.mouseWheeledActor );
DALI_TEST_EQUALS(0, data.receivedMouseWheelEvent.direction, TEST_LOCATION); // check direction
screenCoordinates.x = screenCoordinates.y = 300.0f;
Integration::MouseWheelEvent newEvent(0, SHIFT_MODIFIER, screenCoordinates, 1, 1000u);
- core.SendEvent( newEvent );
+ application.ProcessEvent( newEvent );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( rootActor == rootData.mouseWheeledActor );
application.Render();
// Emit a move at the same point, we should not be signalled.
- core.SendEvent( event );
+ application.ProcessEvent( event );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
}
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
- application.GetCore().SendEvent(touchEvent);
+ application.ProcessEvent(touchEvent);
}
static void UtcDaliPanGestureDetectorDownCast()
static void UtcDaliPanGestureSignalReceptionNegative()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do a pan outside actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(110.0f, 110.0f), Vector2(112.0f, 112.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(110.0f, 110.0f), Vector2(112.0f, 112.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(110.0f, 110.0f), Vector2(112.0f, 112.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(110.0f, 110.0f), Vector2(112.0f, 112.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Continue pan into actor's area - we should still not receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(112.0f, 112.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(112.0f, 112.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Stop panning - we should still not receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 20.0f), Vector2(12.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 20.0f), Vector2(12.0f, 12.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPanGestureSignalReceptionDownMotionLeave()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan within the actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Continue the pan within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Pan Gesture leaves actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 10.0f), Vector2(320.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 10.0f), Vector2(320.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Gesture ends - we would receive a finished state
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(320.0f, 10.0f), Vector2(310.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(320.0f, 10.0f), Vector2(310.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
static void UtcDaliPanGestureSignalReceptionDownMotionUp()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan within the actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Continue the pan within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Gesture ends within actor's area - we would receive a finished state
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
static void UtcDaliPanGestureSignalReceptionCancelled()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan within the actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
// Continue the pan within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
// The gesture is cancelled
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Cancelled, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Cancelled, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Cancelled, data.receivedGesture.state, TEST_LOCATION);
}
static void UtcDaliPanGestureSignalReceptionDetach()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan within the actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Continue the pan within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Detach actor
// Ensure we are no longer signalled
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPanGestureSignalReceptionDetachWhilePanning()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan within the actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Continue the pan within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Detach actor during the pan, we should not receive the next event
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPanGestureSignalReceptionActorDestroyedWhilePanning()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
SignalData data;
GestureReceivedFunctor functor(data);
detector.Attach(actor);
// Start pan within the actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Continue the pan within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Remove the actor from stage and reset the data
// Gesture ends within the area where the actor used to be
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPanGestureSignalReceptionRotatedActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do an entire pan, only check finished value
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Vector2(8.0f, -5.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
application.Render();
// Do an entire pan, only check finished value
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Vector2(-5.0f, -8.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
application.Render();
// Do an entire pan, only check finished value
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Vector2(-8.0f, 5.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
}
static void UtcDaliPanGestureSignalReceptionChildHit()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor parent = Actor::New();
parent.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do an entire pan, only check finished value - hits child area but parent should still receive it
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, parent == data.pannedActor, TEST_LOCATION);
DALI_TEST_EQUALS(Vector2(5.0f, 8.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
detector.Detach(parent);
// Do an entire pan, only check finished value
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(11.0f, 12.0f), Vector2(22.0f, 12.0f), 10));
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(22.0f, 12.0f), Vector2(27.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, child == data.pannedActor, TEST_LOCATION);
DALI_TEST_EQUALS(Vector2(8.0f, -5.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
static void UtcDaliPanGestureSignalReceptionAttachDetachMany()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor first = Actor::New();
first.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan within second actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(110.0f, 20.0f), Vector2(120.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(110.0f, 20.0f), Vector2(120.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(110.0f, 20.0f), Vector2(120.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(110.0f, 20.0f), Vector2(120.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pannedActor, TEST_LOCATION);
// Pan moves into first actor's area - second actor should receive the pan
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(120.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(120.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pannedActor, TEST_LOCATION);
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPanGestureSignalReceptionActorBecomesUntouchable()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan in actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Pan continues within actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Actor become invisible - actor should not receive the next pan
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 10.0f), Vector2(10.0f, 10.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPanGestureSignalReceptionMultipleGestureDetectors()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Dali::TestGestureManager& gestureManager = application.GetGestureManager();
Actor first = Actor::New();
DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
// Start pan within second actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10, 2));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10, 2));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10, 2));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10, 2));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pannedActor, TEST_LOCATION);
// Two touch pan changes to single touch - we should receive a finished state
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pannedActor, TEST_LOCATION);
// Pan continues as single touch gesture - we should not receive any gesture
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 10.0f), Vector2(30.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 10.0f), Vector2(30.0f, 10.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Pan ends - still no signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(30.0f, 10.0f), Vector2(30.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(30.0f, 10.0f), Vector2(30.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Single touch pan starts - first actor should be panned
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, first == data.pannedActor, TEST_LOCATION);
// Pan changes to double-touch - we should receive a finished state
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10, 2));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10, 2));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(true, first == data.pannedActor, TEST_LOCATION);
// Pan continues as double touch gesture - we should not receive any gesture
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 10.0f), Vector2(30.0f, 10.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 10.0f), Vector2(30.0f, 10.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Pan ends - still no signal
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(30.0f, 10.0f), Vector2(30.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(30.0f, 10.0f), Vector2(30.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Reset gesture manager statistics
void UtcDaliPanGestureSignalReceptionMultipleDetectorsOnActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
secondDetector.Attach(actor2);
// Pan in actor's area - both detector's functors should be called
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
// Pan continues in actor's area - both detector's functors should be called
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
firstDetector.Detach(actor);
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
// New pan on actor, only secondDetector has actor attached
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
secondDetector.Detach(actor);
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(false, secondData.functorCalled, TEST_LOCATION);
}
// Should handle two started events gracefully.
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
application.Render();
// Start pan in actor's area
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Send another start in actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Add a child actor to overlap actor and send another start in actor's area
// Send another possible and start in actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Send another start in actor's area
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
}
void UtcDaliPanGestureSignalReceptionEnsureCorrectSignalling()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor1 = Actor::New();
actor1.SetSize(100.0f, 100.0f);
application.Render();
// Start pan in actor1's area, only data1 should be set
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data1.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(false, data2.functorCalled, TEST_LOCATION);
}
void UtcDaliPanGestureSignalReceptionDifferentPossible()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Gesture possible in actor's area.
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Move actor somewhere else
application.Render();
// Emit Started event, we should not receive the long press.
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// LongPress possible in empty area.
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Move actor in to the long press position.
application.Render();
// Emit Started event, we should not receive the long press.
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Normal long press in actor's area for completeness.
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
}
void UtcDaliPanGestureEmitIncorrectState()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Clear state
try
{
- core.SendEvent(GeneratePan(Gesture::Clear, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Clear, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliPanGestureDetectorTypeRegistry()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
application.Render();
// Emit gesture
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
}
void UtcDaliPanGestureActorUnstaged()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit signals
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
stateToUnstage = Gesture::Continuing;
// Emit signals
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
stateToUnstage = Gesture::Finished;
// Emit signals
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
tet_result( TET_PASS ); // If we get here then we have handled actor stage removal gracefully.
}
void UtcDaliPanGestureActorStagedAndDestroyed()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// position, we should still not be signalled.
// Emit signals
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
application.Render();
// Continue signal emission
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
// Here we delete an actor in started, we should not receive any subsequent signalling.
// Emit signals
- core.SendEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
- core.SendEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
application.Render();
// Continue signal emission
- core.SendEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+ application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliPanGestureSystemOverlay()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
+ Dali::Integration::SystemOverlay& systemOverlay( application.GetCore().GetSystemOverlay() );
systemOverlay.GetOverlayRenderTasks().CreateTask();
Actor actor = Actor::New();
Vector2 screenCoordsEnd( 20.0f, 20.0f );
// Start pan within the actor's area
- core.SendEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
}
void UtcDaliPanGestureAngleProcessing()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor parent = Actor::New();
parent.SetSize(100.0f, 100.0f);
childDetector.DetectedSignal().Connect(&application, childFunctor);
// Generate an Up pan gesture, only parent should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10 ) );
DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a Right pan gesture, only child should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(30.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(30.0f, 20.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a Down pan gesture, no one should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 30.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 30.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a Left pan gesture, no one should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
}
void UtcDaliPanGestureDirectionProcessing()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor parent = Actor::New();
parent.SetSize(100.0f, 100.0f);
childDetector.DetectedSignal().Connect(&application, childFunctor);
// Generate an Up pan gesture, only parent should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 10.0f), 10 ) );
DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a Right pan gesture, only child should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(30.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(30.0f, 20.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a Down pan gesture, only parent should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 30.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(20.0f, 30.0f), 10 ) );
DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a Left pan gesture, only child should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 20.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a pan at -45 degrees, no one should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 30.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 30.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a pan at 45 degrees, no one should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(30.0f, 30.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(30.0f, 30.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a pan at 135 degrees, no one should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 30.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 30.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
// Generate a pan at -135 degrees, no one should receive it.
- core.SendEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 10.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, Vector2(20.0f, 20.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, Vector2(20.0f, 20.0f), Vector2(10.0f, 10.0f), 10 ) );
DALI_TEST_EQUALS( false, parentData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, childData.functorCalled, TEST_LOCATION );
- core.SendEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Finished, Vector2(20.0f, 30.0f), Vector2(20.0f, 20.0f), 10 ) );
parentData.Reset();
childData.Reset();
}
void UtcDaliPanGestureSetPropertiesAlreadyPanning()
{
TestApplication application;
- Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
Vector2 previousPosition( 20.0f, 20.0f );
Vector2 currentPosition( 20.0f, 10.0f );
- core.SendEvent( GeneratePan( Gesture::Possible, previousPosition, previousPosition, 10 ) );
- core.SendEvent( GeneratePan( Gesture::Started, previousPosition, currentPosition, 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Possible, previousPosition, previousPosition, 10 ) );
+ application.ProcessEvent( GeneratePan( Gesture::Started, previousPosition, currentPosition, 10 ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
Vector2 screenPosition( 100.0f, 20.0f );
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
- application.GetCore().SendEvent(touchEvent);
+ application.ProcessEvent(touchEvent);
TouchPoint point2(1, TouchPoint::Down, 20.0f, 20.0f, 20.0f, 20.0f);
touchEvent.AddPoint(point2);
- application.GetCore().SendEvent(touchEvent);
+ application.ProcessEvent(touchEvent);
}
static void UtcDaliPinchGestureDetectorDownCast()
static void UtcDaliPinchGestureSignalReceptionNegative()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do a pinch outside actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 45.0f, Vector2(112.0f, 112.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 45.0f, Vector2(112.0f, 112.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Continue pinch into actor's area - we should still not receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 4.5f, 95.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 4.5f, 95.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Stop pinching - we should still not receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(12.0f, 12.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(12.0f, 12.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPinchGestureSignalReceptionDownMotionLeave()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pan within the actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(10.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
// Continue the pan within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 5.0f, 90.0f, Vector2(21.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 5.0f, 90.0f, Vector2(21.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(5.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
// Pan Gesture leaves actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 15.5f, Vector2(320.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 15.5f, Vector2(320.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(10.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
// Gesture ends - we would receive a finished state
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 15.2f, 12.1f, Vector2(310.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 15.2f, 12.1f, Vector2(310.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(15.2f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
static void UtcDaliPinchGestureSignalReceptionDownMotionUp()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pinch within the actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(10.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
// Continue the pinch within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(5.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
// Gesture ends within actor's area - we would receive a finished state
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(5.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
static void UtcDaliPinchGestureSignalReceptionCancelled()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pinch within the actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
// Continue the pinch within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
// The gesture is cancelled
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Cancelled, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Cancelled, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Cancelled, data.receivedGesture.state, TEST_LOCATION);
}
static void UtcDaliPinchGestureSignalReceptionDetach()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pinch within the actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
// Continue the pinch within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
// Ensure we are no longer signalled
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
- core.SendEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPinchGestureSignalReceptionDetachWhilePinching()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pinch within the actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
// Continue the pinch within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPinchGestureSignalReceptionActorDestroyedWhilePinching()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
SignalData data;
GestureReceivedFunctor functor(data);
detector.Attach(actor);
// Start pinch within the actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
// Continue the pinch within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
// Gesture ends within the area where the actor used to be
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 25.0f, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPinchGestureSignalReceptionRotatedActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do an entire pinch, only check finished value
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(10.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
DALI_TEST_EQUALS(50.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
application.Render();
// Do an entire pinch, only check finished value
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(10.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
DALI_TEST_EQUALS(50.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
application.Render();
// Do an entire pinch, only check finished value
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(10.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
DALI_TEST_EQUALS(50.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
static void UtcDaliPinchGestureSignalReceptionChildHit()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor parent = Actor::New();
parent.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do an entire pan, only check finished value - hits child area but parent should still receive it
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, parent == data.pinchedActor, TEST_LOCATION);
DALI_TEST_EQUALS(5.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
detector.Detach(parent);
// Do an entire pan, only check finished value
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, child == data.pinchedActor, TEST_LOCATION);
DALI_TEST_EQUALS(5.0f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
static void UtcDaliPinchGestureSignalReceptionAttachDetachMany()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor first = Actor::New();
first.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pinch within second actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(120.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pinchedActor, TEST_LOCATION);
// Pinch moves into first actor's area - second actor should receive the pinch
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pinchedActor, TEST_LOCATION);
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(120.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliPinchGestureSignalReceptionActorBecomesUntouchable()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start pinch in actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Pan continues within actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Started, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Actor become invisible - actor should not receive the next pinch
// Gesture ends within actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 5.0f, 50.0f, Vector2(10.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliPinchGestureSignalReceptionMultipleDetectorsOnActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
secondDetector.Attach(actor2);
// Pinch in actor's area - both detector's functors should be called
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
// Pinch continues in actor's area - both detector's functors should be called
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
firstDetector.Detach(actor);
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
// New pinch on actor, only secondDetector has actor attached
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
secondDetector.Detach(actor);
firstData.Reset();
secondData.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(false, secondData.functorCalled, TEST_LOCATION);
}
// Should handle two started events gracefully.
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
application.Render();
// Start pan in actor's area
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Send another start in actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Add a child actor to overlap actor and send another start in actor's area
// Send another start in actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Send another start in actor's area
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
}
void UtcDaliPinchGestureSignalReceptionEnsureCorrectSignalling()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor1 = Actor::New();
actor1.SetSize(100.0f, 100.0f);
application.Render();
// Start pan in actor1's area, only data1 should be set
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data1.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(false, data2.functorCalled, TEST_LOCATION);
}
void UtcDaliPinchGestureEmitIncorrectStateClear()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Clear state
try
{
- core.SendEvent(GeneratePinch(Gesture::Clear, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Clear, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliPinchGestureEmitIncorrectStatePossible()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Possible state
try
{
- core.SendEvent(GeneratePinch(Gesture::Possible, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Possible, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliPinchGestureDetectorTypeRegistry()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
application.Render();
// Emit gesture
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
}
void UtcDaliPinchGestureActorUnstaged()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit signals
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
stateToUnstage = Gesture::Continuing;
// Emit signals
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
stateToUnstage = Gesture::Finished;
// Emit signals
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
tet_result( TET_PASS ); // If we get here then we have handled actor stage removal gracefully.
}
void UtcDaliPinchGestureActorStagedAndDestroyed()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// position, we should still not be signalled.
// Emit signals
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
application.Render();
// Continue signal emission
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
// Here we delete an actor in started, we should not receive any subsequent signalling.
// Emit signals
- core.SendEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
application.Render();
// Continue signal emission
- core.SendEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Continuing, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GeneratePinch(Gesture::Finished, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliPinchGestureSystemOverlay()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
+ Dali::Integration::SystemOverlay& systemOverlay( application.GetCore().GetSystemOverlay() );
systemOverlay.GetOverlayRenderTasks().CreateTask();
Actor actor = Actor::New();
float speed ( 50.0f );
// Start pan within the actor's area
- core.SendEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
+ application.ProcessEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
}
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
- application.GetCore().SendEvent(touchEvent);
+ application.ProcessEvent(touchEvent);
// Render and notify
application.SendNotification();
static void UtcDaliTapGestureSignalReceptionNegative()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Do a tap outside actor's area
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(112.0f, 112.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(112.0f, 112.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(112.0f, 112.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(112.0f, 112.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliTapGestureSignalReceptionPositive()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Do a tap inside actor's area
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
static void UtcDaliTapGestureSignalReceptionDetach()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Start tap within the actor's area
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// repeat the tap within the actor's area - we should still receive the signal
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Ensure we are no longer signalled
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliTapGestureSignalReceptionActorDestroyedWhileTapping()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
SignalData data;
GestureReceivedFunctor functor(data);
detector.Attach(actor);
// Start tap within the actor's area
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Remove the actor from stage and reset the data
// Actor should now have been destroyed
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliTapGestureSignalReceptionRotatedActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do tap, only check finished value
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(5.0f, 5.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(5.0f, 5.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Do tap, should still receive event
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(5.0f, 5.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(5.0f, 5.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(5.0f, 5.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
// Do tap, inside the actor's area (area if it is not rotated), Should not receive the event
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(70.0f, 70.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(70.0f, 70.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(70.0f, 70.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(70.0f, 70.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliTapGestureSignalReceptionChildHit()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor parent = Actor::New();
parent.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Do tap - hits child area but parent should still receive it
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, parent == data.tappedActor, TEST_LOCATION);
DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
// Do an entire tap, only check finished value
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(51.0f, 51.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(51.0f, 51.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(51.0f, 51.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(51.0f, 51.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, child == data.tappedActor, TEST_LOCATION);
DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
static void UtcDaliTapGestureSignalReceptionAttachDetachMany()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor first = Actor::New();
first.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Tap within second actor's area
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(120.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(120.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.tappedActor, TEST_LOCATION);
// Tap within first actor's area
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, first == data.tappedActor, TEST_LOCATION);
// second actor shouldn't receive event
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(120.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(120.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(120.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// first actor should continue receiving event
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliTapGestureSignalReceptionActorBecomesUntouchable()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect(&application, functor);
// Tap in actor's area
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Actor become invisible - actor should not receive the next pan
// Tap in the same area, shouldn't receive event
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
static void UtcDaliTapGestureSignalReceptionMultipleGestureDetectors()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Dali::TestGestureManager& gestureManager = application.GetGestureManager();
Actor first = Actor::New();
DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
// Tap within second actor's area
- core.SendEvent(GenerateTap(Gesture::Possible, 2u, 2u, Vector2(150.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 2u, 2u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 2u, 2u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 2u, 2u, Vector2(150.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.tappedActor, TEST_LOCATION);
// Tap continues as single touch gesture - we should not receive any gesture
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(150.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(150.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(150.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Single touch tap starts - first actor should be panned
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, first == data.tappedActor, TEST_LOCATION);
// Pan changes to double-touch - we shouldn't receive event
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Possible, 2u, 2u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 2u, 2u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 2u, 2u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 2u, 2u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Reset gesture manager statistics
void UtcDaliTapGestureSignalReceptionMultipleDetectorsOnActor()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
secondDetector.DetectedSignal().Connect(&application, secondFunctor);
// Tap in actor's area - both detector's functors should be called
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
}
void UtcDaliTapGestureSignalReceptionDifferentPossible()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Gesture possible in actor's area.
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Move actor somewhere else
application.Render();
// Emit Started event, we should not receive the long press.
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// LongPress possible in empty area.
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Move actor in to the long press position.
application.Render();
// Emit Started event, we should not receive the long press.
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Normal long press in actor's area for completeness.
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
}
void UtcDaliTapGestureEmitIncorrectStateClear()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Clear state
try
{
- core.SendEvent(GenerateTap(Gesture::Clear, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Clear, 1u, 1u, Vector2(50.0f, 10.0f)));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliTapGestureEmitIncorrectStateContinuing()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Continuing state
try
{
- core.SendEvent(GenerateTap(Gesture::Continuing, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Continuing, 1u, 1u, Vector2(50.0f, 10.0f)));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliTapGestureEmitIncorrectStateFinished()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
// Try a Finished state
try
{
- core.SendEvent(GenerateTap(Gesture::Finished, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Finished, 1u, 1u, Vector2(50.0f, 10.0f)));
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
void UtcDaliTapGestureDetectorTypeRegistry()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
application.Render();
// Emit gesture
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
}
void UtcDaliTapGestureActorUnstaged()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Tap in Actor's area, actor removed in signal handler, should be handled gracefully.
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
tet_result( TET_PASS ); // If we get here, then the actor removal on signal handler was handled gracefully.
}
void UtcDaliTapGestureRepeatedState()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit two possibles
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Send a couple of Started states, only first one should be received.
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
data.Reset();
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
// Send a couple of cancelled states, no reception
- core.SendEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliTapGesturePossibleCancelled()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit a possible and then a cancelled, no reception
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
- core.SendEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliTapGestureDetectorRemovedWhilePossible()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit a possible
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
// Detach actor and send a Started state, no signal.
detector.DetachAll();
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliTapGestureActorRemovedWhilePossible()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
detector.DetectedSignal().Connect( &application, functor );
// Emit a possible
- core.SendEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
// Remove, render and delete actor
Stage::GetCurrent().Remove(actor);
actor = NULL;
// Send a Started state, no signal.
- core.SendEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+ application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
}
void UtcDaliTapGestureSystemOverlay()
{
TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
+ Dali::Integration::SystemOverlay& systemOverlay( application.GetCore().GetSystemOverlay() );
systemOverlay.GetOverlayRenderTasks().CreateTask();
Actor actor = Actor::New();
Vector2 screenCoords( 50.0f, 50.0f );
// Do a tap inside actor's area
- core.SendEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
- core.SendEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
+ application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
+ application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
}
void UtcDaliTouchNormalProcessing()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
// Emit a motion signal
screenCoordinates.x = screenCoordinates.y = 11.0f;
actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Motion, data.touchEvent.points[0].state, TEST_LOCATION );
// Emit an up signal
screenCoordinates.x = screenCoordinates.y = 12.0f;
actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Up, data.touchEvent.points[0].state, TEST_LOCATION );
// Emit a down signal where the actor is not present
screenCoordinates.x = screenCoordinates.y = 200.0f;
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
}
void UtcDaliTouchOutsideCameraNearFarPlanes()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Stage stage = Stage::GetCurrent();
Vector2 stageSize = stage.GetSize();
Vector2 screenCoordinates( stageSize.x * 0.5f, stageSize.y * 0.5f );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
application.SendNotification();
application.Render();
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
application.SendNotification();
application.Render();
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
application.SendNotification();
application.Render();
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
application.SendNotification();
application.Render();
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliTouchEmitEmpty()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
try
{
// Emit an empty TouchEvent
Integration::TouchEvent event;
- core.SendEvent( event );
+ application.ProcessEvent( event );
tet_result( TET_FAIL );
}
catch ( Dali::DaliException& e )
void UtcDaliTouchInterrupted()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
data.Reset();
// Emit an interrupted signal, we should be signalled regardless of whether there is a hit or not.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f /* Outside actor */ ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f /* Outside actor */ ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
data.Reset();
// Emit another interrupted signal, our signal handler should not be called.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
}
void UtcDaliTouchParentConsumer()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor rootActor( Stage::GetCurrent().GetRootLayer() );
Actor actor = Actor::New();
rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
screenCoordinates.x = screenCoordinates.y = 11.0f;
actor.ScreenToLocal( actorCoordinates.x, actorCoordinates.y, screenCoordinates.x, screenCoordinates.y );
rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
screenCoordinates.x = screenCoordinates.y = 12.0f;
actor.ScreenToLocal( actorCoordinates.x, actorCoordinates.y, screenCoordinates.x, screenCoordinates.y );
rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
// Emit a down signal where the actor is not present, will hit the root actor though
screenCoordinates.x = screenCoordinates.y = 200.0f;
rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, rootData.touchEvent.GetPointCount(), TEST_LOCATION );
void UtcDaliTouchInterruptedParentConsumer()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor rootActor( Stage::GetCurrent().GetRootLayer() );
Actor actor = Actor::New();
rootActor.TouchedSignal().Connect( &application, rootFunctor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::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( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
rootData.Reset();
// Emit an interrupted signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
rootData.Reset();
// Emit another down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::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( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
application.Render();
// Emit an interrupted signal, only root actor's signal should be called.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f /* Outside actor */ ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f /* Outside actor */ ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Interrupted, rootData.touchEvent.points[0].state, TEST_LOCATION );
rootData.Reset();
// Emit another interrupted state, none of the signal's should be called.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( false, rootData.functorCalled, TEST_LOCATION );
}
void UtcDaliTouchLeave()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.SetLeaveRequired( true );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
data.Reset();
// Emit a motion signal outside of actor, should be signalled with a Leave
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Leave, data.touchEvent.points[0].state, TEST_LOCATION );
data.Reset();
// Another motion outside of actor, no signalling
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 201.0f, 201.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 201.0f, 201.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
// Another motion event inside actor, signalled with motion
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 10.0f, 10.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 10.0f, 10.0f )) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Motion, data.touchEvent.points[0].state, TEST_LOCATION );
data.Reset();
actor.SetLeaveRequired( false );
// Another motion event outside of actor, no signalling
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliTouchLeaveParentConsumer()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor rootActor( Stage::GetCurrent().GetRootLayer() );
Actor actor = Actor::New();
rootActor.SetLeaveRequired( true );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::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( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
rootData.Reset();
// Emit a motion signal outside of actor, should be signalled with a Leave
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Leave, data.touchEvent.points[0].state, TEST_LOCATION );
rootData.Reset();
// Another motion outside of actor, only rootActor signalled
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 201.0f, 201.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 201.0f, 201.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Motion, rootData.touchEvent.points[0].state, TEST_LOCATION );
rootData.Reset();
// Another motion event inside actor, signalled with motion
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 10.0f, 10.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 10.0f, 10.0f )) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Motion, data.touchEvent.points[0].state, TEST_LOCATION );
// Another motion event outside of root actor, only root signalled
Vector2 stageSize( Stage::GetCurrent().GetSize() );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( stageSize.width + 10.0f, stageSize.height + 10.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( stageSize.width + 10.0f, stageSize.height + 10.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Leave, rootData.touchEvent.points[0].state, TEST_LOCATION );
void UtcDaliTouchActorBecomesInsensitive()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
data.Reset();
actor.SetSensitive( false );
// Emit a motion signal, signalled with an interrupted
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
data.Reset();
void UtcDaliTouchActorBecomesInsensitiveParentConsumer()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor rootActor( Stage::GetCurrent().GetRootLayer() );
Actor actor = Actor::New();
rootActor.TouchedSignal().Connect( &application, rootFunctor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::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( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
rootActor.SetSensitive( false );
// Emit a motion signal, signalled with an interrupted (should get interrupted even if within root actor)
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Interrupted, rootData.touchEvent.points[0].state, TEST_LOCATION );
void UtcDaliTouchMultipleLayers()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor rootActor( Stage::GetCurrent().GetRootLayer() );
// Connect to actor's touched signal
actor1.TouchedSignal().Connect( &application, functor );
// Hit in hittable area, actor1 should be hit
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.touchedActor == actor1 );
data.Reset();
// Make layer1 insensitive, nothing should be hit
layer1.SetSensitive( false );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
// Make layer1 sensitive again, again actor1 will be hit
layer1.SetSensitive( true );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.touchedActor == actor1 );
data.Reset();
// Make rootActor insensitive, nothing should be hit
rootActor.SetSensitive( false );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
actor2.TouchedSignal().Connect( &application, functor );
// Emit an event, should hit layer2
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
//DALI_TEST_CHECK( data.touchedActor == layer2 ); // TODO: Uncomment this after removing renderable hack!
data.Reset();
// Make layer2 insensitive, should hit actor1
layer2.SetSensitive( false );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.touchedActor == actor1 );
data.Reset();
// Make layer2 sensitive again, should hit layer2
layer2.SetSensitive( true );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
//DALI_TEST_CHECK( data.touchedActor == layer2 ); // TODO: Uncomment this after removing renderable hack!
data.Reset();
application.Render();
// Should hit actor1
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( data.touchedActor == actor1 );
data.Reset();
application.Render();
// Should not hit anything
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliTouchMultipleRenderTasks()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Stage stage ( Stage::GetCurrent() );
Vector2 stageSize ( stage.GetSize() );
actor.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
// Ensure renderTask actor can be hit too.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
// Disable input on renderTask, should not be hittable
renderTask.SetInputEnabled( false );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliTouchMultipleRenderTasksWithChildLayer()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Stage stage ( Stage::GetCurrent() );
Vector2 stageSize ( stage.GetSize() );
layer.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
// Ensure renderTask actor can be hit too.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
// Disable input on renderTask, should not be hittable
renderTask.SetInputEnabled( false );
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliTouchOffscreenRenderTasks()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Stage stage ( Stage::GetCurrent() );
Vector2 stageSize ( stage.GetSize() );
actor.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliTouchMultipleRenderableActors()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Stage stage ( Stage::GetCurrent() );
Vector2 stageSize ( stage.GetSize() );
actor.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( actor == data.touchedActor );
}
void UtcDaliTouchActorRemovedInSignal()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.SetLeaveRequired( true );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
application.Render();
// Emit another signal outside of actor's area, should not get anything as the scene has changed.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
application.Render();
// Emit another signal outside of actor's area, should not get anything as the scene has changed.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
application.Render();
// Emit another down event
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
actor = NULL;
// Emit event, should not crash and should not receive an event.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
}
void UtcDaliTouchActorSignalNotConsumed()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
}
void UtcDaliTouchActorUnStaged()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.TouchedSignal().Connect( &application, functor );
// Emit a down signal
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
application.Render();
// Emit a move at the same point, we should not be signalled.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
}
void UtcDaliTouchSystemOverlayActor()
{
TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
+ Dali::Integration::SystemOverlay& systemOverlay( application.GetCore().GetSystemOverlay() );
systemOverlay.GetOverlayRenderTasks().CreateTask();
// Create an actor and add it to the system overlay.
application.Render();
// Emit a down signal, the system overlay is drawn last so is at the top, should hit the systemActor.
- core.SendEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( systemActor == data.touchedActor );
}
mImpl->Resume();
}
-void Core::SendEvent(const Event& event)
-{
- mImpl->QueueEvent(event);
- mImpl->ProcessEvents();
-}
-
void Core::QueueEvent(const Event& event)
{
mImpl->QueueEvent(event);
void Resume();
/**
- * @deprecated - This is equivalent to:
- * @code
- * Core::QueueEvent(event);
- * Core::ProcessEvents();
- * @endcode
- */
- void SendEvent(const Event& event);
-
- /**
* Queue an event with Core.
* Pre-processing of events may be benificial e.g. a series of motion events could be throttled, so that only the last event is queued.
* Multi-threading note: this method should be called from the main thread.
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// CLASS HEADER
-#include "notification-event.h"
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-NotificationEvent::NotificationEvent()
-: Event(Event::Notification)
-{
-}
-
-NotificationEvent::~NotificationEvent()
-{
-}
-
-} // namespace Integration
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTEGRATION_NOTIFICATION_EVENT_H__
-#define __DALI_INTEGRATION_NOTIFICATION_EVENT_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/events/event.h>
-
-namespace Dali DALI_IMPORT_API
-{
-
-namespace Integration
-{
-
-/**
- * Notification events are sent in order to process messages queued (internally) during rendering.
- * For example, an event may be queued when an animation has finished during Core::Render().
- * The caller of Dali::Integration::Core::Render() is responsible for posting a NotificationEvent,
- * via the main thread's event loop.
- */
-struct NotificationEvent : public Event
-{
- // Construction & Destruction
-
- /**
- * Constructor
- */
- NotificationEvent();
-
- /**
- * Virtual Destructor
- */
- virtual ~NotificationEvent();
-};
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_NOTIFICATION_EVENT_H__
$(platform_abstraction_src_dir)/events/key-event-integ.cpp \
$(platform_abstraction_src_dir)/events/long-press-gesture-event.cpp \
$(platform_abstraction_src_dir)/events/mouse-wheel-event-integ.cpp \
- $(platform_abstraction_src_dir)/events/notification-event.cpp \
$(platform_abstraction_src_dir)/events/pan-gesture-event.cpp \
$(platform_abstraction_src_dir)/events/pinch-gesture-event.cpp \
$(platform_abstraction_src_dir)/events/tap-gesture-event.cpp \
$(platform_abstraction_src_dir)/events/key-event-integ.h \
$(platform_abstraction_src_dir)/events/long-press-gesture-event.h \
$(platform_abstraction_src_dir)/events/mouse-wheel-event-integ.h \
- $(platform_abstraction_src_dir)/events/notification-event.h \
$(platform_abstraction_src_dir)/events/pan-gesture-event.h \
$(platform_abstraction_src_dir)/events/pinch-gesture-event.h \
$(platform_abstraction_src_dir)/events/tap-gesture-event.h \
/**
* Requests a future call to Dali::Integration::Core::ProcessEvents(), when the application is idle.
- * TODO - Rename to RequestProcessEventsOnIdle()
* Multi-threading note: this method will be called from the main thread only.
*/
- virtual void RequestNotificationEventOnIdle() = 0;
+ virtual void RequestProcessEventsOnIdle() = 0;
};
if( mProcessingEvent )
{
DALI_LOG_ERROR( "ProcessEvents should not be called from within ProcessEvents!" );
- mRenderController.RequestNotificationEventOnIdle();
+ mRenderController.RequestProcessEventsOnIdle();
return;
}
}
}
- // SendEvent() may now be called again
+ // ProcessEvents() may now be called again
mProcessingEvent = false;
}
}
}
- // If we are inside core event processing, core will automatically flush the queue.
- // If we are outside, then we have to request an idle update to flush the queue
+ // If we are inside Core::ProcessEvents(), core will automatically flush the queue.
+ // If we are outside, then we have to request a call to Core::ProcessEvents() on idle.
if ( false == mImpl->processingEvents )
{
- mImpl->renderController.RequestNotificationEventOnIdle();
+ mImpl->renderController.RequestProcessEventsOnIdle();
}
return mImpl->currentMessageBuffer->ReserveMessageSlot( requestedSize );