From ee3018b578065010be4c56cacf99a294140ab120 Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Tue, 24 Feb 2015 19:33:49 +0000 Subject: [PATCH] Property refactor in dali-core: Core changes Change-Id: Idb86099961f03a47e7645cffbb9e7640109ee975 --- .../dali-internal/utc-Dali-Internal-Constraint.cpp | 14 +- .../src/dali/utc-Dali-ActiveConstraint.cpp | 20 +- automated-tests/src/dali/utc-Dali-Actor.cpp | 120 ++-- .../src/dali/utc-Dali-AnimatableMesh.cpp | 18 +- automated-tests/src/dali/utc-Dali-Animation.cpp | 708 ++++++++++----------- automated-tests/src/dali/utc-Dali-CameraActor.cpp | 216 +++---- automated-tests/src/dali/utc-Dali-Constraint.cpp | 332 +++++----- automated-tests/src/dali/utc-Dali-Handle.cpp | 270 ++++---- automated-tests/src/dali/utc-Dali-ImageActor.cpp | 16 +- automated-tests/src/dali/utc-Dali-Layer.cpp | 10 +- .../src/dali/utc-Dali-PanGestureDetector.cpp | 72 +-- .../src/dali/utc-Dali-PropertyNotification.cpp | 70 +- automated-tests/src/dali/utc-Dali-RenderTask.cpp | 10 +- automated-tests/src/dali/utc-Dali-ShaderEffect.cpp | 6 +- automated-tests/src/dali/utc-Dali-TextActor.cpp | 50 +- dali/internal/event/actors/actor-impl.cpp | 564 ++++++++-------- dali/internal/event/actors/camera-actor-impl.cpp | 208 +++--- dali/internal/event/actors/image-actor-impl.cpp | 168 +++-- dali/internal/event/actors/layer-impl.cpp | 133 ++-- dali/internal/event/actors/layer-list.cpp | 2 - dali/internal/event/actors/mesh-actor-impl.cpp | 1 - dali/internal/event/actors/text-actor-impl.cpp | 352 +++++----- .../event/animation/active-constraint-base.cpp | 59 +- dali/internal/event/animation/animation-impl.cpp | 128 ++-- dali/internal/event/animation/path-impl.cpp | 144 ++--- dali/internal/event/common/object-impl.cpp | 1 - dali/internal/event/common/object-impl.h | 14 - dali/internal/event/common/property-helper.h | 103 +++ dali/internal/event/common/property-index-ranges.h | 47 -- dali/internal/event/effects/shader-effect-impl.cpp | 65 +- .../event/events/pan-gesture-detector-impl.cpp | 83 ++- .../event/modeling/animatable-mesh-impl.cpp | 97 ++- .../event/render-tasks/render-task-impl.cpp | 79 +-- dali/internal/update/manager/update-algorithms.cpp | 1 - dali/public-api/actors/actor.h | 113 ++-- dali/public-api/actors/camera-actor.h | 39 +- dali/public-api/actors/image-actor.h | 19 +- dali/public-api/actors/layer.h | 15 +- dali/public-api/actors/text-actor.h | 57 +- dali/public-api/animation/active-constraint.h | 15 +- dali/public-api/animation/path.h | 15 +- dali/public-api/dali-core.h | 2 +- dali/public-api/events/pan-gesture-detector.h | 29 +- dali/public-api/file.list | 2 +- dali/public-api/geometry/animatable-vertex.cpp | 12 +- dali/public-api/geometry/animatable-vertex.h | 18 +- dali/public-api/object/handle.cpp | 1 - dali/public-api/object/property-index-ranges.h | 55 ++ dali/public-api/object/property-index.h | 42 -- dali/public-api/object/type-registry.cpp | 3 +- dali/public-api/render-tasks/render-task.h | 20 +- dali/public-api/scripting/scripting.h | 23 + dali/public-api/shader-effects/shader-effect.h | 48 +- 53 files changed, 2295 insertions(+), 2414 deletions(-) create mode 100644 dali/internal/event/common/property-helper.h delete mode 100644 dali/internal/event/common/property-index-ranges.h create mode 100644 dali/public-api/object/property-index-ranges.h delete mode 100644 dali/public-api/object/property-index.h diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-Constraint.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-Constraint.cpp index 983aec3..18d769b 100644 --- a/automated-tests/src/dali-internal/utc-Dali-Internal-Constraint.cpp +++ b/automated-tests/src/dali-internal/utc-Dali-Internal-Constraint.cpp @@ -54,20 +54,20 @@ int UtcDaliConstraintNewInput1OffStage(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( Actor::POSITION, - Source( sibling1, Actor::POSITION ), + Constraint constraint = Constraint::New( Actor::Property::Position, + Source( sibling1, Actor::Property::Position ), EqualToConstraint() ); actor.ApplyConstraint( constraint ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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 ); @@ -78,7 +78,7 @@ int UtcDaliConstraintNewInput1OffStage(void) application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), Vector3(2.0f, 2.0f, 2.0f)/*from SetPosition*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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 ); @@ -89,7 +89,7 @@ int UtcDaliConstraintNewInput1OffStage(void) application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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 ); diff --git a/automated-tests/src/dali/utc-Dali-ActiveConstraint.cpp b/automated-tests/src/dali/utc-Dali-ActiveConstraint.cpp index b54022f..a340ddf 100644 --- a/automated-tests/src/dali/utc-Dali-ActiveConstraint.cpp +++ b/automated-tests/src/dali/utc-Dali-ActiveConstraint.cpp @@ -59,7 +59,7 @@ int UtcDaliConstraintGetTargetObject(void) // Apply a constraint to an actor - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); Actor actor = Actor::New(); @@ -90,7 +90,7 @@ int UtcDaliConstraintGetTargetProperty(void) // Apply a constraint to an actor - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); Actor actor = Actor::New(); @@ -100,7 +100,7 @@ int UtcDaliConstraintGetTargetProperty(void) Property::Index index = active.GetTargetProperty(); - DALI_TEST_CHECK( Actor::SIZE == index ); + DALI_TEST_CHECK( Actor::Property::Size == index ); END_TEST; } @@ -110,7 +110,7 @@ int UtcDaliConstraintSetWeight(void) // Apply a constraint to an actor - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); Actor actor = Actor::New(); Stage::GetCurrent().Add( actor ); @@ -158,7 +158,7 @@ int UtcDaliConstraintGetCurrentWeight(void) // Apply a constraint to an actor - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); Actor actor = Actor::New(); @@ -176,7 +176,7 @@ int UtcDaliConstraintSignalApplied(void) // Apply a constraint to an actor - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); float duration( 10.0f ); constraint.SetApplyTime( duration ); @@ -226,7 +226,7 @@ int UtcDaliConstraintRemove(void) // Apply a constraint to an actor - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); float duration( 1.0f ); constraint.SetApplyTime( duration ); @@ -274,7 +274,7 @@ int UtcDaliConstraintRemove(void) 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(1000.0f)); DALI_TEST_CHECK( 0.5f == active.GetCurrentWeight() ); @@ -284,7 +284,7 @@ int UtcDaliConstraintRemove(void) int UtcDaliConstraintCallback(void) { TestApplication application; - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); constraint.SetApplyTime(2.0f); Actor actor = Actor::New(); ActiveConstraint active = actor.ApplyConstraint( constraint ); @@ -305,7 +305,7 @@ int UtcDaliConstraintProperties(void) { TestApplication application; - Constraint constraint = Constraint::New( Actor::SIZE, TestConstraintVector3() ); + Constraint constraint = Constraint::New( Actor::Property::Size, TestConstraintVector3() ); Actor actor = Actor::New(); ActiveConstraint active = actor.ApplyConstraint( constraint ); diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 43c929c..812a158 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -863,7 +863,7 @@ int UtcDaliActorGetCurrentSizeImmediate(void) 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 ); @@ -1366,16 +1366,16 @@ int UtcDaliActorSizeMode(void) 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; @@ -2056,7 +2056,7 @@ int UtcDaliActorApplyConstraint(void) Actor actor = Actor::New(); - Constraint constraint = Constraint::New( Actor::COLOR, TestConstraint() ); + Constraint constraint = Constraint::New( Actor::Property::Color, TestConstraint() ); actor.ApplyConstraint(constraint); DALI_TEST_CHECK( gTestConstraintCalled == false ); @@ -2083,8 +2083,8 @@ int UtcDaliActorApplyConstraintAppliedCallback(void) parent.SetSize( parentSize ); Stage::GetCurrent().Add( parent ); - Constraint constraint = Constraint::New( Actor::SIZE, - Source( parent, Actor::SIZE ), + Constraint constraint = Constraint::New( Actor::Property::Size, + Source( parent, Actor::Property::Size ), EqualToConstraint() ); // Create some child actors @@ -2275,7 +2275,7 @@ int UtcDaliActorRemoveConstraints(void) Actor actor = Actor::New(); - Constraint constraint = Constraint::New( Actor::COLOR, TestConstraint() ); + Constraint constraint = Constraint::New( Actor::Property::Color, TestConstraint() ); actor.ApplyConstraint(constraint); actor.RemoveConstraints(); @@ -2304,8 +2304,8 @@ int UtcDaliActorRemoveConstraint(void) // 1. Apply Constraint1 and Constraint2, and test... unsigned int result1 = 0u; unsigned int result2 = 0u; - ActiveConstraint activeConstraint1 = actor.ApplyConstraint( Constraint::New( Actor::COLOR, TestConstraintRef(result1, 1) ) ); - ActiveConstraint activeConstraint2 = actor.ApplyConstraint( Constraint::New( Actor::COLOR, TestConstraintRef(result2, 2) ) ); + ActiveConstraint activeConstraint1 = actor.ApplyConstraint( Constraint::New( Actor::Property::Color, TestConstraintRef(result1, 1) ) ); + ActiveConstraint activeConstraint2 = actor.ApplyConstraint( Constraint::New( Actor::Property::Color, TestConstraintRef(result2, 2) ) ); Stage::GetCurrent().Add( actor ); // flush the queue and render once @@ -2331,7 +2331,7 @@ int UtcDaliActorRemoveConstraint(void) // 3. Re-Apply Constraint1 and test... result1 = 0; result2 = 0; - activeConstraint1 = actor.ApplyConstraint( Constraint::New( Actor::COLOR, TestConstraintRef(result1, 1) ) ); + activeConstraint1 = actor.ApplyConstraint( Constraint::New( Actor::Property::Color, TestConstraintRef(result1, 1) ) ); // make color property dirty, which will trigger constraints to be reapplied. actor.SetColor( Color::WHITE ); // flush the queue and render once @@ -2381,12 +2381,12 @@ int UtcDaliActorRemoveConstraintTag(void) unsigned int result2 = 0u; unsigned constraint1Tag = 1u; - Constraint constraint1 = Constraint::New( Actor::COLOR, TestConstraintRef(result1, 1) ); + Constraint constraint1 = Constraint::New( Actor::Property::Color, TestConstraintRef(result1, 1) ); constraint1.SetTag( constraint1Tag ); actor.ApplyConstraint( constraint1 ); unsigned constraint2Tag = 2u; - Constraint constraint2 = Constraint::New( Actor::COLOR, TestConstraintRef(result2, 2) ); + Constraint constraint2 = Constraint::New( Actor::Property::Color, TestConstraintRef(result2, 2) ); constraint2.SetTag( constraint2Tag ); actor.ApplyConstraint( constraint2 ); @@ -3011,7 +3011,7 @@ int UtcDaliActorConstrainedToWorldMatrix(void) Actor child = Actor::New(); child.SetParentOrigin(ParentOrigin::CENTER); - Constraint posConstraint = Constraint::New( Actor::POSITION, Source( parent, Actor::WORLD_MATRIX), PositionComponentConstraint() ); + Constraint posConstraint = Constraint::New( Actor::Property::Position, Source( parent, Actor::Property::WorldMatrix), PositionComponentConstraint() ); child.ApplyConstraint(posConstraint); Stage::GetCurrent().Add( child ); @@ -3143,51 +3143,51 @@ struct PropertyStringIndex 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 diff --git a/automated-tests/src/dali/utc-Dali-AnimatableMesh.cpp b/automated-tests/src/dali/utc-Dali-AnimatableMesh.cpp index 530913a..35d3b35 100644 --- a/automated-tests/src/dali/utc-Dali-AnimatableMesh.cpp +++ b/automated-tests/src/dali/utc-Dali-AnimatableMesh.cpp @@ -253,16 +253,16 @@ int UtcDaliAnimatableMeshGetPropertyIndex01(void) 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; } @@ -275,7 +275,7 @@ int UtcDaliAnimatableMeshGetPropertyIndex02(void) 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) @@ -294,7 +294,7 @@ int UtcDaliAnimatableMeshGetPropertyIndex03(void) 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) @@ -313,7 +313,7 @@ int UtcDaliAnimatableMeshGetPropertyIndex04(void) 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) @@ -380,8 +380,8 @@ int UtcDaliAnimatableMeshAnimateVertex01(void) 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(); diff --git a/automated-tests/src/dali/utc-Dali-Animation.cpp b/automated-tests/src/dali/utc-Dali-Animation.cpp index 2dbb814..b44c95e 100644 --- a/automated-tests/src/dali/utc-Dali-Animation.cpp +++ b/automated-tests/src/dali/utc-Dali-Animation.cpp @@ -643,7 +643,7 @@ int UtcDaliAnimationSetSpeedFactor(void) 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); @@ -1193,7 +1193,7 @@ int UtcDaliAnimationPlayRange(void) 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) ); @@ -3035,7 +3035,7 @@ int UtcDaliAnimationAnimateByActorPosition(void) 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); @@ -3087,7 +3087,7 @@ int UtcDaliAnimationAnimateByActorPositionAlphaFunction(void) 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); @@ -3145,7 +3145,7 @@ int UtcDaliAnimationAnimateByActorPositionTimePeriod(void) 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)); @@ -3200,7 +3200,7 @@ int UtcDaliAnimationAnimateByActorPositionAlphaFunctionTimePeriod(void) 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)); @@ -4638,7 +4638,7 @@ int UtcDaliAnimationAnimateToActorParentOrigin(void) try { - animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN), targetParentOrigin ); + animation.AnimateTo( Property(actor, Actor::Property::ParentOrigin), targetParentOrigin ); } catch (Dali::DaliException& e) { @@ -4656,7 +4656,7 @@ int UtcDaliAnimationAnimateToActorParentOriginX(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().x, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::PARENT_ORIGIN_X), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ParentOriginX), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4665,7 +4665,7 @@ int UtcDaliAnimationAnimateToActorParentOriginX(void) try { - animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_X), targetX ); + animation.AnimateTo( Property(actor, Actor::Property::ParentOriginX), targetX ); } catch (Dali::DaliException& e) { @@ -4683,7 +4683,7 @@ int UtcDaliAnimationAnimateToActorParentOriginY(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().y, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::PARENT_ORIGIN_Y), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ParentOriginY), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4692,7 +4692,7 @@ int UtcDaliAnimationAnimateToActorParentOriginY(void) try { - animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_Y), targetY ); + animation.AnimateTo( Property(actor, Actor::Property::ParentOriginY), targetY ); } catch (Dali::DaliException& e) { @@ -4710,7 +4710,7 @@ int UtcDaliAnimationAnimateToActorParentOriginZ(void) Stage::GetCurrent().Add(actor); float startValue(0.5f); DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().z, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::PARENT_ORIGIN_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ParentOriginZ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4719,7 +4719,7 @@ int UtcDaliAnimationAnimateToActorParentOriginZ(void) try { - animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_Z), targetZ ); + animation.AnimateTo( Property(actor, Actor::Property::ParentOriginZ), targetZ ); } catch (Dali::DaliException& e) { @@ -4744,7 +4744,7 @@ int UtcDaliAnimationAnimateToActorAnchorPoint(void) try { - animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT), targetAnchorPoint); + animation.AnimateTo( Property(actor, Actor::Property::AnchorPoint), targetAnchorPoint); } catch (Dali::DaliException& e) { @@ -4762,7 +4762,7 @@ int UtcDaliAnimationAnimateToActorAnchorPointX(void) Stage::GetCurrent().Add(actor); float startValue(0.5f); DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().x, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::ANCHOR_POINT_X), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::AnchorPointX), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4771,7 +4771,7 @@ int UtcDaliAnimationAnimateToActorAnchorPointX(void) try { - animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_X), targetX ); + animation.AnimateTo( Property(actor, Actor::Property::AnchorPointX), targetX ); } catch (Dali::DaliException& e) { @@ -4789,7 +4789,7 @@ int UtcDaliAnimationAnimateToActorAnchorPointY(void) Stage::GetCurrent().Add(actor); float startValue(0.5f); DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().y, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::ANCHOR_POINT_Y), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::AnchorPointY), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4798,7 +4798,7 @@ int UtcDaliAnimationAnimateToActorAnchorPointY(void) try { - animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_Y), targetY ); + animation.AnimateTo( Property(actor, Actor::Property::AnchorPointY), targetY ); } catch (Dali::DaliException& e) { @@ -4816,7 +4816,7 @@ int UtcDaliAnimationAnimateToActorAnchorPointZ(void) Stage::GetCurrent().Add(actor); float startValue(0.5f); DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().z, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::ANCHOR_POINT_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::AnchorPointZ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4825,7 +4825,7 @@ int UtcDaliAnimationAnimateToActorAnchorPointZ(void) try { - animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_Z), targetZ ); + animation.AnimateTo( Property(actor, Actor::Property::AnchorPointZ), targetZ ); } catch (Dali::DaliException& e) { @@ -4847,7 +4847,7 @@ int UtcDaliAnimationAnimateToActorSize(void) 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); @@ -4883,7 +4883,7 @@ int UtcDaliAnimationAnimateToActorSize(void) // 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(); @@ -4921,7 +4921,7 @@ int UtcDaliAnimationAnimateToActorSize(void) // 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(); @@ -4951,13 +4951,13 @@ int UtcDaliAnimationAnimateToActorSizeWidth(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentSize().width, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_WIDTH), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -4975,7 +4975,7 @@ int UtcDaliAnimationAnimateToActorSizeWidth(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentSize().width, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_WIDTH), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SizeWidth), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -4984,7 +4984,7 @@ int UtcDaliAnimationAnimateToActorSizeWidth(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentSize().width, targetWidth, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_WIDTH), targetWidth, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SizeWidth), targetWidth, TEST_LOCATION ); END_TEST; } @@ -4996,13 +4996,13 @@ int UtcDaliAnimationAnimateToActorSizeHeight(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentSize().height, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_HEIGHT), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5020,7 +5020,7 @@ int UtcDaliAnimationAnimateToActorSizeHeight(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentSize().height, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_HEIGHT), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SizeHeight), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5029,7 +5029,7 @@ int UtcDaliAnimationAnimateToActorSizeHeight(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentSize().height, targetHeight, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_HEIGHT), targetHeight, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SizeHeight), targetHeight, TEST_LOCATION ); END_TEST; } @@ -5041,13 +5041,13 @@ int UtcDaliAnimationAnimateToActorSizeDepth(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentSize().depth, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_DEPTH), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5065,7 +5065,7 @@ int UtcDaliAnimationAnimateToActorSizeDepth(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentSize().depth, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_DEPTH), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SizeDepth), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5074,7 +5074,7 @@ int UtcDaliAnimationAnimateToActorSizeDepth(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentSize().depth, targetDepth, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SIZE_DEPTH), targetDepth, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SizeDepth), targetDepth, TEST_LOCATION ); END_TEST; } @@ -5090,7 +5090,7 @@ int UtcDaliAnimationAnimateToActorPosition(void) 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); @@ -5127,15 +5127,15 @@ int UtcDaliAnimationAnimateToActorPositionX(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentPosition().x, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5153,9 +5153,9 @@ int UtcDaliAnimationAnimateToActorPositionX(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentPosition().x, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionZ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5164,9 +5164,9 @@ int UtcDaliAnimationAnimateToActorPositionX(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentPosition().x, targetX, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), targetX, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), targetX, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionZ), startValue, TEST_LOCATION ); END_TEST; } @@ -5178,15 +5178,15 @@ int UtcDaliAnimationAnimateToActorPositionY(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentPosition().y, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5204,9 +5204,9 @@ int UtcDaliAnimationAnimateToActorPositionY(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentPosition().y, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionZ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5215,9 +5215,9 @@ int UtcDaliAnimationAnimateToActorPositionY(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentPosition().y, targetY, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), targetY, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), targetY, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionZ), startValue, TEST_LOCATION ); END_TEST; } @@ -5229,15 +5229,15 @@ int UtcDaliAnimationAnimateToActorPositionZ(void) Stage::GetCurrent().Add(actor); float startValue(0.0f); DALI_TEST_EQUALS( actor.GetCurrentPosition().z, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5255,9 +5255,9 @@ int UtcDaliAnimationAnimateToActorPositionZ(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentPosition().z, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionZ), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5266,9 +5266,9 @@ int UtcDaliAnimationAnimateToActorPositionZ(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentPosition().z, targetZ, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::POSITION_Z), targetZ, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PositionZ), targetZ, TEST_LOCATION ); END_TEST; } @@ -5284,7 +5284,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunction(void) 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); @@ -5334,7 +5334,7 @@ int UtcDaliAnimationAnimateToActorPositionTimePeriod(void) 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 ) ); @@ -5386,7 +5386,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionTimePeriod(void) 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 ) ); @@ -5440,7 +5440,7 @@ int UtcDaliAnimationAnimateToActorRotationAngleAxis(void) 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(); @@ -5498,7 +5498,7 @@ int UtcDaliAnimationAnimateToActorRotationQuaternion(void) 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(); @@ -5555,7 +5555,7 @@ int UtcDaliAnimationAnimateToActorRotationAlphaFunction(void) 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(); @@ -5613,7 +5613,7 @@ int UtcDaliAnimationAnimateToActorRotationTimePeriod(void) 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(); @@ -5674,7 +5674,7 @@ int UtcDaliAnimationAnimateToActorRotationAlphaFunctionTimePeriod(void) 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(); @@ -5732,7 +5732,7 @@ int UtcDaliAnimationAnimateToActorScale(void) 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); @@ -5768,7 +5768,7 @@ int UtcDaliAnimationAnimateToActorScale(void) // 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(); @@ -5806,7 +5806,7 @@ int UtcDaliAnimationAnimateToActorScale(void) // 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(); @@ -5836,15 +5836,15 @@ int UtcDaliAnimationAnimateToActorScaleX(void) Stage::GetCurrent().Add(actor); float startValue(1.0f); DALI_TEST_EQUALS( actor.GetCurrentScale().x, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5862,9 +5862,9 @@ int UtcDaliAnimationAnimateToActorScaleX(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentScale().x, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleZ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5873,9 +5873,9 @@ int UtcDaliAnimationAnimateToActorScaleX(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentScale().x, targetX, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), targetX, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), targetX, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleZ), startValue, TEST_LOCATION ); END_TEST; } @@ -5887,15 +5887,15 @@ int UtcDaliAnimationAnimateToActorScaleY(void) Stage::GetCurrent().Add(actor); float startValue(1.0f); DALI_TEST_EQUALS( actor.GetCurrentScale().y, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5913,9 +5913,9 @@ int UtcDaliAnimationAnimateToActorScaleY(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentScale().y, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleZ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5924,9 +5924,9 @@ int UtcDaliAnimationAnimateToActorScaleY(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentScale().y, targetY, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), targetY, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), targetY, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleZ), startValue, TEST_LOCATION ); END_TEST; } @@ -5938,15 +5938,15 @@ int UtcDaliAnimationAnimateToActorScaleZ(void) Stage::GetCurrent().Add(actor); float startValue(1.0f); DALI_TEST_EQUALS( actor.GetCurrentScale().z, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -5964,9 +5964,9 @@ int UtcDaliAnimationAnimateToActorScaleZ(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentScale().z, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleZ), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -5975,9 +5975,9 @@ int UtcDaliAnimationAnimateToActorScaleZ(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentScale().z, targetZ, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::SCALE_Z), targetZ, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleX), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleY), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ScaleZ), targetZ, TEST_LOCATION ); END_TEST; } @@ -5993,7 +5993,7 @@ int UtcDaliAnimationAnimateToActorColor(void) 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)); @@ -6030,7 +6030,7 @@ int UtcDaliAnimationAnimateToActorColor(void) // 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(); @@ -6068,7 +6068,7 @@ int UtcDaliAnimationAnimateToActorColor(void) // 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(); @@ -6106,16 +6106,16 @@ int UtcDaliAnimationAnimateToActorColorRed(void) Stage::GetCurrent().Add(actor); float startValue(1.0f); DALI_TEST_EQUALS( actor.GetCurrentColor().r, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -6133,10 +6133,10 @@ int UtcDaliAnimationAnimateToActorColorRed(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().r, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6145,10 +6145,10 @@ int UtcDaliAnimationAnimateToActorColorRed(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().r, targetRed, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), targetRed, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), targetRed, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); END_TEST; } @@ -6160,16 +6160,16 @@ int UtcDaliAnimationAnimateToActorColorGreen(void) Stage::GetCurrent().Add(actor); float startValue(1.0f); DALI_TEST_EQUALS( actor.GetCurrentColor().g, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -6187,10 +6187,10 @@ int UtcDaliAnimationAnimateToActorColorGreen(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().g, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6199,10 +6199,10 @@ int UtcDaliAnimationAnimateToActorColorGreen(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().g, targetGreen, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), targetGreen, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), targetGreen, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); END_TEST; } @@ -6214,16 +6214,16 @@ int UtcDaliAnimationAnimateToActorColorBlue(void) Stage::GetCurrent().Add(actor); float startValue(1.0f); DALI_TEST_EQUALS( actor.GetCurrentColor().b, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -6241,10 +6241,10 @@ int UtcDaliAnimationAnimateToActorColorBlue(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().b, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6253,10 +6253,10 @@ int UtcDaliAnimationAnimateToActorColorBlue(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().b, targetBlue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), targetBlue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), targetBlue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); END_TEST; } @@ -6268,16 +6268,16 @@ int UtcDaliAnimationAnimateToActorColorAlpha(void) Stage::GetCurrent().Add(actor); float startValue(1.0f); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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); @@ -6295,10 +6295,10 @@ int UtcDaliAnimationAnimateToActorColorAlpha(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().a, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6307,10 +6307,10 @@ int UtcDaliAnimationAnimateToActorColorAlpha(void) application.SendNotification(); finishCheck.CheckSignalReceived(); DALI_TEST_EQUALS( actor.GetCurrentColor().a, targetAlpha, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), targetAlpha, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), targetAlpha, TEST_LOCATION ); END_TEST; } @@ -6501,10 +6501,10 @@ int UtcDaliAnimationAnimateBetweenActorColorAlpha(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6518,7 +6518,7 @@ int UtcDaliAnimationAnimateBetweenActorColorAlpha(void) 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(); @@ -6534,50 +6534,50 @@ int UtcDaliAnimationAnimateBetweenActorColorAlpha(void) application.Render(static_cast(durationSeconds*100.0f)/* 10% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*200.0f)/* 30% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.25f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*100.0f)/* 40% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*400.0f)/* 80% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*100.0f)/* 90% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*100.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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 @@ -6596,10 +6596,10 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaCubic(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6613,7 +6613,7 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaCubic(void) 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(); @@ -6629,50 +6629,50 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaCubic(void) application.Render(static_cast(durationSeconds*100.0f)/* 10% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.36f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*200.0f)/* 30% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.21f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*100.0f)/* 40% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*400.0f)/* 80% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*100.0f)/* 90% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.76f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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(durationSeconds*100.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(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 @@ -6691,10 +6691,10 @@ int UtcDaliAnimationAnimateBetweenActorColor(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6705,7 +6705,7 @@ int UtcDaliAnimationAnimateBetweenActorColor(void) 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(); @@ -6717,38 +6717,38 @@ int UtcDaliAnimationAnimateBetweenActorColor(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -6766,10 +6766,10 @@ int UtcDaliAnimationAnimateBetweenActorColorCubic(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6780,7 +6780,7 @@ int UtcDaliAnimationAnimateBetweenActorColorCubic(void) 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(); @@ -6792,38 +6792,38 @@ int UtcDaliAnimationAnimateBetweenActorColorCubic(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.55f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.525f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.506f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.4875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.55f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.525f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.506f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.4875f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.99375f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.925f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.85625f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.7875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.99375f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.925f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.85625f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.7875f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -6856,7 +6856,7 @@ int UtcDaliAnimationAnimateBetweenActorVisible(void) 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(); @@ -6902,7 +6902,7 @@ int UtcDaliAnimationAnimateBetweenActorVisibleCubic(void) 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(); @@ -6943,7 +6943,7 @@ int UtcDaliAnimationAnimateBetweenActorRotation01(void) 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(); @@ -6988,7 +6988,7 @@ int UtcDaliAnimationAnimateBetweenActorRotation02(void) 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(); @@ -7052,7 +7052,7 @@ int UtcDaliAnimationAnimateBetweenActorRotation01Cubic(void) 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(); @@ -7098,7 +7098,7 @@ int UtcDaliAnimationAnimateBetweenActorRotation02Cubic(void) 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(); @@ -9373,10 +9373,10 @@ int UtcDaliAnimationAnimateBetweenActorColorTimePeriod(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -9387,7 +9387,7 @@ int UtcDaliAnimationAnimateBetweenActorColorTimePeriod(void) 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(); @@ -9399,38 +9399,38 @@ int UtcDaliAnimationAnimateBetweenActorColorTimePeriod(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9448,10 +9448,10 @@ int UtcDaliAnimationAnimateBetweenActorColorFunction(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -9462,7 +9462,7 @@ int UtcDaliAnimationAnimateBetweenActorColorFunction(void) 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(); @@ -9474,38 +9474,38 @@ int UtcDaliAnimationAnimateBetweenActorColorFunction(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9523,10 +9523,10 @@ int UtcDaliAnimationAnimateBetweenActorColorFunctionTimePeriod(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -9537,7 +9537,7 @@ int UtcDaliAnimationAnimateBetweenActorColorFunctionTimePeriod(void) 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(); @@ -9549,38 +9549,38 @@ int UtcDaliAnimationAnimateBetweenActorColorFunctionTimePeriod(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorRed), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorGreen), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorBlue), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ColorAlpha), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9633,7 +9633,7 @@ int UtcDaliAnimationUpdateManager(void) 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(); @@ -9667,9 +9667,9 @@ int UtcDaliAnimationSignalOrder(void) 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 ); diff --git a/automated-tests/src/dali/utc-Dali-CameraActor.cpp b/automated-tests/src/dali/utc-Dali-CameraActor.cpp index 5ee9ee0..3aae871 100644 --- a/automated-tests/src/dali/utc-Dali-CameraActor.cpp +++ b/automated-tests/src/dali/utc-Dali-CameraActor.cpp @@ -164,18 +164,18 @@ int UtcDaliCameraActorSetCameraOffStage(void) 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; } @@ -212,21 +212,21 @@ int UtcDaliCameraActorSetCameraOnStage(void) 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; } @@ -243,11 +243,11 @@ int UtcDaliCameraActorGetCamera(void) 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); @@ -269,24 +269,24 @@ int UtcDaliCameraActorDefaultProperties(void) 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 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() ) ); @@ -297,8 +297,8 @@ int UtcDaliCameraActorDefaultProperties(void) 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) ); } @@ -314,7 +314,7 @@ int UtcDaliCameraActorDefaultProperties(void) // 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(); @@ -338,7 +338,7 @@ int UtcDaliCameraActorSetTarget(void) 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; } @@ -356,7 +356,7 @@ int UtcDaliCameraActorSetType01(void) 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; @@ -412,7 +412,7 @@ int UtcDaliCameraActorSetFieldOfView(void) 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; } @@ -430,7 +430,7 @@ int UtcDaliCameraActorSetAspectRatio(void) 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; } @@ -447,7 +447,7 @@ int UtcDaliCameraActorSetNearClippingPlane(void) 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; } @@ -464,7 +464,7 @@ int UtcDaliCameraActorSetFarClippingPlane(void) 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; } @@ -483,7 +483,7 @@ int UtcDaliCameraActorSetTargetPosition(void) 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; } @@ -501,7 +501,7 @@ int UtcDaliCameraActorSetInvertYAxis(void) 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; } @@ -531,7 +531,7 @@ int UtcDaliCameraActorModelView(void) 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 ) ); @@ -549,19 +549,19 @@ int UtcDaliCameraActorSetPerspectiveProjection(void) 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; } @@ -586,10 +586,10 @@ int UtcDaliCameraActorSetOrthographicProjection01(void) 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 ) ); @@ -600,22 +600,22 @@ int UtcDaliCameraActorSetOrthographicProjection01(void) 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(); @@ -638,30 +638,30 @@ int UtcDaliCameraActorSetOrthographicProjection02(void) 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); @@ -682,42 +682,42 @@ int UtcDaliCameraActorSetOrthographicProjection03(void) 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; } @@ -742,8 +742,8 @@ int UtcDaliCameraActorReadProjectionMatrix(void) 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); @@ -754,8 +754,8 @@ int UtcDaliCameraActorReadProjectionMatrix(void) 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( projectionMatrixPropertyIndex, Source( camera, CameraActor::PROJECTION_MATRIX ), EqualToConstraint()); - Constraint viewMatrixConstraint = Constraint::New( viewMatrixPropertyIndex, Source( camera, CameraActor::VIEW_MATRIX ), EqualToConstraint()); + Constraint projectionMatrixConstraint = Constraint::New( projectionMatrixPropertyIndex, Source( camera, CameraActor::Property::ProjectionMatrix ), EqualToConstraint()); + Constraint viewMatrixConstraint = Constraint::New( viewMatrixPropertyIndex, Source( camera, CameraActor::Property::ViewMatrix ), EqualToConstraint()); shaderEffect.ApplyConstraint(projectionMatrixConstraint); shaderEffect.ApplyConstraint(viewMatrixConstraint); @@ -780,7 +780,7 @@ int UtcDaliCameraActorAnimatedProperties(void) actor.SetSize(100.0f, 100.0f); Stage::GetCurrent().Add(actor); - actor.ApplyConstraint(Constraint::New( Actor::POSITION, Source( camera, Actor::POSITION), EqualToConstraint())); + actor.ApplyConstraint(Constraint::New( Actor::Property::Position, Source( camera, Actor::Property::Position), EqualToConstraint())); camera.SetPosition(100.0f, 200.0f, 300.0f); application.SendNotification(); @@ -819,10 +819,10 @@ int UtcDaliCameraActorCheckLookAtAndFreeLookViews01(void) target.SetPosition(targetPosition); Constraint cameraOrientationConstraint = - Constraint::New ( Actor::ROTATION, - Source( target, Actor::WORLD_POSITION ), - Source( freeLookCameraActor, Actor::WORLD_POSITION ), - Source( target, Actor::WORLD_ROTATION ), + Constraint::New ( Actor::Property::Rotation, + Source( target, Actor::Property::WorldPosition ), + Source( freeLookCameraActor, Actor::Property::WorldPosition ), + Source( target, Actor::Property::WorldRotation ), &LookAt ); freeLookCameraActor.ApplyConstraint( cameraOrientationConstraint ); @@ -855,8 +855,8 @@ int UtcDaliCameraActorCheckLookAtAndFreeLookViews01(void) 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 ); } @@ -881,10 +881,10 @@ int UtcDaliCameraActorCheckLookAtAndFreeLookViews02(void) target.SetPosition(targetPosition); Constraint cameraOrientationConstraint = - Constraint::New ( Actor::ROTATION, - Source( target, Actor::WORLD_POSITION ), - Source( freeLookCameraActor, Actor::WORLD_POSITION ), - Source( target, Actor::WORLD_ROTATION ), + Constraint::New ( Actor::Property::Rotation, + Source( target, Actor::Property::WorldPosition ), + Source( freeLookCameraActor, Actor::Property::WorldPosition ), + Source( target, Actor::Property::WorldRotation ), &LookAt ); freeLookCameraActor.ApplyConstraint( cameraOrientationConstraint ); @@ -917,8 +917,8 @@ int UtcDaliCameraActorCheckLookAtAndFreeLookViews02(void) 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(); @@ -968,7 +968,7 @@ int UtcDaliCameraActorCheckLookAtAndFreeLookViews03(void) application.Render(); Matrix freeLookViewMatrix; - freeLookCameraActor.GetProperty(CameraActor::CameraActor::VIEW_MATRIX).Get(freeLookViewMatrix); + freeLookCameraActor.GetProperty(CameraActor::CameraActor::Property::ViewMatrix).Get(freeLookViewMatrix); Matrix freeLookWorld = freeLookCameraActor.GetCurrentWorldMatrix(); diff --git a/automated-tests/src/dali/utc-Dali-Constraint.cpp b/automated-tests/src/dali/utc-Dali-Constraint.cpp index 0fa9aaf..4fdec7f 100644 --- a/automated-tests/src/dali/utc-Dali-Constraint.cpp +++ b/automated-tests/src/dali/utc-Dali-Constraint.cpp @@ -1812,20 +1812,20 @@ int UtcDaliConstraintNewLocalInput(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a local input property - Constraint constraint = Constraint::New( Actor::POSITION, - LocalSource( Actor::COLOR ), + Constraint constraint = Constraint::New( Actor::Property::Position, + LocalSource( Actor::Property::Color ), MoveAwayWithFadeConstraint(distanceWhenFullyTransparent) ); actor.ApplyConstraint( constraint ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); @@ -1838,9 +1838,9 @@ int UtcDaliConstraintNewLocalInput(void) application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), ( startValue - Vector3(0.0f, 0.0f, progress*distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), ( startValue - Vector3(0.0f, 0.0f, progress*distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION ); } - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), ( startValue - Vector3(0.0f, 0.0f, distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), ( startValue - Vector3(0.0f, 0.0f, distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -1863,26 +1863,26 @@ int UtcDaliConstraintNewParentInput(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( Actor::POSITION, - ParentSource( Actor::SIZE ), + Constraint constraint = Constraint::New( Actor::Property::Position, + ParentSource( Actor::Property::Size ), TestBottomRightAlignConstraint() ); actor.ApplyConstraint( constraint ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), parentStartSize, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), parent.GetCurrentSize(), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), parentStartSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), parent.GetCurrentSize(), TEST_LOCATION ); // Gradually shrink the parent; the actor should move inwards @@ -1894,10 +1894,10 @@ int UtcDaliConstraintNewParentInput(void) application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), size, POSITION_EPSILON, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), parent.GetCurrentSize(), POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), size, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), parent.GetCurrentSize(), POSITION_EPSILON, TEST_LOCATION ); } - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), Vector3::ZERO, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), Vector3::ZERO, POSITION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -1924,30 +1924,30 @@ int UtcDaliConstraintNewInput1(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( Actor::POSITION, - Source( sibling1, Actor::POSITION ), + Constraint constraint = Constraint::New( Actor::Property::Position, + Source( sibling1, Actor::Property::Position ), MeanPositionConstraint1() ); actor.ApplyConstraint( constraint ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), sibling1.GetCurrentPosition(), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), sibling1.GetCurrentPosition(), TEST_LOCATION ); END_TEST; } @@ -1984,31 +1984,31 @@ int UtcDaliConstraintNewInput2(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( Actor::POSITION, - Source( sibling1, Actor::POSITION ), - Source( sibling2, Actor::POSITION ), + Constraint constraint = Constraint::New( Actor::Property::Position, + Source( sibling1, Actor::Property::Position ), + Source( sibling2, Actor::Property::Position ), MeanPositionConstraint2() ); actor.ApplyConstraint( constraint ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -2050,32 +2050,32 @@ int UtcDaliConstraintNewInput3(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( Actor::POSITION, - Source( sibling1, Actor::POSITION ), - Source( sibling2, Actor::POSITION ), - Source( sibling3, Actor::POSITION ), + Constraint constraint = Constraint::New( 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( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -2119,33 +2119,33 @@ int UtcDaliConstraintNewInput4(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( Actor::POSITION, - Source( sibling1, Actor::POSITION ), - Source( sibling2, Actor::POSITION ), - ParentSource( Actor::POSITION ), - Source( sibling3, Actor::POSITION ), + Constraint constraint = Constraint::New( 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( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -2194,34 +2194,34 @@ int UtcDaliConstraintNewInput5(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( 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( 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( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -2275,35 +2275,35 @@ int UtcDaliConstraintNewInput6(void) */ application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Apply constraint with a parent input property - Constraint constraint = Constraint::New( 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( 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( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( 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( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), meanValue, POSITION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -2343,7 +2343,7 @@ int UtcDaliConstraintSetApplyTime(void) // Build constraint Vector4 targetColor(Color::BLACK); - Constraint constraint = Constraint::New( Actor::COLOR, TestColorConstraint(targetColor) ); + Constraint constraint = Constraint::New( Actor::Property::Color, TestColorConstraint(targetColor) ); DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(0.0f), TEST_LOCATION); float applySeconds(7.0f); @@ -2400,7 +2400,7 @@ int UtcDaliConstraintGetApplyTime(void) { TestApplication application; - Constraint constraint = Constraint::New( Actor::COLOR, TestConstraint() ); + Constraint constraint = Constraint::New( Actor::Property::Color, TestConstraint() ); DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(0.0f), TEST_LOCATION); float applySeconds(7.0f); @@ -2419,7 +2419,7 @@ int UtcDaliConstraintSetAlphaFunction(void) Vector3 startValue( Vector3::ZERO ); Vector3 targetValue(100.0f, 100.0f, 100.0f); - Constraint constraint = Constraint::New( Actor::POSITION, + Constraint constraint = Constraint::New( Actor::Property::Position, TestConstraintVector3( targetValue ) ); // Test the alpha-function itself @@ -2434,42 +2434,42 @@ int UtcDaliConstraintSetAlphaFunction(void) application.SendNotification(); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); constraint.SetApplyTime( 10.0f ); actor.ApplyConstraint( constraint ); application.SendNotification(); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.1f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.1f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.2f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.2f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.3f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.3f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.4f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.4f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.5f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.5f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.6f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.6f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.7f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.7f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.8f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.8f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue) * 0.9f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue) * 0.9f, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION ); // Check that the constrained value is stable application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION ); // Remove the constraint @@ -2478,11 +2478,11 @@ int UtcDaliConstraintSetAlphaFunction(void) application.SendNotification(); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), startValue, TEST_LOCATION ); // Change to non-linear alpha and retest @@ -2495,23 +2495,23 @@ int UtcDaliConstraintSetAlphaFunction(void) application.SendNotification(); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_CHECK( actor.GetProperty( Actor::POSITION ).x > startValue.x ); - DALI_TEST_CHECK( actor.GetProperty( Actor::POSITION ).y > startValue.y ); - DALI_TEST_CHECK( actor.GetProperty( Actor::POSITION ).z > startValue.z ); + DALI_TEST_CHECK( actor.GetProperty( Actor::Property::Position ).x > startValue.x ); + DALI_TEST_CHECK( actor.GetProperty( Actor::Property::Position ).y > startValue.y ); + DALI_TEST_CHECK( actor.GetProperty( Actor::Property::Position ).z > startValue.z ); Vector3 lessThanTenPercentProgress( (targetValue - startValue) * 0.09f ); - DALI_TEST_CHECK( actor.GetProperty( Actor::POSITION ).x < lessThanTenPercentProgress.x ); - DALI_TEST_CHECK( actor.GetProperty( Actor::POSITION ).y < lessThanTenPercentProgress.y ); - DALI_TEST_CHECK( actor.GetProperty( Actor::POSITION ).z < lessThanTenPercentProgress.z ); + DALI_TEST_CHECK( actor.GetProperty( Actor::Property::Position ).x < lessThanTenPercentProgress.x ); + DALI_TEST_CHECK( actor.GetProperty( Actor::Property::Position ).y < lessThanTenPercentProgress.y ); + DALI_TEST_CHECK( actor.GetProperty( Actor::Property::Position ).z < lessThanTenPercentProgress.z ); application.Render(static_cast(9000.0f/*9 seconds*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION ); // Check that the constrained value is stable application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION ); application.Render(static_cast(1000.0f/*1 second*/)); - DALI_TEST_EQUALS( actor.GetProperty( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::Position ), (targetValue - startValue), TEST_LOCATION ); END_TEST; } @@ -2519,7 +2519,7 @@ int UtcDaliConstraintGetAlphaFunction(void) { TestApplication application; - Constraint constraint = Constraint::New( Actor::COLOR, TestConstraint() ); + Constraint constraint = Constraint::New( Actor::Property::Color, TestConstraint() ); AlphaFunction func = constraint.GetAlphaFunction(); DALI_TEST_EQUALS(func(0.5f), 0.5f, TEST_LOCATION); // Default is Linear @@ -2535,7 +2535,7 @@ int UtcDaliConstraintSetRemoveAction(void) // Build constraint, with "Discard" remove action - Constraint constraint = Constraint::New( Actor::POSITION, TestPositionConstraint(targetPosition) ); + Constraint constraint = Constraint::New( Actor::Property::Position, TestPositionConstraint(targetPosition) ); DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION); constraint.SetRemoveAction(Constraint::Discard); @@ -2586,7 +2586,7 @@ int UtcDaliConstraintGetRemoveAction(void) { TestApplication application; - Constraint constraint = Constraint::New( Actor::COLOR, TestConstraint() ); + Constraint constraint = Constraint::New( Actor::Property::Color, TestConstraint() ); DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION); constraint.SetRemoveAction(Constraint::Discard); @@ -2609,7 +2609,7 @@ int UtcDaliConstraintImmediateRemoveDuringApply(void) // Build constraint - Constraint constraint = Constraint::New( Actor::POSITION, TestPositionConstraint(targetPosition) ); + Constraint constraint = Constraint::New( Actor::Property::Position, TestPositionConstraint(targetPosition) ); DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION); float applySeconds(4.0f); @@ -2664,8 +2664,8 @@ int UtcDaliConstraintActorSize(void) // Build constraint, to make child 20% of parent size - Constraint constraint = Constraint::New( Actor::SIZE, - ParentSource( Actor::SIZE ), + Constraint constraint = Constraint::New( Actor::Property::Size, + ParentSource( Actor::Property::Size ), TestRelativeConstraintVector3(0.2f) ); // Apply to a child actor @@ -2684,7 +2684,7 @@ int UtcDaliConstraintActorSize(void) 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(); @@ -2721,8 +2721,8 @@ int UtcDaliConstraintActorSizeWidth(void) // Build constraint, to make child 20% of parent width - Constraint constraint = Constraint::New( Actor::SIZE_WIDTH, - ParentSource( Actor::SIZE_WIDTH ), + Constraint constraint = Constraint::New( Actor::Property::SizeWidth, + ParentSource( Actor::Property::SizeWidth ), TestRelativeConstraintFloat(0.2f) ); // Apply to a child actor @@ -2741,7 +2741,7 @@ int UtcDaliConstraintActorSizeWidth(void) 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(); @@ -2791,8 +2791,8 @@ int UtcDaliConstraintActorSizeHeight(void) // Build constraint, to make child 20% of parent height - Constraint constraint = Constraint::New( Actor::SIZE_HEIGHT, - ParentSource( Actor::SIZE_HEIGHT ), + Constraint constraint = Constraint::New( Actor::Property::SizeHeight, + ParentSource( Actor::Property::SizeHeight ), TestRelativeConstraintFloat(0.2f) ); // Apply to a child actor @@ -2811,7 +2811,7 @@ int UtcDaliConstraintActorSizeHeight(void) 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(); @@ -2861,8 +2861,8 @@ int UtcDaliConstraintActorSizeDepth(void) // Build constraint, to make child 20% of parent height - Constraint constraint = Constraint::New( Actor::SIZE_DEPTH, - ParentSource( Actor::SIZE_DEPTH ), + Constraint constraint = Constraint::New( Actor::Property::SizeDepth, + ParentSource( Actor::Property::SizeDepth ), TestRelativeConstraintFloat(0.2f) ); // Apply to a child actor @@ -2881,7 +2881,7 @@ int UtcDaliConstraintActorSizeDepth(void) 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(); @@ -2968,8 +2968,8 @@ int UtcDaliConstraintInputWorldPosition(void) // 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( Actor::POSITION, - Source( child, Actor::WORLD_POSITION ), + Constraint constraint = Constraint::New( Actor::Property::Position, + Source( child, Actor::Property::WorldPosition ), EqualToConstraint() ); trackingActor.ApplyConstraint( constraint ); @@ -3045,8 +3045,8 @@ int UtcDaliConstraintInputWorldRotation(void) // 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( Actor::ROTATION, - Source( child, Actor::WORLD_ROTATION ), + Constraint constraint = Constraint::New( Actor::Property::Rotation, + Source( child, Actor::Property::WorldRotation ), EqualToQuaternion() ); trackingActor.ApplyConstraint( constraint ); @@ -3123,8 +3123,8 @@ int UtcDaliConstraintInputWorldScale(void) // 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( Actor::SCALE, - Source( child, Actor::WORLD_SCALE ), + Constraint constraint = Constraint::New( Actor::Property::Scale, + Source( child, Actor::Property::WorldScale ), EqualToConstraint() ); trackingActor.ApplyConstraint( constraint ); @@ -3201,8 +3201,8 @@ int UtcDaliConstraintInputWorldColor(void) // 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( Actor::COLOR, - Source( child, Actor::WORLD_COLOR ), + Constraint constraint = Constraint::New( Actor::Property::Color, + Source( child, Actor::Property::WorldColor ), EqualToVector4() ); trackingActor.ApplyConstraint( constraint ); @@ -3247,7 +3247,7 @@ int UtcDaliConstraintInvalidInputProperty(void) { TestApplication application; Actor actor = Actor::New(); - Constraint constraint = Constraint::New( Actor::POSITION, LocalSource( PROPERTY_REGISTRATION_START_INDEX ), EqualToConstraint() ); + Constraint constraint = Constraint::New( Actor::Property::Position, LocalSource( PROPERTY_REGISTRATION_START_INDEX ), EqualToConstraint() ); Stage::GetCurrent().Add( actor ); @@ -3284,7 +3284,7 @@ int UtcDaliBuiltinConstraintParentSize(void) // Apply constraint - Constraint constraint = Constraint::New( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ); + Constraint constraint = Constraint::New( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ); actor.ApplyConstraint( constraint ); application.SendNotification(); @@ -3338,7 +3338,7 @@ int UtcDaliBuiltinConstraintParentSizeRelative(void) // Apply constraint - Constraint constraint = Constraint::New( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( scale ) ); + Constraint constraint = Constraint::New( Actor::Property::Size, ParentSource( Actor::Property::Size ), RelativeToConstraint( scale ) ); actor.ApplyConstraint( constraint ); application.SendNotification(); @@ -3396,9 +3396,9 @@ int UtcDaliBuiltinConstraintScaleToFitConstraint(void) // Apply constraint - Constraint constraint = Constraint::New( Actor::SCALE, - LocalSource( Actor::SIZE ), - ParentSource( Actor::SIZE ), + Constraint constraint = Constraint::New( Actor::Property::Scale, + LocalSource( Actor::Property::Size ), + ParentSource( Actor::Property::Size ), ScaleToFitConstraint() ); actor.ApplyConstraint( constraint ); @@ -3453,9 +3453,9 @@ int UtcDaliBuiltinConstraintScaleToFitKeepAspectRatio(void) // Apply constraint - Constraint constraint = Constraint::New( Actor::SCALE, - LocalSource( Actor::SIZE ), - ParentSource( Actor::SIZE ), + Constraint constraint = Constraint::New( Actor::Property::Scale, + LocalSource( Actor::Property::Size ), + ParentSource( Actor::Property::Size ), ScaleToFitKeepAspectRatioConstraint() ); actor.ApplyConstraint( constraint ); @@ -3501,9 +3501,9 @@ int UtcDaliBuiltinConstraintScaleToFillXYKeepAspectRatio(void) // Apply constraint - Constraint constraint = Constraint::New( Actor::SCALE, - LocalSource( Actor::SIZE ), - ParentSource( Actor::SIZE ), + Constraint constraint = Constraint::New( Actor::Property::Scale, + LocalSource( Actor::Property::Size ), + ParentSource( Actor::Property::Size ), ScaleToFillXYKeepAspectRatioConstraint() ); actor.ApplyConstraint( constraint ); @@ -3549,8 +3549,8 @@ int UtcDaliBuiltinConstraintEqualToConstraint(void) // Apply constraint - actor1 size == actor2 position - Constraint constraint = Constraint::New( Actor::SIZE, - Source( actor1, Actor::POSITION ), + Constraint constraint = Constraint::New( Actor::Property::Size, + Source( actor1, Actor::Property::Position ), EqualToConstraint() ); constraint.SetRemoveAction( Constraint::Discard ); actor2.ApplyConstraint( constraint ); @@ -3586,8 +3586,8 @@ int UtcDaliBuiltinConstraintEqualToConstraint(void) DALI_TEST_EQUALS( actor1.GetCurrentOpacity(), startOpacity, TEST_LOCATION ); DALI_TEST_EQUALS( actor2.GetCurrentOpacity(), startOpacity, TEST_LOCATION ); - Constraint constraint2 = Constraint::New( Actor::COLOR_ALPHA, - Source( actor1, Actor::COLOR_ALPHA ), + Constraint constraint2 = Constraint::New( Actor::Property::ColorAlpha, + Source( actor1, Actor::Property::ColorAlpha ), EqualToConstraint() ); constraint2.SetRemoveAction( Constraint::Discard ); actor2.ApplyConstraint( constraint2 ); @@ -3610,8 +3610,8 @@ int UtcDaliBuiltinConstraintEqualToConstraint(void) DALI_TEST_CHECK( actor1.GetCurrentColor() == Color::GREEN ); DALI_TEST_CHECK( actor2.GetCurrentColor() == Color::RED ); - Constraint constraint3 = Constraint::New( Actor::COLOR, - Source( actor1, Actor::COLOR ), + Constraint constraint3 = Constraint::New( Actor::Property::Color, + Source( actor1, Actor::Property::Color ), EqualToConstraint() ); constraint3.SetRemoveAction( Constraint::Discard ); actor2.ApplyConstraint( constraint3 ); @@ -3632,8 +3632,8 @@ int UtcDaliBuiltinConstraintEqualToConstraint(void) DALI_TEST_EQUALS( actor1.GetCurrentRotation(), q1, 0.01, TEST_LOCATION ); DALI_TEST_EQUALS( actor2.GetCurrentRotation(), q2, 0.01, TEST_LOCATION ); - Constraint constraint4 = Constraint::New( Actor::ROTATION, - Source( actor1, Actor::ROTATION ), + Constraint constraint4 = Constraint::New( Actor::Property::Rotation, + Source( actor1, Actor::Property::Rotation ), EqualToConstraint() ); constraint4.SetRemoveAction( Constraint::Discard ); actor2.ApplyConstraint( constraint4 ); @@ -3680,8 +3680,8 @@ int UtcDaliBuiltinConstraintRelativeToConstraint(void) RelativeToConstraint( 0.f ); Vector3 scale( 0.5, 0.6, 0.7 ); - Constraint constraint = Constraint::New( Actor::SIZE, - Source( actor1, Actor::POSITION ), + Constraint constraint = Constraint::New( Actor::Property::Size, + Source( actor1, Actor::Property::Position ), RelativeToConstraint( scale ) ); constraint.SetRemoveAction( Constraint::Discard ); actor2.ApplyConstraint( constraint ); @@ -3717,8 +3717,8 @@ int UtcDaliBuiltinConstraintRelativeToConstraint(void) DALI_TEST_EQUALS( actor1.GetCurrentOpacity(), startOpacity, TEST_LOCATION ); DALI_TEST_EQUALS( actor2.GetCurrentOpacity(), startOpacity, TEST_LOCATION ); - Constraint constraint2 = Constraint::New( Actor::COLOR_ALPHA, - Source( actor1, Actor::COLOR_ALPHA ), + Constraint constraint2 = Constraint::New( Actor::Property::ColorAlpha, + Source( actor1, Actor::Property::ColorAlpha ), RelativeToConstraintFloat(scale2) ); constraint2.SetRemoveAction( Constraint::Discard ); actor2.ApplyConstraint(constraint2); diff --git a/automated-tests/src/dali/utc-Dali-Handle.cpp b/automated-tests/src/dali/utc-Dali-Handle.cpp index cf49f4a..924c3e8 100644 --- a/automated-tests/src/dali/utc-Dali-Handle.cpp +++ b/automated-tests/src/dali/utc-Dali-Handle.cpp @@ -247,7 +247,7 @@ int UtcDaliHandleGetPropertyName(void) 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"); @@ -263,7 +263,7 @@ int UtcDaliHandleGetPropertyIndex(void) 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"); @@ -280,42 +280,42 @@ int UtcDaliHandleIsPropertyWritable(void) 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; } @@ -328,42 +328,42 @@ int UtcDaliHandleIsPropertyAnimatable(void) 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; } @@ -375,52 +375,52 @@ int UtcDaliHandleIsPropertyAConstraintInput(void) 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; } @@ -433,14 +433,14 @@ int UtcDaliHandleGetPropertyType(void) 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) ); @@ -706,13 +706,13 @@ int UtcDaliHandleSetProperty01(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get() ); + DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::ParentOrigin ).Get() ); - 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() ); + DALI_TEST_CHECK( ParentOrigin::CENTER == actor.GetProperty( Actor::Property::ParentOrigin ).Get() ); END_TEST; } @@ -723,10 +723,10 @@ int UtcDaliHandleSetProperty02(void) 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; } @@ -737,7 +737,7 @@ int UtcDaliHandleRegisterProperty(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get() ); + DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::ParentOrigin ).Get() ); END_TEST; } @@ -749,13 +749,13 @@ int UtcDaliHandleGetProperty(void) Actor actor = Actor::New(); - DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get() ); - DALI_TEST_CHECK( AnchorPoint::CENTER == actor.GetProperty( Actor::ANCHOR_POINT ).Get() ); - DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::SIZE ).Get() ); - DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::POSITION ).Get() ); - DALI_TEST_CHECK( Vector3::ONE == actor.GetProperty( Actor::SCALE ).Get() ); - DALI_TEST_CHECK( true == actor.GetProperty( Actor::VISIBLE ).Get() ); - DALI_TEST_CHECK( Color::WHITE == actor.GetProperty( Actor::COLOR ).Get() ); + DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::ParentOrigin ).Get() ); + DALI_TEST_CHECK( AnchorPoint::CENTER == actor.GetProperty( Actor::Property::AnchorPoint ).Get() ); + DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::Property::Size ).Get() ); + DALI_TEST_CHECK( Vector3::ZERO == actor.GetProperty( Actor::Property::Position ).Get() ); + DALI_TEST_CHECK( Vector3::ONE == actor.GetProperty( Actor::Property::Scale ).Get() ); + DALI_TEST_CHECK( true == actor.GetProperty( Actor::Property::Visible ).Get() ); + DALI_TEST_CHECK( Color::WHITE == actor.GetProperty( Actor::Property::Color ).Get() ); END_TEST; } diff --git a/automated-tests/src/dali/utc-Dali-ImageActor.cpp b/automated-tests/src/dali/utc-Dali-ImageActor.cpp index bbffcd1..5df2c0c 100644 --- a/automated-tests/src/dali/utc-Dali-ImageActor.cpp +++ b/automated-tests/src/dali/utc-Dali-ImageActor.cpp @@ -658,10 +658,10 @@ int UtcDaliImageActorDefaultProperties(void) ImageActor actor = ImageActor::New( img ); std::vector 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() ) ); @@ -677,11 +677,11 @@ int UtcDaliImageActorDefaultProperties(void) actor.SetPixelArea(ImageActor::PixelArea( 0, 0, 0, 0 )); ImageActor::PixelArea area( 1, 2, 3, 4 ); - actor.SetProperty(ImageActor::PIXEL_AREA, Property::Value(Rect(area))); + actor.SetProperty(ImageActor::Property::PixelArea, Property::Value(Rect(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 >() == area); @@ -924,7 +924,7 @@ int UtcDaliImageActorImageProperty(void) 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; diff --git a/automated-tests/src/dali/utc-Dali-Layer.cpp b/automated-tests/src/dali/utc-Dali-Layer.cpp index a80a16d..1d40297 100644 --- a/automated-tests/src/dali/utc-Dali-Layer.cpp +++ b/automated-tests/src/dali/utc-Dali-Layer.cpp @@ -442,8 +442,8 @@ int UtcDaliLayerDefaultProperties(void) Layer actor = Layer::New(); std::vector 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() ) ); @@ -461,11 +461,11 @@ int UtcDaliLayerDefaultProperties(void) ClippingBox testBox(10,20,30,40); DALI_TEST_CHECK(actor.GetClippingBox() != testBox); - actor.SetProperty(Layer::CLIPPING_BOX, Property::Value(Rect(testBox))); + actor.SetProperty(Layer::Property::ClippingBox, Property::Value(Rect(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 >() == testBox); diff --git a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp index a902e9f..a4bbc4d 100644 --- a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp @@ -2085,12 +2085,12 @@ int UtcDaliPanGestureNoPredictionNoSmoothing(void) Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO ); ConstraintData constraintData; - actor.ApplyConstraint( Constraint::New( 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( 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 @@ -2130,12 +2130,12 @@ int UtcDaliPanGestureNoPredictionSmoothing(void) Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO ); ConstraintData constraintData; - actor.ApplyConstraint( Constraint::New( 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( 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 @@ -2176,12 +2176,12 @@ int UtcDaliPanGesturePredictionNoSmoothing(void) Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO ); ConstraintData constraintData; - actor.ApplyConstraint( Constraint::New( 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( 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 @@ -2222,12 +2222,12 @@ int UtcDaliPanGesturePredictionSmoothing(void) Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO ); ConstraintData constraintData; - actor.ApplyConstraint( Constraint::New( 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( 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 @@ -2269,12 +2269,12 @@ int UtcDaliPanGestureSetProperties(void) Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO ); ConstraintData constraintData; - actor.ApplyConstraint( Constraint::New( 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( 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 @@ -2329,12 +2329,12 @@ int UtcDaliPanGestureSetPropertiesAlreadyPanning(void) Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO ); ConstraintData constraintData; - actor.ApplyConstraint( Constraint::New( 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( 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 diff --git a/automated-tests/src/dali/utc-Dali-PropertyNotification.cpp b/automated-tests/src/dali/utc-Dali-PropertyNotification.cpp index 8d20317..9849825 100644 --- a/automated-tests/src/dali/utc-Dali-PropertyNotification.cpp +++ b/automated-tests/src/dali/utc-Dali-PropertyNotification.cpp @@ -63,7 +63,7 @@ public: { 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 ); } @@ -128,7 +128,7 @@ int UtcDaliPropertyNotificationDownCast(void) 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; @@ -152,7 +152,7 @@ int UtcDaliPropertyNotificationDownCastNegative(void) 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; @@ -168,7 +168,7 @@ int UtcDaliAddPropertyNotification(void) 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; } @@ -273,7 +273,7 @@ int UtcDaliPropertyNotificationGetCondition(void) 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; } @@ -308,7 +308,7 @@ int UtcDaliPropertyNotificationGetConditionConst(void) 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(); @@ -326,7 +326,7 @@ int UtcDaliPropertyNotificationGetTarget(void) 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() ); @@ -341,11 +341,11 @@ int UtcDaliPropertyNotificationGetProperty(void) 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; } @@ -356,7 +356,7 @@ int UtcDaliPropertyNotificationGetNotifyMode(void) 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(); @@ -373,7 +373,7 @@ int UtcDaliPropertyNotificationGreaterThan(void) 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)); @@ -408,7 +408,7 @@ int UtcDaliPropertyNotificationLessThan(void) 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)); @@ -443,7 +443,7 @@ int UtcDaliPropertyNotificationInside(void) 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)); @@ -478,7 +478,7 @@ int UtcDaliPropertyNotificationOutside(void) 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)); @@ -513,13 +513,13 @@ int UtcDaliPropertyNotificationVectorComponentGreaterThan(void) 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)); @@ -562,13 +562,13 @@ int UtcDaliPropertyNotificationVectorComponentLessThan(void) 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)); @@ -611,13 +611,13 @@ int UtcDaliPropertyNotificationVectorComponentInside(void) 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 @@ -661,13 +661,13 @@ int UtcDaliPropertyNotificationVectorComponentOutside(void) 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 @@ -779,7 +779,7 @@ int UtcDaliPropertyNotificationStep(void) 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 @@ -824,7 +824,7 @@ int UtcDaliPropertyNotificationVariableStep(void) 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 @@ -856,13 +856,13 @@ int UtcDaliPropertyNotificationOrder(void) 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 diff --git a/automated-tests/src/dali/utc-Dali-RenderTask.cpp b/automated-tests/src/dali/utc-Dali-RenderTask.cpp index c22e696..9a1e634 100644 --- a/automated-tests/src/dali/utc-Dali-RenderTask.cpp +++ b/automated-tests/src/dali/utc-Dali-RenderTask.cpp @@ -938,7 +938,7 @@ int UtcDaliRenderTaskSetViewportPosition(void) // 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(); @@ -948,7 +948,7 @@ int UtcDaliRenderTaskSetViewportPosition(void) 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. @@ -986,7 +986,7 @@ int UtcDaliRenderTaskSetViewportSize(void) // 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(); @@ -996,7 +996,7 @@ int UtcDaliRenderTaskSetViewportSize(void) 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. @@ -1027,7 +1027,7 @@ int UtcDaliRenderTaskSetClearColor(void) 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); diff --git a/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp b/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp index a340d56..9ed7752 100644 --- a/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp +++ b/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp @@ -682,7 +682,7 @@ int UtcDaliShaderEffectMethodApplyConstraintFromActor(void) Property::Index uVecProperty = effect.GetPropertyIndex("uVec3"); Constraint constraint = Constraint::New( uVecProperty, - Source(actor, Actor::POSITION), + Source(actor, Actor::Property::Position), TestConstraintFromPositionToVector3() ); effect.ApplyConstraint(constraint); @@ -722,12 +722,12 @@ int UtcDaliShaderEffectMethodApplyConstraintFromActor2(void) Property::Index uVecProperty = effect.GetPropertyIndex("uVec3"); Constraint shaderConstraint = Constraint::New( uVecProperty, - Source(actor, Actor::POSITION), + Source(actor, Actor::Property::Position), TestConstraintFromPositionToVector3() ); effect.ApplyConstraint(shaderConstraint); - Constraint actorConstraint = Constraint::New( Actor::POSITION, + Constraint actorConstraint = Constraint::New( Actor::Property::Position, TestConstraintToVector3Double(targetPosition) ); actor.ApplyConstraint(actorConstraint); diff --git a/automated-tests/src/dali/utc-Dali-TextActor.cpp b/automated-tests/src/dali/utc-Dali-TextActor.cpp index a57b2aa..841dbe6 100644 --- a/automated-tests/src/dali/utc-Dali-TextActor.cpp +++ b/automated-tests/src/dali/utc-Dali-TextActor.cpp @@ -771,28 +771,28 @@ int UtcDaliTextActorDefaultProperties(void) TextActor actor = TextActor::New("@"); std::vector 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() ) ); @@ -808,8 +808,8 @@ int UtcDaliTextActorDefaultProperties(void) 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() == true); @@ -1016,7 +1016,7 @@ int UtcDaliTextActorAutomaticSizeSetAnimation(void) // 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 diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index b463799..d85f393 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -63,122 +63,6 @@ using Dali::Internal::SceneGraph::PropertyBase; 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 { @@ -207,9 +91,64 @@ struct DynamicsData #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"; @@ -223,6 +162,15 @@ const char* const SIGNAL_OFF_STAGE = "off-stage"; 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(); @@ -232,13 +180,13 @@ TypeRegistration mType( typeid( Dali::Actor ), typeid( Dali::Handle ), CreateAct 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() { @@ -2382,10 +2330,8 @@ const char* Actor::GetDefaultPropertyName( Property::Index index ) const { return DEFAULT_PROPERTY_DETAILS[index].name; } - else - { - return NULL; - } + + return NULL; } Property::Index Actor::GetDefaultPropertyIndex(const std::string& name) const @@ -2412,10 +2358,8 @@ bool Actor::IsDefaultPropertyWritable(Property::Index index) const { return DEFAULT_PROPERTY_DETAILS[index].writable; } - else - { - return false; - } + + return false; } bool Actor::IsDefaultPropertyAnimatable(Property::Index index) const @@ -2424,10 +2368,8 @@ 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 @@ -2436,10 +2378,8 @@ 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 @@ -2448,236 +2388,234 @@ 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() ); break; } - case Dali::Actor::PARENT_ORIGIN_X: + case Dali::Actor::Property::ParentOriginX: { SetParentOriginX( property.Get() ); break; } - case Dali::Actor::PARENT_ORIGIN_Y: + case Dali::Actor::Property::ParentOriginY: { SetParentOriginY( property.Get() ); break; } - case Dali::Actor::PARENT_ORIGIN_Z: + case Dali::Actor::Property::ParentOriginZ: { SetParentOriginZ( property.Get() ); break; } - case Dali::Actor::ANCHOR_POINT: + case Dali::Actor::Property::AnchorPoint: { SetAnchorPoint( property.Get() ); break; } - case Dali::Actor::ANCHOR_POINT_X: + case Dali::Actor::Property::AnchorPointX: { SetAnchorPointX( property.Get() ); break; } - case Dali::Actor::ANCHOR_POINT_Y: + case Dali::Actor::Property::AnchorPointY: { SetAnchorPointY( property.Get() ); break; } - case Dali::Actor::ANCHOR_POINT_Z: + case Dali::Actor::Property::AnchorPointZ: { SetAnchorPointZ( property.Get() ); break; } - case Dali::Actor::SIZE: + case Dali::Actor::Property::Size: { SetSize( property.Get() ); break; } - case Dali::Actor::SIZE_WIDTH: + case Dali::Actor::Property::SizeWidth: { SetWidth( property.Get() ); break; } - case Dali::Actor::SIZE_HEIGHT: + case Dali::Actor::Property::SizeHeight: { SetHeight( property.Get() ); break; } - case Dali::Actor::SIZE_DEPTH: + case Dali::Actor::Property::SizeDepth: { SetDepth( property.Get() ); break; } - case Dali::Actor::POSITION: + case Dali::Actor::Property::Position: { SetPosition( property.Get() ); break; } - case Dali::Actor::POSITION_X: + case Dali::Actor::Property::PositionX: { SetX( property.Get() ); break; } - case Dali::Actor::POSITION_Y: + case Dali::Actor::Property::PositionY: { SetY( property.Get() ); break; } - case Dali::Actor::POSITION_Z: + case Dali::Actor::Property::PositionZ: { SetZ( property.Get() ); break; } - case Dali::Actor::ROTATION: + case Dali::Actor::Property::Rotation: { SetRotation( property.Get() ); break; } - case Dali::Actor::SCALE: + case Dali::Actor::Property::Scale: { SetScale( property.Get() ); break; } - case Dali::Actor::SCALE_X: + case Dali::Actor::Property::ScaleX: { SetScaleX( property.Get() ); break; } - case Dali::Actor::SCALE_Y: + case Dali::Actor::Property::ScaleY: { SetScaleY( property.Get() ); break; } - case Dali::Actor::SCALE_Z: + case Dali::Actor::Property::ScaleZ: { SetScaleZ( property.Get() ); break; } - case Dali::Actor::VISIBLE: + case Dali::Actor::Property::Visible: { SetVisible( property.Get() ); break; } - case Dali::Actor::COLOR: + case Dali::Actor::Property::Color: { SetColor( property.Get() ); break; } - case Dali::Actor::COLOR_RED: + case Dali::Actor::Property::ColorRed: { SetColorRed( property.Get() ); break; } - case Dali::Actor::COLOR_GREEN: + case Dali::Actor::Property::ColorGreen: { SetColorGreen( property.Get() ); break; } - case Dali::Actor::COLOR_BLUE: + case Dali::Actor::Property::ColorBlue: { SetColorBlue( property.Get() ); break; } - case Dali::Actor::COLOR_ALPHA: + case Dali::Actor::Property::ColorAlpha: { SetOpacity( property.Get() ); break; } - case Dali::Actor::NAME: + case Dali::Actor::Property::Name: { SetName( property.Get() ); break; } - case Dali::Actor::SENSITIVE: + case Dali::Actor::Property::Sensitive: { SetSensitive( property.Get() ); break; } - case Dali::Actor::LEAVE_REQUIRED: + case Dali::Actor::Property::LeaveRequired: { SetLeaveRequired( property.Get() ); break; } - case Dali::Actor::INHERIT_ROTATION: + case Dali::Actor::Property::InheritRotation: { SetInheritRotation( property.Get() ); break; } - case Dali::Actor::SIZE_MODE: + case Dali::Actor::Property::InheritScale: { - SetSizeMode( Scripting::GetEnumeration< SizeMode >( property.Get().c_str(), SIZE_MODE_TABLE, SIZE_MODE_TABLE_COUNT ) ); + SetInheritScale( property.Get() ); break; } - case Dali::Actor::SIZE_MODE_FACTOR: + case Dali::Actor::Property::ColorMode: { - SetSizeModeFactor( property.Get() ); + SetColorMode( Scripting::GetColorMode( property.Get() ) ); break; } - case Dali::Actor::INHERIT_SCALE: + case Dali::Actor::Property::PositionInheritance: { - SetInheritScale( property.Get() ); + SetPositionInheritanceMode( Scripting::GetPositionInheritanceMode( property.Get() ) ); break; } - case Dali::Actor::COLOR_MODE: + case Dali::Actor::Property::DrawMode: { - SetColorMode( Scripting::GetColorMode( property.Get() ) ); + SetDrawMode( Scripting::GetDrawMode( property.Get() ) ); break; } - case Dali::Actor::POSITION_INHERITANCE: + case Dali::Actor::Property::SizeMode: { - SetPositionInheritanceMode( Scripting::GetPositionInheritanceMode( property.Get() ) ); + SetSizeMode( Scripting::GetEnumeration< SizeMode >( property.Get().c_str(), SizeModeTable, SizeModeTableCount ) ); break; } - case Dali::Actor::DRAW_MODE: + case Dali::Actor::Property::SizeModeFactor: { - SetDrawMode( Scripting::GetDrawMode( property.Get() ) ); + SetSizeModeFactor( property.Get() ); break; } @@ -2803,279 +2741,279 @@ void Actor::SetSceneGraphProperty( Property::Index index, const CustomProperty& } } -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; } @@ -3123,79 +3061,79 @@ const PropertyBase* Actor::GetSceneObjectAnimatableProperty( Property::Index ind { 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; @@ -3227,143 +3165,143 @@ const PropertyInputImpl* Actor::GetSceneObjectInputProperty( Property::Index ind { 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; @@ -3381,43 +3319,43 @@ int Actor::GetPropertyComponentIndex( Property::Index index ) const 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; diff --git a/dali/internal/event/actors/camera-actor-impl.cpp b/dali/internal/event/actors/camera-actor-impl.cpp index e2a99dc..273c2dd 100644 --- a/dali/internal/event/actors/camera-actor-impl.cpp +++ b/dali/internal/event/actors/camera-actor-impl.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -35,27 +35,36 @@ 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 ) { @@ -69,44 +78,7 @@ BaseHandle Create() 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 @@ -422,17 +394,17 @@ const Matrix& CameraActor::GetProjectionMatrix() const 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 ); } @@ -440,58 +412,47 @@ void CameraActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) 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 { @@ -509,11 +470,11 @@ const char* CameraActor::GetDefaultPropertyName( Property::Index index ) const } 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; } @@ -524,11 +485,11 @@ Property::Index CameraActor::GetDefaultPropertyIndex(const std::string& name) co 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; } } @@ -553,9 +514,9 @@ void CameraActor::SetDefaultProperty( Property::Index index, const Property::Val 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 s( propertyValue.Get() ); if(s == "LOOK_AT_TARGET") { mCameraAttachment->SetType(Dali::Camera::LOOK_AT_TARGET); @@ -570,7 +531,7 @@ void CameraActor::SetDefaultProperty( Property::Index index, const Property::Val } break; } - case Dali::CameraActor::PROJECTION_MODE: + case Dali::CameraActor::Property::ProjectionMode: { std::string s(propertyValue.Get()); if(s == "PERSPECTIVE_PROJECTION") @@ -587,62 +548,62 @@ void CameraActor::SetDefaultProperty( Property::Index index, const Property::Val } break; } - case Dali::CameraActor::FIELD_OF_VIEW: + case Dali::CameraActor::Property::FieldOfView: { mCameraAttachment->SetFieldOfView(propertyValue.Get()); break; } - case Dali::CameraActor::ASPECT_RATIO: + case Dali::CameraActor::Property::AspectRatio: { mCameraAttachment->SetAspectRatio(propertyValue.Get()); break; } - case Dali::CameraActor::LEFT_PLANE_DISTANCE: + case Dali::CameraActor::Property::LeftPlaneDistance: { mCameraAttachment->SetLeftClippingPlane(propertyValue.Get()); break; } - case Dali::CameraActor::RIGHT_PLANE_DISTANCE: + case Dali::CameraActor::Property::RightPlaneDistance: { mCameraAttachment->SetRightClippingPlane(propertyValue.Get()); break; } - case Dali::CameraActor::TOP_PLANE_DISTANCE: + case Dali::CameraActor::Property::TopPlaneDistance: { mCameraAttachment->SetTopClippingPlane(propertyValue.Get()); break; } - case Dali::CameraActor::BOTTOM_PLANE_DISTANCE: + case Dali::CameraActor::Property::BottomPlaneDistance: { mCameraAttachment->SetBottomClippingPlane(propertyValue.Get()); break; } - case Dali::CameraActor::NEAR_PLANE_DISTANCE: + case Dali::CameraActor::Property::NearPlaneDistance: { mCameraAttachment->SetNearClippingPlane(propertyValue.Get()); break; } - case Dali::CameraActor::FAR_PLANE_DISTANCE: + case Dali::CameraActor::Property::FarPlaneDistance: { mCameraAttachment->SetFarClippingPlane(propertyValue.Get()); break; } - case Dali::CameraActor::TARGET_POSITION: + case Dali::CameraActor::Property::TargetPosition: { mCameraAttachment->SetTargetPosition(propertyValue.Get()); 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()); break; @@ -669,8 +630,7 @@ Property::Value CameraActor::GetDefaultProperty( Property::Index index ) const 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) { @@ -687,9 +647,7 @@ Property::Value CameraActor::GetDefaultProperty( Property::Index index ) const } break; } - - - case Dali::CameraActor::PROJECTION_MODE: + case Dali::CameraActor::Property::ProjectionMode: { if(mCameraAttachment->GetProjectionMode() == Dali::Camera::PERSPECTIVE_PROJECTION) { @@ -706,62 +664,62 @@ Property::Value CameraActor::GetDefaultProperty( Property::Index index ) const } 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; @@ -817,12 +775,12 @@ const PropertyInputImpl* CameraActor::GetSceneObjectInputProperty( Property::Ind { 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; diff --git a/dali/internal/event/actors/image-actor-impl.cpp b/dali/internal/event/actors/image-actor-impl.cpp index 7ca5741..08f98b5 100644 --- a/dali/internal/event/actors/image-actor-impl.cpp +++ b/dali/internal/event/actors/image-actor-impl.cpp @@ -19,42 +19,37 @@ #include // INTERNAL INCLUDES -#include #include -#include -#include #include +#include +#include +#include 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) { @@ -284,17 +279,17 @@ void ImageActor::OnStageDisconnectionInternal() 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 ); } @@ -302,97 +297,84 @@ void ImageActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) 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 @@ -400,12 +382,12 @@ Property::Index ImageActor::GetDefaultPropertyIndex(const std::string& name) con 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; } } @@ -420,30 +402,30 @@ Property::Index ImageActor::GetDefaultPropertyIndex(const std::string& name) con 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 >()); break; } - case Dali::ImageActor::STYLE: + case Dali::ImageActor::Property::Style: { - SetStyle(StyleEnum(propertyValue.Get())); + SetStyle( StyleEnum( propertyValue.Get() ) ); break; } - case Dali::ImageActor::BORDER: + case Dali::ImageActor::Property::Border: { SetNinePatchBorder( propertyValue.Get(), true /*in pixels*/ ); break; } - case Dali::ImageActor::IMAGE: + case Dali::ImageActor::Property::Image: { Dali::Image img = Scripting::NewImage( propertyValue ); if(img) @@ -470,31 +452,31 @@ void ImageActor::SetDefaultProperty( Property::Index index, const Property::Valu 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 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 ); @@ -503,7 +485,7 @@ Property::Value ImageActor::GetDefaultProperty( Property::Index index ) const } default: { - DALI_LOG_WARNING("Unknown property (%d)\n", index); + DALI_LOG_WARNING( "Unknown property (%d)\n", index ); break; } } // switch(index) diff --git a/dali/internal/event/actors/layer-impl.cpp b/dali/internal/event/actors/layer-impl.cpp index f83d627..721ac12 100644 --- a/dali/internal/event/actors/layer-impl.cpp +++ b/dali/internal/event/actors/layer-impl.cpp @@ -21,24 +21,29 @@ // INTERNAL INCLUDES #include #include -#include -#include #include +#include +#include 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"; @@ -58,14 +63,6 @@ TypeAction a2( mType, ACTION_LOWER, &Layer::DoAction ); 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() @@ -329,16 +326,16 @@ const SceneGraph::Layer& Layer::GetSceneLayerOnStage() const 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 ); } @@ -346,78 +343,66 @@ void Layer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const 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 @@ -425,12 +410,12 @@ 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; } } @@ -445,20 +430,20 @@ Property::Index Layer::GetDefaultPropertyIndex(const std::string& name) const 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() ); break; } - case Dali::Layer::CLIPPING_BOX: + case Dali::Layer::Property::ClippingBox: { Rect clippingBox( propertyValue.Get >() ); SetClippingBox( clippingBox.x, clippingBox.y, clippingBox.width, clippingBox.height ); @@ -466,7 +451,7 @@ void Layer::SetDefaultProperty( Property::Index index, const Property::Value& pr } default: { - DALI_LOG_WARNING("Unknown property (%d)\n", index); + DALI_LOG_WARNING( "Unknown property (%d)\n", index ); break; } } // switch(index) @@ -477,27 +462,27 @@ void Layer::SetDefaultProperty( Property::Index index, const Property::Value& pr 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) diff --git a/dali/internal/event/actors/layer-list.cpp b/dali/internal/event/actors/layer-list.cpp index 740cdbb..deef789 100644 --- a/dali/internal/event/actors/layer-list.cpp +++ b/dali/internal/event/actors/layer-list.cpp @@ -33,8 +33,6 @@ namespace Dali namespace Internal { - - namespace // unnamed namespace { diff --git a/dali/internal/event/actors/mesh-actor-impl.cpp b/dali/internal/event/actors/mesh-actor-impl.cpp index 260aa91..5188024 100644 --- a/dali/internal/event/actors/mesh-actor-impl.cpp +++ b/dali/internal/event/actors/mesh-actor-impl.cpp @@ -33,7 +33,6 @@ using Internal::MaterialIPtr; namespace Internal { - namespace { diff --git a/dali/internal/event/actors/text-actor-impl.cpp b/dali/internal/event/actors/text-actor-impl.cpp index c8957f9..564ad16 100644 --- a/dali/internal/event/actors/text-actor-impl.cpp +++ b/dali/internal/event/actors/text-actor-impl.cpp @@ -21,117 +21,62 @@ // INTERNAL INCLUDES #include #include -#include -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include +#include 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 ); @@ -637,17 +582,17 @@ bool TextActor::CheckTextLoadState() 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 ); } @@ -655,23 +600,19 @@ void TextActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) c 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 @@ -679,11 +620,11 @@ Property::Index TextActor::GetDefaultPropertyIndex(const std::string& name) cons 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; } } @@ -699,134 +640,125 @@ Property::Index TextActor::GetDefaultPropertyIndex(const std::string& name) cons 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() ) ) ); break; } - case Dali::TextActor::FONT: + case Dali::TextActor::Property::Font: { - SetFont(*Font::New(propertyValue.Get(), + SetFont( *Font::New( propertyValue.Get(), 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(), - 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(), color, thickness); + mTextAttachment->SetOutline( propertyValue.Get(), 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(), thickness); + mTextAttachment->SetOutline( mTextAttachment->GetOutline(), propertyValue.Get(), 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()); + mTextAttachment->SetOutline( mTextAttachment->GetOutline(), color, propertyValue.Get() ); break; } - case Dali::TextActor::SMOOTH_EDGE: + case Dali::TextActor::Property::SmoothEdge: { mTextAttachment->SetSmoothEdge( propertyValue.Get()); break; } - case Dali::TextActor::GLOW_ENABLE: + case Dali::TextActor::Property::GlowEnable: { Vector4 color; float intensity; mTextAttachment->GetGlowParams( color, intensity ); - mTextAttachment->SetGlow(propertyValue.Get(), color, intensity); + mTextAttachment->SetGlow( propertyValue.Get(), 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(), intensity); + mTextAttachment->SetGlow( mTextAttachment->GetGlow(), propertyValue.Get(), intensity ); break; } - case Dali::TextActor::GLOW_INTENSITY: + case Dali::TextActor::Property::GlowIntensity: { Vector4 color; float intensity; @@ -834,85 +766,85 @@ void TextActor::SetDefaultProperty( Property::Index index, const Property::Value mTextAttachment->SetGlow(mTextAttachment->GetGlow(), color, propertyValue.Get()); 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(), color, offset, size ); + mTextAttachment->SetShadow( propertyValue.Get(), 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(), offset, size); + mTextAttachment->SetShadow( mTextAttachment->GetShadow(), propertyValue.Get(), 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(), size ); + mTextAttachment->SetShadow( mTextAttachment->GetShadow(), color, propertyValue.Get(), 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()); + mTextAttachment->SetShadow( mTextAttachment->GetShadow(), color, offset, propertyValue.Get() ); break; } - case Dali::TextActor::ITALICS_ANGLE: + case Dali::TextActor::Property::ItalicsAngle: { - SetItalics(Radian(propertyValue.Get())) ; + SetItalics( Radian( propertyValue.Get() ) ) ; break; } - case Dali::TextActor::UNDERLINE: + case Dali::TextActor::Property::Underline: { - SetUnderline(propertyValue.Get(), 0.f, 0.f ) ; + SetUnderline( propertyValue.Get(), 0.f, 0.f ) ; break; } - case Dali::TextActor::WEIGHT: + case Dali::TextActor::Property::Weight: { - mTextAttachment->SetWeight(static_cast(propertyValue.Get())) ; + mTextAttachment->SetWeight( static_cast( propertyValue.Get() ) ) ; break; } - case Dali::TextActor::FONT_DETECTION_AUTOMATIC: + case Dali::TextActor::Property::FontDetectionAutomatic: { mFontDetection = propertyValue.Get() ; break; } - case Dali::TextActor::GRADIENT_COLOR: + case Dali::TextActor::Property::GradientColor: { mTextAttachment->SetGradient( propertyValue.Get(), mTextAttachment->GetGradientStartPoint(), mTextAttachment->GetGradientEndPoint() ); break; } - case Dali::TextActor::GRADIENT_START_POINT: + case Dali::TextActor::Property::GradientStartPoint: { mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), propertyValue.Get(), mTextAttachment->GetGradientEndPoint() ); break; } - case Dali::TextActor::GRADIENT_END_POINT: + case Dali::TextActor::Property::GradientEndPoint: { mTextAttachment->SetGradient( mTextAttachment->GetGradientColor(), mTextAttachment->GetGradientStartPoint(), propertyValue.Get() ); break; } - case Dali::TextActor::TEXT_COLOR: + case Dali::TextActor::Property::TextColor: { mTextAttachment->SetTextColor( propertyValue.Get() ); 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) @@ -923,35 +855,35 @@ void TextActor::SetDefaultProperty( Property::Index index, const Property::Value 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; @@ -959,7 +891,7 @@ Property::Value TextActor::GetDefaultProperty( Property::Index index ) const ret = color; break; } - case Dali::TextActor::OUTLINE_THICKNESS_WIDTH: + case Dali::TextActor::Property::OutlineThicknessWidth: { Vector4 color; Vector2 thickness; @@ -967,38 +899,38 @@ Property::Value TextActor::GetDefaultProperty( Property::Index index ) const 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; @@ -1007,7 +939,7 @@ Property::Value TextActor::GetDefaultProperty( Property::Index index ) const ret = color; break; } - case Dali::TextActor::SHADOW_OFFSET: + case Dali::TextActor::Property::ShadowOffset: { Vector4 color; Vector2 offset; @@ -1016,7 +948,7 @@ Property::Value TextActor::GetDefaultProperty( Property::Index index ) const ret = offset; break; } - case Dali::TextActor::SHADOW_SIZE: + case Dali::TextActor::Property::ShadowSize: { Vector4 color; Vector2 offset; @@ -1025,49 +957,49 @@ Property::Value TextActor::GetDefaultProperty( Property::Index index ) const ret = size; break; } - case Dali::TextActor::ITALICS_ANGLE: + case Dali::TextActor::Property::ItalicsAngle: { - ret = static_cast(mTextAttachment->GetItalics()) ; + ret = static_cast( 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(mTextAttachment->GetWeight()); + ret = static_cast( 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) diff --git a/dali/internal/event/animation/active-constraint-base.cpp b/dali/internal/event/animation/active-constraint-base.cpp index db62b56..74910ce 100644 --- a/dali/internal/event/animation/active-constraint-base.cpp +++ b/dali/internal/event/animation/active-constraint-base.cpp @@ -24,8 +24,9 @@ #include #include #include -#include +#include #include +#include #include using Dali::Internal::SceneGraph::AnimatableProperty; @@ -33,14 +34,19 @@ 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"; @@ -55,27 +61,6 @@ TypeRegistration mType( typeid(Dali::ActiveConstraint), typeid(Dali::Handle), Cr 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 ) @@ -159,7 +144,7 @@ void ActiveConstraintBase::FirstApply( Object& parent, TimePeriod applyTime ) // 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 @@ -338,7 +323,7 @@ const char* ActiveConstraintBase::GetDefaultPropertyName( Property::Index index { if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) ) { - return DEFAULT_PROPERTY_NAMES[index]; + return DEFAULT_PROPERTY_DETAILS[index].name; } else { @@ -351,7 +336,7 @@ Property::Index ActiveConstraintBase::GetDefaultPropertyIndex( const std::string 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; } @@ -361,35 +346,33 @@ Property::Index ActiveConstraintBase::GetDefaultPropertyIndex( const std::string 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() ); } @@ -399,7 +382,7 @@ Property::Value ActiveConstraintBase::GetDefaultProperty( Property::Index index { Property::Value value; - if( Dali::ActiveConstraint::WEIGHT == index ) + if( Dali::ActiveConstraint::Property::Weight == index ) { value = GetCurrentWeight(); } diff --git a/dali/internal/event/animation/animation-impl.cpp b/dali/internal/event/animation/animation-impl.cpp index 6029980..931bba6 100644 --- a/dali/internal/event/animation/animation-impl.cpp +++ b/dali/internal/event/animation/animation-impl.cpp @@ -19,6 +19,7 @@ #include // INTERNAL INCLUDES +#include #include #include #include @@ -26,13 +27,14 @@ #include #include #include -#include -#include #include +#include #include -#include -#include +#include +#include #include +#include +#include using Dali::Internal::SceneGraph::UpdateManager; using Dali::Internal::SceneGraph::AnimatorBase; @@ -421,51 +423,51 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn { case Property::BOOLEAN: { - AddAnimatorConnector( AnimatorConnector::New(targetObject, - targetPropertyIndex, - componentIndex, - new AnimateToBoolean(destinationValue.Get()), - alpha, - period) ); + AddAnimatorConnector( AnimatorConnector::New( targetObject, + targetPropertyIndex, + componentIndex, + new AnimateToBoolean( destinationValue.Get() ), + alpha, + period ) ); break; } case Property::FLOAT: { - AddAnimatorConnector( AnimatorConnector::New(targetObject, - targetPropertyIndex, - componentIndex, - new AnimateToFloat(destinationValue.Get()), - alpha, - period) ); + AddAnimatorConnector( AnimatorConnector::New( targetObject, + targetPropertyIndex, + componentIndex, + new AnimateToFloat( destinationValue.Get() ), + alpha, + period ) ); break; } case Property::INTEGER: { - AddAnimatorConnector( AnimatorConnector::New(targetObject, - targetPropertyIndex, - componentIndex, - new AnimateToInteger(destinationValue.Get()), - alpha, - period) ); + AddAnimatorConnector( AnimatorConnector::New( targetObject, + targetPropertyIndex, + componentIndex, + new AnimateToInteger( destinationValue.Get() ), + alpha, + period ) ); break; } case Property::VECTOR2: { - AddAnimatorConnector( AnimatorConnector::New(targetObject, - targetPropertyIndex, - componentIndex, - new AnimateToVector2(destinationValue.Get()), - alpha, - period) ); + AddAnimatorConnector( AnimatorConnector::New( targetObject, + targetPropertyIndex, + componentIndex, + new AnimateToVector2( destinationValue.Get() ), + 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( &targetObject ); @@ -476,34 +478,34 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn } } - AddAnimatorConnector( AnimatorConnector::New(targetObject, - targetPropertyIndex, - componentIndex, - new AnimateToVector3(destinationValue.Get()), - alpha, - period) ); + AddAnimatorConnector( AnimatorConnector::New( targetObject, + targetPropertyIndex, + componentIndex, + new AnimateToVector3( destinationValue.Get() ), + alpha, + period ) ); break; } case Property::VECTOR4: { - AddAnimatorConnector( AnimatorConnector::New(targetObject, - targetPropertyIndex, - componentIndex, - new AnimateToVector4(destinationValue.Get()), - alpha, - period) ); + AddAnimatorConnector( AnimatorConnector::New( targetObject, + targetPropertyIndex, + componentIndex, + new AnimateToVector4( destinationValue.Get() ), + alpha, + period ) ); break; } case Property::ROTATION: { - AddAnimatorConnector( AnimatorConnector::New(targetObject, - targetPropertyIndex, - componentIndex, - new RotateToQuaternion(destinationValue.Get()), - alpha, - period) ); + AddAnimatorConnector( AnimatorConnector::New( targetObject, + targetPropertyIndex, + componentIndex, + new RotateToQuaternion( destinationValue.Get() ), + alpha, + period ) ); break; } @@ -752,7 +754,7 @@ void Animation::Animate( Actor& actor, const Path& path, const Vector3& forward, //Position animation AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::POSITION, + Dali::Actor::Property::Position, Property::INVALID_COMPONENT_INDEX, new PathPositionFunctor( pathCopy ), alpha, @@ -763,7 +765,7 @@ void Animation::Animate( Actor& actor, const Path& path, const Vector3& forward, { //Rotation animation AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::ROTATION, + Dali::Actor::Property::Rotation, Property::INVALID_COMPONENT_INDEX, new PathRotationFunctor( pathCopy, forward ), alpha, @@ -786,7 +788,7 @@ void Animation::MoveBy(Actor& actor, const Vector3& displacement, AlphaFunction ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::POSITION, + Dali::Actor::Property::Position, Property::INVALID_COMPONENT_INDEX, new AnimateByVector3(displacement), alpha, @@ -808,7 +810,7 @@ void Animation::MoveTo(Actor& actor, const Vector3& position, AlphaFunction alph ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::POSITION, + Dali::Actor::Property::Position, Property::INVALID_COMPONENT_INDEX, new AnimateToVector3(position), alpha, @@ -830,7 +832,7 @@ void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaF ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::ROTATION, + Dali::Actor::Property::Rotation, Property::INVALID_COMPONENT_INDEX, new RotateByAngleAxis(angle, axis), alpha, @@ -882,7 +884,7 @@ void Animation::RotateTo(Actor& actor, const Quaternion& rotation, AlphaFunction ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::ROTATION, + Dali::Actor::Property::Rotation, Property::INVALID_COMPONENT_INDEX, new RotateToQuaternion(rotation), alpha, @@ -904,7 +906,7 @@ void Animation::ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha, ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::SCALE, + Dali::Actor::Property::Scale, Property::INVALID_COMPONENT_INDEX, new AnimateByVector3(scale), alpha, @@ -926,7 +928,7 @@ void Animation::ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha, ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::SCALE, + Dali::Actor::Property::Scale, Property::INVALID_COMPONENT_INDEX, new AnimateToVector3(scale), alpha, @@ -938,7 +940,7 @@ void Animation::Show(Actor& actor, float delaySeconds) ExtendDuration( TimePeriod(delaySeconds, 0) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::VISIBLE, + Dali::Actor::Property::Visible, Property::INVALID_COMPONENT_INDEX, new AnimateToBoolean(SHOW_VALUE), AlphaFunctions::Default, @@ -950,7 +952,7 @@ void Animation::Hide(Actor& actor, float delaySeconds) ExtendDuration( TimePeriod(delaySeconds, 0) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::VISIBLE, + Dali::Actor::Property::Visible, Property::INVALID_COMPONENT_INDEX, new AnimateToBoolean(HIDE_VALUE), AlphaFunctions::Default, @@ -972,7 +974,7 @@ void Animation::OpacityBy(Actor& actor, float opacity, AlphaFunction alpha, floa ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::COLOR, + Dali::Actor::Property::Color, Property::INVALID_COMPONENT_INDEX, new AnimateByOpacity(opacity), alpha, @@ -994,7 +996,7 @@ void Animation::OpacityTo(Actor& actor, float opacity, AlphaFunction alpha, floa ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::COLOR, + Dali::Actor::Property::Color, Property::INVALID_COMPONENT_INDEX, new AnimateToOpacity(opacity), alpha, @@ -1016,7 +1018,7 @@ void Animation::ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha, ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::COLOR, + Dali::Actor::Property::Color, Property::INVALID_COMPONENT_INDEX, new AnimateByVector4(color), alpha, @@ -1038,7 +1040,7 @@ void Animation::ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha, ExtendDuration( TimePeriod(delaySeconds, durationSeconds) ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::COLOR, + Dali::Actor::Property::Color, Property::INVALID_COMPONENT_INDEX, new AnimateToVector4(color), alpha, @@ -1065,7 +1067,7 @@ void Animation::Resize(Actor& actor, float width, float height, AlphaFunction al actor.NotifySizeAnimation( *this, targetSize ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::SIZE, + Dali::Actor::Property::Size, Property::INVALID_COMPONENT_INDEX, new AnimateToVector3(targetSize), alpha, @@ -1090,7 +1092,7 @@ void Animation::Resize(Actor& actor, const Vector3& size, AlphaFunction alpha, f actor.NotifySizeAnimation( *this, size ); AddAnimatorConnector( AnimatorConnector::New( actor, - Dali::Actor::SIZE, + Dali::Actor::Property::Size, Property::INVALID_COMPONENT_INDEX, new AnimateToVector3(size), alpha, diff --git a/dali/internal/event/animation/path-impl.cpp b/dali/internal/event/animation/path-impl.cpp index c1ecca0..3d0a46c 100644 --- a/dali/internal/event/animation/path-impl.cpp +++ b/dali/internal/event/animation/path-impl.cpp @@ -17,9 +17,25 @@ // CLASS HEADER #include +#include + +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. @@ -39,23 +55,7 @@ const float BezierBasisCoeff[] = { -1.0f, 3.0f, -3.0f, 1.0f, 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() { @@ -101,11 +101,9 @@ const char* Path::GetDefaultPropertyName(Property::Index index) const { 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 @@ -131,40 +129,28 @@ Property::Type Path::GetDefaultPropertyType(Property::Index index) 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] ); } } @@ -173,38 +159,28 @@ Property::Value Path::GetDefaultProperty( Property::Index index ) const 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]); } } } @@ -215,10 +191,8 @@ bool Path::IsDefaultPropertyWritable(Property::Index index) const { return DEFAULT_PROPERTY_DETAILS[index].writable; } - else - { - return false; - } + + return false; } bool Path::IsDefaultPropertyAnimatable(Property::Index index) const @@ -227,10 +201,8 @@ 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 @@ -239,10 +211,8 @@ bool Path::IsDefaultPropertyAConstraintInput( Property::Index index ) const { return DEFAULT_PROPERTY_DETAILS[index].constraintInput; } - else - { - return false; - } + + return false; } void Path::AddPoint(const Vector3& point ) diff --git a/dali/internal/event/common/object-impl.cpp b/dali/internal/event/common/object-impl.cpp index 09d5997..d449702 100644 --- a/dali/internal/event/common/object-impl.cpp +++ b/dali/internal/event/common/object-impl.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include using Dali::Internal::SceneGraph::AnimatableProperty; diff --git a/dali/internal/event/common/object-impl.h b/dali/internal/event/common/object-impl.h index 1949f09..0a8a192 100644 --- a/dali/internal/event/common/object-impl.h +++ b/dali/internal/event/common/object-impl.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -35,7 +34,6 @@ #include #include - namespace Dali { @@ -50,18 +48,6 @@ class PropertyInputImpl; 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; diff --git a/dali/internal/event/common/property-helper.h b/dali/internal/event/common/property-helper.h new file mode 100644 index 0000000..04df690 --- /dev/null +++ b/dali/internal/event/common/property-helper.h @@ -0,0 +1,103 @@ +#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 + +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__ + diff --git a/dali/internal/event/common/property-index-ranges.h b/dali/internal/event/common/property-index-ranges.h deleted file mode 100644 index 2808605..0000000 --- a/dali/internal/event/common/property-index-ranges.h +++ /dev/null @@ -1,47 +0,0 @@ -#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 - -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__ diff --git a/dali/internal/event/effects/shader-effect-impl.cpp b/dali/internal/event/effects/shader-effect-impl.cpp index bd41274..fbdca05 100644 --- a/dali/internal/event/effects/shader-effect-impl.cpp +++ b/dali/internal/event/effects/shader-effect-impl.cpp @@ -19,22 +19,23 @@ #include // INTERNAL INCLUDES -#include #include #include -#include +#include #include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include #include #include #include +#include +#include #include "dali-shaders.h" using Dali::Internal::SceneGraph::UpdateManager; @@ -48,26 +49,21 @@ using std::string; 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() { @@ -412,10 +408,8 @@ const char* ShaderEffect::GetDefaultPropertyName(Property::Index index) const { return DEFAULT_PROPERTY_DETAILS[index].name; } - else - { - return NULL; - } + + return NULL; } Property::Index ShaderEffect::GetDefaultPropertyIndex(const std::string& name) const @@ -434,22 +428,21 @@ Property::Index ShaderEffect::GetDefaultPropertyIndex(const std::string& name) c } 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 @@ -458,24 +451,22 @@ 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() ); break; } - case Dali::ShaderEffect::IMAGE: + case Dali::ShaderEffect::Property::Image: { Dali::Image img(Scripting::NewImage( propertyValue )); if(img) @@ -489,7 +480,7 @@ void ShaderEffect::SetDefaultProperty( Property::Index index, const Property::Va break; } - case Dali::ShaderEffect::PROGRAM: + case Dali::ShaderEffect::Property::Program: { std::string vertexPrefix = GetShader("vertex-prefix", propertyValue); std::string fragmentPrefix = GetShader("fragment-prefix", propertyValue); @@ -529,7 +520,7 @@ void ShaderEffect::SetDefaultProperty( Property::Index index, const Property::Va 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"); diff --git a/dali/internal/event/events/pan-gesture-detector-impl.cpp b/dali/internal/event/events/pan-gesture-detector-impl.cpp index 5c9ea9e..f1ab255 100644 --- a/dali/internal/event/events/pan-gesture-detector-impl.cpp +++ b/dali/internal/event/events/pan-gesture-detector-impl.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -33,14 +33,6 @@ 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 { @@ -49,17 +41,16 @@ namespace // 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 @@ -337,7 +328,7 @@ void PanGestureDetector::GetDefaultPropertyIndices( Property::IndexContainer& in { 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 ); @@ -346,15 +337,13 @@ void PanGestureDetector::GetDefaultPropertyIndices( Property::IndexContainer& in 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 @@ -364,7 +353,7 @@ Property::Index PanGestureDetector::GetDefaultPropertyIndex(const std::string& n // 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; @@ -377,27 +366,27 @@ Property::Index PanGestureDetector::GetDefaultPropertyIndex(const std::string& n 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 { @@ -417,7 +406,7 @@ Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) co switch ( index ) { - case Dali::PanGestureDetector::SCREEN_POSITION: + case Dali::PanGestureDetector::Property::ScreenPosition: { if(mSceneObject) { @@ -430,7 +419,7 @@ Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) co break; } - case Dali::PanGestureDetector::SCREEN_DISPLACEMENT: + case Dali::PanGestureDetector::Property::ScreenDisplacement: { if(mSceneObject) { @@ -443,7 +432,7 @@ Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) co break; } - case Dali::PanGestureDetector::SCREEN_VELOCITY: + case Dali::PanGestureDetector::Property::ScreenVelocity: { if(mSceneObject) { @@ -456,7 +445,7 @@ Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) co break; } - case Dali::PanGestureDetector::LOCAL_POSITION: + case Dali::PanGestureDetector::Property::LocalPosition: { if(mSceneObject) { @@ -469,7 +458,7 @@ Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) co break; } - case Dali::PanGestureDetector::LOCAL_DISPLACEMENT: + case Dali::PanGestureDetector::Property::LocalDisplacement: { if(mSceneObject) { @@ -482,7 +471,7 @@ Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) co break; } - case Dali::PanGestureDetector::LOCAL_VELOCITY: + case Dali::PanGestureDetector::Property::LocalVelocity: { if(mSceneObject) { @@ -495,7 +484,7 @@ Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) co break; } - case Dali::PanGestureDetector::PANNING: + case Dali::PanGestureDetector::Property::Panning: { if(mSceneObject) { @@ -552,43 +541,43 @@ const PropertyInputImpl* PanGestureDetector::GetSceneObjectInputProperty( Proper { 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; diff --git a/dali/internal/event/modeling/animatable-mesh-impl.cpp b/dali/internal/event/modeling/animatable-mesh-impl.cpp index 1dc391a..13d7339 100644 --- a/dali/internal/event/modeling/animatable-mesh-impl.cpp +++ b/dali/internal/event/modeling/animatable-mesh-impl.cpp @@ -15,37 +15,35 @@ * */ -#include +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include #include #include -#include -#include #include +#include #include #include 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 @@ -58,13 +56,12 @@ AnimatableMesh::AnimatableMesh( 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 ) @@ -80,7 +77,6 @@ AnimatableMeshPtr AnimatableMesh::New( return New( numVertices, faceIndices, material, false ); } - AnimatableMeshPtr AnimatableMesh::New( unsigned int numVertices, const Dali::AnimatableMesh::Faces& faceIndices, @@ -128,7 +124,6 @@ AnimatableMeshPtr AnimatableMesh::New( return animatableMeshPtr; } - AnimatableMesh::~AnimatableMesh() { // Guard to allow handle destruction after Core has been destroyed @@ -150,8 +145,8 @@ Property::Index AnimatableMesh::GetVertexPropertyIndex( 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) @@ -225,7 +220,7 @@ const char* AnimatableMesh::GetDefaultPropertyName( Property::Index index ) cons { if ( ( index >= 0 ) && ( index < mPropertyCount ) ) { - return DEFAULT_PROPERTY_DETAILS[index % VERTEX_PROPERTY_COUNT].name; + return DEFAULT_PROPERTY_DETAILS[index % DEFAULT_PROPERTY_COUNT].name; } else { @@ -238,7 +233,7 @@ Property::Index AnimatableMesh::GetDefaultPropertyIndex(const std::string& name) 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 @@ -252,51 +247,49 @@ Property::Index AnimatableMesh::GetDefaultPropertyIndex(const std::string& name) 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() ); break; } - case Dali::AnimatableVertex::COLOR: + case Dali::AnimatableVertex::Property::Color: { SetColor( vertexIndex, property.Get() ); break; } - case Dali::AnimatableVertex::TEXTURE_COORDS: + case Dali::AnimatableVertex::Property::TextureCoords: { SetTextureCoords( vertexIndex, property.Get() ); break; @@ -312,22 +305,22 @@ void AnimatableMesh::SetDefaultProperty( Property::Index index, const Property:: 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; @@ -356,18 +349,18 @@ const SceneGraph::PropertyBase* AnimatableMesh::GetSceneObjectAnimatableProperty // 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; } @@ -381,18 +374,18 @@ const PropertyInputImpl* AnimatableMesh::GetSceneObjectInputProperty( Property:: 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; } diff --git a/dali/internal/event/render-tasks/render-task-impl.cpp b/dali/internal/event/render-tasks/render-task-impl.cpp index 7b7539a..7193843 100644 --- a/dali/internal/event/render-tasks/render-task-impl.cpp +++ b/dali/internal/event/render-tasks/render-task-impl.cpp @@ -24,11 +24,12 @@ #include #include #include +#include #include #include #include -#include #include +#include #if defined(DEBUG_ENABLED) namespace @@ -40,16 +41,21 @@ Debug::Filter* gLogRender = Debug::Filter::New(Debug::Concise, false, "LOG_RENDE 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"; @@ -58,22 +64,7 @@ TypeRegistration mType( typeid( Dali::RenderTask ), typeid( Dali::BaseHandle ), 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 ) { @@ -456,9 +447,7 @@ void RenderTask::DiscardSceneObject() } /******************************************************************************** - ******************************************************************************** ******************************** PROPERTY METHODS ************************** - ******************************************************************************** ********************************************************************************/ unsigned int RenderTask::GetDefaultPropertyCount() const @@ -480,7 +469,7 @@ const char* RenderTask::GetDefaultPropertyName( Property::Index index ) const { if( index < DEFAULT_PROPERTY_COUNT ) { - return DEFAULT_PROPERTY_NAMES[index]; + return DEFAULT_PROPERTY_DETAILS[index].name; } else { @@ -495,7 +484,7 @@ Property::Index RenderTask::GetDefaultPropertyIndex(const std::string& name) con // 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; @@ -507,47 +496,45 @@ Property::Index RenderTask::GetDefaultPropertyIndex(const std::string& name) con 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() ); break; } - case Dali::RenderTask::VIEWPORT_SIZE: + case Dali::RenderTask::Property::ViewportSize: { SetViewportSize( property.Get() ); break; } - case Dali::RenderTask::CLEAR_COLOR: + case Dali::RenderTask::Property::ClearColor: { SetClearColor( property.Get() ); break; @@ -567,17 +554,17 @@ Property::Value RenderTask::GetDefaultProperty(Property::Index index) const 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; @@ -609,15 +596,15 @@ const SceneGraph::PropertyBase* RenderTask::GetSceneObjectAnimatableProperty( Pr { 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; @@ -636,15 +623,15 @@ const PropertyInputImpl* RenderTask::GetSceneObjectInputProperty( Property::Inde { 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; diff --git a/dali/internal/update/manager/update-algorithms.cpp b/dali/internal/update/manager/update-algorithms.cpp index 5e08ce3..71581e0 100644 --- a/dali/internal/update/manager/update-algorithms.cpp +++ b/dali/internal/update/manager/update-algorithms.cpp @@ -35,7 +35,6 @@ #include - namespace Dali { diff --git a/dali/public-api/actors/actor.h b/dali/public-api/actors/actor.h index 248225a..c0cef0a 100644 --- a/dali/public-api/actors/actor.h +++ b/dali/public-api/actors/actor.h @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace Dali @@ -64,7 +65,6 @@ typedef ActorContainer::iterator ActorIter; ///< Iterator for Dali::ActorContain typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for Dali::ActorContainer - /** * @brief Actor is the primary object with which Dali applications interact. * @@ -247,62 +247,69 @@ class DALI_IMPORT_API Actor : public Handle { 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 /** diff --git a/dali/public-api/actors/camera-actor.h b/dali/public-api/actors/camera-actor.h index 6887298..f8e17cf 100644 --- a/dali/public-api/actors/camera-actor.h +++ b/dali/public-api/actors/camera-actor.h @@ -70,21 +70,30 @@ class DALI_IMPORT_API CameraActor : public Actor { 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. diff --git a/dali/public-api/actors/image-actor.h b/dali/public-api/actors/image-actor.h index 357fc33..18e1932 100644 --- a/dali/public-api/actors/image-actor.h +++ b/dali/public-api/actors/image-actor.h @@ -62,11 +62,20 @@ class DALI_IMPORT_API ImageActor : public RenderableActor { 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. diff --git a/dali/public-api/actors/layer.h b/dali/public-api/actors/layer.h index 71437a6..6daef8f 100644 --- a/dali/public-api/actors/layer.h +++ b/dali/public-api/actors/layer.h @@ -65,9 +65,18 @@ class DALI_IMPORT_API Layer : public Actor { 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. diff --git a/dali/public-api/actors/text-actor.h b/dali/public-api/actors/text-actor.h index 2c2eadd..5c4fdc6 100644 --- a/dali/public-api/actors/text-actor.h +++ b/dali/public-api/actors/text-actor.h @@ -60,31 +60,40 @@ class DALI_IMPORT_API TextActor : public RenderableActor { 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. diff --git a/dali/public-api/animation/active-constraint.h b/dali/public-api/animation/active-constraint.h index a5a9329..d030e39 100644 --- a/dali/public-api/animation/active-constraint.h +++ b/dali/public-api/animation/active-constraint.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace Dali { @@ -44,8 +45,16 @@ class DALI_IMPORT_API ActiveConstraint : public Handle { 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 @@ -91,7 +100,7 @@ public: * * @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. diff --git a/dali/public-api/animation/path.h b/dali/public-api/animation/path.h index 2fb2077..9826bce 100644 --- a/dali/public-api/animation/path.h +++ b/dali/public-api/animation/path.h @@ -20,6 +20,7 @@ // INTERNAL INCLUDES #include +#include namespace Dali { @@ -38,8 +39,18 @@ class DALI_IMPORT_API Path : public Handle { 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. * diff --git a/dali/public-api/dali-core.h b/dali/public-api/dali-core.h index 58d28bf..caa6819 100644 --- a/dali/public-api/dali-core.h +++ b/dali/public-api/dali-core.h @@ -125,7 +125,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/dali/public-api/events/pan-gesture-detector.h b/dali/public-api/events/pan-gesture-detector.h index 94ebca6..f5f50a2 100644 --- a/dali/public-api/events/pan-gesture-detector.h +++ b/dali/public-api/events/pan-gesture-detector.h @@ -20,6 +20,7 @@ // INTERNAL INCLUDES #include +#include #include namespace Dali @@ -60,6 +61,23 @@ class DALI_IMPORT_API PanGestureDetector : public GestureDetector { 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 @@ -76,17 +94,6 @@ public: 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 /** diff --git a/dali/public-api/file.list b/dali/public-api/file.list index b8ba1c9..021d96a 100644 --- a/dali/public-api/file.list +++ b/dali/public-api/file.list @@ -246,7 +246,7 @@ public_api_core_object_header_files = \ $(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 \ diff --git a/dali/public-api/geometry/animatable-vertex.cpp b/dali/public-api/geometry/animatable-vertex.cpp index ab5db92..75f5a82 100644 --- a/dali/public-api/geometry/animatable-vertex.cpp +++ b/dali/public-api/geometry/animatable-vertex.cpp @@ -36,37 +36,37 @@ AnimatableVertex::~AnimatableVertex() 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; } diff --git a/dali/public-api/geometry/animatable-vertex.h b/dali/public-api/geometry/animatable-vertex.h index f955c28..6fe146a 100644 --- a/dali/public-api/geometry/animatable-vertex.h +++ b/dali/public-api/geometry/animatable-vertex.h @@ -21,6 +21,7 @@ // INTERNAL INCLUDES #include #include +#include #include #include #include @@ -49,10 +50,19 @@ class DALI_IMPORT_API AnimatableVertex { 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 diff --git a/dali/public-api/object/handle.cpp b/dali/public-api/object/handle.cpp index 34532ae..01065b5 100644 --- a/dali/public-api/object/handle.cpp +++ b/dali/public-api/object/handle.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/dali/public-api/object/property-index-ranges.h b/dali/public-api/object/property-index-ranges.h new file mode 100644 index 0000000..da2c188 --- /dev/null +++ b/dali/public-api/object/property-index-ranges.h @@ -0,0 +1,55 @@ +#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 + +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__ diff --git a/dali/public-api/object/property-index.h b/dali/public-api/object/property-index.h deleted file mode 100644 index d578451..0000000 --- a/dali/public-api/object/property-index.h +++ /dev/null @@ -1,42 +0,0 @@ -#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 - -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__ diff --git a/dali/public-api/object/type-registry.cpp b/dali/public-api/object/type-registry.cpp index 4bd7611..93286fb 100644 --- a/dali/public-api/object/type-registry.cpp +++ b/dali/public-api/object/type-registry.cpp @@ -21,9 +21,8 @@ // EXTERNAL INCLUDES // INTERNAL INCLUDES -#include +#include #include -#include namespace Dali { diff --git a/dali/public-api/render-tasks/render-task.h b/dali/public-api/render-tasks/render-task.h index 8f71f52..5003b24 100644 --- a/dali/public-api/render-tasks/render-task.h +++ b/dali/public-api/render-tasks/render-task.h @@ -21,6 +21,7 @@ // INTERNAL INCLUDES #include #include +#include #include namespace Dali @@ -77,16 +78,25 @@ class RenderTask; 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. diff --git a/dali/public-api/scripting/scripting.h b/dali/public-api/scripting/scripting.h index 411af54..94ae209 100644 --- a/dali/public-api/scripting/scripting.h +++ b/dali/public-api/scripting/scripting.h @@ -136,6 +136,29 @@ const char * GetEnumerationName( T value, const StringEnum< T >* table, unsigned } /** + * @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 diff --git a/dali/public-api/shader-effects/shader-effect.h b/dali/public-api/shader-effects/shader-effect.h index 446bb12..893ad27 100644 --- a/dali/public-api/shader-effects/shader-effect.h +++ b/dali/public-api/shader-effects/shader-effect.h @@ -21,6 +21,7 @@ // INTERNAL INCLUDES #include #include +#include namespace Dali { @@ -150,6 +151,34 @@ enum GeometryType 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. @@ -171,25 +200,6 @@ public: 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. */ -- 2.7.4