Remove some public Setter/Getter APIs from Dali::Actor
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-HoverProcessing.cpp
index df73182..9e543ac 100644 (file)
@@ -137,7 +137,7 @@ int UtcDaliHoverNormalProcessing(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -206,8 +206,8 @@ int UtcDaliHoverOutsideCameraNearFarPlanes(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::CENTER);
-  actor.SetParentOrigin(ParentOrigin::CENTER);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
   stage.Add(actor);
 
   // Render and notify
@@ -307,7 +307,7 @@ int UtcDaliHoverInterrupted(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -344,7 +344,7 @@ int UtcDaliHoverParentConsumer(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -444,7 +444,7 @@ int UtcDaliHoverInterruptedParentConsumer(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -521,7 +521,7 @@ int UtcDaliHoverLeave(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -534,7 +534,7 @@ int UtcDaliHoverLeave(void)
   actor.HoveredSignal().Connect( &application, functor );
 
   // Set actor to require leave events
-  actor.SetLeaveRequired( true );
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
 
   // Emit a started signal
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
@@ -560,7 +560,7 @@ int UtcDaliHoverLeave(void)
   data.Reset();
 
   // We do not want to listen to leave events anymore
-  actor.SetLeaveRequired( false );
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, false );
 
   // Another motion event outside of actor, no signalling
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
@@ -576,7 +576,7 @@ int UtcDaliHoverLeaveParentConsumer(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -594,8 +594,8 @@ int UtcDaliHoverLeaveParentConsumer(void)
   rootActor.HoveredSignal().Connect( &application, rootFunctor );
 
   // Set actor to require leave events
-  actor.SetLeaveRequired( true );
-  rootActor.SetLeaveRequired( true );
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+  rootActor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
 
   // Emit a started signal
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
@@ -640,7 +640,7 @@ int UtcDaliHoverLeaveParentConsumer(void)
   rootData.Reset();
 
   // We do not want to listen to leave events of actor anymore
-  actor.SetLeaveRequired( false );
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, false );
 
   // Another motion event outside of root actor, only root signalled
   Vector2 stageSize( Stage::GetCurrent().GetSize() );
@@ -657,7 +657,7 @@ int UtcDaliHoverActorBecomesInsensitive(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -676,7 +676,7 @@ int UtcDaliHoverActorBecomesInsensitive(void)
   data.Reset();
 
   // Change actor to insensitive
-  actor.SetSensitive( false );
+  actor.SetProperty( Actor::Property::SENSITIVE, false );
 
   // Emit a motion signal, signalled with an interrupted
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
@@ -693,7 +693,7 @@ int UtcDaliHoverActorBecomesInsensitiveParentConsumer(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -729,7 +729,7 @@ int UtcDaliHoverActorBecomesInsensitiveParentConsumer(void)
   application.Render();
 
   // Make root actor insensitive
-  rootActor.SetSensitive( false );
+  rootActor.SetProperty( Actor::Property::SENSITIVE, false );
 
   // Emit a motion signal, signalled with an interrupted (should get interrupted even if within root actor)
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
@@ -750,12 +750,12 @@ int UtcDaliHoverMultipleLayers(void)
 
   Layer layer1 ( Layer::New() );
   layer1.SetSize(100.0f, 100.0f);
-  layer1.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  layer1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add( layer1 );
 
   Actor actor1 ( Actor::New() );
   actor1.SetSize( 100.0f, 100.0f );
-  actor1.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   actor1.SetZ( 1.0f ); // Should hit actor1 in this layer
   layer1.Add( actor1 );
 
@@ -774,37 +774,37 @@ int UtcDaliHoverMultipleLayers(void)
   data.Reset();
 
   // Make layer1 insensitive, nothing should be hit
-  layer1.SetSensitive( false );
+  layer1.SetProperty( Actor::Property::SENSITIVE, false );
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, 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 );
+  layer1.SetProperty( Actor::Property::SENSITIVE, true );
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   DALI_TEST_CHECK( data.hoveredActor == actor1 );
   data.Reset();
 
   // Make rootActor insensitive, nothing should be hit
-  rootActor.SetSensitive( false );
+  rootActor.SetProperty( Actor::Property::SENSITIVE, false );
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
   data.Reset();
 
   // Make rootActor sensitive
-  rootActor.SetSensitive( true );
+  rootActor.SetProperty( Actor::Property::SENSITIVE, true );
 
   // Add another layer
   Layer layer2 ( Layer::New() );
   layer2.SetSize(100.0f, 100.0f );
-  layer2.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  layer2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   layer2.SetZ( 10.0f ); // Should hit layer2 in this layer rather than actor2
   Stage::GetCurrent().Add( layer2 );
 
   Actor actor2 ( Actor::New() );
   actor2.SetSize(100.0f, 100.0f);
-  actor2.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   layer2.Add( actor2 );
 
   // Render and notify
@@ -822,21 +822,21 @@ int UtcDaliHoverMultipleLayers(void)
   data.Reset();
 
   // Make layer2 insensitive, should hit actor1
-  layer2.SetSensitive( false );
+  layer2.SetProperty( Actor::Property::SENSITIVE, false );
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   DALI_TEST_CHECK( data.hoveredActor == actor1 );
   data.Reset();
 
   // Make layer2 sensitive again, should hit layer2
-  layer2.SetSensitive( true );
+  layer2.SetProperty( Actor::Property::SENSITIVE, true );
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   //DALI_TEST_CHECK( data.hoveredActor == layer2 ); // TODO: Uncomment this after removing renderable hack!
   data.Reset();
 
   // Make layer2 invisible, render and notify
-  layer2.SetVisible( false );
+  layer2.SetProperty( Actor::Property::VISIBLE, false );
   application.SendNotification();
   application.Render();
 
@@ -847,7 +847,7 @@ int UtcDaliHoverMultipleLayers(void)
   data.Reset();
 
   // Make rootActor invisible, render and notify
-  rootActor.SetVisible( false );
+  rootActor.SetProperty( Actor::Property::VISIBLE, false );
   application.SendNotification();
   application.Render();
 
@@ -866,7 +866,7 @@ int UtcDaliHoverMultipleRenderTasks(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   stage.Add(actor);
 
   // Create render task
@@ -910,12 +910,12 @@ int UtcDaliHoverMultipleRenderTasksWithChildLayer(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   stage.Add(actor);
 
   Layer layer = Layer::New();
   layer.SetSize(100.0f, 100.0f);
-  layer.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   actor.Add(layer);
 
   // Create render task
@@ -964,14 +964,14 @@ int UtcDaliHoverOffscreenRenderTasks(void)
 
   // Create a renderable actor to display the FrameBufferImage
   Actor renderableActor = CreateRenderableActor( frameBufferImage );
-  renderableActor.SetParentOrigin(ParentOrigin::CENTER);
+  renderableActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
   renderableActor.SetSize( stageSize.x, stageSize.y );
   renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
   stage.Add( renderableActor );
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   stage.Add( actor );
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); // Ensure framebuffer connects
 
@@ -1011,12 +1011,12 @@ int UtcDaliHoverMultipleRenderableActors(void)
 
   Actor parent = CreateRenderableActor();
   parent.SetSize( 100.0f, 100.0f );
-  parent.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   stage.Add(parent);
 
   Actor actor = CreateRenderableActor();
   actor.SetSize( 100.0f, 100.0f );
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   parent.Add(actor);
 
   // Render and notify
@@ -1042,7 +1042,7 @@ int UtcDaliHoverActorRemovedInSignal(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -1055,7 +1055,7 @@ int UtcDaliHoverActorRemovedInSignal(void)
   actor.HoveredSignal().Connect( &application, functor );
 
   // Register for leave events
-  actor.SetLeaveRequired( true );
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
 
   // Emit a started signal
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
@@ -1111,7 +1111,7 @@ int UtcDaliHoverActorSignalNotConsumed(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -1135,7 +1135,7 @@ int UtcDaliHoverActorUnStaged(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   Stage::GetCurrent().Add(actor);
 
   // Render and notify
@@ -1173,11 +1173,11 @@ int UtcDaliHoverLeaveActorReadded(void)
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   stage.Add(actor);
 
   // Set actor to receive hover-events
-  actor.SetLeaveRequired( true );
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
 
   // Render and notify
   application.SendNotification();
@@ -1219,12 +1219,12 @@ int UtcDaliHoverClippingActor(void)
 
   Actor actor = Actor::New();
   actor.SetSize( 100.0f, 100.0f );
-  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   stage.Add( actor );
 
   Actor clippingActor = Actor::New();
   clippingActor.SetSize( 50.0f, 50.0f );
-  clippingActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  clippingActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   clippingActor.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
   stage.Add( clippingActor );
 
@@ -1232,7 +1232,7 @@ int UtcDaliHoverClippingActor(void)
   Actor clippingChild = Actor::New();
   clippingChild.SetSize( 50.0f, 50.0f );
   clippingChild.SetPosition( 25.0f, 25.0f );
-  clippingChild.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  clippingChild.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   clippingActor.Add( clippingChild );
 
   // Render and notify.