From 3a742557ad6dc9302c03ba623f45055613c5639b Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Wed, 27 May 2020 14:00:07 +0100 Subject: [PATCH] Remove more public Setter/Getter APIs from Dali::Actor Change-Id: I2bdf4121679a09af4b0880675d244f3bb2a883f8 --- automated-tests/src/dali/utc-Dali-Actor.cpp | 127 +++++++++-------- automated-tests/src/dali/utc-Dali-Animation.cpp | 32 ++--- automated-tests/src/dali/utc-Dali-CameraActor.cpp | 12 +- .../src/dali/utc-Dali-HitTestAlgorithm.cpp | 2 +- .../src/dali/utc-Dali-LongPressGestureDetector.cpp | 8 +- .../src/dali/utc-Dali-PanGestureDetector.cpp | 8 +- .../src/dali/utc-Dali-PinchGestureDetector.cpp | 8 +- automated-tests/src/dali/utc-Dali-Renderer.cpp | 6 +- .../src/dali/utc-Dali-RotationGestureDetector.cpp | 8 +- automated-tests/src/dali/utc-Dali-Scripting.cpp | 12 +- .../src/dali/utc-Dali-TapGestureDetector.cpp | 8 +- dali/internal/event/actors/actor-impl.cpp | 18 +-- dali/public-api/actors/actor.cpp | 74 ---------- dali/public-api/actors/actor.h | 150 +-------------------- dali/public-api/math/rect.h | 16 ++- dali/public-api/object/property-value.cpp | 13 +- dali/public-api/object/property-value.h | 10 +- 17 files changed, 159 insertions(+), 353 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 4cc24d0..d8fe2e6 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -1681,7 +1681,7 @@ int UtcDaliActorSetOrientation01(void) Quaternion rotation( Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); Actor actor = Actor::New(); - actor.SetOrientation(rotation); + actor.SetProperty( Actor::Property::ORIENTATION, rotation); // flush the queue and render once application.SendNotification(); @@ -1700,7 +1700,7 @@ int UtcDaliActorSetOrientation02(void) Radian angle( 0.785f ); Vector3 axis(1.0f, 1.0f, 0.0f); - actor.SetOrientation( angle, axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( angle, axis ) ); Quaternion rotation( angle, axis ); // flush the queue and render once application.SendNotification(); @@ -1711,14 +1711,14 @@ int UtcDaliActorSetOrientation02(void) actor.RotateBy( Degree( 360 ), axis); DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); - actor.SetOrientation( Degree( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ) ); Quaternion result( Radian( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ); // flush the queue and render once application.SendNotification(); application.Render(); DALI_TEST_EQUALS( result, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); - actor.SetOrientation( angle, axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( angle, axis ) ); // flush the queue and render once application.SendNotification(); application.Render(); @@ -1804,7 +1804,7 @@ int UtcDaliActorGetCurrentOrientation(void) Actor actor = Actor::New(); Quaternion rotation(Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); - actor.SetOrientation(rotation); + actor.SetProperty( Actor::Property::ORIENTATION, rotation ); // flush the queue and render once application.SendNotification(); application.Render(); @@ -1820,11 +1820,11 @@ int UtcDaliActorGetCurrentWorldOrientation(void) Actor parent = Actor::New(); Radian rotationAngle( Degree(90.0f) ); Quaternion rotation( rotationAngle, Vector3::YAXIS ); - parent.SetOrientation( rotation ); + parent.SetProperty( Actor::Property::ORIENTATION, rotation ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); - child.SetOrientation( rotation ); + child.SetProperty( Actor::Property::ORIENTATION, rotation ); parent.Add( child ); // The actors should not have a world rotation yet @@ -2353,7 +2353,7 @@ int UtcDaliActorGetCurrentWorldColor(void) DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); // verify the default color mode - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, child.GetColorMode(), TEST_LOCATION ); + DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, child.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); // The actors should not have a world color yet DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Color::WHITE, TEST_LOCATION ); @@ -2370,20 +2370,20 @@ int UtcDaliActorGetCurrentWorldColor(void) DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Vector4( childColor.r, childColor.g, childColor.b, childColor.a * parentColor.a), TEST_LOCATION ); // use own color - child.SetColorMode( USE_OWN_COLOR ); + child.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); application.SendNotification(); application.Render(0); DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), childColor, TEST_LOCATION ); // use parent color - child.SetColorMode( USE_PARENT_COLOR ); + child.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); application.SendNotification(); application.Render(0); DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), childColor, TEST_LOCATION ); DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), parentColor, TEST_LOCATION ); // use parent alpha - child.SetColorMode( USE_OWN_MULTIPLY_PARENT_ALPHA ); + child.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); application.SendNotification(); application.Render(0); Vector4 expectedColor( childColor ); @@ -2401,17 +2401,17 @@ int UtcDaliActorSetColorMode(void) Actor child = Actor::New(); actor.Add( child ); - actor.SetColorMode( USE_OWN_COLOR ); - DALI_TEST_EQUALS( USE_OWN_COLOR, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); + DALI_TEST_EQUALS( USE_OWN_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); - actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_COLOR, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR ); + DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); - actor.SetColorMode( USE_PARENT_COLOR ); - DALI_TEST_EQUALS( USE_PARENT_COLOR, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); + DALI_TEST_EQUALS( USE_PARENT_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); - actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_ALPHA ); - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); + DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); END_TEST; } @@ -2895,19 +2895,19 @@ int UtcDaliActorSetDrawMode(void) app.SendNotification(); app.Render(1); - DALI_TEST_CHECK( DrawMode::NORMAL == a.GetDrawMode() ); // Ensure overlay is off by default + DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Ensure overlay is off by default - a.SetDrawMode( DrawMode::OVERLAY_2D ); + a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); app.SendNotification(); app.Render(1); - DALI_TEST_CHECK( DrawMode::OVERLAY_2D == a.GetDrawMode() ); // Check Actor is overlay + DALI_TEST_CHECK( DrawMode::OVERLAY_2D == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is overlay - a.SetDrawMode( DrawMode::NORMAL ); + a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::NORMAL ); app.SendNotification(); app.Render(1); - DALI_TEST_CHECK( DrawMode::NORMAL == a.GetDrawMode() ); // Check Actor is normal + DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is normal END_TEST; } @@ -2965,7 +2965,7 @@ int UtcDaliActorSetDrawModeOverlayRender(void) // b (9) // c (10) // a (8) - a.SetDrawMode( DrawMode::OVERLAY_2D ); + a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); app.GetGlAbstraction().ClearBoundTextures(); app.SendNotification(); @@ -2995,7 +2995,7 @@ int UtcDaliActorGetCurrentWorldMatrix(void) Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); parent.SetPosition( parentPosition ); - parent.SetOrientation( parentRotation ); + parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); parent.SetScale( parentScale ); Stage::GetCurrent().Add( parent ); @@ -3006,7 +3006,7 @@ int UtcDaliActorGetCurrentWorldMatrix(void) Quaternion childRotation( childRotationAngle, Vector3::YAXIS ); Vector3 childScale( 2.0f, 2.0f, 2.0f ); child.SetPosition( childPosition ); - child.SetOrientation( childRotation ); + child.SetProperty( Actor::Property::ORIENTATION, childRotation ); child.SetScale( childScale ); parent.Add( child ); @@ -3045,7 +3045,7 @@ int UtcDaliActorConstrainedToWorldMatrix(void) Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); parent.SetPosition( parentPosition ); - parent.SetOrientation( parentRotation ); + parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); parent.SetScale( parentScale ); Stage::GetCurrent().Add( parent ); @@ -3083,7 +3083,7 @@ int UtcDaliActorConstrainedToOrientation(void) Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); parent.SetPosition( parentPosition ); - parent.SetOrientation( parentRotation ); + parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); parent.SetScale( parentScale ); Stage::GetCurrent().Add( parent ); @@ -3216,8 +3216,8 @@ int UtcDaliActorSetGetOverlay(void) tet_infoline(" UtcDaliActorSetGetOverlay"); Actor parent = Actor::New(); - parent.SetDrawMode(DrawMode::OVERLAY_2D ); - DALI_TEST_CHECK( parent.GetDrawMode() == DrawMode::OVERLAY_2D ); + parent.SetProperty( Actor::Property::DRAW_MODE,DrawMode::OVERLAY_2D ); + DALI_TEST_CHECK( parent.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) == DrawMode::OVERLAY_2D ); END_TEST; } @@ -3281,12 +3281,12 @@ const PropertyStringIndex PROPERTY_TABLE[] = { "leaveRequired", Actor::Property::LEAVE_REQUIRED, Property::BOOLEAN }, { "inheritOrientation", Actor::Property::INHERIT_ORIENTATION, Property::BOOLEAN }, { "inheritScale", Actor::Property::INHERIT_SCALE, Property::BOOLEAN }, - { "colorMode", Actor::Property::COLOR_MODE, Property::STRING }, - { "drawMode", Actor::Property::DRAW_MODE, Property::STRING }, + { "colorMode", Actor::Property::COLOR_MODE, Property::INTEGER }, + { "drawMode", Actor::Property::DRAW_MODE, Property::INTEGER }, { "sizeModeFactor", Actor::Property::SIZE_MODE_FACTOR, Property::VECTOR3 }, { "widthResizePolicy", Actor::Property::WIDTH_RESIZE_POLICY, Property::STRING }, { "heightResizePolicy", Actor::Property::HEIGHT_RESIZE_POLICY, Property::STRING }, - { "sizeScalePolicy", Actor::Property::SIZE_SCALE_POLICY, Property::STRING }, + { "sizeScalePolicy", Actor::Property::SIZE_SCALE_POLICY, Property::INTEGER }, { "widthForHeight", Actor::Property::WIDTH_FOR_HEIGHT, Property::BOOLEAN }, { "heightForWidth", Actor::Property::HEIGHT_FOR_WIDTH, Property::BOOLEAN }, { "padding", Actor::Property::PADDING, Property::VECTOR4 }, @@ -3362,22 +3362,21 @@ int UtcDaliRelayoutProperties_SizeScalePolicy(void) Actor actor = Actor::New(); // Defaults - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_SCALE_POLICY ).Get< std::string >(), "USE_SIZE_SET", TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetSizeScalePolicy(), SizeScalePolicy::USE_SIZE_SET, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), SizeScalePolicy::USE_SIZE_SET, TEST_LOCATION ); SizeScalePolicy::Type policy = SizeScalePolicy::FILL_WITH_ASPECT_RATIO; - actor.SetSizeScalePolicy( policy ); - DALI_TEST_EQUALS( actor.GetSizeScalePolicy(), policy, TEST_LOCATION ); + actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy, TEST_LOCATION ); // Set - const char* const policy1 = "FIT_WITH_ASPECT_RATIO"; - const char* const policy2 = "FILL_WITH_ASPECT_RATIO"; + const SizeScalePolicy::Type policy1 = SizeScalePolicy::FIT_WITH_ASPECT_RATIO; + const SizeScalePolicy::Type policy2 = SizeScalePolicy::FILL_WITH_ASPECT_RATIO; actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy1 ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_SCALE_POLICY ).Get< std::string >(), policy1, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy1, TEST_LOCATION ); actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy2 ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_SCALE_POLICY ).Get< std::string >(), policy2, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy2, TEST_LOCATION ); END_TEST; } @@ -3390,11 +3389,11 @@ int UtcDaliRelayoutProperties_SizeModeFactor(void) // Defaults DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_MODE_FACTOR ).Get< Vector3 >(), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetSizeModeFactor(), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); Vector3 sizeMode( 1.0f, 2.0f, 3.0f ); - actor.SetSizeModeFactor( sizeMode ); - DALI_TEST_EQUALS( actor.GetSizeModeFactor(), sizeMode, TEST_LOCATION ); + actor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, sizeMode ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ), sizeMode, TEST_LOCATION ); // Set Vector3 sizeMode1( 2.0f, 3.0f, 4.0f ); @@ -3523,7 +3522,7 @@ int UtcDaliActorSetPadding(void) Actor actor = Actor::New(); Padding padding; - actor.GetPadding( padding ); + padding = actor.GetProperty( Actor::Property::PADDING ); DALI_TEST_EQUALS( padding.left, 0.0f, TEST_LOCATION ); DALI_TEST_EQUALS( padding.right, 0.0f, TEST_LOCATION ); @@ -3531,9 +3530,9 @@ int UtcDaliActorSetPadding(void) DALI_TEST_EQUALS( padding.top, 0.0f, TEST_LOCATION ); Padding padding2( 1.0f, 2.0f, 3.0f, 4.0f ); - actor.SetPadding( padding2 ); + actor.SetProperty( Actor::Property::PADDING, padding2 ); - actor.GetPadding( padding ); + padding = actor.GetProperty( Actor::Property::PADDING ); DALI_TEST_EQUALS( padding.left, padding2.left, TEST_LOCATION ); DALI_TEST_EQUALS( padding.right, padding2.right, TEST_LOCATION ); @@ -3782,20 +3781,20 @@ int UtcDaliActorColorModePropertyAsString(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_COLOR" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_PARENT_COLOR" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_COLOR" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_ALPHA" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); // Invalid should not change anything actor.SetProperty( Actor::Property::COLOR_MODE, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); END_TEST; } @@ -3807,14 +3806,14 @@ int UtcDaliActorDrawModePropertyAsString(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::DRAW_MODE, "NORMAL" ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::NORMAL, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::NORMAL, TEST_LOCATION ); actor.SetProperty( Actor::Property::DRAW_MODE, "OVERLAY_2D" ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); // Invalid should not change anything actor.SetProperty( Actor::Property::DRAW_MODE, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); END_TEST; } @@ -3826,16 +3825,16 @@ int UtcDaliActorColorModePropertyAsEnum(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); END_TEST; } @@ -3847,10 +3846,10 @@ int UtcDaliActorDrawModePropertyAsEnum(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::NORMAL ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::NORMAL, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::NORMAL, TEST_LOCATION ); actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); END_TEST; } @@ -6473,7 +6472,7 @@ int utcDaliActorPositionUsesAnchorPointCheckRotation(void) actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); actor.SetSize( 100.0f, 100.0f ); - actor.SetOrientation( Degree( 90.0f), Vector3::ZAXIS ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) ); actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); Stage::GetCurrent().Add( actor ); @@ -6507,7 +6506,7 @@ int utcDaliActorPositionUsesAnchorPointCheckScaleAndRotation(void) actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); actor.SetSize( 100.0f, 100.0f ); - actor.SetOrientation( Degree( 90.0f), Vector3::ZAXIS ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) ); actor.SetScale( 2.0f ); actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); Stage::GetCurrent().Add( actor ); diff --git a/automated-tests/src/dali/utc-Dali-Animation.cpp b/automated-tests/src/dali/utc-Dali-Animation.cpp index 0c53693..e4c695e 100644 --- a/automated-tests/src/dali/utc-Dali-Animation.cpp +++ b/automated-tests/src/dali/utc-Dali-Animation.cpp @@ -4824,7 +4824,7 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -4886,7 +4886,7 @@ int UtcDaliAnimationAnimateByActorOrientationP2(void) tet_printf("Testing that rotation angle > 360 performs full rotations\n"); Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -4947,7 +4947,7 @@ int UtcDaliAnimationAnimateByActorOrientationP3(void) tet_printf("Testing that rotation angle > 360 performs partial rotations when cast to Quaternion\n"); Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -5009,7 +5009,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -5066,7 +5066,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionTimePeriodP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -7826,7 +7826,7 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -7886,7 +7886,7 @@ int UtcDaliAnimationAnimateToActorOrientationQuaternionP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -7944,7 +7944,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); @@ -8001,7 +8001,7 @@ int UtcDaliAnimationAnimateToActorOrientationTimePeriodP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -8062,7 +8062,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionTimePeriodP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); @@ -9316,7 +9316,7 @@ int UtcDaliAnimationAnimateBetweenActorVisibleP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -9364,7 +9364,7 @@ int UtcDaliAnimationAnimateBetweenActorVisibleCubicP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -9410,7 +9410,7 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01P(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -9456,7 +9456,7 @@ int UtcDaliAnimationAnimateBetweenActorOrientation02P(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); application.SendNotification(); application.Render(0); Stage::GetCurrent().Add(actor); @@ -9521,7 +9521,7 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01CubicP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -9565,7 +9565,7 @@ int UtcDaliAnimationAnimateBetweenActorOrientation02CubicP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); application.SendNotification(); application.Render(0); Stage::GetCurrent().Add(actor); diff --git a/automated-tests/src/dali/utc-Dali-CameraActor.cpp b/automated-tests/src/dali/utc-Dali-CameraActor.cpp index 26fe3c0..a2335c9 100644 --- a/automated-tests/src/dali/utc-Dali-CameraActor.cpp +++ b/automated-tests/src/dali/utc-Dali-CameraActor.cpp @@ -1406,12 +1406,12 @@ int UtcDaliCameraActorDefaultPropertiesInherited(void) { "leaveRequired", Property::BOOLEAN, true, false, false, Dali::Actor::Property::LEAVE_REQUIRED }, { "inheritOrientation", Property::BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_ORIENTATION }, { "inheritScale", Property::BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_SCALE }, - { "colorMode", Property::STRING, true, false, false, Dali::Actor::Property::COLOR_MODE }, - { "drawMode", Property::STRING, true, false, false, Dali::Actor::Property::DRAW_MODE }, + { "colorMode", Property::INTEGER, true, false, false, Dali::Actor::Property::COLOR_MODE }, + { "drawMode", Property::INTEGER, true, false, false, Dali::Actor::Property::DRAW_MODE }, { "sizeModeFactor", Property::VECTOR3, true, false, false, Dali::Actor::Property::SIZE_MODE_FACTOR }, { "widthResizePolicy", Property::STRING, true, false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY }, { "heightResizePolicy", Property::STRING, true, false, false, Dali::Actor::Property::HEIGHT_RESIZE_POLICY }, - { "sizeScalePolicy", Property::STRING, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY }, + { "sizeScalePolicy", Property::INTEGER, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY }, { "widthForHeight", Property::BOOLEAN, true, false, false, Dali::Actor::Property::WIDTH_FOR_HEIGHT }, { "heightForWidth", Property::BOOLEAN, true, false, false, Dali::Actor::Property::HEIGHT_FOR_WIDTH }, { "padding", Property::VECTOR4, true, false, false, Dali::Actor::Property::PADDING }, @@ -1708,7 +1708,7 @@ int UtcDaliCameraActorCheckLookAtAndFreeLookViews03(void) Quaternion cameraOrientation( Radian( Degree( 180.0f ) ), Vector3::YAXIS ); freeLookCameraActor.SetPosition( cameraOffset ); - freeLookCameraActor.SetOrientation( cameraOrientation ); + freeLookCameraActor.SetProperty( Actor::Property::ORIENTATION, cameraOrientation ); Actor cameraAnchor = Actor::New(); cameraAnchor.Add( freeLookCameraActor ); @@ -1720,7 +1720,7 @@ int UtcDaliCameraActorCheckLookAtAndFreeLookViews03(void) Quaternion rotation( Radian( Degree( angle ) ), Vector3::YAXIS ); freeLookCameraActor.SetPosition( rotation.Rotate( cameraOffset ) ); - cameraAnchor.SetOrientation( rotation ); + cameraAnchor.SetProperty( Actor::Property::ORIENTATION, rotation ); application.SendNotification(); application.Render(); @@ -1795,4 +1795,4 @@ int UtcDaliCameraActorReflectionByPlane(void) DALI_TEST_EQUALS( reflected, rotation, 0.01f, TEST_LOCATION ); END_TEST; -} \ No newline at end of file +} diff --git a/automated-tests/src/dali/utc-Dali-HitTestAlgorithm.cpp b/automated-tests/src/dali/utc-Dali-HitTestAlgorithm.cpp index fed4521..cec4044 100644 --- a/automated-tests/src/dali/utc-Dali-HitTestAlgorithm.cpp +++ b/automated-tests/src/dali/utc-Dali-HitTestAlgorithm.cpp @@ -339,7 +339,7 @@ int UtcDaliHitTestAlgorithmOverlay(void) Vector2 actorSize( stageSize * 0.5f ); // Create two actors with half the size of the stage and set them to be partially overlapping Actor blue = Actor::New(); - blue.SetDrawMode( DrawMode::OVERLAY_2D ); + blue.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); blue.SetProperty( Actor::Property::NAME, "Blue" ); blue.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); blue.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3(1.0f/3.0f, 1.0f/3.0f, 0.5f) ); diff --git a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp index 1c52e57..21869c5 100644 --- a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp @@ -425,7 +425,7 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void) Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); - actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::Degree(90.0f), Vector3::ZAXIS ) ); Stage::GetCurrent().Add(actor); // Render and notify @@ -447,7 +447,7 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION); // Rotate actor again and render - actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -460,7 +460,7 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION); // Rotate actor again and render - actor.SetOrientation(Dali::Degree(90.0f), Vector3::YAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) ); application.SendNotification(); application.Render(); @@ -488,7 +488,7 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void) child.SetSize(100.0f, 100.0f); child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); parent.Add(child); TouchEventFunctor touchFunctor; diff --git a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp index 3885dc0..a1d65da 100644 --- a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp @@ -747,7 +747,7 @@ int UtcDaliPanGestureSignalReceptionRotatedActor(void) Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); - actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); Stage::GetCurrent().Add(actor); // Render and notify @@ -773,7 +773,7 @@ int UtcDaliPanGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS(Vector2(16.0f, 2.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative // Rotate actor again and render a couple of times - actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -788,7 +788,7 @@ int UtcDaliPanGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS(Vector2(2.0f, -16.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative // Rotate actor again and render a couple of times - actor.SetOrientation(Dali::Degree(270.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -820,7 +820,7 @@ int UtcDaliPanGestureSignalReceptionChildHit(void) child.SetSize(100.0f, 100.0f); child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); parent.Add(child); TouchEventFunctor touchFunctor; diff --git a/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp index 6842603..9cdf967 100644 --- a/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp @@ -541,7 +541,7 @@ int UtcDaliPinchGestureSignalReceptionRotatedActor(void) Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); - actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); Stage::GetCurrent().Add(actor); // Render and notify a couple of times @@ -567,7 +567,7 @@ int UtcDaliPinchGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION); // Rotate actor again and render and notify - actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -583,7 +583,7 @@ int UtcDaliPinchGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION); // Rotate actor again and render and notify - actor.SetOrientation(Dali::Degree(270.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -616,7 +616,7 @@ int UtcDaliPinchGestureSignalReceptionChildHit(void) child.SetSize(100.0f, 100.0f); child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); parent.Add(child); TouchEventFunctor touchFunctor; diff --git a/automated-tests/src/dali/utc-Dali-Renderer.cpp b/automated-tests/src/dali/utc-Dali-Renderer.cpp index 47b3c7e..222885a 100644 --- a/automated-tests/src/dali/utc-Dali-Renderer.cpp +++ b/automated-tests/src/dali/utc-Dali-Renderer.cpp @@ -1871,18 +1871,18 @@ int UtcDaliRendererRenderOrder2DLayerOverlay(void) */ Actor actor0 = CreateActor( root, 0, TEST_LOCATION ); - actor0.SetDrawMode( DrawMode::OVERLAY_2D ); + actor0.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); Renderer renderer0 = CreateRenderer( actor0, geometry, shader, 0 ); Actor actor1 = CreateActor( root, 0, TEST_LOCATION ); - actor1.SetDrawMode( DrawMode::OVERLAY_2D ); + actor1.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); Renderer renderer1 = CreateRenderer( actor1, geometry, shader, 0 ); Actor actor2 = CreateActor( root, 0, TEST_LOCATION ); Renderer renderer2 = CreateRenderer( actor2, geometry, shader, 0 ); Actor actor3 = CreateActor( root, 0, TEST_LOCATION ); - actor3.SetDrawMode( DrawMode::OVERLAY_2D ); + actor3.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); Renderer renderer3 = CreateRenderer( actor3, geometry, shader, 0 ); Actor actor4 = CreateActor( root, 0, TEST_LOCATION ); diff --git a/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp index 5e74c25..68029e7 100644 --- a/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp @@ -536,7 +536,7 @@ int UtcDaliRotationGestureSignalReceptionRotatedActor(void) Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); - actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); Stage::GetCurrent().Add(actor); // Render and notify a couple of times @@ -561,7 +561,7 @@ int UtcDaliRotationGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION); // Rotate actor again and render and notify - actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -576,7 +576,7 @@ int UtcDaliRotationGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION); // Rotate actor again and render and notify - actor.SetOrientation(Dali::Degree(270.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -608,7 +608,7 @@ int UtcDaliRotationGestureSignalReceptionChildHit(void) child.SetSize(100.0f, 100.0f); child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); parent.Add(child); TouchEventFunctor touchFunctor; diff --git a/automated-tests/src/dali/utc-Dali-Scripting.cpp b/automated-tests/src/dali/utc-Dali-Scripting.cpp index 890dbc6..39cbb19 100644 --- a/automated-tests/src/dali/utc-Dali-Scripting.cpp +++ b/automated-tests/src/dali/utc-Dali-Scripting.cpp @@ -507,10 +507,10 @@ int UtcDaliScriptingNewActorProperties(void) DALI_TEST_EQUALS( handle.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION ); DALI_TEST_EQUALS( handle.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::MAGENTA, TEST_LOCATION ); DALI_TEST_EQUALS( handle.GetProperty< std::string >( Actor::Property::NAME ), "MyActor", TEST_LOCATION ); - DALI_TEST_EQUALS( handle.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( handle.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION ); DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::SENSITIVE ), false, TEST_LOCATION ); DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ), true, TEST_LOCATION ); - DALI_TEST_EQUALS( handle.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION ); + DALI_TEST_EQUALS( handle.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::INHERIT_ORIENTATION ), false, TEST_LOCATION ); DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::INHERIT_SCALE ), false, TEST_LOCATION ); @@ -676,7 +676,7 @@ int UtcDaliScriptingCreatePropertyMapActor(void) actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true ); actor.SetProperty( Actor::Property::INHERIT_ORIENTATION, false ); actor.SetProperty( Actor::Property::INHERIT_SCALE, false ); - actor.SetSizeModeFactor( Vector3::ONE ); + actor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3::ONE ); Stage::GetCurrent().Add( actor ); application.SendNotification(); @@ -716,12 +716,6 @@ int UtcDaliScriptingCreatePropertyMapActor(void) Stage::GetCurrent().Remove( actor ); } - // ColorMode - TestEnumStrings< ColorMode >( "colorMode", application, COLOR_MODE_VALUES, COLOR_MODE_VALUES_COUNT, &Actor::SetColorMode ); - - // DrawMode - TestEnumStrings< DrawMode::Type >( "drawMode", application, DRAW_MODE_VALUES, DRAW_MODE_VALUES_COUNT, &Actor::SetDrawMode ); - // Children { Actor actor = Actor::New(); diff --git a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp index f6fb1be..8394587 100644 --- a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp @@ -429,7 +429,7 @@ int UtcDaliTapGestureSignalReceptionRotatedActor(void) Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); - actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); Stage::GetCurrent().Add(actor); // Render and notify @@ -451,7 +451,7 @@ int UtcDaliTapGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION); // Rotate actor again and render - actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) ); application.SendNotification(); application.Render(); @@ -464,7 +464,7 @@ int UtcDaliTapGestureSignalReceptionRotatedActor(void) DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION); // Rotate actor again and render - actor.SetOrientation(Dali::Degree(90.0f), Vector3::YAXIS); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) ); application.SendNotification(); application.Render(); @@ -491,7 +491,7 @@ int UtcDaliTapGestureSignalReceptionChildHit(void) child.SetSize(100.0f, 100.0f); child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS); + child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) ); parent.Add(child); TouchEventFunctor touchFunctor; diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index ae02f5d..bd1a01d 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -193,13 +193,13 @@ DALI_PROPERTY( "sensitive", BOOLEAN, true, false, false, Dali: DALI_PROPERTY( "leaveRequired", BOOLEAN, true, false, false, Dali::Actor::Property::LEAVE_REQUIRED ) DALI_PROPERTY( "inheritOrientation", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_ORIENTATION ) DALI_PROPERTY( "inheritScale", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_SCALE ) -DALI_PROPERTY( "colorMode", STRING, true, false, false, Dali::Actor::Property::COLOR_MODE ) +DALI_PROPERTY( "colorMode", INTEGER, true, false, false, Dali::Actor::Property::COLOR_MODE ) DALI_PROPERTY( "reservedProperty01", STRING, true, false, false, Dali::Actor::Property::RESERVED_PROPERTY_01 ) // This property was removed, but to keep binary compatibility and TypeRegister test app, remain it here. -DALI_PROPERTY( "drawMode", STRING, true, false, false, Dali::Actor::Property::DRAW_MODE ) +DALI_PROPERTY( "drawMode", INTEGER, true, false, false, Dali::Actor::Property::DRAW_MODE ) DALI_PROPERTY( "sizeModeFactor", VECTOR3, true, false, false, Dali::Actor::Property::SIZE_MODE_FACTOR ) DALI_PROPERTY( "widthResizePolicy", STRING, true, false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY ) DALI_PROPERTY( "heightResizePolicy", STRING, true, false, false, Dali::Actor::Property::HEIGHT_RESIZE_POLICY ) -DALI_PROPERTY( "sizeScalePolicy", STRING, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY ) +DALI_PROPERTY( "sizeScalePolicy", INTEGER, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY ) DALI_PROPERTY( "widthForHeight", BOOLEAN, true, false, false, Dali::Actor::Property::WIDTH_FOR_HEIGHT ) DALI_PROPERTY( "heightForWidth", BOOLEAN, true, false, false, Dali::Actor::Property::HEIGHT_FOR_WIDTH ) DALI_PROPERTY( "padding", VECTOR4, true, false, false, Dali::Actor::Property::PADDING ) @@ -2623,7 +2623,7 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr case Dali::Actor::Property::SIZE_SCALE_POLICY: { SizeScalePolicy::Type type = GetSizeScalePolicy(); - if( Scripting::GetEnumeration< SizeScalePolicy::Type >( property.Get< std::string >().c_str(), SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) ) + if( Scripting::GetEnumerationProperty< SizeScalePolicy::Type >( property, SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) ) { SetSizeScalePolicy( type ); } @@ -3743,13 +3743,13 @@ bool Actor::GetCachedPropertyValue( Property::Index index, Property::Value& valu case Dali::Actor::Property::COLOR_MODE: { - value = Scripting::GetLinearEnumerationName< ColorMode >( GetColorMode(), COLOR_MODE_TABLE, COLOR_MODE_TABLE_COUNT ); + value = GetColorMode(); break; } case Dali::Actor::Property::DRAW_MODE: { - value = Scripting::GetEnumerationName< DrawMode::Type >( GetDrawMode(), DRAW_MODE_TABLE, DRAW_MODE_TABLE_COUNT ); + value = GetDrawMode(); break; } @@ -3773,7 +3773,7 @@ bool Actor::GetCachedPropertyValue( Property::Index index, Property::Value& valu case Dali::Actor::Property::SIZE_SCALE_POLICY: { - value = Scripting::GetLinearEnumerationName< SizeScalePolicy::Type >( GetSizeScalePolicy(), SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT ); + value = GetSizeScalePolicy(); break; } @@ -4245,12 +4245,12 @@ float Actor::CalculateChildSizeBase( const Dali::Actor& child, Dimension::Type d case ResizePolicy::SIZE_RELATIVE_TO_PARENT: { - return GetLatestSize( dimension ) * GetDimensionValue( child.GetSizeModeFactor(), dimension ); + return GetLatestSize( dimension ) * GetDimensionValue( child.GetProperty< Vector3 >( Dali::Actor::Property::SIZE_MODE_FACTOR ), dimension ); } case ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT: { - return GetLatestSize( dimension ) + GetDimensionValue( child.GetSizeModeFactor(), dimension ); + return GetLatestSize( dimension ) + GetDimensionValue( child.GetProperty< Vector3 >( Dali::Actor::Property::SIZE_MODE_FACTOR ), dimension ); } default: diff --git a/dali/public-api/actors/actor.cpp b/dali/public-api/actors/actor.cpp index 1595881..4e50bea 100644 --- a/dali/public-api/actors/actor.cpp +++ b/dali/public-api/actors/actor.cpp @@ -200,16 +200,6 @@ void Actor::TranslateBy(const Vector3& distance) GetImplementation(*this).TranslateBy(distance); } -void Actor::SetOrientation(const Radian& angle, const Vector3& axis) -{ - GetImplementation(*this).SetOrientation(angle, axis); -} - -void Actor::SetOrientation(const Quaternion& orientation) -{ - GetImplementation(*this).SetOrientation(orientation); -} - void Actor::RotateBy(const Radian& angle, const Vector3& axis) { GetImplementation(*this).RotateBy(angle, axis); @@ -240,36 +230,6 @@ void Actor::ScaleBy(const Vector3& relativeScale) GetImplementation(*this).ScaleBy(relativeScale); } -void Actor::SetSizeModeFactor(const Vector3& factor) -{ - GetImplementation(*this).SetSizeModeFactor(factor); -} - -Vector3 Actor::GetSizeModeFactor() const -{ - return GetImplementation(*this).GetSizeModeFactor(); -} - -void Actor::SetColorMode( ColorMode colorMode ) -{ - GetImplementation(*this).SetColorMode(colorMode); -} - -ColorMode Actor::GetColorMode() const -{ - return GetImplementation(*this).GetColorMode(); -} - -void Actor::SetDrawMode( DrawMode::Type drawMode ) -{ - GetImplementation(*this).SetDrawMode( drawMode ); -} - -DrawMode::Type Actor::GetDrawMode() const -{ - return GetImplementation(*this).GetDrawMode(); -} - bool Actor::ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const { return GetImplementation(*this).ScreenToLocal(localX, localY, screenX, screenY); @@ -325,16 +285,6 @@ ResizePolicy::Type Actor::GetResizePolicy( Dimension::Type dimension ) const return GetImplementation(*this).GetResizePolicy( dimension ); } -void Actor::SetSizeScalePolicy( SizeScalePolicy::Type policy ) -{ - GetImplementation(*this).SetSizeScalePolicy( policy ); -} - -SizeScalePolicy::Type Actor::GetSizeScalePolicy() const -{ - return GetImplementation(*this).GetSizeScalePolicy(); -} - float Actor::GetHeightForWidth( float width ) { return GetImplementation(*this).GetHeightForWidth( width ); @@ -350,30 +300,6 @@ float Actor::GetRelayoutSize( Dimension::Type dimension ) const return GetImplementation(*this).GetRelayoutSize( dimension ); } -void Actor::SetPadding( const Padding& padding ) -{ - Internal::Actor& impl = GetImplementation(*this); - - Vector2 widthPadding( padding.left, padding.right ); - impl.SetPadding( widthPadding, Dimension::WIDTH ); - - Vector2 heightPadding( padding.bottom, padding.top ); - impl.SetPadding( heightPadding, Dimension::HEIGHT ); -} - -void Actor::GetPadding( Padding& paddingOut ) const -{ - const Internal::Actor& impl = GetImplementation(*this); - - Vector2 widthPadding = impl.GetPadding( Dimension::WIDTH ); - Vector2 heightPadding = impl.GetPadding( Dimension::HEIGHT ); - - paddingOut.left = widthPadding.x; - paddingOut.right = widthPadding.y; - paddingOut.bottom = heightPadding.x; - paddingOut.top = heightPadding.y; -} - int32_t Actor::GetHierarchyDepth() { return GetImplementation(*this).GetHierarchyDepth(); diff --git a/dali/public-api/actors/actor.h b/dali/public-api/actors/actor.h index 295f051..9be506d 100644 --- a/dali/public-api/actors/actor.h +++ b/dali/public-api/actors/actor.h @@ -151,7 +151,7 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 * * Hit Priority of above Actor tree (all overlays): 1 - Lowest. 6 - Highest. * @endcode - * For more information, see SetDrawMode(). + * For more information, see Property::DRAW_MODE. * * Touch or hover Event Delivery: * @@ -409,7 +409,6 @@ public: * @brief The orientation of an actor. * @details Name "orientation", type Property::ROTATION, animatable / constraint-input * @SINCE_1_0.0 - * @see Actor::SetOrientation() */ ORIENTATION, @@ -555,7 +554,6 @@ public: * @brief The color mode of an actor. * @details Name "colorMode", type ColorMode (Property::INTEGER) or Property::STRING. * @SINCE_1_0.0 - * @see Actor::SetColorMode() */ COLOR_MODE, @@ -568,7 +566,6 @@ public: * @brief The draw mode of an actor. * @details Name "drawMode", type DrawMode::Type (Property::INTEGER) or Property::STRING. * @SINCE_1_0.0 - * @see Actor::SetDrawMode() */ DRAW_MODE, @@ -598,9 +595,8 @@ public: /** * @brief The size scale policy of an actor. - * @details Name "sizeScalePolicy", type ResizePolicy::Type (Property::INTEGER) or Property::STRING. + * @details Name "sizeScalePolicy", type SizeScalePolicy::Type (Property::INTEGER) or Property::STRING. * @SINCE_1_0.0 - * @see Actor::SetSizeScalePolicy() */ SIZE_SCALE_POLICY, @@ -624,7 +620,6 @@ public: * @brief The padding of an actor for use in layout. * @details Name "padding", type Property::VECTOR4. * @SINCE_1_0.0 - * @see Actor::SetPadding() */ PADDING, @@ -1031,44 +1026,6 @@ public: void TranslateBy(const Vector3& distance); /** - * @brief Sets the orientation of the Actor. - * - * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point. - * @SINCE_1_0.0 - * @param[in] angle The new orientation angle in degrees - * @param[in] axis The new axis of orientation - * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation(). - */ - void SetOrientation( const Degree& angle, const Vector3& axis ) - { - SetOrientation( Radian( angle ), axis ); - } - - /** - * @brief Sets the orientation of the Actor. - * - * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point. - * @SINCE_1_0.0 - * @param[in] angle The new orientation angle in radians - * @param[in] axis The new axis of orientation - * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation(). - */ - void SetOrientation(const Radian& angle, const Vector3& axis); - - /** - * @brief Sets the orientation of the Actor. - * - * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point. - * @SINCE_1_0.0 - * @param[in] orientation The new orientation - * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation(). - */ - void SetOrientation(const Quaternion& orientation); - - /** * @brief Applies a relative rotation to an actor. * * @SINCE_1_0.0 @@ -1141,54 +1098,6 @@ public: */ void ScaleBy(const Vector3& relativeScale); - // Visibility & Color - - /** - * @brief Sets the actor's color mode. - * - * This specifies whether the Actor uses its own color, or inherits - * its parent color. The default is USE_OWN_MULTIPLY_PARENT_ALPHA. - * @SINCE_1_0.0 - * @param[in] colorMode ColorMode to use - * @pre The Actor has been initialized. - */ - void SetColorMode( ColorMode colorMode ); - - /** - * @brief Returns the actor's color mode. - * - * @SINCE_1_0.0 - * @return Currently used colorMode - * @pre The Actor has been initialized. - */ - ColorMode GetColorMode() const; - - /** - * @brief Sets how the actor and its children should be drawn. - * - * Not all actors are renderable, but DrawMode can be inherited from any actor. - * If an object is in a 3D layer, it will be depth-tested against - * other objects in the world i.e. it may be obscured if other objects are in front. - * - * If DrawMode::OVERLAY_2D is used, the actor and its children will be drawn as a 2D overlay. - * Overlay actors are drawn in a separate pass, after all non-overlay actors within the Layer. - * For overlay actors, the drawing order is with respect to tree levels of Actors, - * and depth-testing will not be used. - - * @SINCE_1_0.0 - * @param[in] drawMode The new draw-mode to use - * @note Layers do not inherit the DrawMode from their parents. - */ - void SetDrawMode( DrawMode::Type drawMode ); - - /** - * @brief Queries how the actor and its children will be drawn. - * - * @SINCE_1_0.0 - * @return Return the draw mode type - */ - DrawMode::Type GetDrawMode() const; - // Input Handling /** @@ -1304,45 +1213,6 @@ public: ResizePolicy::Type GetResizePolicy( Dimension::Type dimension ) const; /** - * @brief Sets the policy to use when setting size with size negotiation. Defaults to SizeScalePolicy::USE_SIZE_SET. - * - * @SINCE_1_0.0 - * @param[in] policy The policy to use for when the size is set - */ - void SetSizeScalePolicy( SizeScalePolicy::Type policy ); - - /** - * @brief Returns the size scale policy in use. - * - * @SINCE_1_0.0 - * @return Return the size scale policy - */ - SizeScalePolicy::Type GetSizeScalePolicy() const; - - /** - * @brief Sets the relative to parent size factor of the actor. - * - * This factor is only used when ResizePolicy is set to either: - * ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT. - * This actor's size is set to the actor's size multiplied by or added to this factor, - * depending on ResizePolicy ( See SetResizePolicy() ). - * - * @SINCE_1_0.0 - * @param[in] factor A Vector3 representing the relative factor to be applied to each axis - * @pre The Actor has been initialized. - */ - void SetSizeModeFactor( const Vector3& factor ); - - /** - * @brief Retrieves the relative to parent size factor of the actor. - * - * @SINCE_1_0.0 - * @return The Actor's current relative size factor - * @pre The Actor has been initialized. - */ - Vector3 GetSizeModeFactor() const; - - /** * @brief Calculates the height of the actor given a width. * * The natural size is used for default calculation. @@ -1376,22 +1246,6 @@ public: float GetRelayoutSize( Dimension::Type dimension ) const; /** - * @brief Sets the padding for use in layout. - * - * @SINCE_1_0.0 - * @param[in] padding Padding for the actor - */ - void SetPadding( const Padding& padding ); - - /** - * @brief Returns the value of the padding. - * - * @SINCE_1_0.0 - * @param[in] paddingOut The returned padding data - */ - void GetPadding( Padding& paddingOut ) const; - - /** * @brief Gets depth in the hierarchy for the actor. * * @SINCE_1_0.0 diff --git a/dali/public-api/math/rect.h b/dali/public-api/math/rect.h index 5560a8a..649949e 100644 --- a/dali/public-api/math/rect.h +++ b/dali/public-api/math/rect.h @@ -2,7 +2,7 @@ #define DALI_RECT_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,6 +72,20 @@ struct Rect } /** + * @brief Conversion constructor from Vector4. + * + * @SINCE_1_9.14 + * @param[in] vec4 Vector4 to convert from + */ + Rect( const Vector4& vec4 ) + { + x = vec4.x; + y = vec4.y; + width = vec4.z; + height = vec4.w; + } + + /** * @brief Copy constructor. * * @SINCE_1_0.0 diff --git a/dali/public-api/object/property-value.cpp b/dali/public-api/object/property-value.cpp index 73e8aab..7132bfb 100644 --- a/dali/public-api/object/property-value.cpp +++ b/dali/public-api/object/property-value.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,6 +120,12 @@ struct Property::Value::Impl { } + Impl( const Rect& rectValue ) + : type( Property::VECTOR4 ), + vector4Value( new Vector4( rectValue.x, rectValue.y, rectValue.width, rectValue.height ) ) + { + } + Impl( const Property::Array& arrayValue ) : type( Property::ARRAY ), arrayValue( new Property::Array( arrayValue ) ) @@ -307,6 +313,11 @@ Property::Value::Value( const Rect& rectValue ) { } +Property::Value::Value( const Rect& rectValue ) +: mImpl( new Impl( rectValue ) ) +{ +} + Property::Value::Value( const AngleAxis& angleAxisValue ) : mImpl( new Impl( angleAxisValue ) ) { diff --git a/dali/public-api/object/property-value.h b/dali/public-api/object/property-value.h index 800ca99..d44349c 100755 --- a/dali/public-api/object/property-value.h +++ b/dali/public-api/object/property-value.h @@ -2,7 +2,7 @@ #define DALI_PROPERTY_VALUE_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,6 +136,14 @@ public: Value( const Rect& vectorValue ); /** + * @brief Creates a Vector4 property value. + * + * @SINCE_1_9.14 + * @param[in] vectorValue A vector of 4 float values + */ + Value( const Rect& vectorValue ); + + /** * @brief Creates an orientation property value. * * @SINCE_1_0.0 -- 2.7.4