{
++gOnStageCallBackCalled;
gActorNamesOnOffStage.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) );
- DALI_TEST_CHECK( actor.OnStage() == true );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true );
}
static int gOffStageCallBackCalled;
void OffStageCallback( Actor actor )
{
++gOffStageCallBackCalled;
gActorNamesOnOffStage.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) );
- DALI_TEST_CHECK( actor.OnStage() == false );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == false );
}
struct PositionComponentConstraint
int UtcDaliActorGetId(void)
{
- tet_infoline("Testing Dali::Actor::UtcDaliActorGetId()");
+ tet_infoline("Testing Dali::Actor::UtcDaliActo.GetProperty< int >( Actor::Property::ID )");
TestApplication application;
Actor first = Actor::New();
Actor second = Actor::New();
Actor third = Actor::New();
- DALI_TEST_CHECK(first.GetId() != second.GetId());
- DALI_TEST_CHECK(second.GetId() != third.GetId());
+ DALI_TEST_CHECK(first.GetProperty< int >( Actor::Property::ID ) != second.GetProperty< int >( Actor::Property::ID ));
+ DALI_TEST_CHECK(second.GetProperty< int >( Actor::Property::ID ) != third.GetProperty< int >( Actor::Property::ID ));
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK(!actor.IsRoot());
+ DALI_TEST_CHECK(!actor.GetProperty< bool >( Actor::Property::IS_ROOT ));
// get the root layer
actor = Stage::GetCurrent().GetLayer( 0 );
- DALI_TEST_CHECK( actor.IsRoot() );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::IS_ROOT ) );
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
// get the root layer
actor = Stage::GetCurrent().GetLayer( 0 );
- DALI_TEST_CHECK( actor.OnStage() );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.IsLayer() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::IS_LAYER ) );
// get the root layer
actor = Stage::GetCurrent().GetLayer( 0 );
- DALI_TEST_CHECK( actor.IsLayer() );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::IS_LAYER ) );
END_TEST;
}
application.SendNotification();
application.Render();
- parent.SetProperty( DevelActor::Property::OPACITY, 0.1f );
+ parent.SetProperty( Actor::Property::OPACITY, 0.1f );
DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
Actor actor = Actor::New();
// initial opacity is 1
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
- actor.SetProperty( DevelActor::Property::OPACITY, 0.4f);
+ actor.SetProperty( Actor::Property::OPACITY, 0.4f);
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.4f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.4f, TEST_LOCATION );
// change opacity, actor is on stage to change is not immediate
- actor.SetProperty( DevelActor::Property::OPACITY, actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) + 0.1f );
+ actor.SetProperty( Actor::Property::OPACITY, actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) + 0.1f );
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.5f, TEST_LOCATION );
// put actor on stage
Stage::GetCurrent().Add( actor );
// change opacity, actor is on stage to change is not immediate
- actor.SetProperty( DevelActor::Property::OPACITY, 0.9f );
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.5f, TEST_LOCATION );
+ actor.SetProperty( Actor::Property::OPACITY, 0.9f );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.5f, TEST_LOCATION );
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.9f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.9f, TEST_LOCATION );
// change opacity, actor is on stage to change is not immediate
- actor.SetProperty( DevelActor::Property::OPACITY, actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) - 0.9f );
+ actor.SetProperty( Actor::Property::OPACITY, actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) - 0.9f );
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) != 0.5f);
+ DALI_TEST_CHECK(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) != 0.5f);
- actor.SetProperty( DevelActor::Property::OPACITY,0.5f);
+ actor.SetProperty( Actor::Property::OPACITY,0.5f);
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_CHECK(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) == 0.5f);
+ DALI_TEST_CHECK(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) == 0.5f);
END_TEST;
}
DALI_TEST_EQUALS( vector, actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION );
DALI_TEST_EQUALS( vector, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION );
- actor.SetProperty( DevelActor::Property::OPACITY, 0.2f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.2f );
// flush the queue and render once
Actor actor = Actor::New();
- actor.SetKeyboardFocusable(true);
- DALI_TEST_CHECK(actor.IsKeyboardFocusable() == true);
+ actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
+ DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == true);
- actor.SetKeyboardFocusable(false);
- DALI_TEST_CHECK(actor.IsKeyboardFocusable() == false);
+ actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, false );
+ DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == false);
END_TEST;
}
Actor actor = Actor::New();
- DALI_TEST_CHECK(actor.IsKeyboardFocusable() == false);
+ DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == false);
END_TEST;
}
Actor found = parent.FindChildById( 100000 );
DALI_TEST_CHECK( !found );
- found = parent.FindChildById( parent.GetId() );
+ found = parent.FindChildById( parent.GetProperty< int >( Actor::Property::ID ) );
DALI_TEST_CHECK( found == parent );
- found = parent.FindChildById( first.GetId() );
+ found = parent.FindChildById( first.GetProperty< int >( Actor::Property::ID ) );
DALI_TEST_CHECK( found == first );
- found = parent.FindChildById( second.GetId() );
+ found = parent.FindChildById( second.GetProperty< int >( Actor::Property::ID ) );
DALI_TEST_CHECK( found == second );
END_TEST;
}
tet_infoline(" UtcDaliActorConstrainedToOpacity");
Actor parent = Actor::New();
- parent.SetProperty( DevelActor::Property::OPACITY, 0.7f );
+ parent.SetProperty( Actor::Property::OPACITY, 0.7f );
Stage::GetCurrent().Add( parent );
Actor child = Actor::New();
- Constraint opacityConstraint = Constraint::New<float>( child, DevelActor::Property::OPACITY, EqualToConstraint() );
- opacityConstraint.AddSource( Source( parent, DevelActor::Property::OPACITY ) );
+ Constraint opacityConstraint = Constraint::New<float>( child, Actor::Property::OPACITY, EqualToConstraint() );
+ opacityConstraint.AddSource( Source( parent, Actor::Property::OPACITY ) );
opacityConstraint.Apply();
Stage::GetCurrent().Add( child );
app.Render();
app.SendNotification();
- DALI_TEST_EQUALS( child.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), parent.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentProperty< float >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION );
- parent.SetProperty( DevelActor::Property::OPACITY, 0.3f );
+ parent.SetProperty( Actor::Property::OPACITY, 0.3f );
app.SendNotification();
app.Render(0);
app.Render();
app.SendNotification();
- DALI_TEST_EQUALS( child.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), parent.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentProperty< float >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION );
END_TEST;
}
{ "maximumSize", Actor::Property::MAXIMUM_SIZE, Property::VECTOR2 },
{ "inheritPosition", Actor::Property::INHERIT_POSITION, Property::BOOLEAN },
{ "clippingMode", Actor::Property::CLIPPING_MODE, Property::STRING },
- { "opacity", DevelActor::Property::OPACITY, Property::FLOAT },
+ { "opacity", Actor::Property::OPACITY, Property::FLOAT },
};
const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] );
} // unnamed namespace
Actor actorF = Actor::New();
//Test that root actor has depth equal 0
- DALI_TEST_EQUALS( 0, stage.GetRootLayer().GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0, stage.GetRootLayer().GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Test actors return depth -1 when not connected to the tree
- DALI_TEST_EQUALS( -1, actorA.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorC.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorE.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorF.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Create the hierarchy
stage.Add( actorA );
actorC.Add( actorF );
//Test actors return correct depth
- DALI_TEST_EQUALS( 1, actorA.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 2, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 2, actorC.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 3, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 3, actorE.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 3, actorF.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 2, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 2, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 3, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 3, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 3, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Removing actorB from the hierarchy. actorB, actorD and actorE should now have depth equal -1
actorA.Remove( actorB );
- DALI_TEST_EQUALS( -1, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorE.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Removing actorA from the stage. All actors should have depth equal -1
stage.Remove( actorA );
- DALI_TEST_EQUALS( -1, actorA.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorC.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorE.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorF.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
END_TEST;
}
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position %f %f \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
DALI_TEST_EQUALS( actorScreenPosition.x, 30lu , TEST_LOCATION );
DALI_TEST_EQUALS( actorScreenPosition.y, 420lu , TEST_LOCATION );
application.SendNotification();
application.Render();
- actorScreenPosition = actorB.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
DALI_TEST_EQUALS( actorScreenPosition.x, 50lu , TEST_LOCATION );
DALI_TEST_EQUALS( actorScreenPosition.y, 50lu , TEST_LOCATION );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT ParentOrigin::TOP_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_LEFT ParentOrigin::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
Actor actorA = Actor::New();
actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- actorA.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actorA.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
actorA.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 20.0f ) );
stage.Add( actorA );
Actor actorB = Actor::New();
actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT );
actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- actorB.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actorB.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
Vector2 actorBSize( 30.0f, 60.0f );
actorB.SetProperty( Actor::Property::SIZE, actorBSize );
stage.Add( actorB );
Actor actorC = Actor::New();
actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- actorC.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actorC.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
Vector2 actorCSize( 60.0f, 120.0f );
actorC.SetProperty( Actor::Property::SIZE, actorCSize );
stage.Add( actorC );
Vector2 center( stage.GetSize() * 0.5f );
- DALI_TEST_EQUALS( actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
- DALI_TEST_EQUALS( actorB.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
- DALI_TEST_EQUALS( actorC.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorC.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
tet_infoline( "Add scale to all actors" );
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center /* TOP_LEFT Anchor */, TEST_LOCATION );
- DALI_TEST_EQUALS( actorB.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorBSize /* BOTTOM_RIGHT Anchor */, TEST_LOCATION );
- DALI_TEST_EQUALS( actorC.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorCSize * 0.5f /* CENTER Anchor*/, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center /* TOP_LEFT Anchor */, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorBSize /* BOTTOM_RIGHT Anchor */, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorC.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorCSize * 0.5f /* CENTER Anchor*/, TEST_LOCATION );
END_TEST;
}
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION );
tet_infoline( "Set the position uses anchor point property to false\n" );
- actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
application.SendNotification();
application.Render();
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::SCALE, 2.0f );
- actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
Stage::GetCurrent().Add( actor );
application.SendNotification();
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) );
- actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
Stage::GetCurrent().Add( actor );
application.SendNotification();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) );
actor.SetProperty( Actor::Property::SCALE, 2.0f );
- actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
Stage::GetCurrent().Add( actor );
application.SendNotification();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::INHERIT_SCALE, false );
actor.SetProperty( Actor::Property::INHERIT_ORIENTATION, false );
- actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
parent.Add( actor );
application.SendNotification();
application.SendNotification();
application.Render( 0 );
- DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::CULLED ), false, TEST_LOCATION );
- PropertyNotification notification = actor.AddPropertyNotification( DevelActor::Property::CULLED, LessThanCondition( 0.5f ) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::CULLED, LessThanCondition( 0.5f ) );
notification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
// Connect NotifySignal
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::CULLED ), true, TEST_LOCATION );
DALI_TEST_EQUALS( propertyNotificationSignal, true, TEST_LOCATION );
- DALI_TEST_EQUALS( source.GetTargetProperty(), static_cast< int >( DevelActor::Property::CULLED ), TEST_LOCATION );
+ DALI_TEST_EQUALS( source.GetTargetProperty(), static_cast< int >( Actor::Property::CULLED ), TEST_LOCATION );
DALI_TEST_EQUALS( source.GetTarget().GetProperty< bool >( source.GetTargetProperty() ), true, TEST_LOCATION );
END_TEST;
DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetColor.g, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetColor.b, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetColor.a, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetColor.a, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::OPACITY ), targetColor.a, TEST_LOCATION );
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
// Target value should be retrievable straight away
DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, startValue, startValue, targetAlpha ), TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetAlpha, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetAlpha, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::OPACITY ), targetAlpha, TEST_LOCATION );
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
// Apply animation to actor
animation.AnimateTo( Property(actor, Actor::Property::POSITION), Vector3( 100.f, 90.f, 80.f ), AlphaFunction::LINEAR );
- animation.AnimateTo( Property(actor, DevelActor::Property::OPACITY), 0.3f, AlphaFunction::LINEAR );
+ animation.AnimateTo( Property(actor, Actor::Property::OPACITY), 0.3f, AlphaFunction::LINEAR );
animation.Play();
{ "clippingMode", Property::STRING, true, false, false, Dali::Actor::Property::CLIPPING_MODE },
{ "layoutDirection", Property::STRING, true, false, false, Dali::Actor::Property::LAYOUT_DIRECTION },
{ "inheritLayoutDirection", Property::BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION },
+ { "opacity", Property::FLOAT, true, true, true, Dali::Actor::Property::OPACITY },
+ { "screenPosition", Property::VECTOR2, false, false, false, Dali::Actor::Property::SCREEN_POSITION },
+ { "positionUsesAnchorPoint",Property::BOOLEAN, true, false, false, Dali::Actor::Property::POSITION_USES_ANCHOR_POINT },
+ { "culled", Property::BOOLEAN, false, false, true, Dali::Actor::Property::CULLED },
+ { "id", Property::INTEGER, false, false, false, Dali::Actor::Property::ID },
+ { "hierarchyDepth", Property::INTEGER, false, false, false, Dali::Actor::Property::HIERARCHY_DEPTH },
+ { "isRoot", Property::BOOLEAN, false, false, false, Dali::Actor::Property::IS_ROOT },
+ { "isLayer", Property::BOOLEAN, false, false, false, Dali::Actor::Property::IS_LAYER },
+ { "connectedToScene", Property::BOOLEAN, false, false, false, Dali::Actor::Property::CONNECTED_TO_SCENE },
+ { "keyboardFocusable", Property::BOOLEAN, true, false, false, Dali::Actor::Property::KEYBOARD_FOCUSABLE },
{ "siblingOrder", Property::INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER },
- { "opacity", Property::FLOAT, true, true, true, Dali::DevelActor::Property::OPACITY },
- { "screenPosition", Property::VECTOR2, false, false, false, Dali::DevelActor::Property::SCREEN_POSITION },
- { "positionUsesAnchorPoint",Property::BOOLEAN, true, false, false, Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT },
- { "culled", Property::BOOLEAN, false, false, true, Dali::DevelActor::Property::CULLED },
// camera own
{ "type", Property::STRING, true, false, true, Dali::CameraActor::Property::TYPE },
{ "projectionMode", Property::STRING, true, false, true, Dali::CameraActor::Property::PROJECTION_MODE },
custom.ConnectSignal( &application, "offStage",
[weakRef]()
{
- DALI_TEST_EQUALS( weakRef.GetHandle().OnStage(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( weakRef.GetHandle().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ), false, TEST_LOCATION );
} );
Stage::GetCurrent().Remove( custom );
Stage stage = Stage::GetCurrent();
stage.Add( actor );
- FrameCallbackOneActor frameCallback( actor.GetId() );
+ FrameCallbackOneActor frameCallback( actor.GetProperty< int >( Actor::Property::ID ) );
DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
application.SendNotification();
Vector4 colorToSet( Color::MAGENTA );
Vector3 scaleToSet( 1.0f, 3.0f, 5.0f );
- FrameCallbackSetter frameCallback( actor.GetId(), sizeToSet, positionToSet, colorToSet, scaleToSet );
+ FrameCallbackSetter frameCallback( actor.GetProperty< int >( Actor::Property::ID ), sizeToSet, positionToSet, colorToSet, scaleToSet );
DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
application.SendNotification();
Vector4 colorToSet( Color::MAGENTA );
Vector3 scaleToSet( 1.0f, 3.0f, 5.0f );
- FrameCallbackBaker frameCallback( actor.GetId(), sizeToSet, positionToSet, colorToSet, scaleToSet );
+ FrameCallbackBaker frameCallback( actor.GetProperty< int >( Actor::Property::ID ), sizeToSet, positionToSet, colorToSet, scaleToSet );
DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
application.SendNotification();
actorG.Add( actorH );
std::map< char, unsigned int > actorIds;
- actorIds['A'] = actorA.GetId();
- actorIds['B'] = actorB.GetId();
- actorIds['C'] = actorC.GetId();
- actorIds['D'] = actorD.GetId();
- actorIds['E'] = actorE.GetId();
- actorIds['F'] = actorF.GetId();
- actorIds['G'] = actorG.GetId();
- actorIds['H'] = actorH.GetId();
+ actorIds['A'] = actorA.GetProperty< int >( Actor::Property::ID );
+ actorIds['B'] = actorB.GetProperty< int >( Actor::Property::ID );
+ actorIds['C'] = actorC.GetProperty< int >( Actor::Property::ID );
+ actorIds['D'] = actorD.GetProperty< int >( Actor::Property::ID );
+ actorIds['E'] = actorE.GetProperty< int >( Actor::Property::ID );
+ actorIds['F'] = actorF.GetProperty< int >( Actor::Property::ID );
+ actorIds['G'] = actorG.GetProperty< int >( Actor::Property::ID );
+ actorIds['H'] = actorH.GetProperty< int >( Actor::Property::ID );
FrameCallbackMultipleActors frameCallback;
for( auto&& i : actorIds )
actor.SetProperty( Actor::Property::SIZE, Vector2( 200, 300 ) );
Stage stage = Stage::GetCurrent();
- FrameCallbackOneActor frameCallback( actor.GetId() );
+ FrameCallbackOneActor frameCallback( actor.GetProperty< int >( Actor::Property::ID ) );
DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
application.SendNotification();
Actor actor = Actor::New();
stage.Add( actor );
- FrameCallbackActorIdCheck frameCallback( actor.GetId() );
+ FrameCallbackActorIdCheck frameCallback( actor.GetProperty< int >( Actor::Property::ID ) );
DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
application.SendNotification();
DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_GREEN ) );
DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_BLUE ) );
DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_ALPHA ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( DevelActor::Property::OPACITY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::OPACITY ) );
// World-properties are not writable:
DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_POSITION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_GREEN ) );
DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_BLUE ) );
DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_ALPHA ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( DevelActor::Property::OPACITY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::OPACITY ) );
// World-properties can not be animated
DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_POSITION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_GREEN ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_BLUE ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_ALPHA ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( DevelActor::Property::OPACITY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::OPACITY ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_POSITION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_ORIENTATION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_SCALE ) );
Actor actor = Actor::New();
// set a transparent actor color so that blending is enabled
- actor.SetProperty( DevelActor::Property::OPACITY, 0.5f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.5f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
Stage::GetCurrent().Add(actor);
Renderer renderer = Renderer::New( geometry, shader );
Actor actor = Actor::New();
- actor.SetProperty( DevelActor::Property::OPACITY, 0.5f ); // enable blending
+ actor.SetProperty( Actor::Property::OPACITY, 0.5f ); // enable blending
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
Stage::GetCurrent().Add(actor);
Renderer renderer = Renderer::New( geometry, shader );
Actor actor = Actor::New();
- actor.SetProperty( DevelActor::Property::OPACITY, 0.1f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.1f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
Stage::GetCurrent().Add(actor);
Renderer renderer = Renderer::New( geometry, shader );
Actor actor = Actor::New();
- actor.SetProperty( DevelActor::Property::OPACITY, 0.98f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.98f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
Stage::GetCurrent().Add(actor);
Renderer renderer = Renderer::New( geometry, shader );
Actor actor = Actor::New();
- actor.SetProperty( DevelActor::Property::OPACITY, 0.0f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.0f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
Stage::GetCurrent().Add(actor);
Renderer renderer = Renderer::New( geometry, shader );
Actor actor = Actor::New();
- actor.SetProperty( DevelActor::Property::OPACITY, 0.15f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.15f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
Stage::GetCurrent().Add(actor);
Renderer renderer = Renderer::New( geometry, shader );
Actor actor = Actor::New();
- actor.SetProperty( DevelActor::Property::OPACITY, 0.75f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.75f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
Stage::GetCurrent().Add(actor);
Dali::Integration::Scene scene = application.GetScene();
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
scene.Add( actor );
- DALI_TEST_CHECK( actor.OnStage() );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
END_TEST;
}
Dali::Integration::Scene scene = application.GetScene();
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
scene.Add( actor );
- DALI_TEST_CHECK( actor.OnStage() );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
scene.Remove(actor);
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
END_TEST;
}
Stage stage = Stage::GetCurrent();
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
stage.Add( actor );
- DALI_TEST_CHECK( actor.OnStage() );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
END_TEST;
}
Stage stage = Stage::GetCurrent();
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
stage.Add( actor );
- DALI_TEST_CHECK( actor.OnStage() );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
stage.Remove(actor);
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
END_TEST;
}
Stage stage = Stage::GetCurrent();
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
bool asserted = false;
try
#define DALI_ACTOR_DEVEL_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
INHERIT_ORIENTATION = Dali::Actor::Property::INHERIT_ORIENTATION,
INHERIT_SCALE = Dali::Actor::Property::INHERIT_SCALE,
COLOR_MODE = Dali::Actor::Property::COLOR_MODE,
- RESERVED_PROPERTY_01 = Dali::Actor::Property::RESERVED_PROPERTY_01,
DRAW_MODE = Dali::Actor::Property::DRAW_MODE,
SIZE_MODE_FACTOR = Dali::Actor::Property::SIZE_MODE_FACTOR,
WIDTH_RESIZE_POLICY = Dali::Actor::Property::WIDTH_RESIZE_POLICY,
CLIPPING_MODE = Dali::Actor::Property::CLIPPING_MODE,
LAYOUT_DIRECTION = Dali::Actor::Property::LAYOUT_DIRECTION,
INHERIT_LAYOUT_DIRECTION = Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION,
+ OPACITY = Dali::Actor::Property::OPACITY,
+ SCREEN_POSITION = Dali::Actor::Property::SCREEN_POSITION,
+ POSITION_USES_ANCHOR_POINT = Dali::Actor::Property::POSITION_USES_ANCHOR_POINT,
+ CULLED = Dali::Actor::Property::CULLED,
+ ID = Dali::Actor::Property::ID,
+ HIERARCHY_DEPTH = Dali::Actor::Property::HIERARCHY_DEPTH,
+ IS_ROOT = Dali::Actor::Property::IS_ROOT,
+ IS_LAYER = Dali::Actor::Property::IS_LAYER,
+ CONNECTED_TO_SCENE = Dali::Actor::Property::CONNECTED_TO_SCENE,
+ KEYBOARD_FOCUSABLE = Dali::Actor::Property::KEYBOARD_FOCUSABLE,
/**
* @brief Sets the sibling order of the actor so depth position can be defined within the same parent.
* @note Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove and LowerBelow will override the
* sibling order. The values set by this Property will likely change.
*/
- SIBLING_ORDER = INHERIT_LAYOUT_DIRECTION + 1,
-
- /**
- * @brief The opacity of the actor.
- * @details Name "opacity", type Property::FLOAT.
- */
- OPACITY = INHERIT_LAYOUT_DIRECTION + 2,
-
- /**
- * @brief Returns the screen position of the Actor
- * @details Name "screenPosition", type Property::VECTOR2. Read-only
- * @note This assumes default camera and default render-task and the Z position is ZERO.
- * @note The last known frame is used for the calculation. May not match a position value just set.
- */
- SCREEN_POSITION = INHERIT_LAYOUT_DIRECTION + 3,
-
- /**
- * @brief Determines whether the anchor point should be used to determine the position of the actor.
- * @details Name "positionUsesAnchorPoint", type Property::BOOLEAN.
- * @note This is true by default.
- * @note If false, then the top-left of the actor is used for the position.
- * @note Setting this to false will allow scaling or rotation around the anchor-point without affecting the actor's position.
- */
- POSITION_USES_ANCHOR_POINT = INHERIT_LAYOUT_DIRECTION + 4,
-
- /**
- * @brief Returns whether the actor is culled or not.
- * @details Name "culled", type Property::BOOLEAN. Read-only
- * @note True means that the actor is out of the view frustum.
- */
- CULLED = INHERIT_LAYOUT_DIRECTION + 5,
+ SIBLING_ORDER = KEYBOARD_FOCUSABLE + 1,
};
} // namespace Property
DALI_PROPERTY( "inheritOrientation", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_ORIENTATION )
DALI_PROPERTY( "inheritScale", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_SCALE )
DALI_PROPERTY( "colorMode", INTEGER, true, false, false, Dali::Actor::Property::COLOR_MODE )
-DALI_PROPERTY( "reservedProperty01", STRING, true, false, false, Dali::Actor::Property::RESERVED_PROPERTY_01 ) // This property was removed, but to keep binary compatibility and TypeRegister test app, remain it here.
DALI_PROPERTY( "drawMode", INTEGER, true, false, false, Dali::Actor::Property::DRAW_MODE )
DALI_PROPERTY( "sizeModeFactor", VECTOR3, true, false, false, Dali::Actor::Property::SIZE_MODE_FACTOR )
DALI_PROPERTY( "widthResizePolicy", STRING, true, false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY )
DALI_PROPERTY( "clippingMode", STRING, true, false, false, Dali::Actor::Property::CLIPPING_MODE )
DALI_PROPERTY( "layoutDirection", STRING, true, false, false, Dali::Actor::Property::LAYOUT_DIRECTION )
DALI_PROPERTY( "inheritLayoutDirection", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION )
+DALI_PROPERTY( "opacity", FLOAT, true, true, true, Dali::Actor::Property::OPACITY )
+DALI_PROPERTY( "screenPosition", VECTOR2, false, false, false, Dali::Actor::Property::SCREEN_POSITION )
+DALI_PROPERTY( "positionUsesAnchorPoint", BOOLEAN, true, false, false, Dali::Actor::Property::POSITION_USES_ANCHOR_POINT )
+DALI_PROPERTY( "culled", BOOLEAN, false, false, true, Dali::Actor::Property::CULLED )
+DALI_PROPERTY( "id", INTEGER, false, false, false, Dali::Actor::Property::ID )
+DALI_PROPERTY( "hierarchyDepth", INTEGER, false, false, false, Dali::Actor::Property::HIERARCHY_DEPTH )
+DALI_PROPERTY( "isRoot", BOOLEAN, false, false, false, Dali::Actor::Property::IS_ROOT )
+DALI_PROPERTY( "isLayer", BOOLEAN, false, false, false, Dali::Actor::Property::IS_LAYER )
+DALI_PROPERTY( "connectedToScene", BOOLEAN, false, false, false, Dali::Actor::Property::CONNECTED_TO_SCENE )
+DALI_PROPERTY( "keyboardFocusable", BOOLEAN, true, false, false, Dali::Actor::Property::KEYBOARD_FOCUSABLE )
DALI_PROPERTY( "siblingOrder", INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER )
-DALI_PROPERTY( "opacity", FLOAT, true, true, true, Dali::DevelActor::Property::OPACITY )
-DALI_PROPERTY( "screenPosition", VECTOR2, false, false, false, Dali::DevelActor::Property::SCREEN_POSITION )
-DALI_PROPERTY( "positionUsesAnchorPoint", BOOLEAN, true, false, false, Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT )
-DALI_PROPERTY( "culled", BOOLEAN, false, false, true, Dali::DevelActor::Property::CULLED )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties )
// Signals
}
case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::DevelActor::Property::OPACITY:
+ case Dali::Actor::Property::OPACITY:
{
float value;
if( property.Get( value ) )
break;
}
- case Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT:
+ case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT:
{
bool value = false;
if( property.Get( value ) && value != mPositionUsesAnchorPoint )
break;
}
+ case Dali::Actor::Property::KEYBOARD_FOCUSABLE:
+ {
+ bool value = false;
+ if( property.Get( value ) )
+ {
+ SetKeyboardFocusable( value );
+ }
+ break;
+ }
+
default:
{
// this can happen in the case of a non-animatable default property so just do nothing
}
case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::DevelActor::Property::OPACITY:
+ case Dali::Actor::Property::OPACITY:
{
value.Get( mTargetColor.a );
break;
}
case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::DevelActor::Property::OPACITY:
+ case Dali::Actor::Property::OPACITY:
{
AdjustValue< float >( mTargetColor.a, value );
break;
case Dali::Actor::Property::COLOR_GREEN: // FALLTHROUGH
case Dali::Actor::Property::COLOR_BLUE: // FALLTHROUGH
case Dali::Actor::Property::COLOR_ALPHA: // FALLTHROUGH
- case Dali::DevelActor::Property::OPACITY:
+ case Dali::Actor::Property::OPACITY:
{
property = &GetNode().mColor;
break;
property = &GetNode().mWorldMatrix;
break;
}
- case Dali::DevelActor::Property::CULLED:
+ case Dali::Actor::Property::CULLED:
{
property = &GetNode().mCulled;
break;
}
case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::DevelActor::Property::OPACITY:
+ case Dali::Actor::Property::OPACITY:
{
componentIndex = 3;
break;
}
case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::DevelActor::Property::OPACITY:
+ case Dali::Actor::Property::OPACITY:
{
value = mTargetColor.a;
break;
break;
}
- case Dali::DevelActor::Property::SCREEN_POSITION:
+ case Dali::Actor::Property::SCREEN_POSITION:
{
value = GetCurrentScreenPosition();
break;
}
- case Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT:
+ case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT:
{
value = mPositionUsesAnchorPoint;
break;
break;
}
+ case Dali::Actor::Property::ID:
+ {
+ value = static_cast<int>( GetId() );
+ break;
+ }
+
+ case Dali::Actor::Property::HIERARCHY_DEPTH:
+ {
+ value = GetHierarchyDepth();
+ break;
+ }
+
+ case Dali::Actor::Property::IS_ROOT:
+ {
+ value = IsRoot();
+ break;
+ }
+
+ case Dali::Actor::Property::IS_LAYER:
+ {
+ value = IsLayer();
+ break;
+ }
+
+ case Dali::Actor::Property::CONNECTED_TO_SCENE:
+ {
+ value = OnStage();
+ break;
+ }
+
+ case Dali::Actor::Property::KEYBOARD_FOCUSABLE:
+ {
+ value = IsKeyboardFocusable();
+ break;
+ }
+
default:
{
// Must be a scene-graph only property
}
case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::DevelActor::Property::OPACITY:
+ case Dali::Actor::Property::OPACITY:
{
value = GetCurrentColor().a;
break;
break;
}
- case DevelActor::Property::CULLED:
+ case Dali::Actor::Property::CULLED:
{
value = GetNode().IsCulled( GetEventThreadServices().GetEventBufferIndex() );
break;
if ( ( primaryPointState == TouchPoint::Started ) &&
( hoverEvent.GetPointCount() == 1 ) &&
- ( consumedActor && consumedActor.OnStage() ) )
+ ( consumedActor && GetImplementation( consumedActor ).OnStage() ) )
{
mHoverStartConsumedActor.SetActor( &GetImplementation( consumedActor ) );
}
else
{
// The primaryHitActor may have been removed from the stage so ensure it is still on the stage before setting members.
- if ( primaryHitActor && primaryHitActor.OnStage() )
+ if ( primaryHitActor && GetImplementation( primaryHitActor ).OnStage() )
{
mLastPrimaryHitActor.SetActor( &GetImplementation( primaryHitActor ) );
// Only observe the consumed actor if we have a primaryHitActor (check if it is still on stage).
- if ( consumedActor && consumedActor.OnStage() )
+ if ( consumedActor && GetImplementation( consumedActor ).OnStage() )
{
mLastConsumedActor.SetActor( &GetImplementation( consumedActor ) );
}
if ( ( primaryPointState == PointState::DOWN ) &&
( touchEvent.GetPointCount() == 1 ) &&
- ( consumedActor && consumedActor.OnStage() ) )
+ ( consumedActor && consumedActor.GetProperty< bool >( Dali::Actor::Property::CONNECTED_TO_SCENE ) ) )
{
mTouchDownConsumedActor.SetActor( &GetImplementation( consumedActor ) );
}
else
{
// The primaryHitActor may have been removed from the stage so ensure it is still on the stage before setting members.
- if ( primaryHitActor && primaryHitActor.OnStage() )
+ if ( primaryHitActor && GetImplementation( primaryHitActor ).OnStage() )
{
mLastPrimaryHitActor.SetActor( &GetImplementation( primaryHitActor ) );
// Only observe the consumed actor if we have a primaryHitActor (check if it is still on stage).
- if ( consumedActor && consumedActor.OnStage() )
+ if ( consumedActor && GetImplementation( consumedActor ).OnStage() )
{
mLastConsumedActor.SetActor( &GetImplementation( consumedActor ) );
}
return *this;
}
-uint32_t Actor::GetId() const
-{
- return GetImplementation(*this).GetId();
-}
-
-bool Actor::IsRoot() const
-{
- return GetImplementation(*this).IsRoot();
-}
-
bool Actor::OnStage() const
{
return GetImplementation(*this).OnStage();
}
-bool Actor::IsLayer() const
-{
- return GetImplementation(*this).IsLayer();
-}
-
Layer Actor::GetLayer()
{
return GetImplementation(*this).GetLayer();
return GetImplementation(*this).ScreenToLocal(localX, localY, screenX, screenY);
}
-void Actor::SetKeyboardFocusable( bool focusable )
-{
- GetImplementation(*this).SetKeyboardFocusable(focusable);
-}
-
-bool Actor::IsKeyboardFocusable() const
-{
- return GetImplementation(*this).IsKeyboardFocusable();
-}
-
void Actor::Raise()
{
GetImplementation( *this ).Raise();
return GetImplementation(*this).GetRelayoutSize( dimension );
}
-int32_t Actor::GetHierarchyDepth()
-{
- return GetImplementation(*this).GetHierarchyDepth();
-}
-
Actor::TouchSignalType& Actor::TouchedSignal()
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" );
COLOR_MODE,
/**
- * @brief This property is removed because it's deprecated.
- */
- RESERVED_PROPERTY_01,
-
- /**
* @brief The draw mode of an actor.
* @details Name "drawMode", type DrawMode::Type (Property::INTEGER) or Property::STRING.
* @SINCE_1_0.0
* @SINCE_1_2.60
*/
INHERIT_LAYOUT_DIRECTION,
+
+ /**
+ * @brief The opacity of the actor.
+ * @details Name "opacity", type Property::FLOAT.
+ * @SINCE_1_9.17
+ */
+ OPACITY,
+
+ /**
+ * @brief Returns the screen position of the Actor
+ * @details Name "screenPosition", type Property::VECTOR2. Read-only
+ * @note This assumes default camera and default render-task and the Z position is ZERO.
+ * @note The last known frame is used for the calculation. May not match a position value just set.
+ * @SINCE_1_9.17
+ */
+ SCREEN_POSITION,
+
+ /**
+ * @brief Determines whether the anchor point should be used to determine the position of the actor.
+ * @details Name "positionUsesAnchorPoint", type Property::BOOLEAN.
+ * @note This is true by default.
+ * @note If false, then the top-left of the actor is used for the position.
+ * @note Setting this to false will allow scaling or rotation around the anchor-point without affecting the actor's position.
+ * @SINCE_1_9.17
+ */
+ POSITION_USES_ANCHOR_POINT,
+
+ /**
+ * @brief Returns whether the actor is culled or not.
+ * @details Name "culled", type Property::BOOLEAN. Read-only
+ * @note True means that the actor is out of the view frustum.
+ * @SINCE_1_9.17
+ */
+ CULLED,
+
+ /**
+ * @brief The unique ID of the actor.
+ * @details Name "id", type Property::INTEGER. Read-only
+ * @SINCE_1_9.17
+ */
+ ID,
+
+ /**
+ * @brief The current depth in the hierarchy of the actor.
+ * @details Name "hierarchyDepth", type Property::INTEGER. Read-only
+ * @note The value is -1 if actor is not in the hierarchy.
+ * @SINCE_1_9.17
+ */
+ HIERARCHY_DEPTH,
+
+ /**
+ * @brief The flag whether an actor is the root actor, which is owned by the Scene.
+ * @details Name "isRoot", type Property::BOOLEAN. Read-only
+ * @SINCE_1_9.17
+ */
+ IS_ROOT,
+
+ /**
+ * @brief The flag whether the actor is of class Dali::Layer.
+ * @details Name "isLayer", type Property::BOOLEAN. Read-only
+ * @SINCE_1_9.17
+ */
+ IS_LAYER,
+
+ /**
+ * @brief The flag whether the actor is connected to the Scene.
+ * When an actor is connected, it will be directly or indirectly parented to the root Actor.
+ * @details Name "connectedToScene", type Property::BOOLEAN. Read-only
+ * @note The root Actor is provided automatically by Dali::Scene, and is always considered to be connected.
+ * @SINCE_1_9.17
+ */
+ CONNECTED_TO_SCENE,
+
+ /**
+ * @brief The flag whether the actor should be focusable by keyboard navigation.
+ * @details Name "keyboardFocusable", type Property::BOOLEAN.
+ * @SINCE_1_9.17
+ */
+ KEYBOARD_FOCUSABLE,
};
};
*/
Actor& operator=(const Actor& rhs);
- /**
- * @brief Retrieves the unique ID of the actor.
- *
- * @SINCE_1_0.0
- * @return The ID
- * @pre The Actor has been initialized.
- */
- uint32_t GetId() const;
-
// Containment
/**
- * @brief Queries whether an actor is the root actor, which is owned by the Stage.
- *
- * @SINCE_1_0.0
- * @return True if the actor is the root actor
- * @pre The Actor has been initialized.
- */
- bool IsRoot() const;
-
- /**
* @brief Queries whether the actor is connected to the Stage.
*
* When an actor is connected, it will be directly or indirectly parented to the root Actor.
bool OnStage() const;
/**
- * @brief Queries whether the actor is of class Dali::Layer.
- *
- * @SINCE_1_0.0
- * @return True if the actor is a layer
- * @pre The Actor has been initialized.
- */
- bool IsLayer() const;
-
- /**
* @brief Gets the layer in which the actor is present.
*
* @SINCE_1_0.0
bool ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const;
/**
- * @brief Sets whether the actor should be focusable by keyboard navigation.
- *
- * The default is false.
- * @SINCE_1_0.0
- * @param[in] focusable - true if the actor should be focusable by keyboard navigation,
- * false otherwise
- * @pre The Actor has been initialized.
- */
- void SetKeyboardFocusable( bool focusable );
-
- /**
- * @brief Returns whether the actor is focusable by keyboard navigation.
- *
- * @SINCE_1_0.0
- * @return @c true if the actor is focusable by keyboard navigation, @c false if not
- * @pre The Actor has been initialized.
- */
- bool IsKeyboardFocusable() const;
-
- /**
* @brief Raise actor above the next sibling actor.
*
* @SINCE_1_2.60
*/
float GetRelayoutSize( Dimension::Type dimension ) const;
- /**
- * @brief Gets depth in the hierarchy for the actor.
- *
- * @SINCE_1_0.0
- * @return The current depth in the hierarchy of the actor, or @c -1 if actor is not in the hierarchy
- */
- int32_t GetHierarchyDepth();
-
public: // Renderer
/**