#include <stdlib.h>
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/hover-event-integ.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali-test-suite-utils.h>
END_TEST;
}
-int UtcDaliHoverSystemOverlayActor(void)
-{
- TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // Create an actor and add it to the system overlay.
- Actor systemActor = Actor::New();
- systemActor.SetSize(100.0f, 100.0f);
- systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add( systemActor );
-
- // Create an actor and add it to the stage as per normal, same position and size as systemActor
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
-
- // Connect to the hover signals.
- SignalData data;
- HoverEventFunctor functor( data );
- systemActor.HoveredSignal().Connect( &application, functor );
- actor.HoveredSignal().Connect( &application, functor );
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Emit a started signal, the system overlay is drawn last so is at the top, should hit the systemActor.
- application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( systemActor == data.hoveredActor );
- END_TEST;
-}
-
int UtcDaliHoverLeaveActorReadded(void)
{
TestApplication application;
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/long-press-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali-test-suite-utils.h>
#include <test-touch-utils.h>
END_TEST;
}
-int UtcDaliLongPressGestureSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.Attach(actor);
- detector.DetectedSignal().Connect(&application, functor);
-
- // Do a long press inside actor's area
- Vector2 screenCoords( 50.0f, 50.0f );
- application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
- application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliLongPressGestureBehindTouchableSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set system-overlay actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set stage actor to receive the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.Attach(stageActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- // Start long press within the two actors' area
- Vector2 screenCoords( 50.0f, 50.0f );
- application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
- application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliLongPressGestureTouchBehindGesturedSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set stage actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set system-overlay actor to have the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.Attach(systemOverlayActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- // Start long press within the two actors' area
- Vector2 screenCoords( 50.0f, 50.0f );
- application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
- application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
int UtcDaliLongPressGestureLayerConsumesTouch(void)
{
TestApplication application;
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/pan-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali/integration-api/profiling.h>
#include <dali/integration-api/input-options.h>
END_TEST;
}
-int UtcDaliPanGestureSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- PanGestureDetector detector = PanGestureDetector::New();
- detector.Attach(actor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoordsStart( 10.0f, 20.0f );
- Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
- // Start pan within the actor's area
- application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
- application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliPanGestureBehindTouchableSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set system-overlay actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set stage actor to receive the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- PanGestureDetector detector = PanGestureDetector::New();
- detector.Attach(stageActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoordsStart( 10.0f, 20.0f );
- Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
- // Start pan within the two actors' area
- application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
- application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
- application.ProcessEvent( GeneratePan( Gesture::Finished, screenCoordsStart, screenCoordsEnd, 10 ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoordsStart ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPanGestureTouchBehindGesturedSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set stage actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set system-overlay actor to have the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- PanGestureDetector detector = PanGestureDetector::New();
- detector.Attach(systemOverlayActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoordsStart( 10.0f, 20.0f );
- Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
- // Start pan within the two actors' area
- application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
- application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
- application.ProcessEvent( GeneratePan( Gesture::Finished, screenCoordsStart, screenCoordsEnd, 10 ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoordsStart ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
int UtcDaliPanGestureAngleHandling(void)
{
TestApplication application;
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/pinch-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali-test-suite-utils.h>
#include <test-touch-utils.h>
END_TEST;
}
-int UtcDaliPinchGestureSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- PinchGestureDetector detector = PinchGestureDetector::New();
- detector.Attach(actor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoords( 50.0f, 50.0f );
- float scale ( 10.0f );
- float speed ( 50.0f );
-
- // Start pan within the actor's area
- application.ProcessEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliPinchGestureBehindTouchableSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set system-overlay actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set stage actor to receive the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- PinchGestureDetector detector = PinchGestureDetector::New();
- detector.Attach(stageActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoords( 50.0f, 50.0f );
- float scale ( 10.0f );
- float speed ( 50.0f );
-
- // Start pinch within the two actors' area
- application.ProcessEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
- application.ProcessEvent( GeneratePinch( Gesture::Finished, scale, speed, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPinchGestureTouchBehindGesturedSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set stage actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set system-overlay actor to have the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- PinchGestureDetector detector = PinchGestureDetector::New();
- detector.Attach(systemOverlayActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoords( 50.0f, 50.0f );
- float scale ( 10.0f );
- float speed ( 50.0f );
-
- // Start pinch within the two actors' area
- application.ProcessEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
- application.ProcessEvent( GeneratePinch( Gesture::Finished, scale, speed, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
int UtcDaliPinchGestureLayerConsumesTouch(void)
{
TestApplication application;
#include <dali/public-api/dali-core.h>
#include <dali/devel-api/images/texture-set-image.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <cstdio>
#include <string>
DALI_TEST_CHECK( !( updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING ) );
- // For test coverage
- Dali::Integration::Core& core( application.GetCore() );
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList additionalRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
-
- // Render and check the update status
- application.SendNotification();
- application.Render();
-
END_TEST;
}
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/tap-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali-test-suite-utils.h>
#include <test-touch-utils.h>
END_TEST;
}
-int UtcDaliTapGestureSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- TapGestureDetector detector = TapGestureDetector::New();
- detector.Attach(actor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoords( 50.0f, 50.0f );
-
- // Do a tap inside actor's area
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliTapGestureBehindTouchableSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set system-overlay actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set stage actor to receive the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- TapGestureDetector detector = TapGestureDetector::New();
- detector.Attach(stageActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoords( 50.0f, 50.0f );
-
- // Do a tap inside both actors' area
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliTapGestureTouchBehindGesturedSystemOverlay(void)
-{
- TestApplication application;
- Dali::Integration::Core& core = application.GetCore();
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // SystemOverlay actor
- Actor systemOverlayActor = Actor::New();
- systemOverlayActor.SetSize(100.0f, 100.0f);
- systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add(systemOverlayActor);
-
- // Stage actor
- Actor stageActor = Actor::New();
- stageActor.SetSize(100.0f, 100.0f);
- stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(stageActor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Set stage actor to touchable
- TouchEventData touchData;
- TouchEventDataFunctor touchFunctor( touchData );
- stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
- // Set system-overlay actor to have the gesture
- SignalData data;
- GestureReceivedFunctor functor(data);
-
- TapGestureDetector detector = TapGestureDetector::New();
- detector.Attach(systemOverlayActor);
- detector.DetectedSignal().Connect(&application, functor);
-
- Vector2 screenCoords( 50.0f, 50.0f );
-
- // Do a tap inside both actors' area
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
- data.Reset();
- touchData.Reset();
-
- // Do touch in the same area
- application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
- DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
- DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
- END_TEST;
-}
-
int UtcDaliTapGestureLayerConsumesTouch(void)
{
TestApplication application;
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali-test-suite-utils.h>
END_TEST;
}
-int UtcDaliTouchDataSystemOverlayActor(void)
-{
- TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // Create an actor and add it to the system overlay.
- Actor systemActor = Actor::New();
- systemActor.SetSize(100.0f, 100.0f);
- systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add( systemActor );
-
- // Create an actor and add it to the stage as per normal, same position and size as systemActor
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
-
- // Connect to the touch signals.
- SignalData data;
- TouchDataFunctor functor( data );
- systemActor.TouchSignal().Connect( &application, functor );
- actor.TouchSignal().Connect( &application, functor );
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Emit a down signal, the system overlay is drawn last so is at the top, should hit the systemActor.
- application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( systemActor == data.touchedActor );
- END_TEST;
-}
-
int UtcDaliTouchDataLayerConsumesTouch(void)
{
TestApplication application;
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali-test-suite-utils.h>
END_TEST;
}
-int UtcDaliTouchSystemOverlayActor(void)
-{
- TestApplication application;
- Dali::Integration::Core& core( application.GetCore() );
- Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-
- Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
- Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
- Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
- Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
- systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
-
- // Create an actor and add it to the system overlay.
- Actor systemActor = Actor::New();
- systemActor.SetSize(100.0f, 100.0f);
- systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- systemOverlay.Add( systemActor );
-
- // Create an actor and add it to the stage as per normal, same position and size as systemActor
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
-
- // Connect to the touch signals.
- SignalData data;
- TouchEventFunctor functor( data );
- systemActor.TouchedSignal().Connect( &application, functor );
- actor.TouchedSignal().Connect( &application, functor );
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Emit a down signal, the system overlay is drawn last so is at the top, should hit the systemActor.
- application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
- DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( systemActor == data.touchedActor );
- END_TEST;
-}
-
int UtcDaliTouchLayerConsumesTouch(void)
{
TestApplication application;
${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp
${CMAKE_CURRENT_SOURCE_DIR}/profiling.cpp
${CMAKE_CURRENT_SOURCE_DIR}/input-options.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/system-overlay.cpp
${CMAKE_CURRENT_SOURCE_DIR}/lockless-buffer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/render-task-list-integ.cpp
${CMAKE_CURRENT_SOURCE_DIR}/events/event.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gesture-manager.h
${CMAKE_CURRENT_SOURCE_DIR}/render-controller.h
${CMAKE_CURRENT_SOURCE_DIR}/platform-abstraction.h
- ${CMAKE_CURRENT_SOURCE_DIR}/system-overlay.h
${CMAKE_CURRENT_SOURCE_DIR}/lockless-buffer.h
${CMAKE_CURRENT_SOURCE_DIR}/render-task-list-integ.h
mImpl->Render( status, forceClear );
}
-SystemOverlay& Core::GetSystemOverlay()
-{
- return mImpl->GetSystemOverlay();
-}
-
void Core::RegisterProcessor( Processor& processor )
{
mImpl->RegisterProcessor( processor );
class PlatformAbstraction;
class Processor;
class RenderController;
-class SystemOverlay;
struct Event;
struct TouchData;
*/
void Render( RenderStatus& status, bool forceClear );
- // System-level overlay
-
- /**
- * Use the SystemOverlay to draw content for system-level indicators, dialogs etc.
- * @return The SystemOverlay.
- */
- SystemOverlay& GetSystemOverlay();
-
/**
* @brief Register a processor
*
$(platform_abstraction_src_dir)/trace.cpp \
$(platform_abstraction_src_dir)/profiling.cpp \
$(platform_abstraction_src_dir)/input-options.cpp \
- $(platform_abstraction_src_dir)/system-overlay.cpp \
$(platform_abstraction_src_dir)/lockless-buffer.cpp \
$(platform_abstraction_src_dir)/render-task-list-integ.cpp \
$(platform_abstraction_src_dir)/events/event.cpp \
$(platform_abstraction_src_dir)/render-controller.h \
$(platform_abstraction_src_dir)/platform-abstraction.h \
$(platform_abstraction_src_dir)/processor-interface.h \
- $(platform_abstraction_src_dir)/system-overlay.h \
$(platform_abstraction_src_dir)/lockless-buffer.h \
$(platform_abstraction_src_dir)/render-task-list-integ.h
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 <dali/integration-api/system-overlay.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
-#include <dali/internal/event/render-tasks/render-task-list-impl.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-SystemOverlay::~SystemOverlay()
-{
- delete mImpl;
-}
-
-void SystemOverlay::Add( Actor actor )
-{
- mImpl->Add( GetImplementation(actor) );
-}
-
-void SystemOverlay::Remove( Actor actor )
-{
- mImpl->Remove( GetImplementation(actor) );
-}
-
-void SystemOverlay::SetOverlayRenderTasks(RenderTaskList& taskList)
-{
- mImpl->SetOverlayRenderTasks( GetImplementation( taskList ) );
-}
-
-RenderTaskList SystemOverlay::GetOverlayRenderTasks()
-{
- return RenderTaskList( &mImpl->GetOverlayRenderTasks() );
-}
-
-Actor SystemOverlay::GetDefaultRootActor()
-{
- return Actor( &mImpl->GetDefaultRootActor() );
-}
-
-CameraActor SystemOverlay::GetDefaultCameraActor()
-{
- return CameraActor( &mImpl->GetDefaultCameraActor() );
-}
-
-SystemOverlay::SystemOverlay( Internal::SystemOverlay* impl )
-: mImpl( impl )
-{
-}
-
-Internal::SystemOverlay* SystemOverlay::GetImpl()
-{
- return mImpl;
-}
-
-} // namespace Integration
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTEGRATION_SYSTEM_OVERLAY_H__
-#define __DALI_INTEGRATION_SYSTEM_OVERLAY_H__
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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/public-api/common/dali-common.h>
-
-namespace Dali
-{
-
-class Actor;
-class CameraActor;
-class RenderTaskList;
-
-namespace Internal
-{
-class SystemOverlay;
-}
-
-namespace Integration
-{
-
-/**
- * Use this interface to draw content for system-level indicators, dialogs etc.
- * The SystemOverlay is accessible using Dali::Integration::Core::GetSystemOverlay().
- */
-class DALI_CORE_API SystemOverlay
-{
-public:
-
- /**
- * Non-virtual destructor. SystemOverlay is not intended as a base class.
- */
- ~SystemOverlay();
-
- /**
- * Add an Actor to the SystemOverlay.
- * @pre The actor handle is not empty.
- * @param [in] actor A handle to the actor to add.
- * @post The actor will be referenced.
- */
- void Add( Actor actor );
-
- /**
- * Remove an Actor that was added to the SystemOverlay.
- * @pre The actor handle is not empty.
- * @param [in] actor A handle to the actor to remove.
- * @post The actor will be unreferenced.
- */
- void Remove( Actor actor );
-
- /**
- * Set the list of render-tasks for system-level overlays.
- * This is a separate list, processed after the render-tasks provided by Stage::GetRenderTaskList().
- * @param[in] taskList The list of overlay render-tasks.
- */
- void SetOverlayRenderTasks(RenderTaskList& taskList);
-
- /**
- * Retrieve the list of render-tasks for system-level overlays.
- * This is a separate list, processed after the render-tasks provided by Stage::GetRenderTaskList().
- * @return The list of overlay render-tasks.
- */
- RenderTaskList GetOverlayRenderTasks();
-
- /**
- * Retrieve the default SystemOverlay root actor.
- * @note This is different to the root actor provided by Dali::Stage.
- */
- Actor GetDefaultRootActor();
-
- /**
- * Retrieve the default SystemOverlay camera actor.
- * @note This is different to the default camera actor provided by Dali::Stage.
- */
- CameraActor GetDefaultCameraActor();
-
- /**
- * Create the SystemOverlay entrance.
- * This is not intended for adaptor implementors; see also Dali::Integration::Core::GetSystemOverlay().
- * @param[in] impl The SystemOverlay implementation.
- */
- SystemOverlay( Internal::SystemOverlay* impl );
-
- /**
- * Retreive the internal implementation; this is not intended for adaptor implementors.
- * @return The SystemOverlay implementation.
- */
- Internal::SystemOverlay* GetImpl();
-
-private:
-
- // Undefined copy-constructor.
- SystemOverlay( const SystemOverlay& core );
-
- // Undefined assignment operator.
- SystemOverlay& operator=( const SystemOverlay& rhs );
-
-private:
-
- Dali::Internal::SystemOverlay* mImpl;
-};
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_SYSTEM_OVERLAY_H__
${CMAKE_CURRENT_SOURCE_DIR}/event/common/property-notification-manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/event/common/property-helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/event/common/stage-impl.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/event/common/system-overlay-impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/event/common/thread-local-storage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/event/common/type-info-impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/event/common/type-registry-impl.cpp
#include <dali/internal/common/core-impl.h>
// INTERNAL INCLUDES
-#include <dali/integration-api/system-overlay.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/events/event.h>
return MAXIMUM_UPDATE_COUNT;
}
-Integration::SystemOverlay& Core::GetSystemOverlay()
-{
- return mStage->GetSystemOverlay();
-}
-
void Core::RegisterProcessor( Integration::Processor& processor )
{
mProcessors.PushBack(&processor);
class GestureManager;
class GlAbstraction;
class GlSyncAbstraction;
-class SystemOverlay;
class UpdateStatus;
class RenderStatus;
struct Event;
uint32_t GetMaximumUpdateCount() const;
/**
- * @copydoc Dali::Integration::Core::GetSystemOverlay()
- */
- Integration::SystemOverlay& GetSystemOverlay();
-
- /**
* @copydoc Dali::Integration::Core::RegisterProcessor
*/
void RegisterProcessor( Dali::Integration::Processor& processor );
DALI_ASSERT_DEBUG( NULL == mLayerList );
// Find the ordered layer-list
- // This is different for Layers added via Integration::GetSystemOverlay()
for ( Actor* parent = mParent; parent != NULL; parent = parent->GetParent() )
{
if( parent->IsLayer() )
* An ordered list of layers.
* Layers are not owned by the LayerList; each layer is responsible for registering & unregistering.
* This is used by the Stage, to keep track of layer depths.
- * A separate LayerList is maintained for actors added via the SystemOverlay::Add().
*/
class LayerList
{
#include <cstring> // for strcmp
// INTERNAL INCLUDES
-#include <dali/integration-api/system-overlay.h>
#include <dali/internal/event/actors/layer-impl.h>
#include <dali/internal/event/actors/layer-list.h>
#include <dali/internal/event/actors/camera-actor-impl.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/common/property-notification-manager.h>
#include <dali/internal/event/render-tasks/render-task-list-impl.h>
void Stage::Uninitialize()
{
- // Remove actors added to SystemOverlay
- delete mSystemOverlay;
- mSystemOverlay = NULL;
-
if( mDefaultCamera )
{
// its enough to release the handle so the object is released
mRootLayer->SetSize( mSize.width, mSize.height );
- // Repeat for SystemOverlay actors
- if( mSystemOverlay )
- {
- // Note that the SystemOverlay has a separate camera, configured for the full surface-size.
- // This will remain unaffected by changes in SetDefaultCameraPosition()
- mSystemOverlay->GetImpl()->SetSize( width, height );
- }
-
SetDefaultSurfaceRectMessage( mUpdateManager, Rect<int32_t>( 0, 0, static_cast<int32_t>( width ), static_cast<int32_t>( height ) ) ); // truncated
// if single render task to screen then set its viewport parameters
return *mLayerList;
}
-Integration::SystemOverlay& Stage::GetSystemOverlay()
-{
- // Lazily create system-level if requested
- if( !mSystemOverlay )
- {
- mSystemOverlay = new Integration::SystemOverlay( SystemOverlay::New( *this ) );
- DALI_ASSERT_ALWAYS( NULL != mSystemOverlay && "Failed to create system overlay" );
-
- mSystemOverlay->GetImpl()->SetSize( mSize.width, mSize.height );
- }
-
- return *mSystemOverlay;
-}
-
-SystemOverlay* Stage::GetSystemOverlayInternal()
-{
- SystemOverlay* overlay( NULL );
-
- if( mSystemOverlay )
- {
- overlay = mSystemOverlay->GetImpl();
- }
-
- return overlay;
-}
-
void Stage::SetBackgroundColor(Vector4 color)
{
// Cache for public GetBackgroundColor()
mBackgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
mTopMargin( 0 ),
mDpi( Vector2::ZERO ),
- mSystemOverlay( NULL ),
mKeyEventSignal(),
mKeyEventGeneratedSignal(),
mEventProcessingFinishedSignal(),
Stage::~Stage()
{
- delete mSystemOverlay;
-
- mObjectRegistry.Reset();
}
} // namespace Internal
namespace Integration
{
-class SystemOverlay;
class RenderController;
}
class PropertyNotificationManager;
class Layer;
class LayerList;
-class SystemOverlay;
class CameraActor;
class RenderTaskList;
*/
LayerList& GetLayerList();
- // System-level overlay actors
-
- /**
- * @copydoc Dali::Integration::Core::GetSystemOverlay()
- */
- Integration::SystemOverlay& GetSystemOverlay();
-
- /**
- * Retrieve the internal implementation of the SystemOverlay.
- * @return The implementation, or NULL if this has never been requested from Integration API.
- */
- SystemOverlay* GetSystemOverlayInternal();
-
// Keyboard stuff
/**
// The list of render-tasks
IntrusivePtr<RenderTaskList> mRenderTaskList;
- Integration::SystemOverlay* mSystemOverlay; ///< SystemOverlay stage access
-
// The key event signal
Dali::Stage::KeyEventSignalType mKeyEventSignal;
Dali::DevelStage::KeyEventGeneratedSignalType mKeyEventGeneratedSignal;
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 <dali/internal/event/common/system-overlay-impl.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/constants.h>
-#include <dali/internal/event/actors/camera-actor-impl.h>
-#include <dali/internal/event/actors/layer-impl.h>
-#include <dali/internal/event/actors/layer-list.h>
-#include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/render-tasks/render-task-list-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-SystemOverlay* SystemOverlay::New( EventThreadServices& eventThreadServices )
-{
- SystemOverlay* overlay = new SystemOverlay( eventThreadServices );
-
- overlay->Initialize();
-
- return overlay;
-}
-
-SystemOverlay::~SystemOverlay()
-{
- if ( mRootLayer )
- {
- // we are closing down so just delete the root, no point emit disconnect
- // signals or send messages to update
- mRootLayer.Reset();
- }
-}
-
-void SystemOverlay::Add( Actor& actor )
-{
- CreateRootLayer();
-
- mRootLayer->Add( actor );
-}
-
-void SystemOverlay::Remove( Actor& actor )
-{
- if ( mRootLayer )
- {
- mRootLayer->Remove( actor );
- }
-}
-
-void SystemOverlay::SetOverlayRenderTasks(RenderTaskList& taskList)
-{
- mOverlayRenderTaskList = &taskList;
-}
-
-RenderTaskList& SystemOverlay::GetOverlayRenderTasks()
-{
- return *mOverlayRenderTaskList;
-}
-
-void SystemOverlay::SetSize( float width, float height )
-{
- mSize = Vector2( width, height );
-
- if ( mRootLayer )
- {
- mRootLayer->SetSize( mSize.width, mSize.height );
- }
-
- if ( mDefaultCameraActor )
- {
- // Sets the default perspective projection for the given size.
- mDefaultCameraActor->SetPerspectiveProjection( mSize );
- }
-}
-
-LayerList& SystemOverlay::GetLayerList()
-{
- return *mLayerList;
-}
-
-Actor& SystemOverlay::GetDefaultRootActor()
-{
- CreateRootLayer();
-
- return *mRootLayer;
-}
-
-CameraActor& SystemOverlay::GetDefaultCameraActor()
-{
- CreateDefaultCameraActor();
-
- return *mDefaultCameraActor;
-}
-
-SystemOverlay::SystemOverlay( EventThreadServices& eventThreadServices )
-: mEventThreadServices( eventThreadServices )
-{
-}
-
-void SystemOverlay::Initialize()
-{
- // Create the ordered list of layers
- mLayerList = LayerList::New( mEventThreadServices.GetUpdateManager() );
-}
-
-void SystemOverlay::CreateRootLayer()
-{
- // Lazy initialization; SystemOverlay may never be used
- if ( !mRootLayer )
- {
- mRootLayer = Layer::NewRoot( *mLayerList, mEventThreadServices.GetUpdateManager() );
- mRootLayer->SetName("SystemOverlayRoot");
- mRootLayer->SetSize( mSize.width, mSize.height );
- }
-}
-
-void SystemOverlay::CreateDefaultCameraActor()
-{
- // Lazy initialization; SystemOverlay may never be used
- if ( !mDefaultCameraActor )
- {
- // Creates a default camera with a default perspective projection.
- mDefaultCameraActor = CameraActor::New( mSize );
- mDefaultCameraActor->SetParentOrigin( ParentOrigin::CENTER );
-
- Add( *mDefaultCameraActor );
- }
-}
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTERNAL_SYSTEM_OVERLAY_H__
-#define __DALI_INTERNAL_SYSTEM_OVERLAY_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
- *
- * 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/public-api/math/vector2.h>
-#include <dali/integration-api/system-overlay.h>
-#include <dali/internal/common/owner-pointer.h>
-#include <dali/internal/event/actors/actor-declarations.h>
-#include <dali/internal/event/render-tasks/render-task-defaults.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class LayerList;
-class RenderTaskList;
-class EventThreadServices;
-
-/**
- * Implementation of Dali::Integration::SystemOverlay
- */
-class SystemOverlay : public RenderTaskDefaults
-{
-public:
-
- /**
- * Create the SystemOverlay; This should only be done once for each Dali core.
- * @param[in] eventThreadServices to send messaged to scene graph.
- * @return The newly allocated SystemOverlay.
- */
- static SystemOverlay* New( EventThreadServices& eventThreadServices );
-
- /**
- * Non-virtual destructor; not intended as a base class.
- */
- ~SystemOverlay();
-
- /**
- * @copydoc Dali::Integration::SystemOverlay::Add()
- */
- void Add( Actor& actor );
-
- /**
- * @copydoc Dali::Integration::SystemOverlay::Remove()
- */
- void Remove( Actor& actor );
-
- /**
- * @copydoc Dali::Integration::SystemOverlay::SetOverlayRenderTasks()
- */
- void SetOverlayRenderTasks(RenderTaskList& taskList);
-
- /**
- * @copydoc Dali::Integration::SystemOverlay::GetOverlayRenderTasks()
- */
- RenderTaskList& GetOverlayRenderTasks();
-
- /**
- * Forwarded from Stage::SetSize().
- * @param[in] width The new width.
- * @param[in] height The new height.
- */
- void SetSize( float width, float height );
-
- /**
- * Retrieve the ordered list of system layers.
- * @return The layer-list.
- */
- LayerList& GetLayerList();
-
- /**
- * From RenderTaskDefaults.
- * Retrieve the default SystemOverlay root actor.
- * @note This is different to the root actor provided by Dali::Stage.
- */
- virtual Actor& GetDefaultRootActor();
-
- /**
- * From RenderTaskDefaults.
- * Retrieve the default SystemOverlay camera actor.
- * @note This is different to the default camera actor provided by Dali::Stage.
- */
- virtual CameraActor& GetDefaultCameraActor();
-
-private:
-
- /**
- * Protected constructor; see also SystemOverlay::New().
- * @param[in] eventThreadServices to send messaged to the scene graph.
- */
- SystemOverlay( EventThreadServices& eventThreadServices );
-
- /**
- * Second-phase construction.
- */
- void Initialize();
-
- /**
- * Lazy initialization of the SystemOverlay root actor.
- */
- void CreateRootLayer();
-
- /**
- * Lazy initialization of the default camera actor.
- */
- void CreateDefaultCameraActor();
-
-private:
-
- EventThreadServices& mEventThreadServices;
-
- Vector2 mSize;
-
- IntrusivePtr<RenderTaskList> mOverlayRenderTaskList;
-
- LayerPtr mRootLayer;
-
- CameraActorPtr mDefaultCameraActor;
-
- // Ordered list of currently on-stage layers
- OwnerPointer<LayerList> mLayerList;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_SYSTEM_OVERLAY_H__
#include <dali/internal/event/events/hit-test-algorithm-impl.h>
// INTERNAL INCLUDES
-#include <dali/integration-api/system-overlay.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/vector4.h>
#include <dali/internal/event/actors/camera-actor-impl.h>
#include <dali/internal/event/actors/layer-impl.h>
#include <dali/internal/event/actors/layer-list.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/common/projection.h>
#include <dali/internal/event/images/frame-buffer-image-impl.h>
{
bool wasHit( false );
- // Hit-test the system-overlay actors first
- SystemOverlay* systemOverlay = stage.GetSystemOverlayInternal();
-
- if( systemOverlay )
- {
- RenderTaskList& overlayTaskList = systemOverlay->GetOverlayRenderTasks();
- LayerList& overlayLayerList = systemOverlay->GetLayerList();
-
- wasHit = HitTestForEachRenderTask( stage, overlayLayerList, overlayTaskList, screenCoordinates, results, hitTestInterface );
- }
-
// Hit-test the regular on-stage actors
if( !wasHit )
{
// EXTERNAL INCLUDES
#if defined(DEBUG_ENABLED)
#include <sstream>
-#include <dali/internal/event/common/system-overlay-impl.h>
#endif // defined(DEBUG_ENABLED)
// INTERNAL INCLUDES
#include <dali/public-api/object/object-registry.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
#include <dali/internal/event/common/thread-local-storage.h>
namespace Dali
Dali::Actor rootLayer = stage.GetRootLayer();
RequestRelayoutTree( rootLayer );
- // Also add request on the root of system overlay
- Dali::Internal::SystemOverlay* systemOverlay = GetImplementation(stage).GetSystemOverlayInternal();
- if( systemOverlay )
- {
- Dali::Internal::Actor& systemOverlayInternalRoot = systemOverlay->GetDefaultRootActor();
- Dali::Actor systemOverlayRoot = Dali::Actor(&systemOverlayInternalRoot);
- RequestRelayoutTree( systemOverlayRoot );
- }
-
// Flag request for end of frame
Request();
}
$(internal_src_dir)/event/common/property-notification-manager.cpp \
$(internal_src_dir)/event/common/property-helper.cpp \
$(internal_src_dir)/event/common/stage-impl.cpp \
- $(internal_src_dir)/event/common/system-overlay-impl.cpp \
$(internal_src_dir)/event/common/thread-local-storage.cpp \
$(internal_src_dir)/event/common/type-info-impl.cpp \
$(internal_src_dir)/event/common/type-registry-impl.cpp \
* Create a message for setting the depth of a layer
* @param[in] manager The update manager
* @param[in] layers list of layers
- * @param[in] rootLayer True if the layers are added via the SystemOverlay API
+ * @param[in] rootLayer The rool layer
*/
inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
{