*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( sibling1, Actor::Property::Position ),
EqualToConstraint() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, ConstraintBase::GetCurrentInstanceCount(), TEST_LOCATION );
DALI_TEST_EQUALS( 1u, ConstraintBase::GetTotalInstanceCount(), TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), Vector3(2.0f, 2.0f, 2.0f)/*from SetPosition*/, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), Vector3(2.0f, 2.0f, 2.0f)/*from SetPosition*/, TEST_LOCATION );
DALI_TEST_EQUALS( 0u/*should have been removed*/, ConstraintBase::GetCurrentInstanceCount(), TEST_LOCATION );
DALI_TEST_EQUALS( 1u, ConstraintBase::GetTotalInstanceCount(), TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION );
DALI_TEST_EQUALS( 1u, ConstraintBase::GetCurrentInstanceCount(), TEST_LOCATION );
DALI_TEST_EQUALS( 2u/*recreated once*/, ConstraintBase::GetTotalInstanceCount(), TEST_LOCATION );
// Apply a constraint to an actor
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
Actor actor = Actor::New();
// Apply a constraint to an actor
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
Actor actor = Actor::New();
Property::Index index = active.GetTargetProperty();
- DALI_TEST_CHECK( Actor::SIZE == index );
+ DALI_TEST_CHECK( Actor::Property::Size == index );
END_TEST;
}
// Apply a constraint to an actor
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
Actor actor = Actor::New();
Stage::GetCurrent().Add( actor );
// Apply a constraint to an actor
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
Actor actor = Actor::New();
// Apply a constraint to an actor
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
float duration( 10.0f );
constraint.SetApplyTime( duration );
// Apply a constraint to an actor
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
float duration( 1.0f );
constraint.SetApplyTime( duration );
DALI_TEST_CHECK( startSize == actor.GetCurrentSize() );
// Try setting the weight after removal
- active.SetProperty( ActiveConstraint::WEIGHT, 0.5f );
+ active.SetProperty( ActiveConstraint::Property::Weight, 0.5f );
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f));
DALI_TEST_CHECK( 0.5f == active.GetCurrentWeight() );
int UtcDaliConstraintCallback(void)
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
constraint.SetApplyTime(2.0f);
Actor actor = Actor::New();
ActiveConstraint active = actor.ApplyConstraint( constraint );
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, TestConstraintVector3() );
Actor actor = Actor::New();
ActiveConstraint active = actor.ApplyConstraint( constraint );
const float durationSeconds = 2.0f;
Animation animation = Animation::New( durationSeconds );
const Vector3 targetValue( 10.0f, 20.0f, 30.0f );
- animation.AnimateTo( Property( actor, Actor::SIZE ), targetValue );
+ animation.AnimateTo( Property( actor, Actor::Property::Size ), targetValue );
DALI_TEST_CHECK( actor.GetSize() == targetValue );
for( unsigned int propertyIndex = 0; propertyIndex < SIZE_MODE_VALUES_COUNT; ++propertyIndex )
{
Property::Value inValue = SIZE_MODE_VALUES[ propertyIndex ].string;
- propertyActor.SetProperty( Actor::SIZE_MODE, inValue );
- std::string outString = propertyActor.GetProperty( Actor::SIZE_MODE ).Get< std::string >();
+ propertyActor.SetProperty( Actor::Property::SizeMode, inValue );
+ std::string outString = propertyActor.GetProperty( Actor::Property::SizeMode ).Get< std::string >();
DALI_TEST_EQUALS( inValue.Get< std::string >(), outString, TEST_LOCATION );
}
// Test setting and getting the SizeModeFactor property.
Vector3 testPropertySizeModeFactor( 1.0f, 2.0f, 3.0f );
Property::Value inValueFactor = testPropertySizeModeFactor;
- propertyActor.SetProperty( Actor::SIZE_MODE_FACTOR, inValueFactor );
- Vector3 outValueFactor = propertyActor.GetProperty( Actor::SIZE_MODE_FACTOR ).Get< Vector3 >();
+ propertyActor.SetProperty( Actor::Property::SizeModeFactor, inValueFactor );
+ Vector3 outValueFactor = propertyActor.GetProperty( Actor::Property::SizeModeFactor ).Get< Vector3 >();
DALI_TEST_EQUALS( testPropertySizeModeFactor, outValueFactor, TEST_LOCATION );
END_TEST;
Actor actor = Actor::New();
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color, TestConstraint() );
actor.ApplyConstraint(constraint);
DALI_TEST_CHECK( gTestConstraintCalled == false );
parent.SetSize( parentSize );
Stage::GetCurrent().Add( parent );
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( parent, Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size,
+ Source( parent, Actor::Property::Size ),
EqualToConstraint() );
// Create some child actors
Actor actor = Actor::New();
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color, TestConstraint() );
actor.ApplyConstraint(constraint);
actor.RemoveConstraints();
// 1. Apply Constraint1 and Constraint2, and test...
unsigned int result1 = 0u;
unsigned int result2 = 0u;
- ActiveConstraint activeConstraint1 = actor.ApplyConstraint( Constraint::New<Vector4>( Actor::COLOR, TestConstraintRef<Vector4>(result1, 1) ) );
- ActiveConstraint activeConstraint2 = actor.ApplyConstraint( Constraint::New<Vector4>( Actor::COLOR, TestConstraintRef<Vector4>(result2, 2) ) );
+ ActiveConstraint activeConstraint1 = actor.ApplyConstraint( Constraint::New<Vector4>( Actor::Property::Color, TestConstraintRef<Vector4>(result1, 1) ) );
+ ActiveConstraint activeConstraint2 = actor.ApplyConstraint( Constraint::New<Vector4>( Actor::Property::Color, TestConstraintRef<Vector4>(result2, 2) ) );
Stage::GetCurrent().Add( actor );
// flush the queue and render once
// 3. Re-Apply Constraint1 and test...
result1 = 0;
result2 = 0;
- activeConstraint1 = actor.ApplyConstraint( Constraint::New<Vector4>( Actor::COLOR, TestConstraintRef<Vector4>(result1, 1) ) );
+ activeConstraint1 = actor.ApplyConstraint( Constraint::New<Vector4>( Actor::Property::Color, TestConstraintRef<Vector4>(result1, 1) ) );
// make color property dirty, which will trigger constraints to be reapplied.
actor.SetColor( Color::WHITE );
// flush the queue and render once
unsigned int result2 = 0u;
unsigned constraint1Tag = 1u;
- Constraint constraint1 = Constraint::New<Vector4>( Actor::COLOR, TestConstraintRef<Vector4>(result1, 1) );
+ Constraint constraint1 = Constraint::New<Vector4>( Actor::Property::Color, TestConstraintRef<Vector4>(result1, 1) );
constraint1.SetTag( constraint1Tag );
actor.ApplyConstraint( constraint1 );
unsigned constraint2Tag = 2u;
- Constraint constraint2 = Constraint::New<Vector4>( Actor::COLOR, TestConstraintRef<Vector4>(result2, 2) );
+ Constraint constraint2 = Constraint::New<Vector4>( Actor::Property::Color, TestConstraintRef<Vector4>(result2, 2) );
constraint2.SetTag( constraint2Tag );
actor.ApplyConstraint( constraint2 );
Actor child = Actor::New();
child.SetParentOrigin(ParentOrigin::CENTER);
- Constraint posConstraint = Constraint::New<Vector3>( Actor::POSITION, Source( parent, Actor::WORLD_MATRIX), PositionComponentConstraint() );
+ Constraint posConstraint = Constraint::New<Vector3>( Actor::Property::Position, Source( parent, Actor::Property::WorldMatrix), PositionComponentConstraint() );
child.ApplyConstraint(posConstraint);
Stage::GetCurrent().Add( child );
const PropertyStringIndex PROPERTY_TABLE[] =
{
- { "parent-origin", Actor::PARENT_ORIGIN, Property::VECTOR3 },
- { "parent-origin-x", Actor::PARENT_ORIGIN_X, Property::FLOAT },
- { "parent-origin-y", Actor::PARENT_ORIGIN_Y, Property::FLOAT },
- { "parent-origin-z", Actor::PARENT_ORIGIN_Z, Property::FLOAT },
- { "anchor-point", Actor::ANCHOR_POINT, Property::VECTOR3 },
- { "anchor-point-x", Actor::ANCHOR_POINT_X, Property::FLOAT },
- { "anchor-point-y", Actor::ANCHOR_POINT_Y, Property::FLOAT },
- { "anchor-point-z", Actor::ANCHOR_POINT_Z, Property::FLOAT },
- { "size", Actor::SIZE, Property::VECTOR3 },
- { "size-width", Actor::SIZE_WIDTH, Property::FLOAT },
- { "size-height", Actor::SIZE_HEIGHT, Property::FLOAT },
- { "size-depth", Actor::SIZE_DEPTH, Property::FLOAT },
- { "position", Actor::POSITION, Property::VECTOR3 },
- { "position-x", Actor::POSITION_X, Property::FLOAT },
- { "position-y", Actor::POSITION_Y, Property::FLOAT },
- { "position-z", Actor::POSITION_Z, Property::FLOAT },
- { "world-position", Actor::WORLD_POSITION, Property::VECTOR3 },
- { "world-position-x", Actor::WORLD_POSITION_X, Property::FLOAT },
- { "world-position-y", Actor::WORLD_POSITION_Y, Property::FLOAT },
- { "world-position-z", Actor::WORLD_POSITION_Z, Property::FLOAT },
- { "rotation", Actor::ROTATION, Property::ROTATION },
- { "world-rotation", Actor::WORLD_ROTATION, Property::ROTATION },
- { "scale", Actor::SCALE, Property::VECTOR3 },
- { "scale-x", Actor::SCALE_X, Property::FLOAT },
- { "scale-y", Actor::SCALE_Y, Property::FLOAT },
- { "scale-z", Actor::SCALE_Z, Property::FLOAT },
- { "world-scale", Actor::WORLD_SCALE, Property::VECTOR3 },
- { "visible", Actor::VISIBLE, Property::BOOLEAN },
- { "color", Actor::COLOR, Property::VECTOR4 },
- { "color-red", Actor::COLOR_RED, Property::FLOAT },
- { "color-green", Actor::COLOR_GREEN, Property::FLOAT },
- { "color-blue", Actor::COLOR_BLUE, Property::FLOAT },
- { "color-alpha", Actor::COLOR_ALPHA, Property::FLOAT },
- { "world-color", Actor::WORLD_COLOR, Property::VECTOR4 },
- { "world-matrix", Actor::WORLD_MATRIX, Property::MATRIX },
- { "name", Actor::NAME, Property::STRING },
- { "sensitive", Actor::SENSITIVE, Property::BOOLEAN },
- { "leave-required", Actor::LEAVE_REQUIRED, Property::BOOLEAN },
- { "inherit-rotation", Actor::INHERIT_ROTATION, Property::BOOLEAN },
- { "inherit-scale", Actor::INHERIT_SCALE, Property::BOOLEAN },
- { "color-mode", Actor::COLOR_MODE, Property::STRING },
- { "position-inheritance", Actor::POSITION_INHERITANCE, Property::STRING },
- { "draw-mode", Actor::DRAW_MODE, Property::STRING },
- { "size-mode", Actor::SIZE_MODE, Property::STRING },
- { "size-mode-factor", Actor::SIZE_MODE_FACTOR, Property::VECTOR3 },
+ { "parent-origin", Actor::Property::ParentOrigin, Property::VECTOR3 },
+ { "parent-origin-x", Actor::Property::ParentOriginX, Property::FLOAT },
+ { "parent-origin-y", Actor::Property::ParentOriginY, Property::FLOAT },
+ { "parent-origin-z", Actor::Property::ParentOriginZ, Property::FLOAT },
+ { "anchor-point", Actor::Property::AnchorPoint, Property::VECTOR3 },
+ { "anchor-point-x", Actor::Property::AnchorPointX, Property::FLOAT },
+ { "anchor-point-y", Actor::Property::AnchorPointY, Property::FLOAT },
+ { "anchor-point-z", Actor::Property::AnchorPointZ, Property::FLOAT },
+ { "size", Actor::Property::Size, Property::VECTOR3 },
+ { "size-width", Actor::Property::SizeWidth, Property::FLOAT },
+ { "size-height", Actor::Property::SizeHeight, Property::FLOAT },
+ { "size-depth", Actor::Property::SizeDepth, Property::FLOAT },
+ { "position", Actor::Property::Position, Property::VECTOR3 },
+ { "position-x", Actor::Property::PositionX, Property::FLOAT },
+ { "position-y", Actor::Property::PositionY, Property::FLOAT },
+ { "position-z", Actor::Property::PositionZ, Property::FLOAT },
+ { "world-position", Actor::Property::WorldPosition, Property::VECTOR3 },
+ { "world-position-x", Actor::Property::WorldPositionX, Property::FLOAT },
+ { "world-position-y", Actor::Property::WorldPositionY, Property::FLOAT },
+ { "world-position-z", Actor::Property::WorldPositionZ, Property::FLOAT },
+ { "rotation", Actor::Property::Rotation, Property::ROTATION },
+ { "world-rotation", Actor::Property::WorldRotation, Property::ROTATION },
+ { "scale", Actor::Property::Scale, Property::VECTOR3 },
+ { "scale-x", Actor::Property::ScaleX, Property::FLOAT },
+ { "scale-y", Actor::Property::ScaleY, Property::FLOAT },
+ { "scale-z", Actor::Property::ScaleZ, Property::FLOAT },
+ { "world-scale", Actor::Property::WorldScale, Property::VECTOR3 },
+ { "visible", Actor::Property::Visible, Property::BOOLEAN },
+ { "color", Actor::Property::Color, Property::VECTOR4 },
+ { "color-red", Actor::Property::ColorRed, Property::FLOAT },
+ { "color-green", Actor::Property::ColorGreen, Property::FLOAT },
+ { "color-blue", Actor::Property::ColorBlue, Property::FLOAT },
+ { "color-alpha", Actor::Property::ColorAlpha, Property::FLOAT },
+ { "world-color", Actor::Property::WorldColor, Property::VECTOR4 },
+ { "world-matrix", Actor::Property::WorldMatrix, Property::MATRIX },
+ { "name", Actor::Property::Name, Property::STRING },
+ { "sensitive", Actor::Property::Sensitive, Property::BOOLEAN },
+ { "leave-required", Actor::Property::LeaveRequired, Property::BOOLEAN },
+ { "inherit-rotation", Actor::Property::InheritRotation, Property::BOOLEAN },
+ { "inherit-scale", Actor::Property::InheritScale, Property::BOOLEAN },
+ { "color-mode", Actor::Property::ColorMode, Property::STRING },
+ { "position-inheritance", Actor::Property::PositionInheritance, Property::STRING },
+ { "draw-mode", Actor::Property::DrawMode, Property::STRING },
+ { "size-mode", Actor::Property::SizeMode, Property::STRING },
+ { "size-mode-factor", Actor::Property::SizeModeFactor, Property::VECTOR3 },
};
const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] );
} // unnamed namespace
tet_infoline("Testing Dali::AnimatableMesh::operator[]");
AnimatableMesh mesh = CreateMesh();
- Property::Index i = mesh.GetPropertyIndex(0, AnimatableVertex::POSITION );
+ Property::Index i = mesh.GetPropertyIndex(0, AnimatableVertex::Property::Position );
DALI_TEST_EQUALS( i, 0*3+0, TEST_LOCATION );
- i = mesh.GetPropertyIndex(5, AnimatableVertex::POSITION );
+ i = mesh.GetPropertyIndex(5, AnimatableVertex::Property::Position );
DALI_TEST_EQUALS( i, 5*3+0, TEST_LOCATION );
- i = mesh.GetPropertyIndex(7, AnimatableVertex::COLOR );
+ i = mesh.GetPropertyIndex(7, AnimatableVertex::Property::Color );
DALI_TEST_EQUALS( i, 7*3+1, TEST_LOCATION );
- i = mesh.GetPropertyIndex(9, AnimatableVertex::TEXTURE_COORDS );
+ i = mesh.GetPropertyIndex(9, AnimatableVertex::Property::TextureCoords );
DALI_TEST_EQUALS( i, 9*3+2, TEST_LOCATION );
END_TEST;
}
AnimatableMesh mesh = CreateMesh();
try
{
- Property::Index i = mesh.GetPropertyIndex(12, AnimatableVertex::POSITION );
+ Property::Index i = mesh.GetPropertyIndex(12, AnimatableVertex::Property::Position );
DALI_TEST_CHECK( i==0 );
}
catch (Dali::DaliException& e)
AnimatableMesh mesh = CreateMesh();
try
{
- Property::Index i = mesh.GetPropertyIndex(12, AnimatableVertex::COLOR );
+ Property::Index i = mesh.GetPropertyIndex(12, AnimatableVertex::Property::Color );
DALI_TEST_CHECK( i==0 );
}
catch (Dali::DaliException& e)
AnimatableMesh mesh = CreateMesh();
try
{
- Property::Index i = mesh.GetPropertyIndex(12342343, AnimatableVertex::TEXTURE_COORDS );
+ Property::Index i = mesh.GetPropertyIndex(12342343, AnimatableVertex::Property::TextureCoords );
DALI_TEST_CHECK( i==0 );
}
catch (Dali::DaliException& e)
mesh[1].SetPosition(Vector3(100.0f, 300.0f, 0.0f));
Animation anim = Animation::New(1);
- anim.AnimateBy(mesh.GetVertexProperty(0, AnimatableVertex::POSITION), Vector3( 0.0f, 100.0f, 0.0f));
- anim.AnimateTo(mesh.GetVertexProperty(1, AnimatableVertex::POSITION), Vector3(100.0f, 0.0f, 0.0f));
+ anim.AnimateBy(mesh.GetVertexProperty(0, AnimatableVertex::Property::Position), Vector3( 0.0f, 100.0f, 0.0f));
+ anim.AnimateTo(mesh.GetVertexProperty(1, AnimatableVertex::Property::Position), Vector3(100.0f, 0.0f, 0.0f));
anim.Play();
application.SendNotification();
KeyFrames keyframes = KeyFrames::New();
keyframes.Add( 0.0f, initialPosition);
keyframes.Add( 1.0f, targetPosition );
- animation.AnimateBetween( Property(actor, Actor::POSITION), keyframes, AlphaFunctions::Linear);
+ animation.AnimateBetween( Property(actor, Actor::Property::Position), keyframes, AlphaFunctions::Linear);
//Set speed to be x2
animation.SetSpeedFactor(2.0f);
keyframes.Add( 0.0f , Vector3(0.0f,0.0f,0.0f ) );
keyframes.Add( 1.0f , Vector3(100.0f,100.0f,100.0f ) );
- animation.AnimateBetween( Property( actor, Actor::POSITION), keyframes );
+ animation.AnimateBetween( Property( actor, Actor::Property::Position), keyframes );
// Set range between 0.4 and 0.8
animation.SetPlayRange( Vector2(0.4f,0.8f) );
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
- animation.AnimateBy(Property(actor, Actor::POSITION), relativePosition);
+ animation.AnimateBy(Property(actor, Actor::Property::Position), relativePosition);
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
- animation.AnimateBy(Property(actor, Actor::POSITION), relativePosition, AlphaFunctions::EaseOut);
+ animation.AnimateBy(Property(actor, Actor::Property::Position), relativePosition, AlphaFunctions::EaseOut);
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
float delay = 0.5f;
- animation.AnimateBy(Property(actor, Actor::POSITION),
+ animation.AnimateBy(Property(actor, Actor::Property::Position),
relativePosition,
TimePeriod(delay, durationSeconds - delay));
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
float delay = 0.5f;
- animation.AnimateBy(Property(actor, Actor::POSITION),
+ animation.AnimateBy(Property(actor, Actor::Property::Position),
relativePosition,
AlphaFunctions::Linear,
TimePeriod(delay, durationSeconds - delay));
try
{
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN), targetParentOrigin );
+ animation.AnimateTo( Property(actor, Actor::Property::ParentOrigin), targetParentOrigin );
}
catch (Dali::DaliException& e)
{
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().x, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::PARENT_ORIGIN_X), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ParentOriginX), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
try
{
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_X), targetX );
+ animation.AnimateTo( Property(actor, Actor::Property::ParentOriginX), targetX );
}
catch (Dali::DaliException& e)
{
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().y, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::PARENT_ORIGIN_Y), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ParentOriginY), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
try
{
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_Y), targetY );
+ animation.AnimateTo( Property(actor, Actor::Property::ParentOriginY), targetY );
}
catch (Dali::DaliException& e)
{
Stage::GetCurrent().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().z, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::PARENT_ORIGIN_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ParentOriginZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
try
{
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_Z), targetZ );
+ animation.AnimateTo( Property(actor, Actor::Property::ParentOriginZ), targetZ );
}
catch (Dali::DaliException& e)
{
try
{
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT), targetAnchorPoint);
+ animation.AnimateTo( Property(actor, Actor::Property::AnchorPoint), targetAnchorPoint);
}
catch (Dali::DaliException& e)
{
Stage::GetCurrent().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().x, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::ANCHOR_POINT_X), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::AnchorPointX), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
try
{
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_X), targetX );
+ animation.AnimateTo( Property(actor, Actor::Property::AnchorPointX), targetX );
}
catch (Dali::DaliException& e)
{
Stage::GetCurrent().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().y, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::ANCHOR_POINT_Y), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::AnchorPointY), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
try
{
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_Y), targetY );
+ animation.AnimateTo( Property(actor, Actor::Property::AnchorPointY), targetY );
}
catch (Dali::DaliException& e)
{
Stage::GetCurrent().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().z, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::ANCHOR_POINT_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::AnchorPointZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
try
{
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_Z), targetZ );
+ animation.AnimateTo( Property(actor, Actor::Property::AnchorPointZ), targetZ );
}
catch (Dali::DaliException& e)
{
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetSize(100.0f, 100.0f, 100.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE), targetSize );
+ animation.AnimateTo( Property(actor, Actor::Property::Size), targetSize );
Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::SIZE), targetSize, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::Size), targetSize, AlphaFunctions::EaseIn);
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::SIZE), targetSize, AlphaFunctions::Linear, TimePeriod(delay, durationSeconds - delay));
+ animation.AnimateTo( Property(actor, Actor::Property::Size), targetSize, AlphaFunctions::Linear, TimePeriod(delay, durationSeconds - delay));
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentSize().width, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_WIDTH), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeWidth), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetWidth(10.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE_WIDTH), targetWidth );
+ animation.AnimateTo( Property(actor, Actor::Property::SizeWidth), targetWidth );
float fiftyPercentProgress(startValue + (targetWidth - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().width, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_WIDTH), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeWidth), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().width, targetWidth, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_WIDTH), targetWidth, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeWidth), targetWidth, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentSize().height, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_HEIGHT), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeHeight), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetHeight(-10.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE_HEIGHT), targetHeight );
+ animation.AnimateTo( Property(actor, Actor::Property::SizeHeight), targetHeight );
float fiftyPercentProgress(startValue + (targetHeight - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().height, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_HEIGHT), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeHeight), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().height, targetHeight, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_HEIGHT), targetHeight, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeHeight), targetHeight, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentSize().depth, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_DEPTH), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeDepth), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetDepth(-10.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE_DEPTH), targetDepth );
+ animation.AnimateTo( Property(actor, Actor::Property::SizeDepth), targetDepth );
float fiftyPercentProgress(startValue + (targetDepth - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().depth, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_DEPTH), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeDepth), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().depth, targetDepth, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_DEPTH), targetDepth, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SizeDepth), targetDepth, TEST_LOCATION );
END_TEST;
}
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- animation.AnimateTo(Property(actor, Actor::POSITION), targetPosition);
+ animation.AnimateTo(Property(actor, Actor::Property::Position), targetPosition);
Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentPosition().x, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetX(1.0f);
- animation.AnimateTo( Property(actor, Actor::POSITION_X), targetX );
+ animation.AnimateTo( Property(actor, Actor::Property::PositionX), targetX );
float fiftyPercentProgress(startValue + (targetX - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().x, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().x, targetX, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), targetX, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), targetX, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), startValue, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentPosition().y, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetY(10.0f);
- animation.AnimateTo( Property(actor, Actor::POSITION_Y), targetY );
+ animation.AnimateTo( Property(actor, Actor::Property::PositionY), targetY );
float fiftyPercentProgress(startValue + (targetY - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().y, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().y, targetY, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), targetY, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), targetY, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), startValue, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentPosition().z, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetZ(-5.0f);
- animation.AnimateTo( Property(actor, Actor::POSITION_Z), targetZ );
+ animation.AnimateTo( Property(actor, Actor::Property::PositionZ), targetZ );
float fiftyPercentProgress(startValue + (targetZ - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().z, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().z, targetZ, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), targetZ, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PositionZ), targetZ, TEST_LOCATION );
END_TEST;
}
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- animation.AnimateTo(Property(actor, Actor::POSITION), targetPosition, AlphaFunctions::EaseIn);
+ animation.AnimateTo(Property(actor, Actor::Property::Position), targetPosition, AlphaFunctions::EaseIn);
Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(200.0f, 200.0f, 200.0f);
float delay = 0.5f;
- animation.AnimateTo( Property(actor, Actor::POSITION),
+ animation.AnimateTo( Property(actor, Actor::Property::Position),
targetPosition,
TimePeriod( delay, durationSeconds - delay ) );
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(200.0f, 200.0f, 200.0f);
float delay = 0.5f;
- animation.AnimateTo( Property(actor, Actor::POSITION),
+ animation.AnimateTo( Property(actor, Actor::Property::Position),
targetPosition,
AlphaFunctions::Linear,
TimePeriod( delay, durationSeconds - delay ) );
Animation animation = Animation::New(durationSeconds);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
- animation.AnimateTo( Property(actor, Actor::ROTATION), AngleAxis(targetRotationRadians, Vector3::YAXIS) );
+ animation.AnimateTo( Property(actor, Actor::Property::Rotation), AngleAxis(targetRotationRadians, Vector3::YAXIS) );
// Start the animation
animation.Play();
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
- animation.AnimateTo( Property(actor, Actor::ROTATION), targetRotation );
+ animation.AnimateTo( Property(actor, Actor::Property::Rotation), targetRotation );
// Start the animation
animation.Play();
Animation animation = Animation::New(durationSeconds);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
- animation.AnimateTo( Property(actor, Actor::ROTATION), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::Rotation), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunctions::EaseIn);
// Start the animation
animation.Play();
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
float delay(0.1f);
- animation.AnimateTo( Property(actor, Actor::ROTATION), AngleAxis(targetRotationDegrees, Vector3::YAXIS), TimePeriod(delay, durationSeconds - delay));
+ animation.AnimateTo( Property(actor, Actor::Property::Rotation), AngleAxis(targetRotationDegrees, Vector3::YAXIS), TimePeriod(delay, durationSeconds - delay));
// Start the animation
animation.Play();
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
float delay(0.1f);
- animation.AnimateTo( Property(actor, Actor::ROTATION), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunctions::EaseIn, TimePeriod(delay, durationSeconds - delay));
+ animation.AnimateTo( Property(actor, Actor::Property::Rotation), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunctions::EaseIn, TimePeriod(delay, durationSeconds - delay));
// Start the animation
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetScale(2.0f, 2.0f, 2.0f);
- animation.AnimateTo( Property(actor, Actor::SCALE), targetScale );
+ animation.AnimateTo( Property(actor, Actor::Property::Scale), targetScale );
Vector3 ninetyNinePercentProgress(Vector3::ONE + (targetScale - Vector3::ONE)*0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::SCALE), targetScale, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::Scale), targetScale, AlphaFunctions::EaseIn);
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::SCALE), targetScale, AlphaFunctions::Linear, TimePeriod(delay, durationSeconds - delay));
+ animation.AnimateTo( Property(actor, Actor::Property::Scale), targetScale, AlphaFunctions::Linear, TimePeriod(delay, durationSeconds - delay));
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
Stage::GetCurrent().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentScale().x, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetX(10.0f);
- animation.AnimateTo( Property(actor, Actor::SCALE_X), targetX );
+ animation.AnimateTo( Property(actor, Actor::Property::ScaleX), targetX );
float fiftyPercentProgress(startValue + (targetX - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentScale().x, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentScale().x, targetX, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), targetX, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), targetX, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), startValue, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentScale().y, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetY(1000.0f);
- animation.AnimateTo( Property(actor, Actor::SCALE_Y), targetY );
+ animation.AnimateTo( Property(actor, Actor::Property::ScaleY), targetY );
float fiftyPercentProgress(startValue + (targetY - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentScale().y, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentScale().y, targetY, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), targetY, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), targetY, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), startValue, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentScale().z, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetZ(-1000.0f);
- animation.AnimateTo( Property(actor, Actor::SCALE_Z), targetZ );
+ animation.AnimateTo( Property(actor, Actor::Property::ScaleZ), targetZ );
float fiftyPercentProgress(startValue + (targetZ - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentScale().z, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentScale().z, targetZ, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SCALE_Z), targetZ, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleX), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleY), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ScaleZ), targetZ, TEST_LOCATION );
END_TEST;
}
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector4 targetColor(Color::RED);
- animation.AnimateTo( Property(actor, Actor::COLOR), targetColor );
+ animation.AnimateTo( Property(actor, Actor::Property::Color), targetColor );
Vector4 tenPercentProgress(Vector4(1.0f, 0.9f, 0.9f, 1.0f));
Vector4 twentyPercentProgress(Vector4(1.0f, 0.8f, 0.8f, 1.0f));
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::COLOR), targetColor, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::Color), targetColor, AlphaFunctions::EaseIn);
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a shorter animator duration
float animatorDuration = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::COLOR), targetColor, AlphaFunctions::Linear, TimePeriod(animatorDuration));
+ animation.AnimateTo( Property(actor, Actor::Property::Color), targetColor, AlphaFunctions::Linear, TimePeriod(animatorDuration));
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
Stage::GetCurrent().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentColor().r, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetRed(0.5f);
- animation.AnimateTo( Property(actor, Actor::COLOR_RED), targetRed );
+ animation.AnimateTo( Property(actor, Actor::Property::ColorRed), targetRed );
float fiftyPercentProgress(startValue + (targetRed - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().r, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().r, targetRed, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), targetRed, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), targetRed, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentColor().g, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetGreen(0.5f);
- animation.AnimateTo( Property(actor, Actor::COLOR_GREEN), targetGreen );
+ animation.AnimateTo( Property(actor, Actor::Property::ColorGreen), targetGreen );
float fiftyPercentProgress(startValue + (targetGreen - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().g, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().g, targetGreen, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), targetGreen, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), targetGreen, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentColor().b, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetBlue(0.5f);
- animation.AnimateTo( Property(actor, Actor::COLOR_BLUE), targetBlue );
+ animation.AnimateTo( Property(actor, Actor::Property::ColorBlue), targetBlue );
float fiftyPercentProgress(startValue + (targetBlue - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().b, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().b, targetBlue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), targetBlue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), targetBlue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetAlpha(0.5f);
- animation.AnimateTo( Property(actor, Actor::COLOR_ALPHA), targetAlpha );
+ animation.AnimateTo( Property(actor, Actor::Property::ColorAlpha), targetAlpha );
float fiftyPercentProgress(startValue + (targetAlpha - startValue)*0.5f);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().a, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), fiftyPercentProgress, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentColor().a, targetAlpha, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), targetAlpha, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), targetAlpha, TEST_LOCATION );
END_TEST;
}
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
keyFrames.Add(0.8f, 0.7f);
keyFrames.Add(1.0f, 0.9f);
- animation.AnimateBetween( Property(actor, Actor::COLOR_ALPHA), keyFrames );
+ animation.AnimateBetween( Property(actor, Actor::Property::ColorAlpha), keyFrames );
// Start the animation
animation.Play();
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)/* 10% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.3f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.3f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.3f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 30% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.25f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.25f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.25f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)/* 40% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.0f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.0f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*400.0f)/* 80% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.7f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.7f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.7f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)/* 90% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.8f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.8f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.8f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)+1/* 100% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.9f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.9f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.9f, 0.01f, TEST_LOCATION );
// We did expect the animation to finish
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
keyFrames.Add(0.8f, 0.7f);
keyFrames.Add(1.0f, 0.9f);
- animation.AnimateBetween( Property(actor, Actor::COLOR_ALPHA), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::ColorAlpha), keyFrames, Animation::Cubic );
// Start the animation
animation.Play();
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)/* 10% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.36f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.36f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.36f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 30% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.21f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.21f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.21f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)/* 40% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.0f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.0f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*400.0f)/* 80% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.7f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.7f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.7f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)/* 90% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.76f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.76f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.76f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*100.0f)+1/* 100% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.9f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.9f, 0.01f, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.9f, 0.01f, TEST_LOCATION );
// We did expect the animation to finish
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::COLOR), keyFrames );
+ animation.AnimateBetween( Property(actor, Actor::Property::Color), keyFrames );
// Start the animation
animation.Play();
application.Render(0);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)+1/* 100% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION );
// We did expect the animation to finish
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::COLOR), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::Color), keyFrames, Animation::Cubic );
// Start the animation
animation.Play();
application.Render(0);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.55f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.525f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.506f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.4875f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.55f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.525f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.506f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.4875f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.99375f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.925f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.85625f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.7875f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.99375f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.925f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.85625f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.7875f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)+1/* 100% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION );
// We did expect the animation to finish
keyFrames.Add(0.8f, false);
keyFrames.Add(1.0f, true);
- animation.AnimateBetween( Property(actor, Actor::VISIBLE), keyFrames );
+ animation.AnimateBetween( Property(actor, Actor::Property::Visible), keyFrames );
// Start the animation
animation.Play();
keyFrames.Add(1.0f, true);
//Cubic interpolation for boolean values should be ignored
- animation.AnimateBetween( Property(actor, Actor::VISIBLE), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::Visible), keyFrames, Animation::Cubic );
// Start the animation
animation.Play();
KeyFrames keyFrames = KeyFrames::New();
keyFrames.Add(0.0f, AngleAxis(Degree(60), Vector3::ZAXIS));
- animation.AnimateBetween( Property(actor, Actor::ROTATION), keyFrames );
+ animation.AnimateBetween( Property(actor, Actor::Property::Rotation), keyFrames );
// Start the animation
animation.Play();
keyFrames.Add(0.5f, AngleAxis(Degree(120), Vector3::XAXIS));
keyFrames.Add(1.0f, AngleAxis(Degree(120), Vector3::YAXIS));
- animation.AnimateBetween( Property(actor, Actor::ROTATION), keyFrames );
+ animation.AnimateBetween( Property(actor, Actor::Property::Rotation), keyFrames );
// Start the animation
animation.Play();
keyFrames.Add(0.0f, AngleAxis(Degree(60), Vector3::ZAXIS));
//Cubic interpolation should be ignored for quaternions
- animation.AnimateBetween( Property(actor, Actor::ROTATION), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::Rotation), keyFrames, Animation::Cubic );
// Start the animation
animation.Play();
keyFrames.Add(1.0f, AngleAxis(Degree(120), Vector3::YAXIS));
//Cubic interpolation should be ignored for quaternions
- animation.AnimateBetween( Property(actor, Actor::ROTATION), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::Rotation), keyFrames, Animation::Cubic );
// Start the animation
animation.Play();
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::COLOR), keyFrames, TimePeriod( 1.0f) );
+ animation.AnimateBetween( Property(actor, Actor::Property::Color), keyFrames, TimePeriod( 1.0f) );
// Start the animation
animation.Play();
application.Render(0);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)+1/* 100% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION );
// We did expect the animation to finish
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::COLOR), keyFrames, AlphaFunctions::Linear );
+ animation.AnimateBetween( Property(actor, Actor::Property::Color), keyFrames, AlphaFunctions::Linear );
// Start the animation
animation.Play();
application.Render(0);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)+1/* 100% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION );
// We did expect the animation to finish
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::COLOR), keyFrames, AlphaFunctions::Linear, TimePeriod( 1.0f) );
+ animation.AnimateBetween( Property(actor, Actor::Property::Color), keyFrames, AlphaFunctions::Linear, TimePeriod( 1.0f) );
// Start the animation
animation.Play();
application.Render(0);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)+1/* 100% progress */);
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION );
// We did expect the animation to finish
actor.ApplyConstraint( constraint );
// Apply animation to actor
- animation.AnimateTo( Property(actor, Actor::POSITION), Vector3( 100.f, 90.f, 80.f ), AlphaFunctions::Linear );
+ animation.AnimateTo( Property(actor, Actor::Property::Position), Vector3( 100.f, 90.f, 80.f ), AlphaFunctions::Linear );
animation.Play();
animation2.FinishedSignal().Connect( &application, AnimationFinishCheck( signal2Received ) );
// Apply animations to actor
- animation1.AnimateTo( Property(actor, Actor::POSITION), Vector3( 3.0f, 2.0f, 1.0f ), AlphaFunctions::Linear );
+ animation1.AnimateTo( Property(actor, Actor::Property::Position), Vector3( 3.0f, 2.0f, 1.0f ), AlphaFunctions::Linear );
animation1.Play();
- animation2.AnimateTo( Property(actor, Actor::SIZE ), Vector3( 10.0f, 20.0f, 30.0f ), AlphaFunctions::Linear );
+ animation2.AnimateTo( Property(actor, Actor::Property::Size ), Vector3( 10.0f, 20.0f, 30.0f ), AlphaFunctions::Linear );
animation2.Play();
DALI_TEST_EQUALS( signal1Received, false, TEST_LOCATION );
float value;
std::string sValue;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(value);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(value);
DALI_TEST_EQUALS(TEST_ASPECT_RATIO, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(value);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(value);
DALI_TEST_EQUALS(TEST_FIELD_OF_VIEW, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(value);
DALI_TEST_EQUALS(TEST_NEAR_PLANE_DISTANCE, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(value);
DALI_TEST_EQUALS(TEST_FAR_PLANE_DISTANCE, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::PROJECTION_MODE).Get(sValue);
+ actor.GetProperty(CameraActor::Property::ProjectionMode).Get(sValue);
DALI_TEST_EQUALS("PERSPECTIVE_PROJECTION", sValue, TEST_LOCATION);
bool bValue;
- actor.GetProperty(CameraActor::INVERT_Y_AXIS).Get(bValue);
+ actor.GetProperty(CameraActor::Property::InvertYAxis).Get(bValue);
DALI_TEST_EQUALS(false, bValue, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS(false, actor.GetInvertYAxis(), TEST_LOCATION);
std::string sValue;
- actor.GetProperty(CameraActor::TYPE).Get(sValue);
+ actor.GetProperty(CameraActor::Property::Type).Get(sValue);
DALI_TEST_EQUALS(sValue, "LOOK_AT_TARGET", TEST_LOCATION);
float value;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(value);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(value);
DALI_TEST_EQUALS(TEST_ASPECT_RATIO, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(value);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(value);
DALI_TEST_EQUALS(TEST_FIELD_OF_VIEW, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(value);
DALI_TEST_EQUALS(TEST_NEAR_PLANE_DISTANCE, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(value);
DALI_TEST_EQUALS(TEST_FAR_PLANE_DISTANCE, value, FLOAT_EPSILON, TEST_LOCATION);
bool bValue;
- actor.GetProperty(CameraActor::INVERT_Y_AXIS).Get(bValue);
+ actor.GetProperty(CameraActor::Property::InvertYAxis).Get(bValue);
DALI_TEST_EQUALS(false, bValue, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS(actor.GetAspectRatio(), TEST_ASPECT_RATIO, FLOAT_EPSILON, TEST_LOCATION);
- actor.SetProperty(CameraActor::TYPE, "FREE_LOOK");
- actor.SetProperty(CameraActor::ASPECT_RATIO, TEST_ASPECT_RATIO);
- actor.SetProperty(CameraActor::FIELD_OF_VIEW, TEST_FIELD_OF_VIEW);
- actor.SetProperty(CameraActor::NEAR_PLANE_DISTANCE, TEST_NEAR_PLANE_DISTANCE);
- actor.SetProperty(CameraActor::FAR_PLANE_DISTANCE, TEST_FAR_PLANE_DISTANCE);
+ actor.SetProperty(CameraActor::Property::Type, "FREE_LOOK");
+ actor.SetProperty(CameraActor::Property::AspectRatio, TEST_ASPECT_RATIO);
+ actor.SetProperty(CameraActor::Property::FieldOfView, TEST_FIELD_OF_VIEW);
+ actor.SetProperty(CameraActor::Property::NearPlaneDistance, TEST_NEAR_PLANE_DISTANCE);
+ actor.SetProperty(CameraActor::Property::FarPlaneDistance, TEST_FAR_PLANE_DISTANCE);
DALI_TEST_EQUALS(Camera::FREE_LOOK, actor.GetType(), TEST_LOCATION);
DALI_TEST_EQUALS(TEST_ASPECT_RATIO, actor.GetAspectRatio(), FLOAT_EPSILON, TEST_LOCATION);
application.Render(0);
application.SendNotification();
bool bValue;
- actor.GetProperty(CameraActor::INVERT_Y_AXIS).Get(bValue);
+ actor.GetProperty(CameraActor::Property::InvertYAxis).Get(bValue);
DALI_TEST_EQUALS(false, bValue, TEST_LOCATION);
std::vector<Property::Index> indices ;
- indices.push_back(CameraActor::TYPE);
- indices.push_back(CameraActor::PROJECTION_MODE);
- indices.push_back(CameraActor::FIELD_OF_VIEW );
- indices.push_back(CameraActor::ASPECT_RATIO );
- indices.push_back(CameraActor::NEAR_PLANE_DISTANCE );
- indices.push_back(CameraActor::FAR_PLANE_DISTANCE );
- indices.push_back(CameraActor::LEFT_PLANE_DISTANCE );
- indices.push_back(CameraActor::RIGHT_PLANE_DISTANCE );
- indices.push_back(CameraActor::TOP_PLANE_DISTANCE );
- indices.push_back(CameraActor::BOTTOM_PLANE_DISTANCE );
- indices.push_back(CameraActor::TARGET_POSITION );
- indices.push_back(CameraActor::PROJECTION_MATRIX );
- indices.push_back(CameraActor::VIEW_MATRIX);
- indices.push_back(CameraActor::INVERT_Y_AXIS );
+ indices.push_back(CameraActor::Property::Type);
+ indices.push_back(CameraActor::Property::ProjectionMode);
+ indices.push_back(CameraActor::Property::FieldOfView);
+ indices.push_back(CameraActor::Property::AspectRatio);
+ indices.push_back(CameraActor::Property::NearPlaneDistance);
+ indices.push_back(CameraActor::Property::FarPlaneDistance);
+ indices.push_back(CameraActor::Property::LeftPlaneDistance);
+ indices.push_back(CameraActor::Property::RightPlaneDistance);
+ indices.push_back(CameraActor::Property::TopPlaneDistance);
+ indices.push_back(CameraActor::Property::BottomPlaneDistance);
+ indices.push_back(CameraActor::Property::TargetPosition);
+ indices.push_back(CameraActor::Property::ProjectionMatrix);
+ indices.push_back(CameraActor::Property::ViewMatrix);
+ indices.push_back(CameraActor::Property::InvertYAxis);
DALI_TEST_CHECK(actor.GetPropertyCount() == ( Actor::New().GetPropertyCount() + indices.size() ) );
switch(*iter)
{
- if ( ( *iter == CameraActor::PROJECTION_MATRIX ) ||
- ( *iter == CameraActor::VIEW_MATRIX ) )
+ if ( ( *iter == CameraActor::Property::ProjectionMatrix ) ||
+ ( *iter == CameraActor::Property::ViewMatrix ) )
{
DALI_TEST_CHECK( ! actor.IsPropertyWritable(*iter) );
}
// set/get one of them
const float newAspect = TEST_ASPECT_RATIO * 2.f;
- actor.SetProperty( CameraActor::ASPECT_RATIO, Property::Value(newAspect) );
+ actor.SetProperty( CameraActor::Property::AspectRatio, Property::Value(newAspect) );
application.Render();
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.GetTargetPosition(), target, TEST_LOCATION );
Vector3 value;
- actor.GetProperty(CameraActor::TARGET_POSITION).Get(value);
+ actor.GetProperty(CameraActor::Property::TargetPosition).Get(value);
DALI_TEST_EQUALS(target, value, FLOAT_EPSILON, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS( actor.GetType(), Dali::Camera::LOOK_AT_TARGET, TEST_LOCATION );
std::string sValue;
- actor.GetProperty(CameraActor::TYPE).Get(sValue);
+ actor.GetProperty(CameraActor::Property::Type).Get(sValue);
std::string result("LOOK_AT_TARGET");
DALI_TEST_EQUALS(result, sValue, TEST_LOCATION);
END_TEST;
DALI_TEST_EQUALS( actor.GetFieldOfView(), fov, TEST_LOCATION );
float value;
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(value);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(value);
DALI_TEST_EQUALS(fov, value, FLOAT_EPSILON, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS( actor.GetAspectRatio(), aspect, TEST_LOCATION );
float value;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(value);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(value);
DALI_TEST_EQUALS(aspect, value, FLOAT_EPSILON, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS( actor.GetNearClippingPlane(), 400.0f, TEST_LOCATION );
float value;
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(value);
DALI_TEST_EQUALS(400.0f, value, FLOAT_EPSILON, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS( actor.GetFarClippingPlane(), 4000.0f, TEST_LOCATION );
float value;
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(value);
DALI_TEST_EQUALS(4000.0f, value, FLOAT_EPSILON, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS( actor.GetTargetPosition(), target, TEST_LOCATION );
Vector3 value;
- actor.GetProperty(CameraActor::TARGET_POSITION).Get(value);
+ actor.GetProperty(CameraActor::Property::TargetPosition).Get(value);
DALI_TEST_EQUALS(target, value, FLOAT_EPSILON, TEST_LOCATION);
END_TEST;
}
DALI_TEST_EQUALS( actor.GetInvertYAxis(), true, TEST_LOCATION );
bool bValue;
- actor.GetProperty(CameraActor::INVERT_Y_AXIS).Get(bValue);
+ actor.GetProperty(CameraActor::Property::InvertYAxis).Get(bValue);
DALI_TEST_EQUALS(true, bValue, TEST_LOCATION);
END_TEST;
}
CameraActor cameraActor = task.GetCameraActor();
Matrix viewMatrix(false);
- cameraActor.GetProperty(CameraActor::VIEW_MATRIX).Get( viewMatrix );
+ cameraActor.GetProperty(CameraActor::Property::ViewMatrix).Get( viewMatrix );
Matrix::Multiply(resultMatrix, resultMatrix, viewMatrix);
DALI_TEST_CHECK( application.GetGlAbstraction().CheckUniformValue( "uModelView", resultMatrix ) );
DALI_TEST_CHECK(actor);
float value;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(value);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(value);
DALI_TEST_EQUALS(0.666666f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(value);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(value);
DALI_TEST_EQUALS(0.489957f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(value);
DALI_TEST_EQUALS(150.f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(value);
DALI_TEST_EQUALS(4245.f, value, FLOAT_EPSILON, TEST_LOCATION);
DALI_TEST_EQUALS((int)actor.GetProjectionMode(), (int)Dali::Camera::PERSPECTIVE_PROJECTION, TEST_LOCATION);
std::string stringValue;
- actor.GetProperty(CameraActor::PROJECTION_MODE).Get(stringValue);
+ actor.GetProperty(CameraActor::Property::ProjectionMode).Get(stringValue);
DALI_TEST_EQUALS(stringValue, "PERSPECTIVE_PROJECTION", TEST_LOCATION);
END_TEST;
}
float defaultFieldOfView;
float defaultNearPlaneDistance;
float defaultFarPlaneDistance;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(defaultAspectRatio);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(defaultFieldOfView);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(defaultNearPlaneDistance);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(defaultFarPlaneDistance);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(defaultAspectRatio);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(defaultFieldOfView);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(defaultNearPlaneDistance);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(defaultFarPlaneDistance);
Vector3 defaultPos = actor.GetCurrentPosition();
actor.SetOrthographicProjection( Size( 1080.0f, 1920.0f ) );
application.SendNotification();
float value;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(value);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(value);
DALI_TEST_EQUALS(defaultAspectRatio, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(value);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(value);
DALI_TEST_EQUALS(defaultFieldOfView, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(value);
DALI_TEST_EQUALS(defaultNearPlaneDistance, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(value);
DALI_TEST_EQUALS(defaultFarPlaneDistance, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::LEFT_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::LeftPlaneDistance).Get(value);
DALI_TEST_EQUALS(-540.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::RIGHT_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::RightPlaneDistance).Get(value);
DALI_TEST_EQUALS( 540.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::TOP_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::TopPlaneDistance).Get(value);
DALI_TEST_EQUALS(960.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::BOTTOM_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::BottomPlaneDistance).Get(value);
DALI_TEST_EQUALS(-960.0f, value, FLOAT_EPSILON, TEST_LOCATION);
Vector3 pos = actor.GetCurrentPosition();
float defaultFieldOfView;
float defaultNearPlaneDistance;
float defaultFarPlaneDistance;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(defaultAspectRatio);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(defaultFieldOfView);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(defaultNearPlaneDistance);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(defaultFarPlaneDistance);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(defaultAspectRatio);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(defaultFieldOfView);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(defaultNearPlaneDistance);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(defaultFarPlaneDistance);
actor.SetOrthographicProjection( -100.0f, 200.0f, -300.0f, 500.0f, 400.0f, 4000.0f );
float value;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(value);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(value);
DALI_TEST_EQUALS(defaultAspectRatio, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(value);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(value);
DALI_TEST_EQUALS(defaultFieldOfView, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(value);
DALI_TEST_EQUALS(400.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(value);
DALI_TEST_EQUALS(4000.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::LEFT_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::LeftPlaneDistance).Get(value);
DALI_TEST_EQUALS(-100.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::RIGHT_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::RightPlaneDistance).Get(value);
DALI_TEST_EQUALS( 200.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::TOP_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::TopPlaneDistance).Get(value);
DALI_TEST_EQUALS(-300.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::BOTTOM_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::BottomPlaneDistance).Get(value);
DALI_TEST_EQUALS( 500.0f, value, FLOAT_EPSILON, TEST_LOCATION);
DALI_TEST_EQUALS((int)actor.GetProjectionMode(), (int)Dali::Camera::ORTHOGRAPHIC_PROJECTION, TEST_LOCATION);
float defaultFieldOfView;
float defaultNearPlaneDistance;
float defaultFarPlaneDistance;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(defaultAspectRatio);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(defaultFieldOfView);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(defaultNearPlaneDistance);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(defaultFarPlaneDistance);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(defaultAspectRatio);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(defaultFieldOfView);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(defaultNearPlaneDistance);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(defaultFarPlaneDistance);
actor.SetProjectionMode(Dali::Camera::ORTHOGRAPHIC_PROJECTION);
- actor.SetProperty(CameraActor::LEFT_PLANE_DISTANCE, -100.0f);
- actor.SetProperty(CameraActor::RIGHT_PLANE_DISTANCE, 200.0f);
- actor.SetProperty(CameraActor::TOP_PLANE_DISTANCE, -300.0f);
- actor.SetProperty(CameraActor::BOTTOM_PLANE_DISTANCE, 500.0f);
+ actor.SetProperty(CameraActor::Property::LeftPlaneDistance, -100.0f);
+ actor.SetProperty(CameraActor::Property::RightPlaneDistance, 200.0f);
+ actor.SetProperty(CameraActor::Property::TopPlaneDistance, -300.0f);
+ actor.SetProperty(CameraActor::Property::BottomPlaneDistance, 500.0f);
actor.SetNearClippingPlane( 400.0f );
actor.SetFarClippingPlane( 4000.0f );
float value;
- actor.GetProperty(CameraActor::ASPECT_RATIO).Get(value);
+ actor.GetProperty(CameraActor::Property::AspectRatio).Get(value);
DALI_TEST_EQUALS(defaultAspectRatio, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FIELD_OF_VIEW).Get(value);
+ actor.GetProperty(CameraActor::Property::FieldOfView).Get(value);
DALI_TEST_EQUALS(defaultFieldOfView, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::NEAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::NearPlaneDistance).Get(value);
DALI_TEST_EQUALS(400.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::FAR_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::FarPlaneDistance).Get(value);
DALI_TEST_EQUALS(4000.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::LEFT_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::LeftPlaneDistance).Get(value);
DALI_TEST_EQUALS(-100.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::RIGHT_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::RightPlaneDistance).Get(value);
DALI_TEST_EQUALS( 200.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::TOP_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::TopPlaneDistance).Get(value);
DALI_TEST_EQUALS(-300.0f, value, FLOAT_EPSILON, TEST_LOCATION);
- actor.GetProperty(CameraActor::BOTTOM_PLANE_DISTANCE).Get(value);
+ actor.GetProperty(CameraActor::Property::BottomPlaneDistance).Get(value);
DALI_TEST_EQUALS( 500.0f, value, FLOAT_EPSILON, TEST_LOCATION);
DALI_TEST_EQUALS((int)actor.GetProjectionMode(), (int)Dali::Camera::ORTHOGRAPHIC_PROJECTION, TEST_LOCATION);
std::string stringValue;
- actor.GetProperty(CameraActor::PROJECTION_MODE).Get(stringValue);
+ actor.GetProperty(CameraActor::Property::ProjectionMode).Get(stringValue);
DALI_TEST_EQUALS(stringValue, "ORTHOGRAPHIC_PROJECTION", TEST_LOCATION);
END_TEST;
}
Matrix projectionMatrix;
Matrix viewMatrix;
- camera.GetProperty(CameraActor::CameraActor::PROJECTION_MATRIX).Get(projectionMatrix);
- camera.GetProperty(CameraActor::CameraActor::VIEW_MATRIX).Get(viewMatrix);
+ camera.GetProperty(CameraActor::CameraActor::Property::ProjectionMatrix).Get(projectionMatrix);
+ camera.GetProperty(CameraActor::CameraActor::Property::ViewMatrix).Get(viewMatrix);
ShaderEffect shaderEffect = ShaderEffect::New( RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE);
imageActor.SetShaderEffect(shaderEffect);
Property::Index projectionMatrixPropertyIndex = shaderEffect.GetPropertyIndex(SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME);
Property::Index viewMatrixPropertyIndex = shaderEffect.GetPropertyIndex(SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME);
- Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( projectionMatrixPropertyIndex, Source( camera, CameraActor::PROJECTION_MATRIX ), EqualToConstraint());
- Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( viewMatrixPropertyIndex, Source( camera, CameraActor::VIEW_MATRIX ), EqualToConstraint());
+ Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( projectionMatrixPropertyIndex, Source( camera, CameraActor::Property::ProjectionMatrix ), EqualToConstraint());
+ Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( viewMatrixPropertyIndex, Source( camera, CameraActor::Property::ViewMatrix ), EqualToConstraint());
shaderEffect.ApplyConstraint(projectionMatrixConstraint);
shaderEffect.ApplyConstraint(viewMatrixConstraint);
actor.SetSize(100.0f, 100.0f);
Stage::GetCurrent().Add(actor);
- actor.ApplyConstraint(Constraint::New<Dali::Vector3>( Actor::POSITION, Source( camera, Actor::POSITION), EqualToConstraint()));
+ actor.ApplyConstraint(Constraint::New<Dali::Vector3>( Actor::Property::Position, Source( camera, Actor::Property::Position), EqualToConstraint()));
camera.SetPosition(100.0f, 200.0f, 300.0f);
application.SendNotification();
target.SetPosition(targetPosition);
Constraint cameraOrientationConstraint =
- Constraint::New<Quaternion> ( Actor::ROTATION,
- Source( target, Actor::WORLD_POSITION ),
- Source( freeLookCameraActor, Actor::WORLD_POSITION ),
- Source( target, Actor::WORLD_ROTATION ),
+ Constraint::New<Quaternion> ( Actor::Property::Rotation,
+ Source( target, Actor::Property::WorldPosition ),
+ Source( freeLookCameraActor, Actor::Property::WorldPosition ),
+ Source( target, Actor::Property::WorldRotation ),
&LookAt );
freeLookCameraActor.ApplyConstraint( cameraOrientationConstraint );
application.Render();
Matrix freeLookViewMatrix;
Matrix lookAtViewMatrix;
- freeLookCameraActor.GetProperty(CameraActor::CameraActor::VIEW_MATRIX).Get(freeLookViewMatrix);
- lookAtCameraActor.GetProperty(CameraActor::CameraActor::VIEW_MATRIX).Get(lookAtViewMatrix);
+ freeLookCameraActor.GetProperty(CameraActor::CameraActor::Property::ViewMatrix).Get(freeLookViewMatrix);
+ lookAtCameraActor.GetProperty(CameraActor::CameraActor::Property::ViewMatrix).Get(lookAtViewMatrix);
DALI_TEST_EQUALS( freeLookViewMatrix, lookAtViewMatrix, 0.01, TEST_LOCATION );
}
target.SetPosition(targetPosition);
Constraint cameraOrientationConstraint =
- Constraint::New<Quaternion> ( Actor::ROTATION,
- Source( target, Actor::WORLD_POSITION ),
- Source( freeLookCameraActor, Actor::WORLD_POSITION ),
- Source( target, Actor::WORLD_ROTATION ),
+ Constraint::New<Quaternion> ( Actor::Property::Rotation,
+ Source( target, Actor::Property::WorldPosition ),
+ Source( freeLookCameraActor, Actor::Property::WorldPosition ),
+ Source( target, Actor::Property::WorldRotation ),
&LookAt );
freeLookCameraActor.ApplyConstraint( cameraOrientationConstraint );
application.Render();
Matrix freeLookViewMatrix;
Matrix lookAtViewMatrix;
- freeLookCameraActor.GetProperty(CameraActor::CameraActor::VIEW_MATRIX).Get(freeLookViewMatrix);
- lookAtCameraActor.GetProperty(CameraActor::CameraActor::VIEW_MATRIX).Get(lookAtViewMatrix);
+ freeLookCameraActor.GetProperty(CameraActor::CameraActor::Property::ViewMatrix).Get(freeLookViewMatrix);
+ lookAtCameraActor.GetProperty(CameraActor::CameraActor::Property::ViewMatrix).Get(lookAtViewMatrix);
Matrix freeLookWorld = freeLookCameraActor.GetCurrentWorldMatrix();
application.Render();
Matrix freeLookViewMatrix;
- freeLookCameraActor.GetProperty(CameraActor::CameraActor::VIEW_MATRIX).Get(freeLookViewMatrix);
+ freeLookCameraActor.GetProperty(CameraActor::CameraActor::Property::ViewMatrix).Get(freeLookViewMatrix);
Matrix freeLookWorld = freeLookCameraActor.GetCurrentWorldMatrix();
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a local input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- LocalSource( Actor::COLOR ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ LocalSource( Actor::Property::Color ),
MoveAwayWithFadeConstraint(distanceWhenFullyTransparent) );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), ( startValue - Vector3(0.0f, 0.0f, progress*distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), ( startValue - Vector3(0.0f, 0.0f, progress*distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
}
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), ( startValue - Vector3(0.0f, 0.0f, distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), ( startValue - Vector3(0.0f, 0.0f, distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ ParentSource( Actor::Property::Size ),
TestBottomRightAlignConstraint() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), parentStartSize, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), parent.GetCurrentSize(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), parentStartSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), parent.GetCurrentSize(), TEST_LOCATION );
// Gradually shrink the parent; the actor should move inwards
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), size, POSITION_EPSILON, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), parent.GetCurrentSize(), POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), size, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), parent.GetCurrentSize(), POSITION_EPSILON, TEST_LOCATION );
}
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), Vector3::ZERO, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), Vector3::ZERO, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( sibling1, Actor::Property::Position ),
MeanPositionConstraint1() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), sibling1.GetCurrentPosition(), TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), sibling1.GetCurrentPosition(), TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), sibling1.GetCurrentPosition(), TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( sibling1, Actor::Property::Position ),
+ Source( sibling2, Actor::Property::Position ),
MeanPositionConstraint2() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( sibling1, Actor::Property::Position ),
+ Source( sibling2, Actor::Property::Position ),
+ Source( sibling3, Actor::Property::Position ),
MeanPositionConstraint3() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- ParentSource( Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( sibling1, Actor::Property::Position ),
+ Source( sibling2, Actor::Property::Position ),
+ ParentSource( Actor::Property::Position ),
+ Source( sibling3, Actor::Property::Position ),
MeanPositionConstraint4() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- ParentSource( Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
- Source( sibling4, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( sibling1, Actor::Property::Position ),
+ Source( sibling2, Actor::Property::Position ),
+ ParentSource( Actor::Property::Position ),
+ Source( sibling3, Actor::Property::Position ),
+ Source( sibling4, Actor::Property::Position ),
MeanPositionConstraint5() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( child, Actor::POSITION ),
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- ParentSource( Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
- Source( sibling4, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( child, Actor::Property::Position ),
+ Source( sibling1, Actor::Property::Position ),
+ Source( sibling2, Actor::Property::Position ),
+ ParentSource( Actor::Property::Position ),
+ Source( sibling3, Actor::Property::Position ),
+ Source( sibling4, Actor::Property::Position ),
MeanPositionConstraint6() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
// Build constraint
Vector4 targetColor(Color::BLACK);
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestColorConstraint(targetColor) );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color, TestColorConstraint(targetColor) );
DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(0.0f), TEST_LOCATION);
float applySeconds(7.0f);
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color, TestConstraint() );
DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(0.0f), TEST_LOCATION);
float applySeconds(7.0f);
Vector3 startValue( Vector3::ZERO );
Vector3 targetValue(100.0f, 100.0f, 100.0f);
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
TestConstraintVector3( targetValue ) );
// Test the alpha-function itself
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
constraint.SetApplyTime( 10.0f );
actor.ApplyConstraint( constraint );
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.1f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.1f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.2f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.2f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.3f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.3f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.4f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.4f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.5f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.6f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.6f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.7f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.7f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.8f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.8f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.9f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue) * 0.9f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION );
// Check that the constrained value is stable
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION );
// Remove the constraint
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), startValue, TEST_LOCATION );
// Change to non-linear alpha and retest
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).x > startValue.x );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).y > startValue.y );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).z > startValue.z );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::Position ).x > startValue.x );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::Position ).y > startValue.y );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::Position ).z > startValue.z );
Vector3 lessThanTenPercentProgress( (targetValue - startValue) * 0.09f );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).x < lessThanTenPercentProgress.x );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).y < lessThanTenPercentProgress.y );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).z < lessThanTenPercentProgress.z );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::Position ).x < lessThanTenPercentProgress.x );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::Position ).y < lessThanTenPercentProgress.y );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::Position ).z < lessThanTenPercentProgress.z );
application.Render(static_cast<unsigned int>(9000.0f/*9 seconds*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION );
// Check that the constrained value is stable
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION );
END_TEST;
}
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color, TestConstraint() );
AlphaFunction func = constraint.GetAlphaFunction();
DALI_TEST_EQUALS(func(0.5f), 0.5f, TEST_LOCATION); // Default is Linear
// Build constraint, with "Discard" remove action
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, TestPositionConstraint(targetPosition) );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position, TestPositionConstraint(targetPosition) );
DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION);
constraint.SetRemoveAction(Constraint::Discard);
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color, TestConstraint() );
DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION);
constraint.SetRemoveAction(Constraint::Discard);
// Build constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, TestPositionConstraint(targetPosition) );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position, TestPositionConstraint(targetPosition) );
DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION);
float applySeconds(4.0f);
// Build constraint, to make child 20% of parent size
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size,
+ ParentSource( Actor::Property::Size ),
TestRelativeConstraintVector3(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::Size), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make child 20% of parent width
- Constraint constraint = Constraint::New<float>( Actor::SIZE_WIDTH,
- ParentSource( Actor::SIZE_WIDTH ),
+ Constraint constraint = Constraint::New<float>( Actor::Property::SizeWidth,
+ ParentSource( Actor::Property::SizeWidth ),
TestRelativeConstraintFloat(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::Size), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make child 20% of parent height
- Constraint constraint = Constraint::New<float>( Actor::SIZE_HEIGHT,
- ParentSource( Actor::SIZE_HEIGHT ),
+ Constraint constraint = Constraint::New<float>( Actor::Property::SizeHeight,
+ ParentSource( Actor::Property::SizeHeight ),
TestRelativeConstraintFloat(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::Size), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make child 20% of parent height
- Constraint constraint = Constraint::New<float>( Actor::SIZE_DEPTH,
- ParentSource( Actor::SIZE_DEPTH ),
+ Constraint constraint = Constraint::New<float>( Actor::Property::SizeDepth,
+ ParentSource( Actor::Property::SizeDepth ),
TestRelativeConstraintFloat(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::Size), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make actor track the world-position of another actor
// Note that the world-position is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( child, Actor::WORLD_POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+ Source( child, Actor::Property::WorldPosition ),
EqualToConstraint() );
trackingActor.ApplyConstraint( constraint );
// Build constraint, to make actor track the world-rotation of another actor
// Note that the world-rotation is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Quaternion>( Actor::ROTATION,
- Source( child, Actor::WORLD_ROTATION ),
+ Constraint constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+ Source( child, Actor::Property::WorldRotation ),
EqualToQuaternion() );
trackingActor.ApplyConstraint( constraint );
// Build constraint, to make actor track the world-scale of another actor
// Note that the world-scale is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- Source( child, Actor::WORLD_SCALE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
+ Source( child, Actor::Property::WorldScale ),
EqualToConstraint() );
trackingActor.ApplyConstraint( constraint );
// Build constraint, to make actor track the world-color of another actor
// Note that the world-color is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR,
- Source( child, Actor::WORLD_COLOR ),
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color,
+ Source( child, Actor::Property::WorldColor ),
EqualToVector4() );
trackingActor.ApplyConstraint( constraint );
{
TestApplication application;
Actor actor = Actor::New();
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, LocalSource( PROPERTY_REGISTRATION_START_INDEX ), EqualToConstraint() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position, LocalSource( PROPERTY_REGISTRATION_START_INDEX ), EqualToConstraint() );
Stage::GetCurrent().Add( actor );
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() );
actor.ApplyConstraint( constraint );
application.SendNotification();
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( scale ) );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), RelativeToConstraint( scale ) );
actor.ApplyConstraint( constraint );
application.SendNotification();
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
+ LocalSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::Size ),
ScaleToFitConstraint() );
actor.ApplyConstraint( constraint );
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
+ LocalSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::Size ),
ScaleToFitKeepAspectRatioConstraint() );
actor.ApplyConstraint( constraint );
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
+ LocalSource( Actor::Property::Size ),
+ ParentSource( Actor::Property::Size ),
ScaleToFillXYKeepAspectRatioConstraint() );
actor.ApplyConstraint( constraint );
// Apply constraint - actor1 size == actor2 position
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( actor1, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size,
+ Source( actor1, Actor::Property::Position ),
EqualToConstraint() );
constraint.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint );
DALI_TEST_EQUALS( actor1.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
DALI_TEST_EQUALS( actor2.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
- Constraint constraint2 = Constraint::New<float>( Actor::COLOR_ALPHA,
- Source( actor1, Actor::COLOR_ALPHA ),
+ Constraint constraint2 = Constraint::New<float>( Actor::Property::ColorAlpha,
+ Source( actor1, Actor::Property::ColorAlpha ),
EqualToConstraint() );
constraint2.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint2 );
DALI_TEST_CHECK( actor1.GetCurrentColor() == Color::GREEN );
DALI_TEST_CHECK( actor2.GetCurrentColor() == Color::RED );
- Constraint constraint3 = Constraint::New<Vector4>( Actor::COLOR,
- Source( actor1, Actor::COLOR ),
+ Constraint constraint3 = Constraint::New<Vector4>( Actor::Property::Color,
+ Source( actor1, Actor::Property::Color ),
EqualToConstraint() );
constraint3.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint3 );
DALI_TEST_EQUALS( actor1.GetCurrentRotation(), q1, 0.01, TEST_LOCATION );
DALI_TEST_EQUALS( actor2.GetCurrentRotation(), q2, 0.01, TEST_LOCATION );
- Constraint constraint4 = Constraint::New<Quaternion>( Actor::ROTATION,
- Source( actor1, Actor::ROTATION ),
+ Constraint constraint4 = Constraint::New<Quaternion>( Actor::Property::Rotation,
+ Source( actor1, Actor::Property::Rotation ),
EqualToConstraint() );
constraint4.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint4 );
RelativeToConstraint( 0.f );
Vector3 scale( 0.5, 0.6, 0.7 );
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( actor1, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size,
+ Source( actor1, Actor::Property::Position ),
RelativeToConstraint( scale ) );
constraint.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint );
DALI_TEST_EQUALS( actor1.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
DALI_TEST_EQUALS( actor2.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
- Constraint constraint2 = Constraint::New<float>( Actor::COLOR_ALPHA,
- Source( actor1, Actor::COLOR_ALPHA ),
+ Constraint constraint2 = Constraint::New<float>( Actor::Property::ColorAlpha,
+ Source( actor1, Actor::Property::ColorAlpha ),
RelativeToConstraintFloat(scale2) );
constraint2.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint(constraint2);
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( "parent-origin" == actor.GetPropertyName( Actor::PARENT_ORIGIN ) );
+ DALI_TEST_CHECK( "parent-origin" == actor.GetPropertyName( Actor::Property::ParentOrigin ) );
// Register a dynamic property
std::string name("this-name-should-match");
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( Actor::PARENT_ORIGIN == actor.GetPropertyIndex("parent-origin") );
+ DALI_TEST_CHECK( Actor::Property::ParentOrigin == actor.GetPropertyIndex("parent-origin") );
// Register a dynamic property
std::string name("this-name-should-match");
Actor actor = Actor::New();
// Actor properties which are writable:
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::PARENT_ORIGIN ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::PARENT_ORIGIN_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::PARENT_ORIGIN_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::PARENT_ORIGIN_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE_WIDTH ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE_HEIGHT ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE_DEPTH ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ROTATION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::VISIBLE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_RED ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_GREEN ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_BLUE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_ALPHA ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ParentOrigin ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ParentOriginX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ParentOriginY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ParentOriginZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::AnchorPoint ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::AnchorPointX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::AnchorPointY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::AnchorPointZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::Size ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SizeWidth ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SizeHeight ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SizeDepth ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::Position ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::PositionX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::PositionY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::PositionZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::Rotation ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::Scale ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ScaleX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ScaleY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ScaleZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::Visible ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::Color ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ColorRed ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ColorGreen ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ColorBlue ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ColorAlpha ) );
// World-properties are not writable:
- DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_POSITION ) );
- DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_ROTATION ) );
- DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_SCALE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_COLOR ) );
- DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_POSITION_X ) );
- DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_POSITION_Y ) );
- DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_POSITION_Z ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WorldPosition ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WorldRotation ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WorldScale ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WorldColor ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WorldPositionX ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WorldPositionY ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WorldPositionZ ) );
END_TEST;
}
Actor actor = Actor::New();
// Actor properties which are animatable:
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::PARENT_ORIGIN ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::PARENT_ORIGIN_X ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::PARENT_ORIGIN_Y ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::PARENT_ORIGIN_Z ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT_X ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT_Y ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE_WIDTH ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE_HEIGHT ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE_DEPTH ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::ROTATION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::VISIBLE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_RED ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_GREEN ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_BLUE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_ALPHA ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ParentOrigin ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ParentOriginX ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ParentOriginY ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ParentOriginZ ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::AnchorPoint ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::AnchorPointX ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::AnchorPointY ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::AnchorPointZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::Size ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SizeWidth ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SizeHeight ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SizeDepth ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::Position ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::PositionX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::PositionY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::PositionZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::Rotation ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::Scale ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ScaleX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ScaleY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ScaleZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::Visible ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::Color ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ColorRed ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ColorGreen ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ColorBlue ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ColorAlpha ) );
// World-properties can not be animated
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_POSITION ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_ROTATION ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_SCALE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_COLOR ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_POSITION_X ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_POSITION_Y ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_POSITION_Z ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WorldPosition ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WorldRotation ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WorldScale ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WorldColor ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WorldPositionX ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WorldPositionY ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WorldPositionZ ) );
END_TEST;
}
Actor actor = Actor::New();
// Actor properties which can be used as a constraint input:
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::PARENT_ORIGIN ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::PARENT_ORIGIN_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::PARENT_ORIGIN_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::PARENT_ORIGIN_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE_WIDTH ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE_HEIGHT ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE_DEPTH ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ROTATION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE_Z ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::VISIBLE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_RED ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_GREEN ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_BLUE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_ALPHA ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_ROTATION ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_SCALE ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_COLOR ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION_X ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION_Y ) );
- DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION_Z ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ParentOrigin ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ParentOriginX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ParentOriginY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ParentOriginZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::AnchorPoint ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::AnchorPointX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::AnchorPointY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::AnchorPointZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::Size ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SizeWidth ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SizeHeight ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SizeDepth ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::Position ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::PositionX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::PositionY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::PositionZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::Rotation ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::Scale ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ScaleX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ScaleY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ScaleZ ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::Visible ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::Color ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ColorRed ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ColorGreen ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ColorBlue ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ColorAlpha ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WorldPosition ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WorldRotation ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WorldScale ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WorldColor ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WorldPositionX ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WorldPositionY ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WorldPositionZ ) );
// Actor properties that cannot be used as a constraint input
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::NAME ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::SENSITIVE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::LEAVE_REQUIRED ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::INHERIT_ROTATION ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::INHERIT_SCALE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::COLOR_MODE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::POSITION_INHERITANCE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::DRAW_MODE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::SIZE_MODE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::SIZE_MODE_FACTOR ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::Name ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::Sensitive ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::LeaveRequired ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::InheritRotation ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::InheritScale ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::ColorMode ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::PositionInheritance ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::DrawMode ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::SizeMode ) );
+ DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::SizeModeFactor ) );
END_TEST;
}
unsigned int unsingedIntTest = 33;
Actor actor = Actor::New();
- DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::PARENT_ORIGIN ) );
- DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::ANCHOR_POINT ) );
- DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::SIZE ) );
- DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::POSITION ) );
- DALI_TEST_CHECK( Property::ROTATION == actor.GetPropertyType( Actor::ROTATION ) );
- DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::SCALE ) );
- DALI_TEST_CHECK( Property::BOOLEAN == actor.GetPropertyType( Actor::VISIBLE ) );
- DALI_TEST_CHECK( Property::VECTOR4 == actor.GetPropertyType( Actor::COLOR ) );
+ DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::Property::ParentOrigin ) );
+ DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::Property::AnchorPoint ) );
+ DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::Property::Size ) );
+ DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::Property::Position ) );
+ DALI_TEST_CHECK( Property::ROTATION == actor.GetPropertyType( Actor::Property::Rotation ) );
+ DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::Property::Scale ) );
+ DALI_TEST_CHECK( Property::BOOLEAN == actor.GetPropertyType( Actor::Property::Visible ) );
+ DALI_TEST_CHECK( Property::VECTOR4 == actor.GetPropertyType( Actor::Property::Color ) );
// Register some dynamic properties
Property::Index boolIndex = actor.RegisterProperty( "bool-property", bool(true) );
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get<Vector3>() );
+ DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::ParentOrigin ).Get<Vector3>() );
- actor.SetProperty( Actor::PARENT_ORIGIN, ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ParentOrigin, ParentOrigin::CENTER );
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( ParentOrigin::CENTER == actor.GetProperty( Actor::PARENT_ORIGIN ).Get<Vector3>() );
+ DALI_TEST_CHECK( ParentOrigin::CENTER == actor.GetProperty( Actor::Property::ParentOrigin ).Get<Vector3>() );
END_TEST;
}
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.IsPropertyWritable( Actor::WORLD_POSITION ) );
+ DALI_TEST_CHECK( !actor.IsPropertyWritable( Actor::Property::WorldPosition ) );
// World position is not writable so this is a no-op and should not crash
- actor.SetProperty( Actor::WORLD_POSITION, Vector3(1,2,3) );
+ actor.SetProperty( Actor::Property::WorldPosition, Vector3(1,2,3) );
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get<Vector3>() );
+ DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::ParentOrigin ).Get<Vector3>() );
END_TEST;
}
Actor actor = Actor::New();
- DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get<Vector3>() );
- DALI_TEST_CHECK( AnchorPoint::CENTER == actor.GetProperty( Actor::ANCHOR_POINT ).Get<Vector3>() );
- DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::SIZE ).Get<Vector3>() );
- DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::POSITION ).Get<Vector3>() );
- DALI_TEST_CHECK( Vector3::ONE == actor.GetProperty( Actor::SCALE ).Get<Vector3>() );
- DALI_TEST_CHECK( true == actor.GetProperty( Actor::VISIBLE ).Get<bool>() );
- DALI_TEST_CHECK( Color::WHITE == actor.GetProperty( Actor::COLOR ).Get<Vector4>() );
+ DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::ParentOrigin ).Get<Vector3>() );
+ DALI_TEST_CHECK( AnchorPoint::CENTER == actor.GetProperty( Actor::Property::AnchorPoint ).Get<Vector3>() );
+ DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::Property::Size ).Get<Vector3>() );
+ DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::Property::Position ).Get<Vector3>() );
+ DALI_TEST_CHECK( Vector3::ONE == actor.GetProperty( Actor::Property::Scale ).Get<Vector3>() );
+ DALI_TEST_CHECK( true == actor.GetProperty( Actor::Property::Visible ).Get<bool>() );
+ DALI_TEST_CHECK( Color::WHITE == actor.GetProperty( Actor::Property::Color ).Get<Vector4>() );
END_TEST;
}
ImageActor actor = ImageActor::New( img );
std::vector<Property::Index> indices;
- indices.push_back(ImageActor::PIXEL_AREA );
- indices.push_back(ImageActor::STYLE );
- indices.push_back(ImageActor::BORDER );
- indices.push_back(ImageActor::IMAGE );
+ indices.push_back(ImageActor::Property::PixelArea );
+ indices.push_back(ImageActor::Property::Style );
+ indices.push_back(ImageActor::Property::Border );
+ indices.push_back(ImageActor::Property::Image );
DALI_TEST_CHECK(actor.GetPropertyCount() == ( Actor::New().GetPropertyCount() + indices.size() ) );
actor.SetPixelArea(ImageActor::PixelArea( 0, 0, 0, 0 ));
ImageActor::PixelArea area( 1, 2, 3, 4 );
- actor.SetProperty(ImageActor::PIXEL_AREA, Property::Value(Rect<int>(area)));
+ actor.SetProperty(ImageActor::Property::PixelArea, Property::Value(Rect<int>(area)));
- DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(ImageActor::PIXEL_AREA));
+ DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(ImageActor::Property::PixelArea));
- Property::Value v = actor.GetProperty(ImageActor::PIXEL_AREA);
+ Property::Value v = actor.GetProperty(ImageActor::Property::PixelArea);
DALI_TEST_CHECK(v.Get<Rect<int> >() == area);
application.SendNotification();
application.Render();
- Property::Value imageMap = imageActor.GetProperty( ImageActor::IMAGE );
+ Property::Value imageMap = imageActor.GetProperty( ImageActor::Property::Image );
DALI_TEST_CHECK( imageMap.HasKey( "filename" ) );
DALI_TEST_EQUALS( imageMap.GetValue( "filename" ).Get< std::string >(), "MY_PATH", TEST_LOCATION );
END_TEST;
Layer actor = Layer::New();
std::vector<Property::Index> indices ;
- indices.push_back(Layer::CLIPPING_ENABLE );
- indices.push_back(Layer::CLIPPING_BOX );
+ indices.push_back(Layer::Property::ClippingEnable);
+ indices.push_back(Layer::Property::ClippingBox);
DALI_TEST_CHECK(actor.GetPropertyCount() == ( Actor::New().GetPropertyCount() + indices.size() ) );
ClippingBox testBox(10,20,30,40);
DALI_TEST_CHECK(actor.GetClippingBox() != testBox);
- actor.SetProperty(Layer::CLIPPING_BOX, Property::Value(Rect<int>(testBox)));
+ actor.SetProperty(Layer::Property::ClippingBox, Property::Value(Rect<int>(testBox)));
- DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(Layer::CLIPPING_BOX)) ;
+ DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(Layer::Property::ClippingBox)) ;
- Property::Value v = actor.GetProperty(Layer::CLIPPING_BOX);
+ Property::Value v = actor.GetProperty(Layer::Property::ClippingBox);
DALI_TEST_CHECK(v.Get<Rect<int> >() == testBox);
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
+ actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::Property::ScreenPosition ),
+ Source( detector, PanGestureDetector::Property::ScreenDisplacement ),
+ Source( detector, PanGestureDetector::Property::ScreenVelocity ),
+ Source( detector, PanGestureDetector::Property::LocalPosition ),
+ Source( detector, PanGestureDetector::Property::LocalDisplacement ),
+ Source( detector, PanGestureDetector::Property::LocalVelocity ),
PanConstraint( constraintData ) ) );
// Render and notify
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
+ actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::Property::ScreenPosition ),
+ Source( detector, PanGestureDetector::Property::ScreenDisplacement ),
+ Source( detector, PanGestureDetector::Property::ScreenVelocity ),
+ Source( detector, PanGestureDetector::Property::LocalPosition ),
+ Source( detector, PanGestureDetector::Property::LocalDisplacement ),
+ Source( detector, PanGestureDetector::Property::LocalVelocity ),
PanConstraint( constraintData ) ) );
// Render and notify
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
+ actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::Property::ScreenPosition ),
+ Source( detector, PanGestureDetector::Property::ScreenDisplacement ),
+ Source( detector, PanGestureDetector::Property::ScreenVelocity ),
+ Source( detector, PanGestureDetector::Property::LocalPosition ),
+ Source( detector, PanGestureDetector::Property::LocalDisplacement ),
+ Source( detector, PanGestureDetector::Property::LocalVelocity ),
PanConstraint( constraintData ) ) );
// Render and notify
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
+ actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::Property::ScreenPosition ),
+ Source( detector, PanGestureDetector::Property::ScreenDisplacement ),
+ Source( detector, PanGestureDetector::Property::ScreenVelocity ),
+ Source( detector, PanGestureDetector::Property::LocalPosition ),
+ Source( detector, PanGestureDetector::Property::LocalDisplacement ),
+ Source( detector, PanGestureDetector::Property::LocalVelocity ),
PanConstraint( constraintData ) ) );
// Render and notify
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
+ actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::Property::ScreenPosition ),
+ Source( detector, PanGestureDetector::Property::ScreenDisplacement ),
+ Source( detector, PanGestureDetector::Property::ScreenVelocity ),
+ Source( detector, PanGestureDetector::Property::LocalPosition ),
+ Source( detector, PanGestureDetector::Property::LocalDisplacement ),
+ Source( detector, PanGestureDetector::Property::LocalVelocity ),
PanConstraint( constraintData ) ) );
// Render and notify
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
+ actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::Property::ScreenPosition ),
+ Source( detector, PanGestureDetector::Property::ScreenDisplacement ),
+ Source( detector, PanGestureDetector::Property::ScreenVelocity ),
+ Source( detector, PanGestureDetector::Property::LocalPosition ),
+ Source( detector, PanGestureDetector::Property::LocalDisplacement ),
+ Source( detector, PanGestureDetector::Property::LocalVelocity ),
PanConstraint( constraintData ) ) );
// Render and notify
{
mActor = Actor::New();
Stage::GetCurrent().Add( mActor );
- mNotification = mActor.AddPropertyNotification( Actor::POSITION_X, GreaterThanCondition(100.0f) );
+ mNotification = mActor.AddPropertyNotification( Actor::Property::PositionX, GreaterThanCondition(100.0f) );
mNotification.NotifySignal().Connect( this, &TestClass::OnPropertyNotify );
}
tet_infoline(" UtcDaliPropertyNotificationDownCast");
Actor actor = Actor::New();
- PropertyNotification notification = actor.AddPropertyNotification(Actor::POSITION_X, GreaterThanCondition(100.0f));
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::PositionX, GreaterThanCondition(100.0f));
BaseHandle handle = notification;
PropertyNotification notificationHandle;
Actor somethingElse = Actor::New();
Actor actor = Actor::New();
- actor.AddPropertyNotification(Actor::POSITION_X, GreaterThanCondition(100.0f));
+ actor.AddPropertyNotification(Actor::Property::PositionX, GreaterThanCondition(100.0f));
BaseHandle handle = somethingElse;
PropertyNotification notificationHandle;
Actor actor = Actor::New();
- PropertyNotification notification = actor.AddPropertyNotification(Actor::POSITION_X, GreaterThanCondition(100.0f));
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::PositionX, GreaterThanCondition(100.0f));
DALI_TEST_CHECK( notification );
END_TEST;
}
Actor actor = Actor::New();
PropertyCondition condition = GreaterThanCondition(100.0f);
- PropertyNotification notification = actor.AddPropertyNotification(Actor::POSITION_X, condition);
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::PositionX, condition);
DALI_TEST_CHECK( condition == notification.GetCondition() );
END_TEST;
}
Actor actor = Actor::New();
PropertyCondition condition = GreaterThanCondition(100.0f);
- PropertyNotification notification = actor.AddPropertyNotification(Actor::POSITION_X, condition);
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::PositionX, condition);
PropertyNotificationConstWrapper notificationConst(notification);
const PropertyCondition& conditionReference1 = notificationConst.GetCondition();
const PropertyCondition& conditionReference2 = notificationConst.GetCondition();
Actor actor = Actor::New();
Actor actor2 = Actor::New();
- PropertyNotification notification = actor.AddPropertyNotification(Actor::POSITION_X,
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::PositionX,
GreaterThanCondition(100.0f));
Actor targetActor = Actor::DownCast( notification.GetTarget() );
Actor actor = Actor::New();
- PropertyNotification notification = actor.AddPropertyNotification(Actor::POSITION_X,
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::PositionX,
GreaterThanCondition(100.0f));
Property::Index targetProperty = notification.GetTargetProperty();
- DALI_TEST_EQUALS( targetProperty, Actor::POSITION_X, TEST_LOCATION );
+ DALI_TEST_EQUALS( targetProperty, Actor::Property::PositionX, TEST_LOCATION );
END_TEST;
}
Actor actor = Actor::New();
- PropertyNotification notification = actor.AddPropertyNotification(Actor::POSITION_X,
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::PositionX,
GreaterThanCondition(100.0f));
notification.SetNotifyMode(PropertyNotification::NotifyOnChanged);
PropertyNotification::NotifyMode notifyMode = notification.GetNotifyMode();
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION_X, GreaterThanCondition(100.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::PositionX, GreaterThanCondition(100.0f) );
notification.NotifySignal().Connect( &TestCallback );
actor.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION_X, LessThanCondition(100.0f ) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::PositionX, LessThanCondition(100.0f ) );
notification.NotifySignal().Connect( &TestCallback );
actor.SetPosition(Vector3(200.0f, 0.0f, 0.0f));
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION_X, InsideCondition(100.0f, 200.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::PositionX, InsideCondition(100.0f, 200.0f) );
notification.NotifySignal().Connect( &TestCallback );
actor.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION_X, OutsideCondition(100.0f, 200.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::PositionX, OutsideCondition(100.0f, 200.0f) );
notification.NotifySignal().Connect( &TestCallback );
actor.SetPosition(Vector3(150.0f, 0.0f, 0.0f));
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION, 0, GreaterThanCondition(100.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::Position, 0, GreaterThanCondition(100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 1, GreaterThanCondition(100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 1, GreaterThanCondition(100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 2, GreaterThanCondition(100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 2, GreaterThanCondition(100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::COLOR, 3, GreaterThanCondition(0.5f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Color, 3, GreaterThanCondition(0.5f) );
notification.NotifySignal().Connect( &TestCallback );
actor.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION, 0, LessThanCondition(-100.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::Position, 0, LessThanCondition(-100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 1, LessThanCondition(-100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 1, LessThanCondition(-100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 2, LessThanCondition(-100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 2, LessThanCondition(-100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::COLOR, 3, LessThanCondition(0.5f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Color, 3, LessThanCondition(0.5f) );
notification.NotifySignal().Connect( &TestCallback );
actor.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION, 0, InsideCondition(-100.0f, 100.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::Position, 0, InsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 1, InsideCondition(-100.0f, 100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 1, InsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 2, InsideCondition(-100.0f, 100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 2, InsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::COLOR, 3, InsideCondition(0.25f, 0.75f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Color, 3, InsideCondition(0.25f, 0.75f) );
notification.NotifySignal().Connect( &TestCallback );
// set outside all conditions
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION, 0, OutsideCondition(-100.0f, 100.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::Position, 0, OutsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 1, OutsideCondition(-100.0f, 100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 1, OutsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::POSITION, 2, OutsideCondition(-100.0f, 100.0f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Position, 2, OutsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
- notification = actor.AddPropertyNotification( Actor::COLOR, 3, OutsideCondition(0.25f, 0.75f) );
+ notification = actor.AddPropertyNotification( Actor::Property::Color, 3, OutsideCondition(0.25f, 0.75f) );
notification.NotifySignal().Connect( &TestCallback );
// set inside all conditions
const float step = 100.0f;
// float
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION, 0, StepCondition(step, 50.0f) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::Position, 0, StepCondition(step, 50.0f) );
notification.NotifySignal().Connect( &TestCallback );
// set initial position
values.push_back(i * averageStep + (i % 2 == 0 ? -(averageStep * 0.2f) : (averageStep * 0.2f)));
}
// float
- PropertyNotification notification = actor.AddPropertyNotification( Actor::POSITION, 0, VariableStepCondition(values) );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::Position, 0, VariableStepCondition(values) );
notification.NotifySignal().Connect( &TestCallback );
// set initial position lower than first position in list
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
// this should complete in first frame
- PropertyNotification notification1 = actor.AddPropertyNotification( Actor::POSITION_X, GreaterThanCondition(90.0f) );
+ PropertyNotification notification1 = actor.AddPropertyNotification( Actor::Property::PositionX, GreaterThanCondition(90.0f) );
notification1.NotifySignal().Connect( &TestCallback );
// this should complete in second frame
- PropertyNotification notification2 = actor.AddPropertyNotification( Actor::POSITION_X, GreaterThanCondition(150.0f) );
+ PropertyNotification notification2 = actor.AddPropertyNotification( Actor::Property::PositionX, GreaterThanCondition(150.0f) );
notification2.NotifySignal().Connect( &TestCallback2 );
Animation animation = Animation::New( 0.032f ); // finishes in 32 ms
- animation.AnimateTo( Property(actor, Actor::POSITION ), Vector3( 200.0f, 0.0f, 0.0f ), AlphaFunctions::Linear );
+ animation.AnimateTo( Property(actor, Actor::Property::Position ), Vector3( 200.0f, 0.0f, 0.0f ), AlphaFunctions::Linear );
animation.Play();
// flush the queue
// Set by Property test
Vector2 newPosition2(32.0f, 32.0f);
- task.SetProperty( RenderTask::VIEWPORT_POSITION, newPosition2 );
+ task.SetProperty( RenderTask::Property::ViewportPosition, newPosition2 );
// Update
application.SendNotification();
Vector2 newPosition3(64.0f, 0.0f);
Animation animation = Animation::New(1.0f);
- animation.AnimateTo( Property( task, RenderTask::VIEWPORT_POSITION ), newPosition3, AlphaFunctions::Linear );
+ animation.AnimateTo( Property( task, RenderTask::Property::ViewportPosition ), newPosition3, AlphaFunctions::Linear );
animation.Play();
// Perform 1000ms worth of updates at which point animation should have completed.
// Set by Property test
Vector2 newSize2(50.0f, 50.0f);
- task.SetProperty( RenderTask::VIEWPORT_SIZE, newSize2 );
+ task.SetProperty( RenderTask::Property::ViewportSize, newSize2 );
// Update
application.SendNotification();
Vector2 newSize3(10.0f, 10.0f);
Animation animation = Animation::New(1.0f);
- animation.AnimateTo( Property( task, RenderTask::VIEWPORT_SIZE ), newSize3, AlphaFunctions::Linear );
+ animation.AnimateTo( Property( task, RenderTask::Property::ViewportSize ), newSize3, AlphaFunctions::Linear );
animation.Play();
// Perform 1000ms worth of updates at which point animation should have completed.
DALI_TEST_EQUALS( task.GetClearColor(), testColor, TEST_LOCATION );
- task.SetProperty( RenderTask::CLEAR_COLOR, testColor2 );
+ task.SetProperty( RenderTask::Property::ClearColor, testColor2 );
// Wait a frame.
Wait(application);
Property::Index uVecProperty = effect.GetPropertyIndex("uVec3");
Constraint constraint = Constraint::New<Vector3>( uVecProperty,
- Source(actor, Actor::POSITION),
+ Source(actor, Actor::Property::Position),
TestConstraintFromPositionToVector3() );
effect.ApplyConstraint(constraint);
Property::Index uVecProperty = effect.GetPropertyIndex("uVec3");
Constraint shaderConstraint = Constraint::New<Vector3>( uVecProperty,
- Source(actor, Actor::POSITION),
+ Source(actor, Actor::Property::Position),
TestConstraintFromPositionToVector3() );
effect.ApplyConstraint(shaderConstraint);
- Constraint actorConstraint = Constraint::New<Vector3>( Actor::POSITION,
+ Constraint actorConstraint = Constraint::New<Vector3>( Actor::Property::Position,
TestConstraintToVector3Double(targetPosition) );
actor.ApplyConstraint(actorConstraint);
TextActor actor = TextActor::New("@");
std::vector<Property::Index> indices ;
- indices.push_back(TextActor::TEXT );
- indices.push_back(TextActor::FONT );
- indices.push_back(TextActor::FONT_STYLE );
- indices.push_back(TextActor::OUTLINE_ENABLE );
- indices.push_back(TextActor::OUTLINE_COLOR );
- indices.push_back(TextActor::OUTLINE_THICKNESS_WIDTH );
- indices.push_back(TextActor::SMOOTH_EDGE );
- indices.push_back(TextActor::GLOW_ENABLE );
- indices.push_back(TextActor::GLOW_COLOR );
- indices.push_back(TextActor::GLOW_INTENSITY );
- indices.push_back(TextActor::SHADOW_ENABLE );
- indices.push_back(TextActor::SHADOW_COLOR );
- indices.push_back(TextActor::SHADOW_OFFSET );
- indices.push_back(TextActor::ITALICS_ANGLE );
- indices.push_back(TextActor::UNDERLINE );
- indices.push_back(TextActor::WEIGHT );
- indices.push_back(TextActor::FONT_DETECTION_AUTOMATIC );
- indices.push_back(TextActor::GRADIENT_COLOR );
- indices.push_back(TextActor::GRADIENT_START_POINT );
- indices.push_back(TextActor::GRADIENT_END_POINT );
- indices.push_back(TextActor::SHADOW_SIZE );
- indices.push_back(TextActor::TEXT_COLOR );
+ indices.push_back(TextActor::Property::Text );
+ indices.push_back(TextActor::Property::Font );
+ indices.push_back(TextActor::Property::FontStyle );
+ indices.push_back(TextActor::Property::OutlineEnable );
+ indices.push_back(TextActor::Property::OutlineColor );
+ indices.push_back(TextActor::Property::OutlineThicknessWidth );
+ indices.push_back(TextActor::Property::SmoothEdge );
+ indices.push_back(TextActor::Property::GlowEnable );
+ indices.push_back(TextActor::Property::GlowColor );
+ indices.push_back(TextActor::Property::GlowIntensity );
+ indices.push_back(TextActor::Property::ShadowEnable );
+ indices.push_back(TextActor::Property::ShadowColor );
+ indices.push_back(TextActor::Property::ShadowOffset );
+ indices.push_back(TextActor::Property::ItalicsAngle );
+ indices.push_back(TextActor::Property::Underline );
+ indices.push_back(TextActor::Property::Weight );
+ indices.push_back(TextActor::Property::FontDetectionAutomatic );
+ indices.push_back(TextActor::Property::GradientColor );
+ indices.push_back(TextActor::Property::GradientStartPoint );
+ indices.push_back(TextActor::Property::GradientEndPoint );
+ indices.push_back(TextActor::Property::ShadowSize );
+ indices.push_back(TextActor::Property::TextColor );
DALI_TEST_CHECK(actor.GetPropertyCount() == ( Actor::New().GetPropertyCount() + indices.size() ) );
actor.SetUnderline(false);
DALI_TEST_CHECK(actor.GetUnderline() != true);
- actor.SetProperty(TextActor::UNDERLINE, Property::Value(true));
- Property::Value v = actor.GetProperty(TextActor::UNDERLINE);
+ actor.SetProperty(TextActor::Property::Underline, Property::Value(true));
+ Property::Value v = actor.GetProperty(TextActor::Property::Underline);
DALI_TEST_CHECK(v.GetType() == Property::BOOLEAN);
DALI_TEST_CHECK(v.Get<bool>() == true);
// animate size, from this point onwards text actor no longer uses the "natural" size of the text
Animation sizeAnim = Animation::New( 0.1f ); // 0.1 seconds
Vector3 animationTargetSize( 20.0f, 30.0f, 0.0f );
- sizeAnim.AnimateTo( Property( actor, Actor::SIZE ), animationTargetSize );
+ sizeAnim.AnimateTo( Property( actor, Actor::Property::Size ), animationTargetSize );
sizeAnim.Play();
// set some more text
#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/internal/event/actors/camera-actor-impl.h>
#include <dali/internal/event/render-tasks/render-task-list-impl.h>
-#include <dali/internal/event/common/property-index-ranges.h>
+#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
#include <dali/internal/event/animation/constraint-impl.h>
namespace Dali
{
-const Property::Index Actor::PARENT_ORIGIN = 0;
-const Property::Index Actor::PARENT_ORIGIN_X = 1;
-const Property::Index Actor::PARENT_ORIGIN_Y = 2;
-const Property::Index Actor::PARENT_ORIGIN_Z = 3;
-const Property::Index Actor::ANCHOR_POINT = 4;
-const Property::Index Actor::ANCHOR_POINT_X = 5;
-const Property::Index Actor::ANCHOR_POINT_Y = 6;
-const Property::Index Actor::ANCHOR_POINT_Z = 7;
-const Property::Index Actor::SIZE = 8;
-const Property::Index Actor::SIZE_WIDTH = 9;
-const Property::Index Actor::SIZE_HEIGHT = 10;
-const Property::Index Actor::SIZE_DEPTH = 11;
-const Property::Index Actor::POSITION = 12;
-const Property::Index Actor::POSITION_X = 13;
-const Property::Index Actor::POSITION_Y = 14;
-const Property::Index Actor::POSITION_Z = 15;
-const Property::Index Actor::WORLD_POSITION = 16;
-const Property::Index Actor::WORLD_POSITION_X = 17;
-const Property::Index Actor::WORLD_POSITION_Y = 18;
-const Property::Index Actor::WORLD_POSITION_Z = 19;
-const Property::Index Actor::ROTATION = 20;
-const Property::Index Actor::WORLD_ROTATION = 21;
-const Property::Index Actor::SCALE = 22;
-const Property::Index Actor::SCALE_X = 23;
-const Property::Index Actor::SCALE_Y = 24;
-const Property::Index Actor::SCALE_Z = 25;
-const Property::Index Actor::WORLD_SCALE = 26;
-const Property::Index Actor::VISIBLE = 27;
-const Property::Index Actor::COLOR = 28;
-const Property::Index Actor::COLOR_RED = 29;
-const Property::Index Actor::COLOR_GREEN = 30;
-const Property::Index Actor::COLOR_BLUE = 31;
-const Property::Index Actor::COLOR_ALPHA = 32;
-const Property::Index Actor::WORLD_COLOR = 33;
-const Property::Index Actor::WORLD_MATRIX = 34;
-const Property::Index Actor::NAME = 35;
-const Property::Index Actor::SENSITIVE = 36;
-const Property::Index Actor::LEAVE_REQUIRED = 37;
-const Property::Index Actor::INHERIT_ROTATION = 38;
-const Property::Index Actor::INHERIT_SCALE = 39;
-const Property::Index Actor::COLOR_MODE = 40;
-const Property::Index Actor::POSITION_INHERITANCE = 41;
-const Property::Index Actor::DRAW_MODE = 42;
-const Property::Index Actor::SIZE_MODE = 43;
-const Property::Index Actor::SIZE_MODE_FACTOR = 44;
-
-namespace // unnamed namespace
-{
-
-/**
- * We want to discourage the use of property strings (minimize string comparisons),
- * particularly for the default properties.
- */
-const Internal::PropertyDetails DEFAULT_PROPERTY_DETAILS[] =
-{
- // Name Type writable animatable constraint-input
- { "parent-origin", Property::VECTOR3, true, false, true }, // PARENT_ORIGIN
- { "parent-origin-x", Property::FLOAT, true, false, true }, // PARENT_ORIGIN_X
- { "parent-origin-y", Property::FLOAT, true, false, true }, // PARENT_ORIGIN_Y
- { "parent-origin-z", Property::FLOAT, true, false, true }, // PARENT_ORIGIN_Z
- { "anchor-point", Property::VECTOR3, true, false, true }, // ANCHOR_POINT
- { "anchor-point-x", Property::FLOAT, true, false, true }, // ANCHOR_POINT_X
- { "anchor-point-y", Property::FLOAT, true, false, true }, // ANCHOR_POINT_Y
- { "anchor-point-z", Property::FLOAT, true, false, true }, // ANCHOR_POINT_Z
- { "size", Property::VECTOR3, true, true, true }, // SIZE
- { "size-width", Property::FLOAT, true, true, true }, // SIZE_WIDTH
- { "size-height", Property::FLOAT, true, true, true }, // SIZE_HEIGHT
- { "size-depth", Property::FLOAT, true, true, true }, // SIZE_DEPTH
- { "position", Property::VECTOR3, true, true, true }, // POSITION
- { "position-x", Property::FLOAT, true, true, true }, // POSITION_X
- { "position-y", Property::FLOAT, true, true, true }, // POSITION_Y
- { "position-z", Property::FLOAT, true, true, true }, // POSITION_Z
- { "world-position", Property::VECTOR3, false, false, true }, // WORLD_POSITION
- { "world-position-x", Property::FLOAT, false, false, true }, // WORLD_POSITION_X
- { "world-position-y", Property::FLOAT, false, false, true }, // WORLD_POSITION_Y
- { "world-position-z", Property::FLOAT, false, false, true }, // WORLD_POSITION_Z
- { "rotation", Property::ROTATION, true, true, true }, // ROTATION
- { "world-rotation", Property::ROTATION, false, false, true }, // WORLD_ROTATION
- { "scale", Property::VECTOR3, true, true, true }, // SCALE
- { "scale-x", Property::FLOAT, true, true, true }, // SCALE_X
- { "scale-y", Property::FLOAT, true, true, true }, // SCALE_Y
- { "scale-z", Property::FLOAT, true, true, true }, // SCALE_Z
- { "world-scale", Property::VECTOR3, false, false, true }, // WORLD_SCALE
- { "visible", Property::BOOLEAN, true, true, true }, // VISIBLE
- { "color", Property::VECTOR4, true, true, true }, // COLOR
- { "color-red", Property::FLOAT, true, true, true }, // COLOR_RED
- { "color-green", Property::FLOAT, true, true, true }, // COLOR_GREEN
- { "color-blue", Property::FLOAT, true, true, true }, // COLOR_BLUE
- { "color-alpha", Property::FLOAT, true, true, true }, // COLOR_ALPHA
- { "world-color", Property::VECTOR4, false, false, true }, // WORLD_COLOR
- { "world-matrix", Property::MATRIX, false, false, true }, // WORLD_MATRIX
- { "name", Property::STRING, true, false, false }, // NAME
- { "sensitive", Property::BOOLEAN, true, false, false }, // SENSITIVE
- { "leave-required", Property::BOOLEAN, true, false, false }, // LEAVE_REQUIRED
- { "inherit-rotation", Property::BOOLEAN, true, false, false }, // INHERIT_ROTATION
- { "inherit-scale", Property::BOOLEAN, true, false, false }, // INHERIT_SCALE
- { "color-mode", Property::STRING, true, false, false }, // COLOR_MODE
- { "position-inheritance", Property::STRING, true, false, false }, // POSITION_INHERITANCE
- { "draw-mode", Property::STRING, true, false, false }, // DRAW_MODE
- { "size-mode", Property::STRING, true, false, false }, // SIZE_MODE
- { "size-mode-factor", Property::VECTOR3, true, false, false }, // SIZE_MODE_FACTOR
-};
-const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Internal::PropertyDetails );
-
-// Enumeration to/from text conversion tables:
-const Scripting::StringEnum< SizeMode > SIZE_MODE_TABLE[] =
-{
- { "USE_OWN_SIZE", USE_OWN_SIZE },
- { "SIZE_EQUAL_TO_PARENT", SIZE_EQUAL_TO_PARENT },
- { "SIZE_RELATIVE_TO_PARENT", SIZE_RELATIVE_TO_PARENT },
- { "SIZE_FIXED_OFFSET_FROM_PARENT", SIZE_FIXED_OFFSET_FROM_PARENT },
-};
-const unsigned int SIZE_MODE_TABLE_COUNT = sizeof( SIZE_MODE_TABLE ) / sizeof( SIZE_MODE_TABLE[0] );
-
-} // unnamed namespace
-
namespace Internal
{
#endif // DYNAMICS_SUPPORT
-namespace
+namespace // unnamed namespace
{
+// Properties
+
+/**
+ * We want to discourage the use of property strings (minimize string comparisons),
+ * particularly for the default properties.
+ * Name Type writable animatable constraint-input enum for index-checking
+ */
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "parent-origin", VECTOR3, true, false, true, Dali::Actor::Property::ParentOrigin )
+DALI_PROPERTY( "parent-origin-x", FLOAT, true, false, true, Dali::Actor::Property::ParentOriginX )
+DALI_PROPERTY( "parent-origin-y", FLOAT, true, false, true, Dali::Actor::Property::ParentOriginY )
+DALI_PROPERTY( "parent-origin-z", FLOAT, true, false, true, Dali::Actor::Property::ParentOriginZ )
+DALI_PROPERTY( "anchor-point", VECTOR3, true, false, true, Dali::Actor::Property::AnchorPoint )
+DALI_PROPERTY( "anchor-point-x", FLOAT, true, false, true, Dali::Actor::Property::AnchorPointX )
+DALI_PROPERTY( "anchor-point-y", FLOAT, true, false, true, Dali::Actor::Property::AnchorPointY )
+DALI_PROPERTY( "anchor-point-z", FLOAT, true, false, true, Dali::Actor::Property::AnchorPointZ )
+DALI_PROPERTY( "size", VECTOR3, true, true, true, Dali::Actor::Property::Size )
+DALI_PROPERTY( "size-width", FLOAT, true, true, true, Dali::Actor::Property::SizeWidth )
+DALI_PROPERTY( "size-height", FLOAT, true, true, true, Dali::Actor::Property::SizeHeight )
+DALI_PROPERTY( "size-depth", FLOAT, true, true, true, Dali::Actor::Property::SizeDepth )
+DALI_PROPERTY( "position", VECTOR3, true, true, true, Dali::Actor::Property::Position )
+DALI_PROPERTY( "position-x", FLOAT, true, true, true, Dali::Actor::Property::PositionX )
+DALI_PROPERTY( "position-y", FLOAT, true, true, true, Dali::Actor::Property::PositionY )
+DALI_PROPERTY( "position-z", FLOAT, true, true, true, Dali::Actor::Property::PositionZ )
+DALI_PROPERTY( "world-position", VECTOR3, false, false, true, Dali::Actor::Property::WorldPosition )
+DALI_PROPERTY( "world-position-x", FLOAT, false, false, true, Dali::Actor::Property::WorldPositionX )
+DALI_PROPERTY( "world-position-y", FLOAT, false, false, true, Dali::Actor::Property::WorldPositionY )
+DALI_PROPERTY( "world-position-z", FLOAT, false, false, true, Dali::Actor::Property::WorldPositionZ )
+DALI_PROPERTY( "rotation", ROTATION, true, true, true, Dali::Actor::Property::Rotation )
+DALI_PROPERTY( "world-rotation", ROTATION, false, false, true, Dali::Actor::Property::WorldRotation )
+DALI_PROPERTY( "scale", VECTOR3, true, true, true, Dali::Actor::Property::Scale )
+DALI_PROPERTY( "scale-x", FLOAT, true, true, true, Dali::Actor::Property::ScaleX )
+DALI_PROPERTY( "scale-y", FLOAT, true, true, true, Dali::Actor::Property::ScaleY )
+DALI_PROPERTY( "scale-z", FLOAT, true, true, true, Dali::Actor::Property::ScaleZ )
+DALI_PROPERTY( "world-scale", VECTOR3, false, false, true, Dali::Actor::Property::WorldScale )
+DALI_PROPERTY( "visible", BOOLEAN, true, true, true, Dali::Actor::Property::Visible )
+DALI_PROPERTY( "color", VECTOR4, true, true, true, Dali::Actor::Property::Color )
+DALI_PROPERTY( "color-red", FLOAT, true, true, true, Dali::Actor::Property::ColorRed )
+DALI_PROPERTY( "color-green", FLOAT, true, true, true, Dali::Actor::Property::ColorGreen )
+DALI_PROPERTY( "color-blue", FLOAT, true, true, true, Dali::Actor::Property::ColorBlue )
+DALI_PROPERTY( "color-alpha", FLOAT, true, true, true, Dali::Actor::Property::ColorAlpha )
+DALI_PROPERTY( "world-color", VECTOR4, false, false, true, Dali::Actor::Property::WorldColor )
+DALI_PROPERTY( "world-matrix", MATRIX, false, false, true, Dali::Actor::Property::WorldMatrix )
+DALI_PROPERTY( "name", STRING, true, false, false, Dali::Actor::Property::Name )
+DALI_PROPERTY( "sensitive", BOOLEAN, true, false, false, Dali::Actor::Property::Sensitive )
+DALI_PROPERTY( "leave-required", BOOLEAN, true, false, false, Dali::Actor::Property::LeaveRequired )
+DALI_PROPERTY( "inherit-rotation", BOOLEAN, true, false, false, Dali::Actor::Property::InheritRotation )
+DALI_PROPERTY( "inherit-scale", BOOLEAN, true, false, false, Dali::Actor::Property::InheritScale )
+DALI_PROPERTY( "color-mode", STRING, true, false, false, Dali::Actor::Property::ColorMode )
+DALI_PROPERTY( "position-inheritance", STRING, true, false, false, Dali::Actor::Property::PositionInheritance )
+DALI_PROPERTY( "draw-mode", STRING, true, false, false, Dali::Actor::Property::DrawMode )
+DALI_PROPERTY( "size-mode", STRING, true, false, false, Dali::Actor::Property::SizeMode )
+DALI_PROPERTY( "size-mode-factor", VECTOR3, true, false, false, Dali::Actor::Property::SizeModeFactor )
+DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
+
// Signals
const char* const SIGNAL_TOUCHED = "touched";
const char* const ACTION_SHOW = "show";
const char* const ACTION_HIDE = "hide";
+// Enumeration to / from string conversion tables
+
+DALI_ENUM_TO_STRING_TABLE_BEGIN( SizeMode )
+DALI_ENUM_TO_STRING( USE_OWN_SIZE )
+DALI_ENUM_TO_STRING( SIZE_EQUAL_TO_PARENT )
+DALI_ENUM_TO_STRING( SIZE_RELATIVE_TO_PARENT )
+DALI_ENUM_TO_STRING( SIZE_FIXED_OFFSET_FROM_PARENT )
+DALI_ENUM_TO_STRING_TABLE_END( SizeMode )
+
BaseHandle CreateActor()
{
return Dali::Actor::New();
SignalConnectorType signalConnector1( mType, SIGNAL_TOUCHED, &Actor::DoConnectSignal );
SignalConnectorType signalConnector2( mType, SIGNAL_HOVERED, &Actor::DoConnectSignal );
-SignalConnectorType signalConnector4( mType, SIGNAL_ON_STAGE, &Actor::DoConnectSignal );
-SignalConnectorType signalConnector5( mType, SIGNAL_OFF_STAGE, &Actor::DoConnectSignal );
+SignalConnectorType signalConnector3( mType, SIGNAL_ON_STAGE, &Actor::DoConnectSignal );
+SignalConnectorType signalConnector4( mType, SIGNAL_OFF_STAGE, &Actor::DoConnectSignal );
TypeAction a1( mType, ACTION_SHOW, &Actor::DoAction );
TypeAction a2( mType, ACTION_HIDE, &Actor::DoAction );
-}
+} // unnamed namespace
ActorPtr Actor::New()
{
{
return DEFAULT_PROPERTY_DETAILS[index].name;
}
- else
- {
- return NULL;
- }
+
+ return NULL;
}
Property::Index Actor::GetDefaultPropertyIndex(const std::string& name) const
{
return DEFAULT_PROPERTY_DETAILS[index].writable;
}
- else
- {
- return false;
- }
+
+ return false;
}
bool Actor::IsDefaultPropertyAnimatable(Property::Index index) const
{
return DEFAULT_PROPERTY_DETAILS[index].animatable;
}
- else
- {
- return false;
- }
+
+ return false;
}
bool Actor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
return DEFAULT_PROPERTY_DETAILS[index].constraintInput;
}
- else
- {
- return false;
- }
+
+ return false;
}
Property::Type Actor::GetDefaultPropertyType(Property::Index index) const
{
return DEFAULT_PROPERTY_DETAILS[index].type;
}
- else
- {
- // index out of range...return Property::NONE
- return Property::NONE;
- }
+
+ // index out of range...return Property::NONE
+ return Property::NONE;
}
void Actor::SetDefaultProperty( Property::Index index, const Property::Value& property )
{
switch ( index )
{
- case Dali::Actor::PARENT_ORIGIN:
+ case Dali::Actor::Property::ParentOrigin:
{
SetParentOrigin( property.Get<Vector3>() );
break;
}
- case Dali::Actor::PARENT_ORIGIN_X:
+ case Dali::Actor::Property::ParentOriginX:
{
SetParentOriginX( property.Get<float>() );
break;
}
- case Dali::Actor::PARENT_ORIGIN_Y:
+ case Dali::Actor::Property::ParentOriginY:
{
SetParentOriginY( property.Get<float>() );
break;
}
- case Dali::Actor::PARENT_ORIGIN_Z:
+ case Dali::Actor::Property::ParentOriginZ:
{
SetParentOriginZ( property.Get<float>() );
break;
}
- case Dali::Actor::ANCHOR_POINT:
+ case Dali::Actor::Property::AnchorPoint:
{
SetAnchorPoint( property.Get<Vector3>() );
break;
}
- case Dali::Actor::ANCHOR_POINT_X:
+ case Dali::Actor::Property::AnchorPointX:
{
SetAnchorPointX( property.Get<float>() );
break;
}
- case Dali::Actor::ANCHOR_POINT_Y:
+ case Dali::Actor::Property::AnchorPointY:
{
SetAnchorPointY( property.Get<float>() );
break;
}
- case Dali::Actor::ANCHOR_POINT_Z:
+ case Dali::Actor::Property::AnchorPointZ:
{
SetAnchorPointZ( property.Get<float>() );
break;
}
- case Dali::Actor::SIZE:
+ case Dali::Actor::Property::Size:
{
SetSize( property.Get<Vector3>() );
break;
}
- case Dali::Actor::SIZE_WIDTH:
+ case Dali::Actor::Property::SizeWidth:
{
SetWidth( property.Get<float>() );
break;
}
- case Dali::Actor::SIZE_HEIGHT:
+ case Dali::Actor::Property::SizeHeight:
{
SetHeight( property.Get<float>() );
break;
}
- case Dali::Actor::SIZE_DEPTH:
+ case Dali::Actor::Property::SizeDepth:
{
SetDepth( property.Get<float>() );
break;
}
- case Dali::Actor::POSITION:
+ case Dali::Actor::Property::Position:
{
SetPosition( property.Get<Vector3>() );
break;
}
- case Dali::Actor::POSITION_X:
+ case Dali::Actor::Property::PositionX:
{
SetX( property.Get<float>() );
break;
}
- case Dali::Actor::POSITION_Y:
+ case Dali::Actor::Property::PositionY:
{
SetY( property.Get<float>() );
break;
}
- case Dali::Actor::POSITION_Z:
+ case Dali::Actor::Property::PositionZ:
{
SetZ( property.Get<float>() );
break;
}
- case Dali::Actor::ROTATION:
+ case Dali::Actor::Property::Rotation:
{
SetRotation( property.Get<Quaternion>() );
break;
}
- case Dali::Actor::SCALE:
+ case Dali::Actor::Property::Scale:
{
SetScale( property.Get<Vector3>() );
break;
}
- case Dali::Actor::SCALE_X:
+ case Dali::Actor::Property::ScaleX:
{
SetScaleX( property.Get<float>() );
break;
}
- case Dali::Actor::SCALE_Y:
+ case Dali::Actor::Property::ScaleY:
{
SetScaleY( property.Get<float>() );
break;
}
- case Dali::Actor::SCALE_Z:
+ case Dali::Actor::Property::ScaleZ:
{
SetScaleZ( property.Get<float>() );
break;
}
- case Dali::Actor::VISIBLE:
+ case Dali::Actor::Property::Visible:
{
SetVisible( property.Get<bool>() );
break;
}
- case Dali::Actor::COLOR:
+ case Dali::Actor::Property::Color:
{
SetColor( property.Get<Vector4>() );
break;
}
- case Dali::Actor::COLOR_RED:
+ case Dali::Actor::Property::ColorRed:
{
SetColorRed( property.Get<float>() );
break;
}
- case Dali::Actor::COLOR_GREEN:
+ case Dali::Actor::Property::ColorGreen:
{
SetColorGreen( property.Get<float>() );
break;
}
- case Dali::Actor::COLOR_BLUE:
+ case Dali::Actor::Property::ColorBlue:
{
SetColorBlue( property.Get<float>() );
break;
}
- case Dali::Actor::COLOR_ALPHA:
+ case Dali::Actor::Property::ColorAlpha:
{
SetOpacity( property.Get<float>() );
break;
}
- case Dali::Actor::NAME:
+ case Dali::Actor::Property::Name:
{
SetName( property.Get<std::string>() );
break;
}
- case Dali::Actor::SENSITIVE:
+ case Dali::Actor::Property::Sensitive:
{
SetSensitive( property.Get<bool>() );
break;
}
- case Dali::Actor::LEAVE_REQUIRED:
+ case Dali::Actor::Property::LeaveRequired:
{
SetLeaveRequired( property.Get<bool>() );
break;
}
- case Dali::Actor::INHERIT_ROTATION:
+ case Dali::Actor::Property::InheritRotation:
{
SetInheritRotation( property.Get<bool>() );
break;
}
- case Dali::Actor::SIZE_MODE:
+ case Dali::Actor::Property::InheritScale:
{
- SetSizeMode( Scripting::GetEnumeration< SizeMode >( property.Get<std::string>().c_str(), SIZE_MODE_TABLE, SIZE_MODE_TABLE_COUNT ) );
+ SetInheritScale( property.Get<bool>() );
break;
}
- case Dali::Actor::SIZE_MODE_FACTOR:
+ case Dali::Actor::Property::ColorMode:
{
- SetSizeModeFactor( property.Get<Vector3>() );
+ SetColorMode( Scripting::GetColorMode( property.Get<std::string>() ) );
break;
}
- case Dali::Actor::INHERIT_SCALE:
+ case Dali::Actor::Property::PositionInheritance:
{
- SetInheritScale( property.Get<bool>() );
+ SetPositionInheritanceMode( Scripting::GetPositionInheritanceMode( property.Get<std::string>() ) );
break;
}
- case Dali::Actor::COLOR_MODE:
+ case Dali::Actor::Property::DrawMode:
{
- SetColorMode( Scripting::GetColorMode( property.Get<std::string>() ) );
+ SetDrawMode( Scripting::GetDrawMode( property.Get<std::string>() ) );
break;
}
- case Dali::Actor::POSITION_INHERITANCE:
+ case Dali::Actor::Property::SizeMode:
{
- SetPositionInheritanceMode( Scripting::GetPositionInheritanceMode( property.Get<std::string>() ) );
+ SetSizeMode( Scripting::GetEnumeration< SizeMode >( property.Get<std::string>().c_str(), SizeModeTable, SizeModeTableCount ) );
break;
}
- case Dali::Actor::DRAW_MODE:
+ case Dali::Actor::Property::SizeModeFactor:
{
- SetDrawMode( Scripting::GetDrawMode( property.Get<std::string>() ) );
+ SetSizeModeFactor( property.Get<Vector3>() );
break;
}
}
}
-Property::Value Actor::GetDefaultProperty(Property::Index index) const
+Property::Value Actor::GetDefaultProperty( Property::Index index ) const
{
Property::Value value;
switch ( index )
{
- case Dali::Actor::PARENT_ORIGIN:
+ case Dali::Actor::Property::ParentOrigin:
{
value = GetCurrentParentOrigin();
break;
}
- case Dali::Actor::PARENT_ORIGIN_X:
+ case Dali::Actor::Property::ParentOriginX:
{
value = GetCurrentParentOrigin().x;
break;
}
- case Dali::Actor::PARENT_ORIGIN_Y:
+ case Dali::Actor::Property::ParentOriginY:
{
value = GetCurrentParentOrigin().y;
break;
}
- case Dali::Actor::PARENT_ORIGIN_Z:
+ case Dali::Actor::Property::ParentOriginZ:
{
value = GetCurrentParentOrigin().z;
break;
}
- case Dali::Actor::ANCHOR_POINT:
+ case Dali::Actor::Property::AnchorPoint:
{
value = GetCurrentAnchorPoint();
break;
}
- case Dali::Actor::ANCHOR_POINT_X:
+ case Dali::Actor::Property::AnchorPointX:
{
value = GetCurrentAnchorPoint().x;
break;
}
- case Dali::Actor::ANCHOR_POINT_Y:
+ case Dali::Actor::Property::AnchorPointY:
{
value = GetCurrentAnchorPoint().y;
break;
}
- case Dali::Actor::ANCHOR_POINT_Z:
+ case Dali::Actor::Property::AnchorPointZ:
{
value = GetCurrentAnchorPoint().z;
break;
}
- case Dali::Actor::SIZE:
+ case Dali::Actor::Property::Size:
{
value = GetCurrentSize();
break;
}
- case Dali::Actor::SIZE_WIDTH:
+ case Dali::Actor::Property::SizeWidth:
{
value = GetCurrentSize().width;
break;
}
- case Dali::Actor::SIZE_HEIGHT:
+ case Dali::Actor::Property::SizeHeight:
{
value = GetCurrentSize().height;
break;
}
- case Dali::Actor::SIZE_DEPTH:
+ case Dali::Actor::Property::SizeDepth:
{
value = GetCurrentSize().depth;
break;
}
- case Dali::Actor::POSITION:
+ case Dali::Actor::Property::Position:
{
value = GetCurrentPosition();
break;
}
- case Dali::Actor::POSITION_X:
+ case Dali::Actor::Property::PositionX:
{
value = GetCurrentPosition().x;
break;
}
- case Dali::Actor::POSITION_Y:
+ case Dali::Actor::Property::PositionY:
{
value = GetCurrentPosition().y;
break;
}
- case Dali::Actor::POSITION_Z:
+ case Dali::Actor::Property::PositionZ:
{
value = GetCurrentPosition().z;
break;
}
- case Dali::Actor::WORLD_POSITION:
+ case Dali::Actor::Property::WorldPosition:
{
value = GetCurrentWorldPosition();
break;
}
- case Dali::Actor::WORLD_POSITION_X:
+ case Dali::Actor::Property::WorldPositionX:
{
value = GetCurrentWorldPosition().x;
break;
}
- case Dali::Actor::WORLD_POSITION_Y:
+ case Dali::Actor::Property::WorldPositionY:
{
value = GetCurrentWorldPosition().y;
break;
}
- case Dali::Actor::WORLD_POSITION_Z:
+ case Dali::Actor::Property::WorldPositionZ:
{
value = GetCurrentWorldPosition().z;
break;
}
- case Dali::Actor::ROTATION:
+ case Dali::Actor::Property::Rotation:
{
value = GetCurrentRotation();
break;
}
- case Dali::Actor::WORLD_ROTATION:
+ case Dali::Actor::Property::WorldRotation:
{
value = GetCurrentWorldRotation();
break;
}
- case Dali::Actor::SCALE:
+ case Dali::Actor::Property::Scale:
{
value = GetCurrentScale();
break;
}
- case Dali::Actor::SCALE_X:
+ case Dali::Actor::Property::ScaleX:
{
value = GetCurrentScale().x;
break;
}
- case Dali::Actor::SCALE_Y:
+ case Dali::Actor::Property::ScaleY:
{
value = GetCurrentScale().y;
break;
}
- case Dali::Actor::SCALE_Z:
+ case Dali::Actor::Property::ScaleZ:
{
value = GetCurrentScale().z;
break;
}
- case Dali::Actor::WORLD_SCALE:
+ case Dali::Actor::Property::WorldScale:
{
value = GetCurrentWorldScale();
break;
}
- case Dali::Actor::VISIBLE:
+ case Dali::Actor::Property::Visible:
{
value = IsVisible();
break;
}
- case Dali::Actor::COLOR:
+ case Dali::Actor::Property::Color:
{
value = GetCurrentColor();
break;
}
- case Dali::Actor::COLOR_RED:
+ case Dali::Actor::Property::ColorRed:
{
value = GetCurrentColor().r;
break;
}
- case Dali::Actor::COLOR_GREEN:
+ case Dali::Actor::Property::ColorGreen:
{
value = GetCurrentColor().g;
break;
}
- case Dali::Actor::COLOR_BLUE:
+ case Dali::Actor::Property::ColorBlue:
{
value = GetCurrentColor().b;
break;
}
- case Dali::Actor::COLOR_ALPHA:
+ case Dali::Actor::Property::ColorAlpha:
{
value = GetCurrentColor().a;
break;
}
- case Dali::Actor::WORLD_COLOR:
+ case Dali::Actor::Property::WorldColor:
{
value = GetCurrentWorldColor();
break;
}
- case Dali::Actor::WORLD_MATRIX:
+ case Dali::Actor::Property::WorldMatrix:
{
value = GetCurrentWorldMatrix();
break;
}
- case Dali::Actor::NAME:
+ case Dali::Actor::Property::Name:
{
value = GetName();
break;
}
- case Dali::Actor::SENSITIVE:
+ case Dali::Actor::Property::Sensitive:
{
value = IsSensitive();
break;
}
- case Dali::Actor::LEAVE_REQUIRED:
+ case Dali::Actor::Property::LeaveRequired:
{
value = GetLeaveRequired();
break;
}
- case Dali::Actor::INHERIT_ROTATION:
+ case Dali::Actor::Property::InheritRotation:
{
value = IsRotationInherited();
break;
}
- case Dali::Actor::SIZE_MODE:
+ case Dali::Actor::Property::InheritScale:
{
- value = Scripting::GetEnumerationName< SizeMode >( GetSizeMode(), SIZE_MODE_TABLE, SIZE_MODE_TABLE_COUNT );
+ value = IsScaleInherited();
break;
}
- case Dali::Actor::SIZE_MODE_FACTOR:
+ case Dali::Actor::Property::ColorMode:
{
- value = GetSizeModeFactor();
+ value = Scripting::GetColorMode( GetColorMode() );
break;
}
- case Dali::Actor::INHERIT_SCALE:
+ case Dali::Actor::Property::PositionInheritance:
{
- value = IsScaleInherited();
+ value = Scripting::GetPositionInheritanceMode( GetPositionInheritanceMode() );
break;
}
- case Dali::Actor::COLOR_MODE:
+ case Dali::Actor::Property::DrawMode:
{
- value = Scripting::GetColorMode( GetColorMode() );
+ value = Scripting::GetDrawMode( GetDrawMode() );
break;
}
- case Dali::Actor::POSITION_INHERITANCE:
+ case Dali::Actor::Property::SizeMode:
{
- value = Scripting::GetPositionInheritanceMode( GetPositionInheritanceMode() );
+ value = Scripting::GetLinearEnumerationName< SizeMode >( GetSizeMode(), SizeModeTable, SizeModeTableCount );
break;
}
- case Dali::Actor::DRAW_MODE:
+ case Dali::Actor::Property::SizeModeFactor:
{
- value = Scripting::GetDrawMode( GetDrawMode() );
+ value = GetSizeModeFactor();
break;
}
{
switch ( index )
{
- case Dali::Actor::SIZE:
+ case Dali::Actor::Property::Size:
property = &mNode->mSize;
break;
- case Dali::Actor::SIZE_WIDTH:
+ case Dali::Actor::Property::SizeWidth:
property = &mNode->mSize;
break;
- case Dali::Actor::SIZE_HEIGHT:
+ case Dali::Actor::Property::SizeHeight:
property = &mNode->mSize;
break;
- case Dali::Actor::SIZE_DEPTH:
+ case Dali::Actor::Property::SizeDepth:
property = &mNode->mSize;
break;
- case Dali::Actor::POSITION:
+ case Dali::Actor::Property::Position:
property = &mNode->mPosition;
break;
- case Dali::Actor::POSITION_X:
+ case Dali::Actor::Property::PositionX:
property = &mNode->mPosition;
break;
- case Dali::Actor::POSITION_Y:
+ case Dali::Actor::Property::PositionY:
property = &mNode->mPosition;
break;
- case Dali::Actor::POSITION_Z:
+ case Dali::Actor::Property::PositionZ:
property = &mNode->mPosition;
break;
- case Dali::Actor::ROTATION:
+ case Dali::Actor::Property::Rotation:
property = &mNode->mRotation;
break;
- case Dali::Actor::SCALE:
+ case Dali::Actor::Property::Scale:
property = &mNode->mScale;
break;
- case Dali::Actor::SCALE_X:
+ case Dali::Actor::Property::ScaleX:
property = &mNode->mScale;
break;
- case Dali::Actor::SCALE_Y:
+ case Dali::Actor::Property::ScaleY:
property = &mNode->mScale;
break;
- case Dali::Actor::SCALE_Z:
+ case Dali::Actor::Property::ScaleZ:
property = &mNode->mScale;
break;
- case Dali::Actor::VISIBLE:
+ case Dali::Actor::Property::Visible:
property = &mNode->mVisible;
break;
- case Dali::Actor::COLOR:
+ case Dali::Actor::Property::Color:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_RED:
+ case Dali::Actor::Property::ColorRed:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_GREEN:
+ case Dali::Actor::Property::ColorGreen:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_BLUE:
+ case Dali::Actor::Property::ColorBlue:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_ALPHA:
+ case Dali::Actor::Property::ColorAlpha:
property = &mNode->mColor;
break;
{
switch ( index )
{
- case Dali::Actor::PARENT_ORIGIN:
+ case Dali::Actor::Property::ParentOrigin:
property = &mNode->mParentOrigin;
break;
- case Dali::Actor::PARENT_ORIGIN_X:
+ case Dali::Actor::Property::ParentOriginX:
property = &mNode->mParentOrigin;
break;
- case Dali::Actor::PARENT_ORIGIN_Y:
+ case Dali::Actor::Property::ParentOriginY:
property = &mNode->mParentOrigin;
break;
- case Dali::Actor::PARENT_ORIGIN_Z:
+ case Dali::Actor::Property::ParentOriginZ:
property = &mNode->mParentOrigin;
break;
- case Dali::Actor::ANCHOR_POINT:
+ case Dali::Actor::Property::AnchorPoint:
property = &mNode->mAnchorPoint;
break;
- case Dali::Actor::ANCHOR_POINT_X:
+ case Dali::Actor::Property::AnchorPointX:
property = &mNode->mAnchorPoint;
break;
- case Dali::Actor::ANCHOR_POINT_Y:
+ case Dali::Actor::Property::AnchorPointY:
property = &mNode->mAnchorPoint;
break;
- case Dali::Actor::ANCHOR_POINT_Z:
+ case Dali::Actor::Property::AnchorPointZ:
property = &mNode->mAnchorPoint;
break;
- case Dali::Actor::SIZE:
+ case Dali::Actor::Property::Size:
property = &mNode->mSize;
break;
- case Dali::Actor::SIZE_WIDTH:
+ case Dali::Actor::Property::SizeWidth:
property = &mNode->mSize;
break;
- case Dali::Actor::SIZE_HEIGHT:
+ case Dali::Actor::Property::SizeHeight:
property = &mNode->mSize;
break;
- case Dali::Actor::SIZE_DEPTH:
+ case Dali::Actor::Property::SizeDepth:
property = &mNode->mSize;
break;
- case Dali::Actor::POSITION:
+ case Dali::Actor::Property::Position:
property = &mNode->mPosition;
break;
- case Dali::Actor::POSITION_X:
+ case Dali::Actor::Property::PositionX:
property = &mNode->mPosition;
break;
- case Dali::Actor::POSITION_Y:
+ case Dali::Actor::Property::PositionY:
property = &mNode->mPosition;
break;
- case Dali::Actor::POSITION_Z:
+ case Dali::Actor::Property::PositionZ:
property = &mNode->mPosition;
break;
- case Dali::Actor::WORLD_POSITION:
+ case Dali::Actor::Property::WorldPosition:
property = &mNode->mWorldPosition;
break;
- case Dali::Actor::WORLD_POSITION_X:
+ case Dali::Actor::Property::WorldPositionX:
property = &mNode->mWorldPosition;
break;
- case Dali::Actor::WORLD_POSITION_Y:
+ case Dali::Actor::Property::WorldPositionY:
property = &mNode->mWorldPosition;
break;
- case Dali::Actor::WORLD_POSITION_Z:
+ case Dali::Actor::Property::WorldPositionZ:
property = &mNode->mWorldPosition;
break;
- case Dali::Actor::ROTATION:
+ case Dali::Actor::Property::Rotation:
property = &mNode->mRotation;
break;
- case Dali::Actor::WORLD_ROTATION:
+ case Dali::Actor::Property::WorldRotation:
property = &mNode->mWorldRotation;
break;
- case Dali::Actor::SCALE:
+ case Dali::Actor::Property::Scale:
property = &mNode->mScale;
break;
- case Dali::Actor::SCALE_X:
+ case Dali::Actor::Property::ScaleX:
property = &mNode->mScale;
break;
- case Dali::Actor::SCALE_Y:
+ case Dali::Actor::Property::ScaleY:
property = &mNode->mScale;
break;
- case Dali::Actor::SCALE_Z:
+ case Dali::Actor::Property::ScaleZ:
property = &mNode->mScale;
break;
- case Dali::Actor::WORLD_SCALE:
+ case Dali::Actor::Property::WorldScale:
property = &mNode->mWorldScale;
break;
- case Dali::Actor::VISIBLE:
+ case Dali::Actor::Property::Visible:
property = &mNode->mVisible;
break;
- case Dali::Actor::COLOR:
+ case Dali::Actor::Property::Color:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_RED:
+ case Dali::Actor::Property::ColorRed:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_GREEN:
+ case Dali::Actor::Property::ColorGreen:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_BLUE:
+ case Dali::Actor::Property::ColorBlue:
property = &mNode->mColor;
break;
- case Dali::Actor::COLOR_ALPHA:
+ case Dali::Actor::Property::ColorAlpha:
property = &mNode->mColor;
break;
- case Dali::Actor::WORLD_COLOR:
+ case Dali::Actor::Property::WorldColor:
property = &mNode->mWorldColor;
break;
- case Dali::Actor::WORLD_MATRIX:
+ case Dali::Actor::Property::WorldMatrix:
property = &mNode->mWorldMatrix;
break;
switch ( index )
{
- case Dali::Actor::PARENT_ORIGIN_X:
- case Dali::Actor::ANCHOR_POINT_X:
- case Dali::Actor::SIZE_WIDTH:
- case Dali::Actor::POSITION_X:
- case Dali::Actor::SCALE_X:
- case Dali::Actor::COLOR_RED:
- case Dali::Actor::WORLD_POSITION_X:
+ case Dali::Actor::Property::ParentOriginX:
+ case Dali::Actor::Property::AnchorPointX:
+ case Dali::Actor::Property::SizeWidth:
+ case Dali::Actor::Property::PositionX:
+ case Dali::Actor::Property::WorldPositionX:
+ case Dali::Actor::Property::ScaleX:
+ case Dali::Actor::Property::ColorRed:
{
componentIndex = 0;
break;
}
- case Dali::Actor::PARENT_ORIGIN_Y:
- case Dali::Actor::ANCHOR_POINT_Y:
- case Dali::Actor::SIZE_HEIGHT:
- case Dali::Actor::POSITION_Y:
- case Dali::Actor::SCALE_Y:
- case Dali::Actor::COLOR_GREEN:
- case Dali::Actor::WORLD_POSITION_Y:
+ case Dali::Actor::Property::ParentOriginY:
+ case Dali::Actor::Property::AnchorPointY:
+ case Dali::Actor::Property::SizeHeight:
+ case Dali::Actor::Property::PositionY:
+ case Dali::Actor::Property::WorldPositionY:
+ case Dali::Actor::Property::ScaleY:
+ case Dali::Actor::Property::ColorGreen:
{
componentIndex = 1;
break;
}
- case Dali::Actor::PARENT_ORIGIN_Z:
- case Dali::Actor::ANCHOR_POINT_Z:
- case Dali::Actor::SIZE_DEPTH:
- case Dali::Actor::POSITION_Z:
- case Dali::Actor::SCALE_Z:
- case Dali::Actor::COLOR_BLUE:
- case Dali::Actor::WORLD_POSITION_Z:
+ case Dali::Actor::Property::ParentOriginZ:
+ case Dali::Actor::Property::AnchorPointZ:
+ case Dali::Actor::Property::SizeDepth:
+ case Dali::Actor::Property::PositionZ:
+ case Dali::Actor::Property::WorldPositionZ:
+ case Dali::Actor::Property::ScaleZ:
+ case Dali::Actor::Property::ColorBlue:
{
componentIndex = 2;
break;
}
- case Dali::Actor::COLOR_ALPHA:
+ case Dali::Actor::Property::ColorAlpha:
{
componentIndex = 3;
break;
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/internal/event/actor-attachments/camera-attachment-impl.h>
-#include <dali/internal/event/common/property-index-ranges.h>
+#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/internal/event/render-tasks/render-task-list-impl.h>
namespace Dali
{
-const Property::Index CameraActor::TYPE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
-const Property::Index CameraActor::PROJECTION_MODE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 1;
-const Property::Index CameraActor::FIELD_OF_VIEW = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 2;
-const Property::Index CameraActor::ASPECT_RATIO = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 3;
-const Property::Index CameraActor::NEAR_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 4;
-const Property::Index CameraActor::FAR_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 5;
-const Property::Index CameraActor::LEFT_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 6;
-const Property::Index CameraActor::RIGHT_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 7;
-const Property::Index CameraActor::TOP_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 8;
-const Property::Index CameraActor::BOTTOM_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 9;
-const Property::Index CameraActor::TARGET_POSITION = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 10;
-const Property::Index CameraActor::PROJECTION_MATRIX = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 11;
-const Property::Index CameraActor::VIEW_MATRIX = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 12;
-const Property::Index CameraActor::INVERT_Y_AXIS = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 13;
-
namespace Internal
{
namespace
{
+// Properties
+
+/**
+ * We want to discourage the use of property strings (minimize string comparisons),
+ * particularly for the default properties.
+ * Name Type writable animatable constraint-input enum for index-checking
+ */
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "type", STRING, true, false, true, Dali::CameraActor::Property::Type )
+DALI_PROPERTY( "projection-mode", STRING, true, false, true, Dali::CameraActor::Property::ProjectionMode )
+DALI_PROPERTY( "field-of-view", FLOAT, true, false, true, Dali::CameraActor::Property::FieldOfView )
+DALI_PROPERTY( "aspect-ratio", FLOAT, true, false, true, Dali::CameraActor::Property::AspectRatio )
+DALI_PROPERTY( "near-plane-distance", FLOAT, true, false, true, Dali::CameraActor::Property::NearPlaneDistance )
+DALI_PROPERTY( "far-plane-distance", FLOAT, true, false, true, Dali::CameraActor::Property::FarPlaneDistance )
+DALI_PROPERTY( "left-plane-distance", FLOAT, true, false, true, Dali::CameraActor::Property::LeftPlaneDistance )
+DALI_PROPERTY( "right-plane-distance", FLOAT, true, false, true, Dali::CameraActor::Property::RightPlaneDistance )
+DALI_PROPERTY( "top-plane-distance", FLOAT, true, false, true, Dali::CameraActor::Property::TopPlaneDistance )
+DALI_PROPERTY( "bottom-plane-distance", FLOAT, true, false, true, Dali::CameraActor::Property::BottomPlaneDistance )
+DALI_PROPERTY( "target-position", VECTOR3, true, false, true, Dali::CameraActor::Property::TargetPosition )
+DALI_PROPERTY( "projection-matrix", MATRIX, false, false, true, Dali::CameraActor::Property::ProjectionMatrix )
+DALI_PROPERTY( "view-matrix", MATRIX, false, false, true, Dali::CameraActor::Property::ViewMatrix )
+DALI_PROPERTY( "invert-y-axis", BOOLEAN, true, false, true, Dali::CameraActor::Property::InvertYAxis )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+
// calculate the far plane distance for a 16bit depth buffer with 4 bits per unit precision
void CalculateClippingAndZ( float width, float height, float& nearClippingPlane, float& farClippingPlane, float& cameraZ )
{
return Dali::CameraActor::New();
}
-TypeRegistration mType( typeid(Dali::CameraActor), typeid(Dali::Actor), Create );
-
-const char* DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES[] =
-{
- "type",
- "projection-mode",
- "field-of-view",
- "aspect-ratio",
- "near-plane-distance",
- "far-plane-distance",
- "left-plane-distance",
- "right-plane-distance",
- "top-plane-distance",
- "bottom-plane-distance",
- "target-position",
- "projection-matrix",
- "view-matrix",
- "invert-y-axis"
-};
-const int DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT = sizeof( DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES ) / sizeof( DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES[0] );
-
-const Property::Type DEFAULT_CAMERA_ACTOR_PROPERTY_TYPES[DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT] =
-{
- Property::STRING, // "type",
- Property::STRING, // "projection-mode",
- Property::FLOAT, // "field-of-view",
- Property::FLOAT, // "aspect-ratio",
- Property::FLOAT, // "near-plane-distance",
- Property::FLOAT, // "far-plane-distance",
- Property::FLOAT, // "left-plane-distance",
- Property::FLOAT, // "right-plane-distance",
- Property::FLOAT, // "top-plane-distance",
- Property::FLOAT, // "bottom-plane-distance",
- Property::VECTOR3, // "target-position",
- Property::MATRIX, // "projection-matrix",
- Property::MATRIX, // "view-matrix",
- Property::BOOLEAN, // "invert-y-axis",
-};
+TypeRegistration mType( typeid( Dali::CameraActor ), typeid( Dali::Actor ), Create );
/**
* Builds the picking ray in the world reference system from an orthographic camera
unsigned int CameraActor::GetDefaultPropertyCount() const
{
- return Actor::GetDefaultPropertyCount() + DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT;
+ return Actor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
}
void CameraActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
{
Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
- indices.reserve( indices.size() + DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT );
+ indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
- int index = DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
- for ( int i = 0; i < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT; ++i, ++index )
+ int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
{
indices.push_back( index );
}
bool CameraActor::IsDefaultPropertyWritable( Property::Index index ) const
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return Actor::IsDefaultPropertyWritable(index);
- }
- else
- {
- if( Dali::CameraActor::PROJECTION_MATRIX == index || Dali::CameraActor::VIEW_MATRIX == index )
- {
- return false;
- }
- else
- {
- return true;
- }
+ return Actor::IsDefaultPropertyWritable( index );
}
+
+ return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].writable;
}
bool CameraActor::IsDefaultPropertyAnimatable( Property::Index index ) const
{
- bool animatable = false; // Our properties are not animatable.
-
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- animatable = Actor::IsDefaultPropertyAnimatable(index);
+ return Actor::IsDefaultPropertyAnimatable( index );
}
- return animatable;
+
+ return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].animatable;
}
bool CameraActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- bool animatable = true; // Our properties can be used as inputs to constraints.
-
if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- animatable = Actor::IsDefaultPropertyAConstraintInput(index);
+ return Actor::IsDefaultPropertyAConstraintInput( index );
}
- return animatable;
+
+ return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].constraintInput;
}
Property::Type CameraActor::GetDefaultPropertyType( Property::Index index ) const
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return Actor::GetDefaultPropertyType(index);
+ return Actor::GetDefaultPropertyType( index );
}
else
{
- index -= DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
- if ( ( index >= 0 ) && ( index < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT ) )
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- return DEFAULT_CAMERA_ACTOR_PROPERTY_TYPES[index];
+ return DEFAULT_PROPERTY_DETAILS[index].type;
}
else
{
}
else
{
- index -= DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
- if ( ( index >= 0 ) && ( index < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT ) )
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- return DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES[index];
+ return DEFAULT_PROPERTY_DETAILS[index].name;
}
return NULL;
}
Property::Index index = Property::INVALID_INDEX;
// Look for name in current class' default properties
- for( int i = 0; i < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT; ++i )
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- if( 0 == strcmp( name.c_str(), DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES[ i ] ) ) // dont want to convert rhs to string
+ if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // dont want to convert rhs to string
{
- index = i + DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
+ index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
break;
}
}
DALI_ASSERT_DEBUG(mCameraAttachment && "where is the camera?");
switch(index)
{
- case Dali::CameraActor::TYPE:
+ case Dali::CameraActor::Property::Type:
{
- std::string s(propertyValue.Get<std::string>());
+ std::string s( propertyValue.Get<std::string>() );
if(s == "LOOK_AT_TARGET")
{
mCameraAttachment->SetType(Dali::Camera::LOOK_AT_TARGET);
}
break;
}
- case Dali::CameraActor::PROJECTION_MODE:
+ case Dali::CameraActor::Property::ProjectionMode:
{
std::string s(propertyValue.Get<std::string>());
if(s == "PERSPECTIVE_PROJECTION")
}
break;
}
- case Dali::CameraActor::FIELD_OF_VIEW:
+ case Dali::CameraActor::Property::FieldOfView:
{
mCameraAttachment->SetFieldOfView(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::ASPECT_RATIO:
+ case Dali::CameraActor::Property::AspectRatio:
{
mCameraAttachment->SetAspectRatio(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::LEFT_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::LeftPlaneDistance:
{
mCameraAttachment->SetLeftClippingPlane(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::RIGHT_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::RightPlaneDistance:
{
mCameraAttachment->SetRightClippingPlane(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::TOP_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::TopPlaneDistance:
{
mCameraAttachment->SetTopClippingPlane(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::BOTTOM_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::BottomPlaneDistance:
{
mCameraAttachment->SetBottomClippingPlane(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::NEAR_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::NearPlaneDistance:
{
mCameraAttachment->SetNearClippingPlane(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::FAR_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::FarPlaneDistance:
{
mCameraAttachment->SetFarClippingPlane(propertyValue.Get<float>());
break;
}
- case Dali::CameraActor::TARGET_POSITION:
+ case Dali::CameraActor::Property::TargetPosition:
{
mCameraAttachment->SetTargetPosition(propertyValue.Get<Vector3>());
break;
}
- case Dali::CameraActor::PROJECTION_MATRIX:
+ case Dali::CameraActor::Property::ProjectionMatrix:
{
DALI_LOG_WARNING("projection-matrix property is not animatable \n");
break;
}
- case Dali::CameraActor::VIEW_MATRIX:
+ case Dali::CameraActor::Property::ViewMatrix:
{
DALI_LOG_WARNING("view-matrix property is not animatable \n");
break;
}
- case Dali::CameraActor::INVERT_Y_AXIS:
+ case Dali::CameraActor::Property::InvertYAxis:
{
mCameraAttachment->SetInvertYAxis(propertyValue.Get<bool>());
break;
DALI_ASSERT_DEBUG(mCameraAttachment && "where is the camera?");
switch(index)
{
-
- case Dali::CameraActor::TYPE:
+ case Dali::CameraActor::Property::Type:
{
if(mCameraAttachment->GetType() == Dali::Camera::LOOK_AT_TARGET)
{
}
break;
}
-
-
- case Dali::CameraActor::PROJECTION_MODE:
+ case Dali::CameraActor::Property::ProjectionMode:
{
if(mCameraAttachment->GetProjectionMode() == Dali::Camera::PERSPECTIVE_PROJECTION)
{
}
break;
}
- case Dali::CameraActor::FIELD_OF_VIEW:
+ case Dali::CameraActor::Property::FieldOfView:
{
ret = mCameraAttachment->GetFieldOfView();
break;
}
- case Dali::CameraActor::ASPECT_RATIO:
+ case Dali::CameraActor::Property::AspectRatio:
{
ret = mCameraAttachment->GetAspectRatio();
break;
}
- case Dali::CameraActor::LEFT_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::LeftPlaneDistance:
{
ret = mCameraAttachment->GetLeftClippingPlane();
break;
}
- case Dali::CameraActor::RIGHT_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::RightPlaneDistance:
{
ret = mCameraAttachment->GetRightClippingPlane();
break;
}
- case Dali::CameraActor::TOP_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::TopPlaneDistance:
{
ret = mCameraAttachment->GetTopClippingPlane();
break;
}
- case Dali::CameraActor::BOTTOM_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::BottomPlaneDistance:
{
ret = mCameraAttachment->GetBottomClippingPlane();
break;
}
- case Dali::CameraActor::NEAR_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::NearPlaneDistance:
{
ret = mCameraAttachment->GetNearClippingPlane();
break;
}
- case Dali::CameraActor::FAR_PLANE_DISTANCE:
+ case Dali::CameraActor::Property::FarPlaneDistance:
{
ret = mCameraAttachment->GetFarClippingPlane();
break;
}
- case Dali::CameraActor::TARGET_POSITION:
+ case Dali::CameraActor::Property::TargetPosition:
{
ret = mCameraAttachment->GetTargetPosition();
break;
}
- case Dali::CameraActor::PROJECTION_MATRIX:
+ case Dali::CameraActor::Property::ProjectionMatrix:
{
ret = mCameraAttachment->GetProjectionMatrix();
break;
}
- case Dali::CameraActor::VIEW_MATRIX:
+ case Dali::CameraActor::Property::ViewMatrix:
{
ret = mCameraAttachment->GetViewMatrix();
break;
}
- case Dali::CameraActor::INVERT_Y_AXIS:
+ case Dali::CameraActor::Property::InvertYAxis:
{
ret = mCameraAttachment->GetInvertYAxis();
break;
{
switch( index )
{
- case Dali::CameraActor::PROJECTION_MATRIX:
+ case Dali::CameraActor::Property::ProjectionMatrix:
{
property = mCameraAttachment->GetProjectionMatrixProperty();
break;
}
- case Dali::CameraActor::VIEW_MATRIX:
+ case Dali::CameraActor::Property::ViewMatrix:
{
property = mCameraAttachment->GetViewMatrixProperty();
break;
#include <dali/internal/event/actors/image-actor-impl.h>
// INTERNAL INCLUDES
-#include <dali/internal/event/images/nine-patch-image-impl.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/internal/event/common/property-index-ranges.h>
-#include <dali/internal/event/images/image-connector.h>
#include <dali/public-api/scripting/scripting.h>
+#include <dali/internal/event/common/property-helper.h>
+#include <dali/internal/event/images/image-connector.h>
+#include <dali/internal/event/images/nine-patch-image-impl.h>
namespace Dali
{
-const Property::Index ImageActor::PIXEL_AREA = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
-const Property::Index ImageActor::STYLE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 1;
-const Property::Index ImageActor::BORDER = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 2;
-const Property::Index ImageActor::IMAGE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 3;
-
namespace Internal
{
namespace
{
+// Properties
+
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "pixel-area", RECTANGLE, true, false, true, Dali::ImageActor::Property::PixelArea )
+DALI_PROPERTY( "style", STRING, true, false, true, Dali::ImageActor::Property::Style )
+DALI_PROPERTY( "border", VECTOR4, true, false, true, Dali::ImageActor::Property::Border )
+DALI_PROPERTY( "image", MAP, true, false, false, Dali::ImageActor::Property::Image )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+
BaseHandle Create()
{
return Dali::ImageActor::New();
}
-TypeRegistration mType( typeid(Dali::ImageActor), typeid(Dali::RenderableActor), Create );
-
-const Internal::PropertyDetails DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[] =
-{
- // Name Type writable animatable constraint-input
- { "pixel-area", Property::RECTANGLE, true, false, true }, // PIXEL_AREA
- { "style", Property::STRING, true, false, true }, // STYLE
- { "border", Property::VECTOR4, true, false, true }, // BORDER
- { "image", Property::MAP, true, false, false }, // IMAGE
-};
-const int DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT = sizeof( DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS ) / sizeof( DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[0] );
+TypeRegistration mType( typeid( Dali::ImageActor ), typeid( Dali::RenderableActor ), Create );
ImageActor::Style StyleEnum(const std::string &s)
{
unsigned int ImageActor::GetDefaultPropertyCount() const
{
- return RenderableActor::GetDefaultPropertyCount() + DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT;
+ return RenderableActor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
}
void ImageActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
{
RenderableActor::GetDefaultPropertyIndices( indices ); // RenderableActor class properties
- indices.reserve( indices.size() + DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT );
+ indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
- int index = DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- for ( int i = 0; i < DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT; ++i, ++index )
+ int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
{
indices.push_back( index );
}
bool ImageActor::IsDefaultPropertyWritable( Property::Index index ) const
{
- if( index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT )
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
return RenderableActor::IsDefaultPropertyWritable(index);
}
- else
+
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- index -= DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT ) )
- {
- return DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[ index ].writable;
- }
+ return DEFAULT_PROPERTY_DETAILS[ index ].writable;
}
+
return false;
}
bool ImageActor::IsDefaultPropertyAnimatable( Property::Index index ) const
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return RenderableActor::IsDefaultPropertyAnimatable(index);
+ return RenderableActor::IsDefaultPropertyAnimatable( index );
}
- else
+
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- index -= DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT ) )
- {
- return DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[ index ].animatable;
- }
+ return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
}
+
return false;
}
bool ImageActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- if( index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT )
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return RenderableActor::IsDefaultPropertyAConstraintInput(index);
+ return RenderableActor::IsDefaultPropertyAConstraintInput( index );
}
- else
+
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- index -= DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT ) )
- {
- return DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[ index ].constraintInput;
- }
+ return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
}
+
return false;
}
Property::Type ImageActor::GetDefaultPropertyType( Property::Index index ) const
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return RenderableActor::GetDefaultPropertyType(index);
+ return RenderableActor::GetDefaultPropertyType( index );
}
- else
- {
- index -= DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT ) )
- {
- return DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[index].type;
- }
- else
- {
- // index out-of-bounds
- return Property::NONE;
- }
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_DETAILS[index].type;
}
+
+ // index out-of-bounds
+ return Property::NONE;
}
const char* ImageActor::GetDefaultPropertyName( Property::Index index ) const
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
{
return RenderableActor::GetDefaultPropertyName(index);
}
- else
- {
- index -= DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT ) )
- {
- return DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[index].name;
- }
- else
- {
- // index out-of-bounds
- return NULL;
- }
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_DETAILS[index].name;
}
+
+ // index out-of-bounds
+ return NULL;
}
Property::Index ImageActor::GetDefaultPropertyIndex(const std::string& name) const
Property::Index index = Property::INVALID_INDEX;
// Look for name in default properties
- for( int i = 0; i < DEFAULT_IMAGE_ACTOR_PROPERTY_COUNT; ++i )
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- const Internal::PropertyDetails* property = &DEFAULT_IMAGE_ACTOR_PROPERTY_DETAILS[ i ];
- if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
+ const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
+ if( 0 == strcmp( name.c_str(), property->name ) ) // Don't want to convert rhs to string
{
- index = i + DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
+ index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
break;
}
}
void ImageActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- RenderableActor::SetDefaultProperty(index, propertyValue);
+ RenderableActor::SetDefaultProperty( index, propertyValue );
}
else
{
switch(index)
{
- case Dali::ImageActor::PIXEL_AREA:
+ case Dali::ImageActor::Property::PixelArea:
{
SetPixelArea(propertyValue.Get<Rect<int> >());
break;
}
- case Dali::ImageActor::STYLE:
+ case Dali::ImageActor::Property::Style:
{
- SetStyle(StyleEnum(propertyValue.Get<std::string>()));
+ SetStyle( StyleEnum( propertyValue.Get<std::string>() ) );
break;
}
- case Dali::ImageActor::BORDER:
+ case Dali::ImageActor::Property::Border:
{
SetNinePatchBorder( propertyValue.Get<Vector4>(), true /*in pixels*/ );
break;
}
- case Dali::ImageActor::IMAGE:
+ case Dali::ImageActor::Property::Image:
{
Dali::Image img = Scripting::NewImage( propertyValue );
if(img)
Property::Value ImageActor::GetDefaultProperty( Property::Index index ) const
{
Property::Value ret;
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- ret = RenderableActor::GetDefaultProperty(index);
+ ret = RenderableActor::GetDefaultProperty( index );
}
else
{
- switch(index)
+ switch( index )
{
- case Dali::ImageActor::PIXEL_AREA:
+ case Dali::ImageActor::Property::PixelArea:
{
Rect<int> r = GetPixelArea();
ret = r;
break;
}
- case Dali::ImageActor::STYLE:
+ case Dali::ImageActor::Property::Style:
{
- ret = StyleString(GetStyle());
+ ret = StyleString( GetStyle() );
break;
}
- case Dali::ImageActor::BORDER:
+ case Dali::ImageActor::Property::Border:
{
ret = GetNinePatchBorder();
break;
}
- case Dali::ImageActor::IMAGE:
+ case Dali::ImageActor::Property::Image:
{
Property::Map map;
Scripting::CreatePropertyMap( Dali::Image( mImageAttachment->GetImage().Get() ), map );
}
default:
{
- DALI_LOG_WARNING("Unknown property (%d)\n", index);
+ DALI_LOG_WARNING( "Unknown property (%d)\n", index );
break;
}
} // switch(index)
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/internal/event/common/property-index-ranges.h>
-#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/actors/layer-list.h>
+#include <dali/internal/event/common/property-helper.h>
+#include <dali/internal/event/common/stage-impl.h>
using Dali::Internal::SceneGraph::UpdateManager;
namespace Dali
{
-const Property::Index Layer::CLIPPING_ENABLE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
-const Property::Index Layer::CLIPPING_BOX = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 1;
-
namespace Internal
{
namespace
{
+// Properties
+
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "clipping-enable", BOOLEAN, true, false, true, Dali::Layer::Property::ClippingEnable )
+DALI_PROPERTY( "clipping-box", RECTANGLE, true, false, true, Dali::Layer::Property::ClippingBox )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+
// Actions
const char* const ACTION_RAISE = "raise";
TypeAction a3( mType, ACTION_RAISE_TO_TOP, &Layer::DoAction );
TypeAction a4( mType, ACTION_LOWER_TO_BOTTOM, &Layer::DoAction );
-const PropertyDetails DEFAULT_PROPERTY_DETAILS[] =
-{
- // Name Type writable animatable constraint-input
- { "clipping-enable", Property::BOOLEAN, true, false, true }, // CLIPPING_ENABLE
- { "clipping-box", Property::RECTANGLE, true, false, true }, // CLIPPING_BOX
-};
-const int DEFAULT_LAYER_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( DEFAULT_PROPERTY_DETAILS[0] );
-
} // unnamed namespace
LayerPtr Layer::New()
unsigned int Layer::GetDefaultPropertyCount() const
{
- return Actor::GetDefaultPropertyCount() + DEFAULT_LAYER_PROPERTY_COUNT;
+ return Actor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
}
void Layer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
{
Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
- indices.reserve( indices.size() + DEFAULT_LAYER_PROPERTY_COUNT );
+ indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
- int index = DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
- for ( int i = 0; i < DEFAULT_LAYER_PROPERTY_COUNT; ++i, ++index )
+ int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
{
indices.push_back( index );
}
bool Layer::IsDefaultPropertyWritable( Property::Index index ) const
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return Actor::IsDefaultPropertyWritable(index);
- }
- else
- {
- return true; // all properties writable, no need to lookup the table
+ return Actor::IsDefaultPropertyWritable( index );
}
+
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].writable;
}
bool Layer::IsDefaultPropertyAnimatable( Property::Index index ) const
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
- {
- return Actor::IsDefaultPropertyAnimatable(index);
- }
- else
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return false; // all properties non animateable, no need to lookup the table
+ return Actor::IsDefaultPropertyAnimatable( index );
}
+
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].animatable;
}
bool Layer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return Actor::IsDefaultPropertyAConstraintInput(index);
+ return Actor::IsDefaultPropertyAConstraintInput( index );
}
- return true; // our properties can be used as an input to a constraint, no need to lookup the table
+
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].constraintInput;
}
Property::Type Layer::GetDefaultPropertyType( Property::Index index ) const
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return Actor::GetDefaultPropertyType(index);
+ return Actor::GetDefaultPropertyType( index );
}
- else
- {
- index -= DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_LAYER_PROPERTY_COUNT ) )
- {
- return DEFAULT_PROPERTY_DETAILS[index].type;
- }
- else
- {
- // index out-of-bounds
- return Property::NONE;
- }
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_DETAILS[index].type;
}
+
+ // index out-of-bounds
+ return Property::NONE;
}
const char* Layer::GetDefaultPropertyName( Property::Index index ) const
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return Actor::GetDefaultPropertyName(index);
+ return Actor::GetDefaultPropertyName( index );
}
- else
- {
- index -= DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_LAYER_PROPERTY_COUNT ) )
- {
- return DEFAULT_PROPERTY_DETAILS[index].name;
- }
- else
- {
- return NULL;
- }
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_DETAILS[index].name;
}
+
+ return NULL;
}
Property::Index Layer::GetDefaultPropertyIndex(const std::string& name) const
Property::Index index = Property::INVALID_INDEX;
// Look for name in current class' default properties
- for( int i = 0; i < DEFAULT_LAYER_PROPERTY_COUNT; ++i )
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
+ const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[i];
if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
{
- index = i + DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
+ index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
break;
}
}
void Layer::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- Actor::SetDefaultProperty(index, propertyValue);
+ Actor::SetDefaultProperty( index, propertyValue );
}
else
{
- switch(index)
+ switch( index )
{
- case Dali::Layer::CLIPPING_ENABLE:
+ case Dali::Layer::Property::ClippingEnable:
{
SetClipping( propertyValue.Get<bool>() );
break;
}
- case Dali::Layer::CLIPPING_BOX:
+ case Dali::Layer::Property::ClippingBox:
{
Rect<int> clippingBox( propertyValue.Get<Rect<int> >() );
SetClippingBox( clippingBox.x, clippingBox.y, clippingBox.width, clippingBox.height );
}
default:
{
- DALI_LOG_WARNING("Unknown property (%d)\n", index);
+ DALI_LOG_WARNING( "Unknown property (%d)\n", index );
break;
}
} // switch(index)
Property::Value Layer::GetDefaultProperty( Property::Index index ) const
{
Property::Value ret;
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- ret = Actor::GetDefaultProperty(index);
+ ret = Actor::GetDefaultProperty( index );
}
else
{
- switch(index)
+ switch( index )
{
- case Dali::Layer::CLIPPING_ENABLE:
+ case Dali::Layer::Property::ClippingEnable:
{
ret = mIsClipping;
break;
}
- case Dali::Layer::CLIPPING_BOX:
+ case Dali::Layer::Property::ClippingBox:
{
ret = mClippingBox;
break;
}
default:
{
- DALI_LOG_WARNING("Unknown property (%d)\n", index);
+ DALI_LOG_WARNING( "Unknown property (%d)\n", index );
break;
}
} // switch(index)
namespace Internal
{
-
-
namespace // unnamed namespace
{
namespace Internal
{
-
namespace
{
// INTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/text/text-actor-parameters.h>
-#include <dali/internal/event/actor-attachments/text-attachment-impl.h>
-#include <dali/internal/event/common/property-index-ranges.h>
-#include <dali/internal/event/text/font-impl.h>
-#include <dali/internal/event/text/utf8-impl.h>
-#include <dali/internal/event/text/text-impl.h>
#include <dali/integration-api/platform-abstraction.h>
#include <dali/integration-api/debug.h>
#include <dali/internal/common/core-impl.h>
+#include <dali/internal/event/actor-attachments/text-attachment-impl.h>
+#include <dali/internal/event/common/property-helper.h>
+#include <dali/internal/event/text/font-impl.h>
+#include <dali/internal/event/text/text-impl.h>
+#include <dali/internal/event/text/utf8-impl.h>
namespace Dali
{
-const Property::Index TextActor::TEXT = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
-const Property::Index TextActor::FONT = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 1;
-const Property::Index TextActor::FONT_STYLE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 2;
-const Property::Index TextActor::OUTLINE_ENABLE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 3;
-const Property::Index TextActor::OUTLINE_COLOR = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 4;
-const Property::Index TextActor::OUTLINE_THICKNESS_WIDTH = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 5;
-const Property::Index TextActor::SMOOTH_EDGE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 6;
-const Property::Index TextActor::GLOW_ENABLE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 7;
-const Property::Index TextActor::GLOW_COLOR = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 8;
-const Property::Index TextActor::GLOW_INTENSITY = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 9;
-const Property::Index TextActor::SHADOW_ENABLE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 10;
-const Property::Index TextActor::SHADOW_COLOR = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 11;
-const Property::Index TextActor::SHADOW_OFFSET = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 12;
-const Property::Index TextActor::ITALICS_ANGLE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 13;
-const Property::Index TextActor::UNDERLINE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 14;
-const Property::Index TextActor::WEIGHT = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 15;
-const Property::Index TextActor::FONT_DETECTION_AUTOMATIC = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 16;
-const Property::Index TextActor::GRADIENT_COLOR = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 17;
-const Property::Index TextActor::GRADIENT_START_POINT = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 18;
-const Property::Index TextActor::GRADIENT_END_POINT = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 19;
-const Property::Index TextActor::SHADOW_SIZE = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 20;
-const Property::Index TextActor::TEXT_COLOR = Internal::DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT + 21;
+namespace Internal
+{
namespace
{
+// Properties
+
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "text", STRING, true, false, true, Dali::TextActor::Property::Text )
+DALI_PROPERTY( "font", STRING, true, false, true, Dali::TextActor::Property::Font )
+DALI_PROPERTY( "font-style", STRING, true, false, true, Dali::TextActor::Property::FontStyle )
+DALI_PROPERTY( "outline-enable", BOOLEAN, true, false, true, Dali::TextActor::Property::OutlineEnable )
+DALI_PROPERTY( "outline-color", VECTOR4, true, false, true, Dali::TextActor::Property::OutlineColor )
+DALI_PROPERTY( "outline-thickness-width", VECTOR2, true, false, true, Dali::TextActor::Property::OutlineThicknessWidth )
+DALI_PROPERTY( "smooth-edge", FLOAT, true, false, true, Dali::TextActor::Property::SmoothEdge )
+DALI_PROPERTY( "glow-enable", BOOLEAN, true, false, true, Dali::TextActor::Property::GlowEnable )
+DALI_PROPERTY( "glow-color", VECTOR4, true, false, true, Dali::TextActor::Property::GlowColor )
+DALI_PROPERTY( "glow-intensity", FLOAT, true, false, true, Dali::TextActor::Property::GlowIntensity )
+DALI_PROPERTY( "shadow-enable", BOOLEAN, true, false, true, Dali::TextActor::Property::ShadowEnable )
+DALI_PROPERTY( "shadow-color", VECTOR4, true, false, true, Dali::TextActor::Property::ShadowColor )
+DALI_PROPERTY( "shadow-offset", VECTOR2, true, false, true, Dali::TextActor::Property::ShadowOffset )
+DALI_PROPERTY( "italics-angle", FLOAT, true, false, true, Dali::TextActor::Property::ItalicsAngle )
+DALI_PROPERTY( "underline", BOOLEAN, true, false, true, Dali::TextActor::Property::Underline )
+DALI_PROPERTY( "weight", INTEGER, true, false, true, Dali::TextActor::Property::Weight )
+DALI_PROPERTY( "font-detection-automatic", BOOLEAN, true, false, true, Dali::TextActor::Property::FontDetectionAutomatic )
+DALI_PROPERTY( "gradient-color", VECTOR4, true, false, true, Dali::TextActor::Property::GradientColor )
+DALI_PROPERTY( "gradient-start-point", VECTOR2, true, false, true, Dali::TextActor::Property::GradientStartPoint )
+DALI_PROPERTY( "gradient-end-point", VECTOR2, true, false, true, Dali::TextActor::Property::GradientEndPoint )
+DALI_PROPERTY( "shadow-size", FLOAT, true, false, true, Dali::TextActor::Property::ShadowSize )
+DALI_PROPERTY( "text-color", VECTOR4, true, false, true, Dali::TextActor::Property::TextColor )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+
// Signals
const char* const SIGNAL_TEXT_LOADING_FINISHED = "text-loading-finished";
-// Default property names
-
-const char* DEFAULT_TEXT_ACTOR_PROPERTY_NAMES[] =
-{
- "text",
- "font",
- "font-style",
- "outline-enable",
- "outline-color",
- "outline-thickness-width",
- "smooth-edge",
- "glow-enable",
- "glow-color",
- "glow-intensity",
- "shadow-enable",
- "shadow-color",
- "shadow-offset",
- "italics-angle",
- "underline",
- "weight",
- "font-detection-automatic",
- "gradient-color",
- "gradient-start-point",
- "gradient-end-point",
- "shadow-size",
- "text-color"
-};
-const int DEFAULT_TEXT_ACTOR_PROPERTY_COUNT = sizeof( DEFAULT_TEXT_ACTOR_PROPERTY_NAMES ) / sizeof( DEFAULT_TEXT_ACTOR_PROPERTY_NAMES[0] );
-
-const Property::Type DEFAULT_TEXT_ACTOR_PROPERTY_TYPES[DEFAULT_TEXT_ACTOR_PROPERTY_COUNT] =
-{
- Property::STRING, // "text"
- Property::STRING, // "font"
- Property::STRING, // "font-style"
- Property::BOOLEAN, // "outline-enable"
- Property::VECTOR4, // "outline-color"
- Property::VECTOR2, // "outline-thickness-width"
- Property::FLOAT, // "smooth-edge"
- Property::BOOLEAN, // "glow-enable"
- Property::VECTOR4, // "glow-color"
- Property::FLOAT, // "glow-intensity"
- Property::BOOLEAN, // "shadow-enable"
- Property::VECTOR4, // "shadow-color"
- Property::VECTOR2, // "shadow-offset"
- Property::FLOAT, // "italics-angle"
- Property::BOOLEAN, // "underline"
- Property::INTEGER, // "weight"
- Property::BOOLEAN, // "font-detection-automatic"
- Property::VECTOR4, // "gradient-color",
- Property::VECTOR2, // "gradient-start-point",
- Property::VECTOR2, // "gradient-end-point"
- Property::FLOAT, // "shadow-size"
- Property::VECTOR4, // "text-color",
-};
-
-}
-
-namespace Internal
-{
-
-namespace
-{
-
BaseHandle Create()
{
return Dali::TextActor::New();
}
-TypeRegistration mType( typeid(Dali::TextActor), typeid(Dali::RenderableActor), Create );
+TypeRegistration mType( typeid( Dali::TextActor ), typeid( Dali::RenderableActor ), Create );
SignalConnectorType s1( mType, SIGNAL_TEXT_LOADING_FINISHED, &TextActor::DoConnectSignal );
unsigned int TextActor::GetDefaultPropertyCount() const
{
- return RenderableActor::GetDefaultPropertyCount() + DEFAULT_TEXT_ACTOR_PROPERTY_COUNT;
+ return RenderableActor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
}
void TextActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
{
RenderableActor::GetDefaultPropertyIndices( indices ); // RenderableActor class properties
- indices.reserve( indices.size() + DEFAULT_TEXT_ACTOR_PROPERTY_COUNT );
+ indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
- int index = DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- for ( int i = 0; i < DEFAULT_TEXT_ACTOR_PROPERTY_COUNT; ++i, ++index )
+ int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
{
indices.push_back( index );
}
const char* TextActor::GetDefaultPropertyName( Property::Index index ) const
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
return RenderableActor::GetDefaultPropertyName(index) ;
}
- else
- {
- index -= DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_TEXT_ACTOR_PROPERTY_COUNT ) )
- {
- return DEFAULT_TEXT_ACTOR_PROPERTY_NAMES[index];
- }
- else
- {
- return NULL;
- }
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_DETAILS[index].name;
}
+
+ // Index out-of-bounds.
+ return NULL;
}
Property::Index TextActor::GetDefaultPropertyIndex(const std::string& name) const
Property::Index index = Property::INVALID_INDEX;
// Look for name in default properties
- for( int i = 0; i < DEFAULT_TEXT_ACTOR_PROPERTY_COUNT; ++i )
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- if( 0 == strcmp( name.c_str(), DEFAULT_TEXT_ACTOR_PROPERTY_NAMES[ i ] ) ) // dont want to convert rhs to string
+ if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // Don't want to convert rhs to string
{
- index = i + DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
+ index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
break;
}
}
bool TextActor::IsDefaultPropertyWritable( Property::Index index ) const
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return RenderableActor::IsDefaultPropertyWritable(index) ;
- }
- else
- {
- return true;
+ return RenderableActor::IsDefaultPropertyWritable( index ) ;
}
+
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].writable;
}
bool TextActor::IsDefaultPropertyAnimatable( Property::Index index ) const
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return RenderableActor::IsDefaultPropertyAnimatable(index) ;
- }
- else
- {
- return false;
+ return RenderableActor::IsDefaultPropertyAnimatable( index ) ;
}
+
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].animatable;
}
bool TextActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- if( index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT )
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return RenderableActor::IsDefaultPropertyAConstraintInput(index);
+ return RenderableActor::IsDefaultPropertyAConstraintInput( index );
}
- return true; // Our properties can be used as input to constraints.
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].constraintInput;
}
Property::Type TextActor::GetDefaultPropertyType( Property::Index index ) const
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- return RenderableActor::GetDefaultPropertyType(index) ;
+ return RenderableActor::GetDefaultPropertyType( index ) ;
}
- else
- {
- index -= DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT;
- if ( ( index >= 0 ) && ( index < DEFAULT_TEXT_ACTOR_PROPERTY_COUNT ) )
- {
- return DEFAULT_TEXT_ACTOR_PROPERTY_TYPES[index];
- }
- else
- {
- // index out-of-bounds
- return Property::NONE;
- }
+ index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
+ if( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_DETAILS[index].type;
}
+
+ // index out-of-bounds
+ return Property::NONE;
}
void TextActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- RenderableActor::SetDefaultProperty(index, propertyValue) ;
+ RenderableActor::SetDefaultProperty( index, propertyValue ) ;
}
else
{
switch(index)
{
- case Dali::TextActor::TEXT:
+ case Dali::TextActor::Property::Text:
{
SetText( GetTextArray( Dali::Text( propertyValue.Get<std::string>() ) ) );
break;
}
- case Dali::TextActor::FONT:
+ case Dali::TextActor::Property::Font:
{
- SetFont(*Font::New(propertyValue.Get<std::string>(),
+ SetFont( *Font::New( propertyValue.Get<std::string>(),
mTextAttachment->GetFont().GetStyle(),
- PointSize(mTextAttachment->GetFont().GetPointSize())));
+ PointSize( mTextAttachment->GetFont().GetPointSize() ) ) );
break;
}
- case Dali::TextActor::FONT_STYLE:
+ case Dali::TextActor::Property::FontStyle:
{
- SetFont(*Font::New(mTextAttachment->GetFont().GetName(),
+ SetFont( *Font::New( mTextAttachment->GetFont().GetName(),
propertyValue.Get<std::string>(),
- PointSize(mTextAttachment->GetFont().GetPointSize())));
+ PointSize( mTextAttachment->GetFont().GetPointSize() ) ) );
break;
}
- case Dali::TextActor::OUTLINE_ENABLE:
+ case Dali::TextActor::Property::OutlineEnable:
{
Vector4 color;
Vector2 thickness;
mTextAttachment->GetOutlineParams( color, thickness );
- mTextAttachment->SetOutline(propertyValue.Get<bool>(), color, thickness);
+ mTextAttachment->SetOutline( propertyValue.Get<bool>(), color, thickness );
break;
}
- case Dali::TextActor::OUTLINE_COLOR:
+ case Dali::TextActor::Property::OutlineColor:
{
Vector4 color;
Vector2 thickness;
mTextAttachment->GetOutlineParams( color, thickness );
- mTextAttachment->SetOutline(mTextAttachment->GetOutline(), propertyValue.Get<Vector4>(), thickness);
+ mTextAttachment->SetOutline( mTextAttachment->GetOutline(), propertyValue.Get<Vector4>(), thickness );
break;
}
- case Dali::TextActor::OUTLINE_THICKNESS_WIDTH:
+ case Dali::TextActor::Property::OutlineThicknessWidth:
{
Vector4 color;
Vector2 thickness;
mTextAttachment->GetOutlineParams( color, thickness );
- mTextAttachment->SetOutline(mTextAttachment->GetOutline(), color, propertyValue.Get<Vector2>());
+ mTextAttachment->SetOutline( mTextAttachment->GetOutline(), color, propertyValue.Get<Vector2>() );
break;
}
- case Dali::TextActor::SMOOTH_EDGE:
+ case Dali::TextActor::Property::SmoothEdge:
{
mTextAttachment->SetSmoothEdge( propertyValue.Get<float>());
break;
}
- case Dali::TextActor::GLOW_ENABLE:
+ case Dali::TextActor::Property::GlowEnable:
{
Vector4 color;
float intensity;
mTextAttachment->GetGlowParams( color, intensity );
- mTextAttachment->SetGlow(propertyValue.Get<bool>(), color, intensity);
+ mTextAttachment->SetGlow( propertyValue.Get<bool>(), color, intensity );
break;
}
- case Dali::TextActor::GLOW_COLOR:
+ case Dali::TextActor::Property::GlowColor:
{
Vector4 color;
float intensity;
mTextAttachment->GetGlowParams( color, intensity );
- mTextAttachment->SetGlow(mTextAttachment->GetGlow(), propertyValue.Get<Vector4>(), intensity);
+ mTextAttachment->SetGlow( mTextAttachment->GetGlow(), propertyValue.Get<Vector4>(), intensity );
break;
}
- case Dali::TextActor::GLOW_INTENSITY:
+ case Dali::TextActor::Property::GlowIntensity:
{
Vector4 color;
float intensity;
mTextAttachment->SetGlow(mTextAttachment->GetGlow(), color, propertyValue.Get<float>());
break;
}
- case Dali::TextActor::SHADOW_ENABLE:
+ case Dali::TextActor::Property::ShadowEnable:
{
Vector4 color;
Vector2 offset;
float size;
mTextAttachment->GetShadowParams( color, offset, size );
- mTextAttachment->SetShadow(propertyValue.Get<bool>(), color, offset, size );
+ mTextAttachment->SetShadow( propertyValue.Get<bool>(), color, offset, size );
break;
}
- case Dali::TextActor::SHADOW_COLOR:
+ case Dali::TextActor::Property::ShadowColor:
{
Vector4 color;
Vector2 offset;
float size;
mTextAttachment->GetShadowParams( color, offset, size );
- mTextAttachment->SetShadow(mTextAttachment->GetShadow(), propertyValue.Get<Vector4>(), offset, size);
+ mTextAttachment->SetShadow( mTextAttachment->GetShadow(), propertyValue.Get<Vector4>(), offset, size );
break;
}
- case Dali::TextActor::SHADOW_OFFSET:
+ case Dali::TextActor::Property::ShadowOffset:
{
Vector4 color;
Vector2 offset;
float size;
mTextAttachment->GetShadowParams( color, offset, size );
- mTextAttachment->SetShadow(mTextAttachment->GetShadow(), color, propertyValue.Get<Vector2>(), size );
+ mTextAttachment->SetShadow( mTextAttachment->GetShadow(), color, propertyValue.Get<Vector2>(), size );
break;
}
- case Dali::TextActor::SHADOW_SIZE:
+ case Dali::TextActor::Property::ShadowSize:
{
Vector4 color;
Vector2 offset;
float size;
mTextAttachment->GetShadowParams( color, offset, size );
- mTextAttachment->SetShadow(mTextAttachment->GetShadow(), color, offset, propertyValue.Get<float>());
+ mTextAttachment->SetShadow( mTextAttachment->GetShadow(), color, offset, propertyValue.Get<float>() );
break;
}
- case Dali::TextActor::ITALICS_ANGLE:
+ case Dali::TextActor::Property::ItalicsAngle:
{
- SetItalics(Radian(propertyValue.Get<float>())) ;
+ SetItalics( Radian( propertyValue.Get<float>() ) ) ;
break;
}
- case Dali::TextActor::UNDERLINE:
+ case Dali::TextActor::Property::Underline:
{
- SetUnderline(propertyValue.Get<bool>(), 0.f, 0.f ) ;
+ SetUnderline( propertyValue.Get<bool>(), 0.f, 0.f ) ;
break;
}
- case Dali::TextActor::WEIGHT:
+ case Dali::TextActor::Property::Weight:
{
- mTextAttachment->SetWeight(static_cast<TextStyle::Weight>(propertyValue.Get<int>())) ;
+ mTextAttachment->SetWeight( static_cast<TextStyle::Weight>( propertyValue.Get<int>() ) ) ;
break;
}
- case Dali::TextActor::FONT_DETECTION_AUTOMATIC:
+ case Dali::TextActor::Property::FontDetectionAutomatic:
{
mFontDetection = propertyValue.Get<bool>() ;
break;
}
- case Dali::TextActor::GRADIENT_COLOR:
+ case Dali::TextActor::Property::GradientColor:
{
mTextAttachment->SetGradient( propertyValue.Get<Vector4>(), mTextAttachment->GetGradientStartPoint(), mTextAttachment->GetGradientEndPoint() );
break;
}
- case Dali::TextActor::GRADIENT_START_POINT:
+ case Dali::TextActor::Property::GradientStartPoint:
{
mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), propertyValue.Get<Vector2>(), mTextAttachment->GetGradientEndPoint() );
break;
}
- case Dali::TextActor::GRADIENT_END_POINT:
+ case Dali::TextActor::Property::GradientEndPoint:
{
mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), mTextAttachment->GetGradientStartPoint(), propertyValue.Get<Vector2>() );
break;
}
- case Dali::TextActor::TEXT_COLOR:
+ case Dali::TextActor::Property::TextColor:
{
mTextAttachment->SetTextColor( propertyValue.Get<Vector4>() );
break;
}
default:
{
- DALI_LOG_WARNING("Unknown text set property (%d)\n", index);
+ DALI_LOG_WARNING( "Unknown text set property (%d)\n", index );
break;
}
} // switch(index)
Property::Value TextActor::GetDefaultProperty( Property::Index index ) const
{
Property::Value ret ;
- if(index < DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT)
+ if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
{
- ret = RenderableActor::GetDefaultProperty(index) ;
+ ret = RenderableActor::GetDefaultProperty( index ) ;
}
else
{
- switch(index)
+ switch( index )
{
- case Dali::TextActor::TEXT:
+ case Dali::TextActor::Property::Text:
{
ret = GetText();
break;
}
- case Dali::TextActor::FONT:
+ case Dali::TextActor::Property::Font:
{
ret = mTextAttachment->GetFont().GetName();
break;
}
- case Dali::TextActor::FONT_STYLE:
+ case Dali::TextActor::Property::FontStyle:
{
ret = mTextAttachment->GetFont().GetStyle();
break;
}
- case Dali::TextActor::OUTLINE_ENABLE:
+ case Dali::TextActor::Property::OutlineEnable:
{
ret = mTextAttachment->GetOutline();
break;
}
- case Dali::TextActor::OUTLINE_COLOR:
+ case Dali::TextActor::Property::OutlineColor:
{
Vector4 color;
Vector2 thickness;
ret = color;
break;
}
- case Dali::TextActor::OUTLINE_THICKNESS_WIDTH:
+ case Dali::TextActor::Property::OutlineThicknessWidth:
{
Vector4 color;
Vector2 thickness;
ret = thickness;
break;
}
- case Dali::TextActor::SMOOTH_EDGE:
+ case Dali::TextActor::Property::SmoothEdge:
{
ret = mTextAttachment->GetSmoothEdge();
break;
}
- case Dali::TextActor::GLOW_ENABLE:
+ case Dali::TextActor::Property::GlowEnable:
{
ret = mTextAttachment->GetGlow();
break;
}
- case Dali::TextActor::GLOW_COLOR:
+ case Dali::TextActor::Property::GlowColor:
{
Vector4 color;
- float intensity(0.0f);
+ float intensity( 0.0f );
mTextAttachment->GetGlowParams( color, intensity );
ret = color;
break;
}
- case Dali::TextActor::GLOW_INTENSITY:
+ case Dali::TextActor::Property::GlowIntensity:
{
Vector4 color;
- float intensity(0.0f);
+ float intensity( 0.0f );
mTextAttachment->GetGlowParams( color, intensity );
ret = intensity;
break;
}
- case Dali::TextActor::SHADOW_ENABLE:
+ case Dali::TextActor::Property::ShadowEnable:
{
ret = mTextAttachment->GetShadow();
break;
}
- case Dali::TextActor::SHADOW_COLOR:
+ case Dali::TextActor::Property::ShadowColor:
{
Vector4 color;
Vector2 offset;
ret = color;
break;
}
- case Dali::TextActor::SHADOW_OFFSET:
+ case Dali::TextActor::Property::ShadowOffset:
{
Vector4 color;
Vector2 offset;
ret = offset;
break;
}
- case Dali::TextActor::SHADOW_SIZE:
+ case Dali::TextActor::Property::ShadowSize:
{
Vector4 color;
Vector2 offset;
ret = size;
break;
}
- case Dali::TextActor::ITALICS_ANGLE:
+ case Dali::TextActor::Property::ItalicsAngle:
{
- ret = static_cast<float>(mTextAttachment->GetItalics()) ;
+ ret = static_cast<float>( mTextAttachment->GetItalics() ) ;
break;
}
- case Dali::TextActor::UNDERLINE:
+ case Dali::TextActor::Property::Underline:
{
ret = mTextAttachment->GetUnderline() ;
break;
}
- case Dali::TextActor::WEIGHT:
+ case Dali::TextActor::Property::Weight:
{
- ret = static_cast<int>(mTextAttachment->GetWeight());
+ ret = static_cast<int>( mTextAttachment->GetWeight() );
break;
}
- case Dali::TextActor::FONT_DETECTION_AUTOMATIC:
+ case Dali::TextActor::Property::FontDetectionAutomatic:
{
ret = mFontDetection;
break;
}
- case Dali::TextActor::GRADIENT_COLOR:
+ case Dali::TextActor::Property::GradientColor:
{
ret = mTextAttachment->GetGradientColor();
break;
}
- case Dali::TextActor::GRADIENT_START_POINT:
+ case Dali::TextActor::Property::GradientStartPoint:
{
ret = mTextAttachment->GetGradientStartPoint();
break;
}
- case Dali::TextActor::GRADIENT_END_POINT:
+ case Dali::TextActor::Property::GradientEndPoint:
{
ret = mTextAttachment->GetGradientEndPoint();
break;
}
- case Dali::TextActor::TEXT_COLOR:
+ case Dali::TextActor::Property::TextColor:
{
ret = mTextAttachment->GetTextColor();
break;
}
default:
{
- DALI_LOG_WARNING("Unknown text set property (%d)\n", index);
+ DALI_LOG_WARNING( "Unknown text set property (%d)\n", index );
break;
}
} // switch(index)
#include <dali/public-api/object/type-registry.h>
#include <dali/internal/common/event-to-update.h>
#include <dali/internal/event/animation/animation-impl.h>
-#include <dali/internal/update/common/animatable-property.h>
+#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/update/animation/scene-graph-constraint-base.h>
+#include <dali/internal/update/common/animatable-property.h>
#include <dali/internal/update/common/property-owner-messages.h>
using Dali::Internal::SceneGraph::AnimatableProperty;
namespace Dali
{
-const Property::Index ActiveConstraint::WEIGHT = 0;
-
namespace Internal
{
namespace // unnamed namespace
{
+// Properties
+
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "weight", FLOAT, true, true, true, Dali::ActiveConstraint::Property::Weight )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX )
+
// Signals
const char* const SIGNAL_APPLIED = "applied";
SignalConnectorType signalConnector1( mType, SIGNAL_APPLIED, &ActiveConstraintBase::DoConnectSignal );
-}
-
-
-namespace // unnamed namespace
-{
-
-/**
- * We want to discourage the use of property strings (minimize string comparisons),
- * particularly for the default properties.
- */
-const char* DEFAULT_PROPERTY_NAMES[] =
-{
- "weight"
-};
-const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_NAMES ) / sizeof( std::string );
-
-const Property::Type DEFAULT_PROPERTY_TYPES[DEFAULT_PROPERTY_COUNT] =
-{
- Property::FLOAT // WEIGHT
-};
-
} // unnamed namespace
ActiveConstraintBase::ActiveConstraintBase( EventToUpdate& eventToUpdate, Property::Index targetPropertyIndex, SourceContainer& sources, unsigned int sourceCount )
// Automatically animate (increase) the weight, until the constraint is fully applied
mApplyAnimation = Dali::Animation::New( applyTime.delaySeconds + applyTime.durationSeconds );
Dali::ActiveConstraint self( this );
- mApplyAnimation.AnimateTo( Property( self, Dali::ActiveConstraint::WEIGHT ), Dali::ActiveConstraint::FINAL_WEIGHT, mAlphaFunction, applyTime );
+ mApplyAnimation.AnimateTo( Property( self, Dali::ActiveConstraint::Property::Weight ), Dali::ActiveConstraint::FINAL_WEIGHT, mAlphaFunction, applyTime );
mApplyAnimation.Play();
// Chain "Finish" to "Applied" signal
{
if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- return DEFAULT_PROPERTY_NAMES[index];
+ return DEFAULT_PROPERTY_DETAILS[index].name;
}
else
{
Property::Index index = Property::INVALID_INDEX;
// Only one name to compare with...
- if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_NAMES[0] ) ) // dont want to convert rhs to string
+ if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[0].name ) ) // Don't want to convert rhs to string
{
index = 0;
}
bool ActiveConstraintBase::IsDefaultPropertyWritable( Property::Index index ) const
{
- return true; // All default properties are currently writable
+ return DEFAULT_PROPERTY_DETAILS[ index ].writable;
}
bool ActiveConstraintBase::IsDefaultPropertyAnimatable( Property::Index index ) const
{
- return true; // All default properties are currently animatable
+ return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
}
bool ActiveConstraintBase::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- return true; // All default properties can currently be used as a constraint input
+ return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
}
Property::Type ActiveConstraintBase::GetDefaultPropertyType( Property::Index index ) const
{
if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- return DEFAULT_PROPERTY_TYPES[index];
- }
- else
- {
- // Index out-of-range
- return Property::NONE;
+ return DEFAULT_PROPERTY_DETAILS[index].type;
}
+
+ // Index out-of-range
+ return Property::NONE;
}
void ActiveConstraintBase::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
- if( Dali::ActiveConstraint::WEIGHT == index )
+ if( Dali::ActiveConstraint::Property::Weight == index )
{
SetWeight( propertyValue.Get<float>() );
}
{
Property::Value value;
- if( Dali::ActiveConstraint::WEIGHT == index )
+ if( Dali::ActiveConstraint::Property::Weight == index )
{
value = GetCurrentWeight();
}
#include <dali/internal/event/animation/animation-impl.h>
// INTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/radian.h>
#include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/animation/animator-connector.h>
#include <dali/internal/event/animation/animation-playlist.h>
+#include <dali/internal/event/animation/animator-connector.h>
#include <dali/internal/event/common/notification-manager.h>
-#include <dali/internal/update/manager/update-manager.h>
-#include <dali/internal/event/effects/shader-effect-impl.h>
+#include <dali/internal/event/common/property-helper.h>
+#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/common/thread-local-storage.h>
+#include <dali/internal/event/effects/shader-effect-impl.h>
+#include <dali/internal/update/manager/update-manager.h>
using Dali::Internal::SceneGraph::UpdateManager;
using Dali::Internal::SceneGraph::AnimatorBase;
{
case Property::BOOLEAN:
{
- AddAnimatorConnector( AnimatorConnector<bool>::New(targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToBoolean(destinationValue.Get<bool>()),
- alpha,
- period) );
+ AddAnimatorConnector( AnimatorConnector<bool>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToBoolean( destinationValue.Get<bool>() ),
+ alpha,
+ period ) );
break;
}
case Property::FLOAT:
{
- AddAnimatorConnector( AnimatorConnector<float>::New(targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToFloat(destinationValue.Get<float>()),
- alpha,
- period) );
+ AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToFloat( destinationValue.Get<float>() ),
+ alpha,
+ period ) );
break;
}
case Property::INTEGER:
{
- AddAnimatorConnector( AnimatorConnector<int>::New(targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToInteger(destinationValue.Get<int>()),
- alpha,
- period) );
+ AddAnimatorConnector( AnimatorConnector<int>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToInteger( destinationValue.Get<int>() ),
+ alpha,
+ period ) );
break;
}
case Property::VECTOR2:
{
- AddAnimatorConnector( AnimatorConnector<Vector2>::New(targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToVector2(destinationValue.Get<Vector2>()),
- alpha,
- period) );
+ AddAnimatorConnector( AnimatorConnector<Vector2>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToVector2( destinationValue.Get<Vector2>() ),
+ alpha,
+ period ) );
break;
}
case Property::VECTOR3:
{
- if ( Dali::Actor::SIZE == targetPropertyIndex )
+ if ( Dali::Actor::Property::Size == targetPropertyIndex )
{
// Test whether this is actually an Actor
Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
}
}
- AddAnimatorConnector( AnimatorConnector<Vector3>::New(targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToVector3(destinationValue.Get<Vector3>()),
- alpha,
- period) );
+ AddAnimatorConnector( AnimatorConnector<Vector3>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToVector3( destinationValue.Get<Vector3>() ),
+ alpha,
+ period ) );
break;
}
case Property::VECTOR4:
{
- AddAnimatorConnector( AnimatorConnector<Vector4>::New(targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToVector4(destinationValue.Get<Vector4>()),
- alpha,
- period) );
+ AddAnimatorConnector( AnimatorConnector<Vector4>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToVector4( destinationValue.Get<Vector4>() ),
+ alpha,
+ period ) );
break;
}
case Property::ROTATION:
{
- AddAnimatorConnector( AnimatorConnector<Quaternion>::New(targetObject,
- targetPropertyIndex,
- componentIndex,
- new RotateToQuaternion(destinationValue.Get<Quaternion>()),
- alpha,
- period) );
+ AddAnimatorConnector( AnimatorConnector<Quaternion>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new RotateToQuaternion( destinationValue.Get<Quaternion>() ),
+ alpha,
+ period ) );
break;
}
//Position animation
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::POSITION,
+ Dali::Actor::Property::Position,
Property::INVALID_COMPONENT_INDEX,
new PathPositionFunctor( pathCopy ),
alpha,
{
//Rotation animation
AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
- Dali::Actor::ROTATION,
+ Dali::Actor::Property::Rotation,
Property::INVALID_COMPONENT_INDEX,
new PathRotationFunctor( pathCopy, forward ),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::POSITION,
+ Dali::Actor::Property::Position,
Property::INVALID_COMPONENT_INDEX,
new AnimateByVector3(displacement),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::POSITION,
+ Dali::Actor::Property::Position,
Property::INVALID_COMPONENT_INDEX,
new AnimateToVector3(position),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
- Dali::Actor::ROTATION,
+ Dali::Actor::Property::Rotation,
Property::INVALID_COMPONENT_INDEX,
new RotateByAngleAxis(angle, axis),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
- Dali::Actor::ROTATION,
+ Dali::Actor::Property::Rotation,
Property::INVALID_COMPONENT_INDEX,
new RotateToQuaternion(rotation),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::SCALE,
+ Dali::Actor::Property::Scale,
Property::INVALID_COMPONENT_INDEX,
new AnimateByVector3(scale),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::SCALE,
+ Dali::Actor::Property::Scale,
Property::INVALID_COMPONENT_INDEX,
new AnimateToVector3(scale),
alpha,
ExtendDuration( TimePeriod(delaySeconds, 0) );
AddAnimatorConnector( AnimatorConnector<bool>::New( actor,
- Dali::Actor::VISIBLE,
+ Dali::Actor::Property::Visible,
Property::INVALID_COMPONENT_INDEX,
new AnimateToBoolean(SHOW_VALUE),
AlphaFunctions::Default,
ExtendDuration( TimePeriod(delaySeconds, 0) );
AddAnimatorConnector( AnimatorConnector<bool>::New( actor,
- Dali::Actor::VISIBLE,
+ Dali::Actor::Property::Visible,
Property::INVALID_COMPONENT_INDEX,
new AnimateToBoolean(HIDE_VALUE),
AlphaFunctions::Default,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::COLOR,
+ Dali::Actor::Property::Color,
Property::INVALID_COMPONENT_INDEX,
new AnimateByOpacity(opacity),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::COLOR,
+ Dali::Actor::Property::Color,
Property::INVALID_COMPONENT_INDEX,
new AnimateToOpacity(opacity),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::COLOR,
+ Dali::Actor::Property::Color,
Property::INVALID_COMPONENT_INDEX,
new AnimateByVector4(color),
alpha,
ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::COLOR,
+ Dali::Actor::Property::Color,
Property::INVALID_COMPONENT_INDEX,
new AnimateToVector4(color),
alpha,
actor.NotifySizeAnimation( *this, targetSize );
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::SIZE,
+ Dali::Actor::Property::Size,
Property::INVALID_COMPONENT_INDEX,
new AnimateToVector3(targetSize),
alpha,
actor.NotifySizeAnimation( *this, size );
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::SIZE,
+ Dali::Actor::Property::Size,
Property::INVALID_COMPONENT_INDEX,
new AnimateToVector3(size),
alpha,
// CLASS HEADER
#include <dali/internal/event/animation/path-impl.h>
+#include <dali/internal/event/common/property-helper.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
namespace
{
+
+// Properties
+
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "points", ARRAY, true, false, false, Dali::Path::Property::Points )
+DALI_PROPERTY( "control-points", ARRAY, true, false, false, Dali::Path::Property::ControlPoints )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX )
+
/**
* These coefficient arise from the cubic polynomial equations for
* a bezier curve.
const Dali::Matrix BezierBasis = Dali::Matrix( BezierBasisCoeff );
-const Dali::Internal::PropertyDetails DEFAULT_PROPERTY_DETAILS[] =
-{
- { "points", Dali::Property::ARRAY, true, false, false },
- { "control-points", Dali::Property::ARRAY, true, false, false },
-};
-
-const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( DEFAULT_PROPERTY_DETAILS[0] );
-
-}//Unnamed namespace
-
-namespace Dali
-{
-const Property::Index Path::POINTS = 0;
-const Property::Index Path::CONTROL_POINTS = 1;
-
-namespace Internal
-{
+} //Unnamed namespace
Path* Path::New()
{
{
return DEFAULT_PROPERTY_DETAILS[index].name;
}
- else
- {
- // index out of range
- return NULL;
- }
+
+ // index out of range
+ return NULL;
}
Property::Index Path::GetDefaultPropertyIndex(const std::string& name) const
{
return DEFAULT_PROPERTY_DETAILS[index].type;
}
- else
- {
- // index out of range
- return Property::NONE;
- }
+
+ // index out of range
+ return Property::NONE;
}
Property::Value Path::GetDefaultProperty( Property::Index index ) const
{
Property::Value value;
- switch ( index )
+ if( index == Dali::Path::Property::Points )
{
- case Dali::Path::POINTS:
- {
- size_t pointCount( mPoint.Size() );
- for( size_t i(0); i!=pointCount; ++i )
- {
- value.AppendItem( mPoint[i] );
- }
- break;
- }
- case Dali::Path::CONTROL_POINTS:
+ size_t pointCount( mPoint.Size() );
+ for( size_t i( 0 ); i != pointCount; ++i )
{
- size_t controlpointCount( mControlPoint.Size() );
- for( size_t i(0); i!=controlpointCount; ++i )
- {
- value.AppendItem( mControlPoint[i] );
- }
- break;
+ value.AppendItem( mPoint[i] );
}
- default:
+ }
+ else if( index == Dali::Path::Property::ControlPoints )
+ {
+ size_t controlpointCount( mControlPoint.Size() );
+ for( size_t i( 0 ); i != controlpointCount; ++i )
{
- DALI_ASSERT_ALWAYS(false && "Path::Property is out of bounds");
- break;
+ value.AppendItem( mControlPoint[i] );
}
}
void Path::SetDefaultProperty(Property::Index index, const Property::Value& propertyValue)
{
- switch ( index )
+ if( index == Dali::Path::Property::Points )
{
- case Dali::Path::POINTS:
+ Property::Array propertyArray;
+ propertyValue.Get(propertyArray);
+
+ size_t propertyArrayCount = propertyArray.size();
+ mPoint.Resize( propertyArrayCount );
+ for( size_t i(0); i!=propertyArrayCount; ++i )
{
- Property::Array propertyArray;
- propertyValue.Get(propertyArray);
-
- size_t propertyArrayCount = propertyArray.size();
- mPoint.Resize( propertyArrayCount );
- for( size_t i(0); i!=propertyArrayCount; ++i )
- {
- propertyArray[i].Get( mPoint[i]);
- }
- break;
+ propertyArray[i].Get( mPoint[i]);
}
- case Dali::Path::CONTROL_POINTS:
+ }
+ else if( index == Dali::Path::Property::ControlPoints )
+ {
+ Property::Array propertyArray;
+ propertyValue.Get(propertyArray);
+
+ size_t propertyArrayCount = propertyArray.size();
+ mControlPoint.Resize( propertyArrayCount );
+ for( size_t i(0); i!=propertyArrayCount; ++i )
{
- Property::Array propertyArray;
- propertyValue.Get(propertyArray);
-
- size_t propertyArrayCount = propertyArray.size();
- mControlPoint.Resize( propertyArrayCount );
- for( size_t i(0); i!=propertyArrayCount; ++i )
- {
- propertyArray[i].Get( mControlPoint[i]);
- }
- break;
- }
- default:
- {
- // no read only properties
- break;
+ propertyArray[i].Get( mControlPoint[i]);
}
}
}
{
return DEFAULT_PROPERTY_DETAILS[index].writable;
}
- else
- {
- return false;
- }
+
+ return false;
}
bool Path::IsDefaultPropertyAnimatable(Property::Index index) const
{
return DEFAULT_PROPERTY_DETAILS[index].animatable;
}
- else
- {
- return false;
- }
+
+ return false;
}
bool Path::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
return DEFAULT_PROPERTY_DETAILS[index].constraintInput;
}
- else
- {
- return false;
- }
+
+ return false;
}
void Path::AddPoint(const Vector3& point )
#include <dali/internal/event/animation/constraint-impl.h>
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/common/property-notification-impl.h>
-#include <dali/internal/event/common/property-index-ranges.h>
#include <dali/internal/event/common/type-registry-impl.h>
using Dali::Internal::SceneGraph::AnimatableProperty;
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/object/handle.h>
#include <dali/public-api/object/property.h>
-#include <dali/public-api/object/property-index.h>
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/property-notification.h>
#include <dali/internal/common/owner-container.h>
#include <dali/internal/event/common/property-input-impl.h>
#include <dali/internal/update/common/property-base.h>
-
namespace Dali
{
class Stage;
class TypeInfo;
-/**
- * @brief Structure for setting up default properties and their details.
- */
-struct PropertyDetails
-{
- const char* name; ///< The name of the property.
- Property::Type type; ///< The property type.
- bool writable:1; ///< Whether the property is writable
- bool animatable:1; ///< Whether the property is animatable.
- bool constraintInput:1; ///< Whether the property can be used as an input to a constraint.
-};
-
namespace SceneGraph
{
class PropertyBase;
--- /dev/null
+#ifndef __DALI_PROPERTY_HELPER_H__
+#define __DALI_PROPERTY_HELPER_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/integration-api/bitmap.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+/**
+ * @brief Structure for setting up default properties and their details.
+ */
+struct PropertyDetails
+{
+ const char* name; ///< The name of the property.
+ Property::Type type; ///< The property type.
+ bool writable:1; ///< Whether the property is writable
+ bool animatable:1; ///< Whether the property is animatable.
+ bool constraintInput:1; ///< Whether the property can be used as an input to a constraint.
+#ifdef DEBUG_ENABLED
+ Property::Index enumIndex; ///< Used to check the index is correct within a debug build.
+#endif
+};
+
+/**
+ * These macros are used to define a table of property details per Actor object.
+ * The index property is only compiled in for DEBUG_ENABLED builds and allows checking the table index VS the property enum index.
+ * DALI_PROPERTY_TABLE_END Forces a run-time check that will happen once.
+ */
+#define DALI_PROPERTY_TABLE_BEGIN const Internal::PropertyDetails DEFAULT_PROPERTY_DETAILS[] = {
+#ifdef DEBUG_ENABLED
+#define DALI_PROPERTY_TABLE_END( startIndex ) }; const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Internal::PropertyDetails ); \
+ struct PROPERTY_CHECK \
+ { \
+ PROPERTY_CHECK() \
+ { \
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; i++ ) \
+ { \
+ if ( DEFAULT_PROPERTY_DETAILS[i].enumIndex != ( startIndex + i ) ) \
+ { \
+ DALI_LOG_ERROR( "Checking property failed: index:%d, enumIndex:%d == index+start:%d, (name:%s)\n", i, \
+ DEFAULT_PROPERTY_DETAILS[i].enumIndex, (startIndex + i), DEFAULT_PROPERTY_DETAILS[i].name ); \
+ DALI_ASSERT_DEBUG( false && "Property enumeration mismatch" ); \
+ } \
+ } \
+ } \
+ }; \
+ static PROPERTY_CHECK PROPERTY_CHECK_INSTANCE;
+#else
+#define DALI_PROPERTY_TABLE_END( startIndex ) }; const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Internal::PropertyDetails );
+#endif
+#ifdef DEBUG_ENABLED
+#define DALI_PROPERTY( text, type, writable, animatable, constraint, index ) { text, Dali::Property::type, writable, animatable, constraint, index },
+#else
+#define DALI_PROPERTY( text, type, writable, animatable, constraint, index ) { text, Dali::Property::type, writable, animatable, constraint },
+#endif
+
+/**
+ * Macros for creating enumeration to string tables.
+ * Example:
+ *
+ * DALI_ENUM_TO_STRING_TABLE_BEGIN( SizeMode )
+ * DALI_ENUM_TO_STRING( USE_OWN_SIZE )
+ * DALI_ENUM_TO_STRING( SIZE_EQUAL_TO_PARENT )
+ * DALI_ENUM_TO_STRING_TABLE_END( SizeMode )
+ *
+ * Creates:
+ * const Scripting::StringEnum< SizeMode > SizeModeTable[] = {
+ * { "USE_OWN_SIZE", USE_OWN_SIZE },
+ * { "SIZE_EQUAL_TO_PARENT", SIZE_EQUAL_TO_PARENT },
+ * }; const unsigned int SizeModeTableCount = sizeof( SizeModeTable ) / sizeof( SizeModeTable[0] );
+ */
+#define DALI_ENUM_TO_STRING_TABLE_BEGIN( t ) const Scripting::StringEnum< t > t##Table[] = {
+#define DALI_ENUM_TO_STRING_TABLE_END( t ) }; const unsigned int t##TableCount = sizeof( t##Table ) / sizeof( t##Table[0] );
+#define DALI_ENUM_TO_STRING( s ) { #s, s },
+
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // __DALI_PROPERTY_HELPER_H__
+
+++ /dev/null
-#ifndef __DALI_INTERNAL_PROPERTY_INDEX_RANGES_H__
-#define __DALI_INTERNAL_PROPERTY_INDEX_RANGES_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.
- *
- */
-
-#include <dali/public-api/object/property-index.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-/*
- * Specifies the allowed ranges for different class types to cater for future allocation
- */
-
-enum
-{
- DEFAULT_PROPERTY_MAX_COUNT = PROPERTY_REGISTRATION_START_INDEX, ///< Default Property Range: 0 to 9999999
-
- DEFAULT_ACTOR_PROPERTY_MAX_COUNT = 10000, ///< Actor Range: 0 to 9999
- DEFAULT_RENDERABLE_ACTOR_PROPERTY_MAX_COUNT = 20000, ///< Renderable Actor Range: 10000 to 19999
-
- DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT = 10000, ///< GestureDetector Range: 0 to 9999
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_PROPERTY_INDEX_RANGES_H__
#include <dali/internal/event/effects/shader-effect-impl.h>
// INTERNAL INCLUDES
-#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/matrix.h>
#include <dali/public-api/math/matrix3.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
+#include <dali/public-api/math/vector2.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/scripting/scripting.h>
+#include <dali/public-api/shader-effects/shader-effect.h>
+#include <dali/internal/event/common/property-helper.h>
+#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/effects/shader-declarations.h>
#include <dali/internal/event/effects/shader-factory.h>
#include <dali/internal/event/images/image-impl.h>
-#include <dali/internal/update/common/animatable-property.h>
-#include <dali/internal/update/manager/update-manager.h>
-#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/render/shaders/shader.h>
#include <dali/internal/render/shaders/uniform-meta.h>
#include <dali/internal/update/animation/scene-graph-constraint-base.h>
+#include <dali/internal/update/common/animatable-property.h>
+#include <dali/internal/update/manager/update-manager.h>
#include "dali-shaders.h"
using Dali::Internal::SceneGraph::UpdateManager;
namespace Dali
{
-const Property::Index ShaderEffect::GRID_DENSITY = 0;
-const Property::Index ShaderEffect::IMAGE = 1;
-const Property::Index ShaderEffect::PROGRAM = 2;
-const Property::Index ShaderEffect::GEOMETRY_HINTS = 3;
-
namespace Internal
{
namespace
{
-const PropertyDetails DEFAULT_PROPERTY_DETAILS[] =
-{
- // Name Type writable animatable constraint-input
- { "grid-density", Property::FLOAT, true, false, false }, // GRID_DENSITY
- { "image", Property::MAP, true, false, false }, // IMAGE
- { "program", Property::MAP, true, false, false }, // PROGRAM
- { "geometry-hints", Property::INTEGER, true, false, false }, // GEOMETRY_HINTS
-};
-const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( DEFAULT_PROPERTY_DETAILS[0] );
+// Properties
+
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "grid-density", FLOAT, true, false, false, Dali::ShaderEffect::Property::GridDensity )
+DALI_PROPERTY( "image", MAP, true, false, false, Dali::ShaderEffect::Property::Image )
+DALI_PROPERTY( "program", MAP, true, false, false, Dali::ShaderEffect::Property::Program )
+DALI_PROPERTY( "geometry-hints", INTEGER, true, false, false, Dali::ShaderEffect::Property::GeometryHints )
+DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
BaseHandle Create()
{
{
return DEFAULT_PROPERTY_DETAILS[index].name;
}
- else
- {
- return NULL;
- }
+
+ return NULL;
}
Property::Index ShaderEffect::GetDefaultPropertyIndex(const std::string& name) const
}
return index;
-
}
bool ShaderEffect::IsDefaultPropertyWritable(Property::Index index) const
{
- return true; // all properties are writable
+ return DEFAULT_PROPERTY_DETAILS[ index ].writable;
}
bool ShaderEffect::IsDefaultPropertyAnimatable(Property::Index index) const
{
- return false; // all properties are non animatable
+ return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
}
bool ShaderEffect::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- return false; // all properties cannot be used as constraint input
+ return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
}
Property::Type ShaderEffect::GetDefaultPropertyType(Property::Index index) const
{
return DEFAULT_PROPERTY_DETAILS[index].type;
}
- else
- {
- // index out of range...return Property::NONE
- return Property::NONE;
- }
+
+ // index out of range...return Property::NONE
+ return Property::NONE;
}
void ShaderEffect::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
switch ( index )
{
- case Dali::ShaderEffect::GRID_DENSITY:
+ case Dali::ShaderEffect::Property::GridDensity:
{
SetGridDensityMessage( mUpdateManager.GetEventToUpdate(), *mSceneObject, propertyValue.Get<float>() );
break;
}
- case Dali::ShaderEffect::IMAGE:
+ case Dali::ShaderEffect::Property::Image:
{
Dali::Image img(Scripting::NewImage( propertyValue ));
if(img)
break;
}
- case Dali::ShaderEffect::PROGRAM:
+ case Dali::ShaderEffect::Property::Program:
{
std::string vertexPrefix = GetShader("vertex-prefix", propertyValue);
std::string fragmentPrefix = GetShader("fragment-prefix", propertyValue);
break;
}
- case Dali::ShaderEffect::GEOMETRY_HINTS:
+ case Dali::ShaderEffect::Property::GeometryHints:
{
Dali::ShaderEffect::GeometryHints hint = Dali::ShaderEffect::HINT_NONE;
Property::Value geometryHintsValue = propertyValue.GetValue("geometry-hints");
#include <dali/public-api/math/degree.h>
#include <dali/integration-api/debug.h>
#include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/common/property-index-ranges.h>
+#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/events/gesture-event-processor.h>
#include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
namespace Dali
{
-const Property::Index PanGestureDetector::SCREEN_POSITION = Internal::DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT;
-const Property::Index PanGestureDetector::SCREEN_DISPLACEMENT = Internal::DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT + 1;
-const Property::Index PanGestureDetector::SCREEN_VELOCITY = Internal::DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT + 2;
-const Property::Index PanGestureDetector::LOCAL_POSITION = Internal::DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT + 3;
-const Property::Index PanGestureDetector::LOCAL_DISPLACEMENT = Internal::DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT + 4;
-const Property::Index PanGestureDetector::LOCAL_VELOCITY = Internal::DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT + 5;
-const Property::Index PanGestureDetector::PANNING = Internal::DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT + 6;
-
namespace Internal
{
// Properties
-PropertyDetails DEFAULT_PROPERTIES[] =
-{
- { "screen-position", Property::VECTOR2, false, false, true },
- { "screen-displacement", Property::VECTOR2, false, false, true },
- { "screen-velocity", Property::VECTOR2, false, false, true },
- { "local-position", Property::VECTOR2, false, false, true },
- { "local-displacement", Property::VECTOR2, false, false, true },
- { "local-velocity", Property::VECTOR2, false, false, true },
- { "panning", Property::BOOLEAN, false, false, true },
-};
-const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTIES ) / sizeof( DEFAULT_PROPERTIES[0] );
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "screen-position", VECTOR2, false, false, true, Dali::PanGestureDetector::Property::ScreenPosition )
+DALI_PROPERTY( "screen-displacement", VECTOR2, false, false, true, Dali::PanGestureDetector::Property::ScreenDisplacement )
+DALI_PROPERTY( "screen-velocity", VECTOR2, false, false, true, Dali::PanGestureDetector::Property::ScreenVelocity )
+DALI_PROPERTY( "local-position", VECTOR2, false, false, true, Dali::PanGestureDetector::Property::LocalPosition )
+DALI_PROPERTY( "local-displacement", VECTOR2, false, false, true, Dali::PanGestureDetector::Property::LocalDisplacement )
+DALI_PROPERTY( "local-velocity", VECTOR2, false, false, true, Dali::PanGestureDetector::Property::LocalVelocity )
+DALI_PROPERTY( "panning", BOOLEAN, false, false, true, Dali::PanGestureDetector::Property::Panning )
+DALI_PROPERTY_TABLE_END( DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX )
// Signals
{
indices.reserve( DEFAULT_PROPERTY_COUNT );
- int index = DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT;
+ int index = DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX;
for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
{
indices.push_back( index );
const char* PanGestureDetector::GetDefaultPropertyName( Property::Index index ) const
{
- index -= DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT;
+ index -= DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX;
if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- return DEFAULT_PROPERTIES[ index ].name;
- }
- else
- {
- return NULL;
+ return DEFAULT_PROPERTY_DETAILS[ index ].name;
}
+
+ return NULL;
}
Property::Index PanGestureDetector::GetDefaultPropertyIndex(const std::string& name) const
// Look for name in default properties
for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- const Internal::PropertyDetails* property = &DEFAULT_PROPERTIES[ i ];
+ const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
{
index = i;
bool PanGestureDetector::IsDefaultPropertyWritable(Property::Index index) const
{
// None of our properties should be writable through the Public API
- return false;
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX ].writable;
}
bool PanGestureDetector::IsDefaultPropertyAnimatable(Property::Index index) const
{
// None of our properties are animatable
- return false;
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX ].animatable;
}
bool PanGestureDetector::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
// All our properties can be used as an input to a constraint.
- return true;
+ return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX ].constraintInput;
}
Property::Type PanGestureDetector::GetDefaultPropertyType(Property::Index index) const
{
- index -= DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT;
+ index -= DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX;
if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
{
- return DEFAULT_PROPERTIES[ index ].type;
+ return DEFAULT_PROPERTY_DETAILS[ index ].type;
}
else
{
switch ( index )
{
- case Dali::PanGestureDetector::SCREEN_POSITION:
+ case Dali::PanGestureDetector::Property::ScreenPosition:
{
if(mSceneObject)
{
break;
}
- case Dali::PanGestureDetector::SCREEN_DISPLACEMENT:
+ case Dali::PanGestureDetector::Property::ScreenDisplacement:
{
if(mSceneObject)
{
break;
}
- case Dali::PanGestureDetector::SCREEN_VELOCITY:
+ case Dali::PanGestureDetector::Property::ScreenVelocity:
{
if(mSceneObject)
{
break;
}
- case Dali::PanGestureDetector::LOCAL_POSITION:
+ case Dali::PanGestureDetector::Property::LocalPosition:
{
if(mSceneObject)
{
break;
}
- case Dali::PanGestureDetector::LOCAL_DISPLACEMENT:
+ case Dali::PanGestureDetector::Property::LocalDisplacement:
{
if(mSceneObject)
{
break;
}
- case Dali::PanGestureDetector::LOCAL_VELOCITY:
+ case Dali::PanGestureDetector::Property::LocalVelocity:
{
if(mSceneObject)
{
break;
}
- case Dali::PanGestureDetector::PANNING:
+ case Dali::PanGestureDetector::Property::Panning:
{
if(mSceneObject)
{
{
switch ( index )
{
- case Dali::PanGestureDetector::SCREEN_POSITION:
+ case Dali::PanGestureDetector::Property::ScreenPosition:
{
property = &mSceneObject->GetScreenPositionProperty();
break;
}
- case Dali::PanGestureDetector::SCREEN_DISPLACEMENT:
+ case Dali::PanGestureDetector::Property::ScreenDisplacement:
{
property = &mSceneObject->GetScreenDisplacementProperty();
break;
}
- case Dali::PanGestureDetector::SCREEN_VELOCITY:
+ case Dali::PanGestureDetector::Property::ScreenVelocity:
{
property = &mSceneObject->GetScreenVelocityProperty();
break;
}
- case Dali::PanGestureDetector::LOCAL_POSITION:
+ case Dali::PanGestureDetector::Property::LocalPosition:
{
property = &mSceneObject->GetLocalPositionProperty();
break;
}
- case Dali::PanGestureDetector::LOCAL_DISPLACEMENT:
+ case Dali::PanGestureDetector::Property::LocalDisplacement:
{
property = &mSceneObject->GetLocalDisplacementProperty();
break;
}
- case Dali::PanGestureDetector::LOCAL_VELOCITY:
+ case Dali::PanGestureDetector::Property::LocalVelocity:
{
property = &mSceneObject->GetLocalVelocityProperty();
break;
}
- case Dali::PanGestureDetector::PANNING:
+ case Dali::PanGestureDetector::Property::Panning:
{
property = &mSceneObject->GetPanningProperty();
break;
*
*/
-#include <dali/internal/event/common/property-index-ranges.h>
+// CLASS HEADER
+#include <dali/internal/event/modeling/animatable-mesh-impl.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/modeling/animatable-mesh-impl.h>
-#include <dali/internal/event/modeling/mesh-impl.h>
#include <dali/internal/event/modeling/material-impl.h>
+#include <dali/internal/event/modeling/mesh-impl.h>
#include <dali/internal/update/manager/update-manager.h>
#include <dali/internal/update/modeling/scene-graph-animatable-mesh.h>
namespace Dali
{
-const Property::Index AnimatableVertex::POSITION = 0;
-const Property::Index AnimatableVertex::COLOR = 1;
-const Property::Index AnimatableVertex::TEXTURE_COORDS = 2;
-
namespace Internal
{
namespace
{
-const PropertyDetails DEFAULT_PROPERTY_DETAILS[] =
-{
- // Name Type writable animatable constraint-input
- { "position", Property::VECTOR3, true, true, true }, // POSITION
- { "vertex-color", Property::VECTOR4, true, true, true }, // COLOR
- { "texture-coords", Property::VECTOR2, true, true, true }, // TEXTURE_COORDS
-};
+// Properties
-const int VERTEX_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( DEFAULT_PROPERTY_DETAILS[0] );
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "position", VECTOR3, true, true, true, Dali::AnimatableVertex::Property::Position )
+DALI_PROPERTY( "vertex-color", VECTOR4, true, true, true, Dali::AnimatableVertex::Property::Color )
+DALI_PROPERTY( "texture-coords", VECTOR2, true, true, true, Dali::AnimatableVertex::Property::TextureCoords )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX )
} // namespace
mSceneObject( sceneObject ),
mMesh( mesh ),
mNumberOfVertices( numberOfVertices ),
- mPropertyCount( numberOfVertices * VERTEX_PROPERTY_COUNT )
+ mPropertyCount( numberOfVertices * DEFAULT_PROPERTY_COUNT )
{
// Transfer animatable ownership to a scene message
AddAnimatableMeshMessage( mUpdateManager, *mSceneObject );
}
-
AnimatableMeshPtr AnimatableMesh::New(
unsigned int numVertices,
const Dali::AnimatableMesh::Faces& faceIndices )
return New( numVertices, faceIndices, material, false );
}
-
AnimatableMeshPtr AnimatableMesh::New(
unsigned int numVertices,
const Dali::AnimatableMesh::Faces& faceIndices,
return animatableMeshPtr;
}
-
AnimatableMesh::~AnimatableMesh()
{
// Guard to allow handle destruction after Core has been destroyed
unsigned int vertex,
Property::Index property ) const
{
- DALI_ASSERT_DEBUG(property < VERTEX_PROPERTY_COUNT );
- return ( vertex * VERTEX_PROPERTY_COUNT ) + property;
+ DALI_ASSERT_DEBUG(property < DEFAULT_PROPERTY_COUNT );
+ return ( vertex * DEFAULT_PROPERTY_COUNT ) + property;
}
void AnimatableMesh::SetPosition( unsigned int vertexIndex, const Vector3& position)
{
if ( ( index >= 0 ) && ( index < mPropertyCount ) )
{
- return DEFAULT_PROPERTY_DETAILS[index % VERTEX_PROPERTY_COUNT].name;
+ return DEFAULT_PROPERTY_DETAILS[index % DEFAULT_PROPERTY_COUNT].name;
}
else
{
Property::Index index = Property::INVALID_INDEX;
// Look for name in default properties
- for( int i = 0; i < VERTEX_PROPERTY_COUNT; ++i )
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
bool AnimatableMesh::IsDefaultPropertyWritable(Property::Index index) const
{
- return DEFAULT_PROPERTY_DETAILS[ index % VERTEX_PROPERTY_COUNT ].writable;
+ return DEFAULT_PROPERTY_DETAILS[ index % DEFAULT_PROPERTY_COUNT ].writable;
}
bool AnimatableMesh::IsDefaultPropertyAnimatable(Property::Index index) const
{
- return DEFAULT_PROPERTY_DETAILS[ index % VERTEX_PROPERTY_COUNT ].animatable;
+ return DEFAULT_PROPERTY_DETAILS[ index % DEFAULT_PROPERTY_COUNT ].animatable;
}
bool AnimatableMesh::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- return DEFAULT_PROPERTY_DETAILS[ index % VERTEX_PROPERTY_COUNT ].constraintInput;
+ return DEFAULT_PROPERTY_DETAILS[ index % DEFAULT_PROPERTY_COUNT ].constraintInput;
}
Property::Type AnimatableMesh::GetDefaultPropertyType(Property::Index index) const
{
if ( ( index >= 0 ) && ( index < mPropertyCount ) )
{
- return DEFAULT_PROPERTY_DETAILS[ index % VERTEX_PROPERTY_COUNT ].type;
- }
- else
- {
- // Index out-of-bounds
- return Property::NONE;
+ return DEFAULT_PROPERTY_DETAILS[ index % DEFAULT_PROPERTY_COUNT ].type;
}
+
+ // Index out-of-bounds
+ return Property::NONE;
}
void AnimatableMesh::SetDefaultProperty( Property::Index index, const Property::Value& property )
{
DALI_ASSERT_ALWAYS( ( index < mPropertyCount ) && "Property index out of bounds" );
- int vertexProperty = index % VERTEX_PROPERTY_COUNT;
- int vertexIndex = index / VERTEX_PROPERTY_COUNT;
+ int vertexProperty = index % DEFAULT_PROPERTY_COUNT;
+ int vertexIndex = index / DEFAULT_PROPERTY_COUNT;
switch ( vertexProperty )
{
- case Dali::AnimatableVertex::POSITION:
+ case Dali::AnimatableVertex::Property::Position:
{
SetPosition( vertexIndex, property.Get<Vector3>() );
break;
}
- case Dali::AnimatableVertex::COLOR:
+ case Dali::AnimatableVertex::Property::Color:
{
SetColor( vertexIndex, property.Get<Vector4>() );
break;
}
- case Dali::AnimatableVertex::TEXTURE_COORDS:
+ case Dali::AnimatableVertex::Property::TextureCoords:
{
SetTextureCoords( vertexIndex, property.Get<Vector2>() );
break;
Property::Value AnimatableMesh::GetDefaultProperty(Property::Index index) const
{
Property::Value value;
- int vertexProperty = index % VERTEX_PROPERTY_COUNT;
- int vertexIndex = index / VERTEX_PROPERTY_COUNT;
+ int vertexProperty = index % DEFAULT_PROPERTY_COUNT;
+ int vertexIndex = index / DEFAULT_PROPERTY_COUNT;
switch ( vertexProperty )
{
- case Dali::AnimatableVertex::POSITION:
+ case Dali::AnimatableVertex::Property::Position:
{
value = GetCurrentPosition(vertexIndex);
break;
}
- case Dali::AnimatableVertex::COLOR:
+ case Dali::AnimatableVertex::Property::Color:
{
value = GetCurrentColor(vertexIndex);
break;
}
- case Dali::AnimatableVertex::TEXTURE_COORDS:
+ case Dali::AnimatableVertex::Property::TextureCoords:
{
value = GetCurrentTextureCoords(vertexIndex);
break;
// This method should only return a property which is part of the scene-graph
if( mSceneObject != NULL )
{
- int vertexProperty = index % VERTEX_PROPERTY_COUNT;
- int vertexIndex = index / VERTEX_PROPERTY_COUNT;
+ int vertexProperty = index % DEFAULT_PROPERTY_COUNT;
+ int vertexIndex = index / DEFAULT_PROPERTY_COUNT;
switch ( vertexProperty )
{
- case Dali::AnimatableVertex::POSITION:
+ case Dali::AnimatableVertex::Property::Position:
property = &mSceneObject->mVertices[vertexIndex].position;
break;
- case Dali::AnimatableVertex::COLOR:
+ case Dali::AnimatableVertex::Property::Color:
property = &mSceneObject->mVertices[vertexIndex].color;
break;
- case Dali::AnimatableVertex::TEXTURE_COORDS:
+ case Dali::AnimatableVertex::Property::TextureCoords:
property = &mSceneObject->mVertices[vertexIndex].textureCoords;
break;
}
const PropertyInputImpl* property( NULL );
if( mSceneObject != NULL )
{
- int vertexProperty = index % VERTEX_PROPERTY_COUNT;
- int vertexIndex = index / VERTEX_PROPERTY_COUNT;
+ int vertexProperty = index % DEFAULT_PROPERTY_COUNT;
+ int vertexIndex = index / DEFAULT_PROPERTY_COUNT;
switch ( vertexProperty )
{
- case Dali::AnimatableVertex::POSITION:
+ case Dali::AnimatableVertex::Property::Position:
property = &mSceneObject->mVertices[vertexIndex].position;
break;
- case Dali::AnimatableVertex::COLOR:
+ case Dali::AnimatableVertex::Property::Color:
property = &mSceneObject->mVertices[vertexIndex].color;
break;
- case Dali::AnimatableVertex::TEXTURE_COORDS:
+ case Dali::AnimatableVertex::Property::TextureCoords:
property = &mSceneObject->mVertices[vertexIndex].textureCoords;
break;
}
#include <dali/internal/common/event-to-update.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/actors/camera-actor-impl.h>
+#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/images/frame-buffer-image-impl.h>
-#include <dali/internal/update/render-tasks/scene-graph-render-task.h>
#include <dali/internal/update/nodes/node.h>
+#include <dali/internal/update/render-tasks/scene-graph-render-task.h>
#if defined(DEBUG_ENABLED)
namespace
namespace Dali
{
-const Property::Index RenderTask::VIEWPORT_POSITION = 0;
-const Property::Index RenderTask::VIEWPORT_SIZE = 1;
-const Property::Index RenderTask::CLEAR_COLOR = 2;
-
namespace Internal
{
namespace // For internal properties
{
+// Properties
+
+// Name Type writable animatable constraint-input enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "viewport-position", VECTOR2, true, true, true, Dali::RenderTask::Property::ViewportPosition )
+DALI_PROPERTY( "viewport-size", VECTOR2, true, true, true, Dali::RenderTask::Property::ViewportSize )
+DALI_PROPERTY( "clear-color", VECTOR4, true, true, true, Dali::RenderTask::Property::ClearColor )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX )
+
// Signals
const char* const SIGNAL_FINISHED = "finished";
SignalConnectorType signalConnector1( mType, SIGNAL_FINISHED, &RenderTask::DoConnectSignal );
-const char* DEFAULT_PROPERTY_NAMES[] =
-{
- "viewport-position",
- "viewport-size",
- "clear-color"
-};
-const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_NAMES ) / sizeof( DEFAULT_PROPERTY_NAMES[0]);
-
-const Property::Type DEFAULT_PROPERTY_TYPES[DEFAULT_PROPERTY_COUNT] =
-{
- Property::VECTOR2, // viewport-position
- Property::VECTOR2, // viewport-size
- Property::VECTOR4, // clear-color
-};
-
-}// unnamed namespace
+} // Unnamed namespace
RenderTask* RenderTask::New( bool isSystemLevel )
{
}
/********************************************************************************
- ********************************************************************************
******************************** PROPERTY METHODS **************************
- ********************************************************************************
********************************************************************************/
unsigned int RenderTask::GetDefaultPropertyCount() const
{
if( index < DEFAULT_PROPERTY_COUNT )
{
- return DEFAULT_PROPERTY_NAMES[index];
+ return DEFAULT_PROPERTY_DETAILS[index].name;
}
else
{
// Look for name in default properties
for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_NAMES[ i ] ) ) // dont want to convert rhs to string
+ if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // dont want to convert rhs to string
{
index = i;
break;
bool RenderTask::IsDefaultPropertyWritable(Property::Index index) const
{
- return true; // all properties writable
+ return DEFAULT_PROPERTY_DETAILS[ index ].writable;
}
bool RenderTask::IsDefaultPropertyAnimatable(Property::Index index) const
{
- return true; // all properties animatable
+ return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
}
bool RenderTask::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- return true; // all properties can be used as constraint input
+ return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
}
Property::Type RenderTask::GetDefaultPropertyType(Property::Index index) const
{
if( index < DEFAULT_PROPERTY_COUNT )
{
- return DEFAULT_PROPERTY_TYPES[index];
- }
- else
- {
- // index out of range...return Property::NONE
- return Property::NONE;
+ return DEFAULT_PROPERTY_DETAILS[index].type;
}
+
+ // index out of range...return Property::NONE
+ return Property::NONE;
}
void RenderTask::SetDefaultProperty( Property::Index index, const Property::Value& property )
{
switch ( index )
{
- case Dali::RenderTask::VIEWPORT_POSITION:
+ case Dali::RenderTask::Property::ViewportPosition:
{
SetViewportPosition( property.Get<Vector2>() );
break;
}
- case Dali::RenderTask::VIEWPORT_SIZE:
+ case Dali::RenderTask::Property::ViewportSize:
{
SetViewportSize( property.Get<Vector2>() );
break;
}
- case Dali::RenderTask::CLEAR_COLOR:
+ case Dali::RenderTask::Property::ClearColor:
{
SetClearColor( property.Get<Vector4>() );
break;
switch ( index )
{
- case Dali::RenderTask::VIEWPORT_POSITION:
+ case Dali::RenderTask::Property::ViewportPosition:
{
value = GetCurrentViewportPosition();
break;
}
- case Dali::RenderTask::VIEWPORT_SIZE:
+ case Dali::RenderTask::Property::ViewportSize:
{
value = GetCurrentViewportSize();
break;
}
- case Dali::RenderTask::CLEAR_COLOR:
+ case Dali::RenderTask::Property::ClearColor:
{
value = GetClearColor();
break;
{
switch ( index )
{
- case Dali::RenderTask::VIEWPORT_POSITION:
+ case Dali::RenderTask::Property::ViewportPosition:
property = &mSceneObject->mViewportPosition;
break;
- case Dali::RenderTask::VIEWPORT_SIZE:
+ case Dali::RenderTask::Property::ViewportSize:
property = &mSceneObject->mViewportSize;
break;
- case Dali::RenderTask::CLEAR_COLOR:
+ case Dali::RenderTask::Property::ClearColor:
property = &mSceneObject->mClearColor;
break;
{
switch ( index )
{
- case Dali::RenderTask::VIEWPORT_POSITION:
+ case Dali::RenderTask::Property::ViewportPosition:
property = &mSceneObject->mViewportPosition;
break;
- case Dali::RenderTask::VIEWPORT_SIZE:
+ case Dali::RenderTask::Property::ViewportSize:
property = &mSceneObject->mViewportSize;
break;
- case Dali::RenderTask::CLEAR_COLOR:
+ case Dali::RenderTask::Property::ClearColor:
property = &mSceneObject->mViewportSize;
break;
#include <dali/integration-api/debug.h>
-
namespace Dali
{
#include <dali/public-api/actors/actor-enumerations.h>
#include <dali/public-api/actors/draw-mode.h>
#include <dali/public-api/object/handle.h>
+#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/signals/dali-signal.h>
namespace Dali
typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for Dali::ActorContainer
-
/**
* @brief Actor is the primary object with which Dali applications interact.
*
{
public:
+ /**
+ * @brief An enumeration of properties belonging to the Actor class.
+ */
+ struct Property
+ {
+ enum
+ {
+ ParentOrigin = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< name "parent-origin", type Vector3
+ ParentOriginX, ///< name "parent-origin-x", type Float
+ ParentOriginY, ///< name "parent-origin-y", type Float
+ ParentOriginZ, ///< name "parent-origin-z", type Float
+ AnchorPoint, ///< name "anchor-point", type Vector3
+ AnchorPointX, ///< name "anchor-point-x", type Float
+ AnchorPointY, ///< name "anchor-point-y", type Float
+ AnchorPointZ, ///< name "anchor-point-z", type Float
+ Size, ///< name "size", type Vector3
+ SizeWidth, ///< name "size-width", type Float
+ SizeHeight, ///< name "size-height", type Float
+ SizeDepth, ///< name "size-depth", type Float
+ Position, ///< name "position", type Vector3
+ PositionX, ///< name "position-x", type Float
+ PositionY, ///< name "position-y", type Float
+ PositionZ, ///< name "position-z", type Float
+ WorldPosition, ///< name "world-position", type Vector3 (read-only)
+ WorldPositionX, ///< name "world-position-x", type Float (read-only)
+ WorldPositionY, ///< name "world-position-y", type Float (read-only)
+ WorldPositionZ, ///< name "world-position-z", type Float (read-only)
+ Rotation, ///< name "rotation", type Rotation
+ WorldRotation, ///< name "world-rotation", type Rotation (read-only)
+ Scale, ///< name "scale", type Vector3
+ ScaleX, ///< name "scale-x", type Float
+ ScaleY, ///< name "scale-y", type Float
+ ScaleZ, ///< name "scale-z", type Float
+ WorldScale, ///< name "world-scale", type Vector3 (read-only)
+ Visible, ///< name "visible", type Boolean
+ Color, ///< name "color", type Vector4
+ ColorRed, ///< name "color-red", type Float
+ ColorGreen, ///< name "color-green", type Float
+ ColorBlue, ///< name "color-blue", type Float
+ ColorAlpha, ///< name "color-alpha", type Float
+ WorldColor, ///< name "world-color", type Vector4 (read-only)
+ WorldMatrix, ///< name "world-matrix", type Matrix (read-only)
+ Name, ///< name "name", type String
+ Sensitive, ///< name "sensitive", type Boolean
+ LeaveRequired, ///< name "leave-required", type Boolean
+ InheritRotation, ///< name "inherit-rotation", type Boolean
+ InheritScale, ///< name "inherit-scale", type Boolean
+ ColorMode, ///< name "color-mode", type String
+ PositionInheritance, ///< name "position-inheritance", type String
+ DrawMode, ///< name "draw-mode", type String
+ SizeMode, ///< name "size-mode", type String
+ SizeModeFactor, ///< name "size-mode-factor", type Vector3
+ };
+ };
+
// Typedefs
- typedef Signal< bool (Actor, const TouchEvent&)> TouchSignalType; ///< Touch signal type
- typedef Signal< bool (Actor, const HoverEvent&)> HoverSignalType; ///< Hover signal type
- typedef Signal< bool (Actor, const MouseWheelEvent&) > MouseWheelEventSignalType;///< Mousewheel signal type
+
+ typedef Signal< bool (Actor, const TouchEvent&)> TouchSignalType; ///< Touch signal type
+ typedef Signal< bool (Actor, const HoverEvent&)> HoverSignalType; ///< Hover signal type
+ typedef Signal< bool (Actor, const MouseWheelEvent&) > MouseWheelEventSignalType; ///< Mousewheel signal type
typedef Signal< void (Actor) > OnStageSignalType; ///< Stage connection signal type
typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type
- /// @name Properties
- /** @{ */
- static const Property::Index PARENT_ORIGIN; ///< name "parent-origin", type VECTOR3
- static const Property::Index PARENT_ORIGIN_X; ///< name "parent-origin-x", type FLOAT
- static const Property::Index PARENT_ORIGIN_Y; ///< name "parent-origin-y", type FLOAT
- static const Property::Index PARENT_ORIGIN_Z; ///< name "parent-origin-z", type FLOAT
- static const Property::Index ANCHOR_POINT; ///< name "anchor-point", type VECTOR3
- static const Property::Index ANCHOR_POINT_X; ///< name "anchor-point-x", type FLOAT
- static const Property::Index ANCHOR_POINT_Y; ///< name "anchor-point-y", type FLOAT
- static const Property::Index ANCHOR_POINT_Z; ///< name "anchor-point-z", type FLOAT
- static const Property::Index SIZE; ///< name "size", type VECTOR3
- static const Property::Index SIZE_WIDTH; ///< name "size-width", type FLOAT
- static const Property::Index SIZE_HEIGHT; ///< name "size-height", type FLOAT
- static const Property::Index SIZE_DEPTH; ///< name "size-depth", type FLOAT
- static const Property::Index POSITION; ///< name "position", type VECTOR3
- static const Property::Index POSITION_X; ///< name "position-x", type FLOAT
- static const Property::Index POSITION_Y; ///< name "position-y", type FLOAT
- static const Property::Index POSITION_Z; ///< name "position-z", type FLOAT
- static const Property::Index WORLD_POSITION; ///< name "world-position", type VECTOR3 (read-only)
- static const Property::Index WORLD_POSITION_X; ///< name "world-position-x", type FLOAT (read-only)
- static const Property::Index WORLD_POSITION_Y; ///< name "world-position-y", type FLOAT (read-only)
- static const Property::Index WORLD_POSITION_Z; ///< name "world-position-z", type FLOAT (read-only)
- static const Property::Index ROTATION; ///< name "rotation", type ROTATION
- static const Property::Index WORLD_ROTATION; ///< name "world-rotation", type ROTATION (read-only)
- static const Property::Index SCALE; ///< name "scale", type VECTOR3
- static const Property::Index SCALE_X; ///< name "scale-x", type FLOAT
- static const Property::Index SCALE_Y; ///< name "scale-y", type FLOAT
- static const Property::Index SCALE_Z; ///< name "scale-z", type FLOAT
- static const Property::Index WORLD_SCALE; ///< name "world-scale", type VECTOR3 (read-only)
- static const Property::Index VISIBLE; ///< name "visible", type BOOLEAN
- static const Property::Index COLOR; ///< name "color", type VECTOR4
- static const Property::Index COLOR_RED; ///< name "color-red", type FLOAT
- static const Property::Index COLOR_GREEN; ///< name "color-green", type FLOAT
- static const Property::Index COLOR_BLUE; ///< name "color-blue", type FLOAT
- static const Property::Index COLOR_ALPHA; ///< name "color-alpha", type FLOAT
- static const Property::Index WORLD_COLOR; ///< name "world-color", type VECTOR4 (read-only)
- static const Property::Index WORLD_MATRIX; ///< name "world-matrix", type MATRIX (read-only)
- static const Property::Index NAME; ///< name "name", type STRING
- static const Property::Index SENSITIVE; ///< name "sensitive", type BOOLEAN
- static const Property::Index LEAVE_REQUIRED; ///< name "leave-required", type BOOLEAN
- static const Property::Index INHERIT_ROTATION; ///< name "inherit-rotation", type BOOLEAN
- static const Property::Index INHERIT_SCALE; ///< name "inherit-scale", type BOOLEAN
- static const Property::Index COLOR_MODE; ///< name "color-mode", type STRING
- static const Property::Index POSITION_INHERITANCE; ///< name "position-inheritance", type STRING
- static const Property::Index DRAW_MODE; ///< name "draw-mode", type STRING
- static const Property::Index SIZE_MODE; ///< name "size-mode", type STRING
- static const Property::Index SIZE_MODE_FACTOR; ///< name "size-mode-factor", type VECTOR3
- /** @} */
-
// Creation
/**
{
public:
- // Default Properties; additional to Actor properties
- static const Property::Index TYPE; ///< Property::STRING, // "type" // Not animatable
- static const Property::Index PROJECTION_MODE; ///< Property::STRING, // "projection-mode" // Not animatable
- static const Property::Index FIELD_OF_VIEW; ///< Property::FLOAT, // "field-of-view" // Not animatable
- static const Property::Index ASPECT_RATIO; ///< Property::FLOAT, // "aspect-ratio" // Not animatable
- static const Property::Index NEAR_PLANE_DISTANCE; ///< Property::FLOAT, // "near-plane-distance" // Not animatable
- static const Property::Index FAR_PLANE_DISTANCE; ///< Property::FLOAT, // "far-plane-distance" // Not animatable
- static const Property::Index LEFT_PLANE_DISTANCE; ///< Property::FLOAT, // "left-plane-distance" // Not animatable
- static const Property::Index RIGHT_PLANE_DISTANCE; ///< Property::FLOAT, // "right-plane-distance" // Not animatable
- static const Property::Index TOP_PLANE_DISTANCE; ///< Property::FLOAT, // "top-plane-distance" // Not animatable
- static const Property::Index BOTTOM_PLANE_DISTANCE; ///< Property::FLOAT, // "bottom-plane-distance" // Not animatable
- static const Property::Index TARGET_POSITION; ///< Property::VECTOR3, // "target-position" // Not animatable
- static const Property::Index PROJECTION_MATRIX; ///< Property::MATRIX, // "projection-matrix" // Constraint input, not animatable
- static const Property::Index VIEW_MATRIX; ///< Property::MATRIX, // "view-matrix" // Constraint input, not animatable
- static const Property::Index INVERT_Y_AXIS; ///< Property::BOOLEAN, // "invert-y-axis" // Not animatable
+ /**
+ * @brief An enumeration of properties belonging to the CameraActor class.
+ * Properties additional to Actor.
+ */
+ struct Property
+ {
+ enum
+ {
+ Type = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "type", type String
+ ProjectionMode, ///< name "projection-mode", type String
+ FieldOfView, ///< name "field-of-view", type Float
+ AspectRatio, ///< name "aspect-ratio", type Float
+ NearPlaneDistance, ///< name "near-plane-distance", type Float
+ FarPlaneDistance, ///< name "far-plane-distance", type Float
+ LeftPlaneDistance, ///< name "left-plane-distance", type Float
+ RightPlaneDistance, ///< name "right-plane-distance", type Float
+ TopPlaneDistance, ///< name "top-plane-distance", type Float
+ BottomPlaneDistance, ///< name "bottom-plane-distance", type Float
+ TargetPosition, ///< name "target-position", type Vector3
+ ProjectionMatrix, ///< name "projection-matrix", type Matrix
+ ViewMatrix, ///< name "view-matrix", type Matrix
+ InvertYAxis, ///< name "invert-y-axis", type Boolean
+ };
+ };
/**
* @brief Create an uninitialized CameraActor handle.
{
public:
- // Default Properties additional to RenderableActor
- static const Property::Index PIXEL_AREA; ///< name "pixel-area", type RECTANGLE
- static const Property::Index STYLE; ///< name "style", type STRING
- static const Property::Index BORDER; ///< name "border", type VECTOR4
- static const Property::Index IMAGE; ///< name "image", type MAP {"filename":"", "load-policy":...}
+ /**
+ * @brief An enumeration of properties belonging to the ImageActor class.
+ * Properties additional to RenderableActor.
+ */
+ struct Property
+ {
+ enum
+ {
+ PixelArea = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "pixel-area", type RECTANGLE
+ Style, ///< name "style", type STRING
+ Border, ///< name "border", type VECTOR4
+ Image, ///< name "image", type MAP {"filename":"", "load-policy":...}
+ };
+ };
/**
* @brief Style determines how the Image is rendered.
{
public:
- // Default Properties additional to Actor
- static const Property::Index CLIPPING_ENABLE; ///< name "clipping-enable", type BOOLEAN
- static const Property::Index CLIPPING_BOX; ///< name "clipping-box", type RECTANGLE
+ /**
+ * @brief An enumeration of properties belonging to the Layer class.
+ * Properties additional to Actor.
+ */
+ struct Property
+ {
+ enum
+ {
+ ClippingEnable = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "clipping-enable", type Boolean
+ ClippingBox, ///< name "clipping-box", type Rectangle
+ };
+ };
/**
* @brief The sort function type.
{
public:
- typedef Signal< void (TextActor) > TextSignalType; ///< Text available signal type
+ /**
+ * @brief An enumeration of properties belonging to the TextActor class.
+ * Properties additional to RenderableActor.
+ */
+ struct Property
+ {
+ enum
+ {
+ Text = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "text" type String
+ Font, ///< name "font" type String
+ FontStyle, ///< name "font-style" type String
+ OutlineEnable, ///< name "outline-enable" type Boolean
+ OutlineColor, ///< name "outline-color" type Vector4
+ OutlineThicknessWidth, ///< name "outline-thickness-width" type Vector2
+ SmoothEdge, ///< name "smooth-edge" type Float
+ GlowEnable, ///< name "glow-enable" type Boolean
+ GlowColor, ///< name "glow-color" type Vector4
+ GlowIntensity, ///< name "glow-intensity" type Float
+ ShadowEnable, ///< name "shadow-enable" type Boolean
+ ShadowColor, ///< name "shadow-color" type Vector4
+ ShadowOffset, ///< name "shadow-offset" type Vector2
+ ItalicsAngle, ///< name "italics-angle" type Float
+ Underline, ///< name "underline" type Boolean
+ Weight, ///< name "weight" type Integer
+ FontDetectionAutomatic, ///< name "font-detection-automatic" type Boolean
+ GradientColor, ///< name "gradient-color" type Vector4
+ GradientStartPoint, ///< name "gradient-start-point" type Vector2
+ GradientEndPoint, ///< name "gradient-end-point" type Vector2
+ ShadowSize, ///< name "shadow-size" type Float
+ TextColor, ///< name "text-color" type Vector4
+ };
+ };
- // Default Properties; additional to RenderableActor properties
- static const Property::Index TEXT; ///< name "text" type STRING
- static const Property::Index FONT; ///< name "font" type STRING
- static const Property::Index FONT_STYLE; ///< name "font-style" type STRING
- static const Property::Index OUTLINE_ENABLE; ///< name "outline-enable" type BOOLEAN
- static const Property::Index OUTLINE_COLOR; ///< name "outline-color" type VECTOR4
- static const Property::Index OUTLINE_THICKNESS_WIDTH; ///< name "outline-thickness-width" type VECTOR2
- static const Property::Index SMOOTH_EDGE; ///< name "smooth-edge" type FLOAT
- static const Property::Index GLOW_ENABLE; ///< name "glow-enable" type BOOLEAN
- static const Property::Index GLOW_COLOR; ///< name "glow-color" type VECTOR4
- static const Property::Index GLOW_INTENSITY; ///< name "glow-intensity" type FLOAT
- static const Property::Index SHADOW_ENABLE; ///< name "shadow-enable" type BOOLEAN
- static const Property::Index SHADOW_COLOR; ///< name "shadow-color" type VECTOR4
- static const Property::Index SHADOW_OFFSET; ///< name "shadow-offset" type VECTOR2
- static const Property::Index ITALICS_ANGLE; ///< name "italics-angle" type FLOAT
- static const Property::Index UNDERLINE; ///< name "underline" type BOOLEAN
- static const Property::Index WEIGHT; ///< name "weight" type INTEGER
- static const Property::Index FONT_DETECTION_AUTOMATIC; ///< name "font-detection-automatic" type BOOLEAN
- static const Property::Index GRADIENT_COLOR; ///< name "gradient-color" type VECTOR4
- static const Property::Index GRADIENT_START_POINT; ///< name "gradient-start-point" type VECTOR2
- static const Property::Index GRADIENT_END_POINT; ///< name "gradient-end-point" type VECTOR2
- static const Property::Index SHADOW_SIZE; ///< name "shadow-size" type FLOAT
- static const Property::Index TEXT_COLOR; ///< name "text-color" type VECTOR4
+ typedef Signal< void (TextActor) > TextSignalType; ///< Text available signal type
/**
* @brief Create an uninitialized TextActor handle.
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/handle.h>
#include <dali/public-api/object/property.h>
+#include <dali/public-api/object/property-index-ranges.h>
namespace Dali
{
{
public:
- // Default Properties
- static const Property::Index WEIGHT; ///< Property 0, name "weight", type FLOAT
+ /**
+ * @brief An enumeration of properties belonging to the ActiveConstraint class.
+ */
+ struct Property
+ {
+ enum
+ {
+ Weight = DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX, ///< name "weight", type FLOAT
+ };
+ };
static const float FINAL_WEIGHT; ///< 1.0f means the constraint is fully-applied, unless weight is still being animated
static const float DEFAULT_WEIGHT; ///< 1.0f
*
* @return The target property.
*/
- Property::Index GetTargetProperty();
+ Dali::Property::Index GetTargetProperty();
/**
* @brief Set the weight of the constraint; this is a value clamped between 0.
// INTERNAL INCLUDES
#include <dali/public-api/object/handle.h>
+#include <dali/public-api/object/property-index-ranges.h>
namespace Dali
{
{
public:
- static const Property::Index POINTS; ///< name "points", type ARRAY of Vector3
- static const Property::Index CONTROL_POINTS; ///< name "control-points", type ARRAY of Vector3
+ /**
+ * @brief An enumeration of properties belonging to the Path class.
+ */
+ struct Property
+ {
+ enum
+ {
+ Points = DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX, ///< name "points", type Vector3
+ ControlPoints, ///< name "control-points", type Vector3
+ };
+ };
+
/**
* @brief Create an initialized Path handle.
*
#include <dali/public-api/object/handle.h>
#include <dali/public-api/object/object-registry.h>
#include <dali/public-api/object/property-conditions.h>
-#include <dali/public-api/object/property-index.h>
+#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/property-notification-declarations.h>
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture-detector.h>
+#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/signals/dali-signal.h>
namespace Dali
{
public:
+ /**
+ * @brief An enumeration of properties belonging to the PanGestureDetector class.
+ */
+ struct Property
+ {
+ enum
+ {
+ ScreenPosition = DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX, ///< name "screen-position", type Vector2
+ ScreenDisplacement, ///< name "screen-displacement", type Vector2
+ ScreenVelocity, ///< name "screen-velocity", type Vector2
+ LocalPosition, ///< name "local-position", type Vector2
+ LocalDisplacement, ///< name "local-displacement", type Vector2
+ LocalVelocity, ///< name "local-velocity", type Vector2
+ Panning, ///< name "panning", type Boolean
+ };
+ };
+
// Typedefs
typedef Signal< void ( Actor, const PanGesture& ) > DetectedSignalType; ///< Pan gesture detected signal type
static const Radian DEFAULT_THRESHOLD; ///< The default threshold is PI * 0.25 radians (or 45 degrees).
- /// @name Properties
- /** @{ */
- static const Property::Index SCREEN_POSITION; ///< name "screen-position", type VECTOR2
- static const Property::Index SCREEN_DISPLACEMENT; ///< name "screen-displacement", type VECTOR2
- static const Property::Index SCREEN_VELOCITY; ///< name "screen-velocity", type VECTOR2
- static const Property::Index LOCAL_POSITION; ///< name "local-position", type VECTOR2
- static const Property::Index LOCAL_DISPLACEMENT; ///< name "local-displacement", type VECTOR2
- static const Property::Index LOCAL_VELOCITY; ///< name "local-velocity", type VECTOR2
- static const Property::Index PANNING; ///< name "panning", type BOOLEAN
- /** @} */
-
public: // Creation & Destruction
/**
$(public_api_src_dir)/object/handle.h \
$(public_api_src_dir)/object/object-registry.h \
$(public_api_src_dir)/object/property-conditions.h \
- $(public_api_src_dir)/object/property-index.h \
+ $(public_api_src_dir)/object/property-index-ranges.h \
$(public_api_src_dir)/object/property-input.h \
$(public_api_src_dir)/object/property-map.h \
$(public_api_src_dir)/object/property-notification-declarations.h \
void AnimatableVertex::SetPosition(const Vector3& position)
{
- mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, POSITION), Property::Value(position) );
+ mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, Property::Position), Dali::Property::Value(position) );
}
void AnimatableVertex::SetColor(const Vector4& color)
{
- mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, COLOR), Property::Value(color) );
+ mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, Property::Color), Dali::Property::Value(color) );
}
void AnimatableVertex::SetTextureCoords(const Vector2& textureCoords)
{
- mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, TEXTURE_COORDS), Property::Value(textureCoords) );
+ mMesh.SetProperty( mMesh.GetVertexPropertyIndex(mVertex, Property::TextureCoords), Dali::Property::Value(textureCoords) );
}
Vector3 AnimatableVertex::GetCurrentPosition()
{
Vector3 position;
- mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, POSITION) ).Get(position);
+ mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, Property::Position) ).Get(position);
return position;
}
Vector4 AnimatableVertex::GetCurrentColor()
{
Vector4 color;
- mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, COLOR) ).Get(color);
+ mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, Property::Color) ).Get(color);
return color;
}
Vector2 AnimatableVertex::GetCurrentTextureCoords()
{
Vector2 textureCoords;
- mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, TEXTURE_COORDS) ).Get(textureCoords);
+ mMesh.GetProperty( mMesh.GetVertexPropertyIndex(mVertex, Property::TextureCoords) ).Get(textureCoords);
return textureCoords;
}
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/object/property.h>
+#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/vector3.h>
#include <dali/public-api/math/vector4.h>
{
public:
- // Default Properties
- static const Property::Index POSITION; ///< Property 0, name prefix "position-", type VECTOR3
- static const Property::Index COLOR; ///< Property 1, name prefix "color-", type VECTOR4
- static const Property::Index TEXTURE_COORDS; ///< Property 2, name prefix "texture-coords-", type VECTOR2
+ /**
+ * @brief An enumeration of properties belonging to the AnimatableVertex class.
+ * Note: These are used by animatable mesh also.
+ */
+ struct Property
+ {
+ enum
+ {
+ Position = DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX, ///< name prefix "position-", type VECTOR3
+ Color, ///< name prefix "color-", type VECTOR4
+ TextureCoords, ///< name prefix "texture-coords-", type VECTOR2
+ };
+ };
/**
* @brief Destructor
#include <dali/public-api/animation/active-constraint.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/object/property-conditions.h>
-#include <dali/public-api/object/property-index.h>
#include <dali/public-api/object/property-notification.h>
#include <dali/internal/event/animation/constraint-impl.h>
#include <dali/internal/event/common/object-impl.h>
--- /dev/null
+#ifndef __DALI_PROPERTY_INDEX_RANGES_H__
+#define __DALI_PROPERTY_INDEX_RANGES_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/common/dali-common.h>
+
+namespace Dali
+{
+
+/**
+ * @brief These are the property index ranges.
+ *
+ * Enumerations are being used here rather than static constants so that switch statements can be
+ * used to compare property indices.
+ */
+enum PropertyRanges
+{
+ DEFAULT_ACTOR_PROPERTY_START_INDEX = 0, ///< Start index for Actor (and other base classes).
+ DEFAULT_ACTOR_PROPERTY_MAX_COUNT = 10000, ///< Actor range: 0 to 9999
+
+ DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< For non-Actor objects.
+
+ DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX = DEFAULT_ACTOR_PROPERTY_START_INDEX + DEFAULT_ACTOR_PROPERTY_MAX_COUNT, ///< Property start index for classes deriving directly from Actor.
+
+ DEFAULT_PROPERTY_MAX_COUNT_PER_DERIVATION = 10000, ///< Second-level and onwards derived objects should increment their start index by this.
+
+ DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< Used by PanGestureDetector.
+
+ PROPERTY_REGISTRATION_START_INDEX = 10000000, ///< The index when registering a property should start from this number.
+ DEFAULT_PROPERTY_MAX_COUNT = PROPERTY_REGISTRATION_START_INDEX, ///< Default Property Range: 0 to 9999999
+
+ PROPERTY_REGISTRATION_MAX_INDEX = 19999999, ///< The maximum index supported when registering a property
+ PROPERTY_CUSTOM_START_INDEX = 50000000, ///< The index at which custom properties start
+};
+
+} // namespace Dali
+
+#endif // __DALI_PROPERTY_INDEX_RANGES_H__
+++ /dev/null
-#ifndef __DALI_PROPERTY_INDEX_H__
-#define __DALI_PROPERTY_INDEX_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/common/dali-common.h>
-
-namespace Dali
-{
-
-/**
- * @brief These are the property index ranges.
- *
- * Enumerations are being used here rather than static constants so that switch statements can be
- * used to compare property indices.
- */
-enum
-{
- PROPERTY_REGISTRATION_START_INDEX = 10000000, ///< The index when registering a property should start from this number
- PROPERTY_REGISTRATION_MAX_INDEX = 19999999, ///< The maximum index supported when registering a property
- PROPERTY_CUSTOM_START_INDEX = 50000000, ///< The index at which custom properties start
-};
-
-} // namespace Dali
-
-#endif // __DALI_PROPERTY_INDEX_H__
// EXTERNAL INCLUDES
// INTERNAL INCLUDES
-#include <dali/public-api/object/property-index.h>
+#include <dali/public-api/object/property-index-ranges.h>
#include <dali/internal/event/common/type-registry-impl.h>
-#include <dali/internal/event/common/property-index-ranges.h>
namespace Dali
{
// INTERNAL INCLUDES
#include <dali/public-api/math/viewport.h>
#include <dali/public-api/object/handle.h>
+#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/signals/dali-signal.h>
namespace Dali
class DALI_IMPORT_API RenderTask : public Handle
{
public:
+
+ /**
+ * @brief An enumeration of properties belonging to the RenderTask class.
+ */
+ struct Property
+ {
+ enum
+ {
+ ViewportPosition = DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX, ///< name "viewport-position", type Vector2
+ ViewportSize, ///< name "viewport-size", type Vector2
+ ClearColor, ///< name "clear-color", type Vector4
+ };
+ };
+
/**
* @brief Typedef for signals sent by this class.
*/
typedef Signal< void (RenderTask& source) > RenderTaskSignalType;
- // Default Properties
- static const Property::Index VIEWPORT_POSITION; ///< Property 0, name "viewport-position", type VECTOR2
- static const Property::Index VIEWPORT_SIZE; ///< Property 1, name "viewport-size", type VECTOR2
- static const Property::Index CLEAR_COLOR; ///< Property 2, name "clear-color", type VECTOR4
-
/**
* @brief A pointer to a function for converting screen to frame-buffer coordinates.
* @param[in,out] coordinates The screen coordinates to convert where (0,0) is the top-left of the screen.
}
/**
+ * @brief Chooses the appropriate string for the provided enumeration from the given table.
+ * This is an optimised version that handles enumerations that start at 0 and are linear only.
+ *
+ * @param[in] value The enumeration.
+ * @param[in] table A pointer to an array with the enumeration to string equivalents.
+ * @param[in] tableCount Number of items in the array.
+ *
+ * @return The equivalent enumeration for the given string. Will return NULL if the value does not exist
+ *
+ * @note The caller is NOT responsible for cleaning up the returned pointer as it is statically allocated.
+ */
+template< typename T >
+const char * GetLinearEnumerationName( T value, const StringEnum< T >* table, unsigned int tableCount )
+{
+ if ( value < 0 || value >= (int)tableCount )
+ {
+ return NULL;
+ }
+
+ return table[value].string;
+}
+
+/**
* @brief Takes a string and returns the appropriate color mode.
*
* @param[in] value The input string
// INTERNAL INCLUDES
#include <dali/public-api/animation/active-constraint-declarations.h>
#include <dali/public-api/object/handle.h>
+#include <dali/public-api/object/property-index-ranges.h>
namespace Dali
{
class DALI_IMPORT_API ShaderEffect : public Handle
{
public:
+
+ // Default Properties
+ /**
+ * @brief An enumeration of properties belonging to the Path class.
+ * Grid Density defines the spacing of vertex coordinates in world units.
+ * ie a larger actor will have more grids at the same spacing.
+ *
+ * +---+---+ +---+---+---+
+ * | | | | | | |
+ * +---+---+ +---+---+---+
+ * | | | | | | |
+ * +---+---+ +---+---+---+
+ * | | | |
+ * +---+---+---+
+ */
+ struct Property
+ {
+ enum
+ {
+ GridDensity = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< name "grid-density", type FLOAT
+ Image, ///< name "image", type MAP {"filename":"", "load-policy":...}
+ Program, ///< name "program", type MAP {"vertex-prefix":"","fragment-prefix":"","vertex":"","fragment":""}
+ GeometryHints, ///< name "geometry-hints", type INT (bitfield) values from enum GeometryHints
+ };
+ };
+
+ static const float DEFAULT_GRID_DENSITY; ///< The default density is 40 pixels
+
/**
* @brief The Extension class is a base class for objects that can be attached to the
* ShaderEffects as extensions.
virtual ~Extension();
};
- // Default Properties
- /* Grid Density defines the spacing of vertex coordinates in world units.
- * ie a larger actor will have more grids at the same spacing.
- *
- * +---+---+ +---+---+---+
- * | | | | | | |
- * +---+---+ +---+---+---+
- * | | | | | | |
- * +---+---+ +---+---+---+
- * | | | |
- * +---+---+---+
- */
- static const Property::Index GRID_DENSITY; ///< name "grid-density", type FLOAT
- static const Property::Index IMAGE; ///< name "image", type MAP; {"filename":"", "load-policy":...}
- static const Property::Index PROGRAM; ///< name "program", type MAP; {"vertex-prefix":"","fragment-prefix":"","vertex":"","fragment":""}
- static const Property::Index GEOMETRY_HINTS; ///< name "geometry-hints", type INT (bitfield) values from enum GeometryHints
-
- static const float DEFAULT_GRID_DENSITY; ///< The default density is 40 pixels
-
/**
* @brief Hints for rendering/subdividing geometry.
*/