X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Factor-property-handler.cpp;h=2012ed1c52cf4d2a538677cfb7334fcfce4240a2;hb=ed72ae68fd287af4285a98c816d4eabff866301b;hp=76f82f5f8735981843012f8c311ad9cb09c2e879;hpb=8dd260bc44e782150aa4a4e02559a2cd3c7ef888;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/actors/actor-property-handler.cpp b/dali/internal/event/actors/actor-property-handler.cpp old mode 100755 new mode 100644 index 76f82f5..2012ed1 --- a/dali/internal/event/actors/actor-property-handler.cpp +++ b/dali/internal/event/actors/actor-property-handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -21,123 +21,124 @@ // INTERNAL INCLUDES #include #include + #include + #include +#include +#include #include -#include #include +#include -using Dali::Internal::SceneGraph::Node; using Dali::Internal::SceneGraph::AnimatableProperty; +using Dali::Internal::SceneGraph::Node; using Dali::Internal::SceneGraph::PropertyBase; namespace Dali { - namespace Internal { - namespace // unnamed namespace { - struct AnchorValue { - const char* name; + const char* name; const Vector3& value; }; -DALI_ENUM_TO_STRING_TABLE_BEGIN_WITH_TYPE( AnchorValue, ANCHOR_CONSTANT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, TOP_LEFT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, TOP_CENTER ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, TOP_RIGHT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, CENTER_LEFT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, CENTER ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, CENTER_RIGHT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, BOTTOM_LEFT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, BOTTOM_CENTER ) -DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, BOTTOM_RIGHT ) -DALI_ENUM_TO_STRING_TABLE_END( ANCHOR_CONSTANT ) - -DALI_ENUM_TO_STRING_TABLE_BEGIN( COLOR_MODE ) -DALI_ENUM_TO_STRING( USE_OWN_COLOR ) -DALI_ENUM_TO_STRING( USE_PARENT_COLOR ) -DALI_ENUM_TO_STRING( USE_OWN_MULTIPLY_PARENT_COLOR ) -DALI_ENUM_TO_STRING( USE_OWN_MULTIPLY_PARENT_ALPHA ) -DALI_ENUM_TO_STRING_TABLE_END( COLOR_MODE ) - -DALI_ENUM_TO_STRING_TABLE_BEGIN( DRAW_MODE ) -DALI_ENUM_TO_STRING_WITH_SCOPE( DrawMode, NORMAL ) -DALI_ENUM_TO_STRING_WITH_SCOPE( DrawMode, OVERLAY_2D ) -DALI_ENUM_TO_STRING_TABLE_END( DRAW_MODE ) - -DALI_ENUM_TO_STRING_TABLE_BEGIN( RESIZE_POLICY ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, FIXED ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, USE_NATURAL_SIZE ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, FILL_TO_PARENT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, SIZE_RELATIVE_TO_PARENT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, SIZE_FIXED_OFFSET_FROM_PARENT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, FIT_TO_CHILDREN ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, DIMENSION_DEPENDENCY ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, USE_ASSIGNED_SIZE ) -DALI_ENUM_TO_STRING_TABLE_END( RESIZE_POLICY ) - -DALI_ENUM_TO_STRING_TABLE_BEGIN( SIZE_SCALE_POLICY ) -DALI_ENUM_TO_STRING_WITH_SCOPE( SizeScalePolicy, USE_SIZE_SET ) -DALI_ENUM_TO_STRING_WITH_SCOPE( SizeScalePolicy, FIT_WITH_ASPECT_RATIO ) -DALI_ENUM_TO_STRING_WITH_SCOPE( SizeScalePolicy, FILL_WITH_ASPECT_RATIO ) -DALI_ENUM_TO_STRING_TABLE_END( SIZE_SCALE_POLICY ) - -DALI_ENUM_TO_STRING_TABLE_BEGIN( CLIPPING_MODE ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ClippingMode, DISABLED ) -DALI_ENUM_TO_STRING_WITH_SCOPE( ClippingMode, CLIP_CHILDREN ) -DALI_ENUM_TO_STRING_TABLE_END( CLIPPING_MODE ) - -DALI_ENUM_TO_STRING_TABLE_BEGIN( LAYOUT_DIRECTION ) -DALI_ENUM_TO_STRING_WITH_SCOPE( LayoutDirection, LEFT_TO_RIGHT ) -DALI_ENUM_TO_STRING_WITH_SCOPE( LayoutDirection, RIGHT_TO_LEFT ) -DALI_ENUM_TO_STRING_TABLE_END( LAYOUT_DIRECTION ) - -bool GetAnchorPointConstant( const std::string& value, Vector3& anchor ) +DALI_ENUM_TO_STRING_TABLE_BEGIN_WITH_TYPE(AnchorValue, ANCHOR_CONSTANT) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, TOP_LEFT) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, TOP_CENTER) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, TOP_RIGHT) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, CENTER_LEFT) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, CENTER) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, CENTER_RIGHT) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, BOTTOM_LEFT) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, BOTTOM_CENTER) + DALI_ENUM_TO_STRING_WITH_SCOPE(AnchorPoint, BOTTOM_RIGHT) +DALI_ENUM_TO_STRING_TABLE_END(ANCHOR_CONSTANT) + +DALI_ENUM_TO_STRING_TABLE_BEGIN(COLOR_MODE) + DALI_ENUM_TO_STRING(USE_OWN_COLOR) + DALI_ENUM_TO_STRING(USE_PARENT_COLOR) + DALI_ENUM_TO_STRING(USE_OWN_MULTIPLY_PARENT_COLOR) + DALI_ENUM_TO_STRING(USE_OWN_MULTIPLY_PARENT_ALPHA) +DALI_ENUM_TO_STRING_TABLE_END(COLOR_MODE) + +DALI_ENUM_TO_STRING_TABLE_BEGIN(DRAW_MODE) + DALI_ENUM_TO_STRING_WITH_SCOPE(DrawMode, NORMAL) + DALI_ENUM_TO_STRING_WITH_SCOPE(DrawMode, OVERLAY_2D) +DALI_ENUM_TO_STRING_TABLE_END(DRAW_MODE) + +DALI_ENUM_TO_STRING_TABLE_BEGIN(RESIZE_POLICY) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, FIXED) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, USE_NATURAL_SIZE) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, FILL_TO_PARENT) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, SIZE_RELATIVE_TO_PARENT) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, SIZE_FIXED_OFFSET_FROM_PARENT) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, FIT_TO_CHILDREN) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, DIMENSION_DEPENDENCY) + DALI_ENUM_TO_STRING_WITH_SCOPE(ResizePolicy, USE_ASSIGNED_SIZE) +DALI_ENUM_TO_STRING_TABLE_END(RESIZE_POLICY) + +DALI_ENUM_TO_STRING_TABLE_BEGIN(SIZE_SCALE_POLICY) + DALI_ENUM_TO_STRING_WITH_SCOPE(SizeScalePolicy, USE_SIZE_SET) + DALI_ENUM_TO_STRING_WITH_SCOPE(SizeScalePolicy, FIT_WITH_ASPECT_RATIO) + DALI_ENUM_TO_STRING_WITH_SCOPE(SizeScalePolicy, FILL_WITH_ASPECT_RATIO) +DALI_ENUM_TO_STRING_TABLE_END(SIZE_SCALE_POLICY) + +DALI_ENUM_TO_STRING_TABLE_BEGIN(CLIPPING_MODE) + DALI_ENUM_TO_STRING_WITH_SCOPE(ClippingMode, DISABLED) + DALI_ENUM_TO_STRING_WITH_SCOPE(ClippingMode, CLIP_CHILDREN) +DALI_ENUM_TO_STRING_TABLE_END(CLIPPING_MODE) + +DALI_ENUM_TO_STRING_TABLE_BEGIN(LAYOUT_DIRECTION) + DALI_ENUM_TO_STRING_WITH_SCOPE(LayoutDirection, LEFT_TO_RIGHT) + DALI_ENUM_TO_STRING_WITH_SCOPE(LayoutDirection, RIGHT_TO_LEFT) +DALI_ENUM_TO_STRING_TABLE_END(LAYOUT_DIRECTION) + +bool GetAnchorPointConstant(const std::string& value, Vector3& anchor) { - for( uint32_t i = 0; i < ANCHOR_CONSTANT_TABLE_COUNT; ++i ) + for(uint32_t i = 0; i < ANCHOR_CONSTANT_TABLE_COUNT; ++i) { uint32_t sizeIgnored = 0; - if( CompareTokens( value.c_str(), ANCHOR_CONSTANT_TABLE[ i ].name, sizeIgnored ) ) + if(CompareTokens(value.c_str(), ANCHOR_CONSTANT_TABLE[i].name, sizeIgnored)) { - anchor = ANCHOR_CONSTANT_TABLE[ i ].value; + anchor = ANCHOR_CONSTANT_TABLE[i].value; return true; } } return false; } -inline bool GetParentOriginConstant( const std::string& value, Vector3& parentOrigin ) +inline bool GetParentOriginConstant(const std::string& value, Vector3& parentOrigin) { // Values are the same so just use the same table as anchor-point - return GetAnchorPointConstant( value, parentOrigin ); + return GetAnchorPointConstant(value, parentOrigin); } } // unnamed namespace -void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Property::Index index, const Property::Value& property ) +void Actor::PropertyHandler::SetDefaultProperty(Internal::Actor& actor, Property::Index index, const Property::Value& property) { - switch( index ) + switch(index) { case Dali::Actor::Property::PARENT_ORIGIN: { Property::Type type = property.GetType(); - if( type == Property::VECTOR3 ) + if(type == Property::VECTOR3) { - actor.SetParentOrigin( property.Get< Vector3 >() ); + actor.SetParentOrigin(property.Get()); } - else if ( type == Property::STRING ) + else if(type == Property::STRING) { std::string parentOriginString; - property.Get( parentOriginString ); + property.Get(parentOriginString); Vector3 parentOrigin; - if( GetParentOriginConstant( parentOriginString, parentOrigin ) ) + if(GetParentOriginConstant(parentOriginString, parentOrigin)) { - actor.SetParentOrigin( parentOrigin ); + actor.SetParentOrigin(parentOrigin); } } break; @@ -146,39 +147,39 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::PARENT_ORIGIN_X: { const Vector3& current = actor.GetCurrentParentOrigin(); - actor.SetParentOrigin( Vector3( property.Get< float >(), current.y, current.z ) ); + actor.SetParentOrigin(Vector3(property.Get(), current.y, current.z)); break; } case Dali::Actor::Property::PARENT_ORIGIN_Y: { const Vector3& current = actor.GetCurrentParentOrigin(); - actor.SetParentOrigin( Vector3( current.x, property.Get< float >(), current.z ) ); + actor.SetParentOrigin(Vector3(current.x, property.Get(), current.z)); break; } case Dali::Actor::Property::PARENT_ORIGIN_Z: { const Vector3& current = actor.GetCurrentParentOrigin(); - actor.SetParentOrigin( Vector3( current.x, current.y, property.Get< float >() ) ); + actor.SetParentOrigin(Vector3(current.x, current.y, property.Get())); break; } case Dali::Actor::Property::ANCHOR_POINT: { Property::Type type = property.GetType(); - if( type == Property::VECTOR3 ) + if(type == Property::VECTOR3) { - actor.SetAnchorPoint( property.Get< Vector3 >() ); + actor.SetAnchorPoint(property.Get()); } - else if ( type == Property::STRING ) + else if(type == Property::STRING) { std::string anchorPointString; - property.Get( anchorPointString ); + property.Get(anchorPointString); Vector3 anchor; - if( GetAnchorPointConstant( anchorPointString, anchor ) ) + if(GetAnchorPointConstant(anchorPointString, anchor)) { - actor.SetAnchorPoint( anchor ); + actor.SetAnchorPoint(anchor); } } break; @@ -187,164 +188,164 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::ANCHOR_POINT_X: { const Vector3& current = actor.GetCurrentAnchorPoint(); - actor.SetAnchorPoint( Vector3( property.Get< float >(), current.y, current.z ) ); + actor.SetAnchorPoint(Vector3(property.Get(), current.y, current.z)); break; } case Dali::Actor::Property::ANCHOR_POINT_Y: { const Vector3& current = actor.GetCurrentAnchorPoint(); - actor.SetAnchorPoint( Vector3( current.x, property.Get< float >(), current.z ) ); + actor.SetAnchorPoint(Vector3(current.x, property.Get(), current.z)); break; } case Dali::Actor::Property::ANCHOR_POINT_Z: { const Vector3& current = actor.GetCurrentAnchorPoint(); - actor.SetAnchorPoint( Vector3( current.x, current.y, property.Get< float >() ) ); + actor.SetAnchorPoint(Vector3(current.x, current.y, property.Get())); break; } case Dali::Actor::Property::SIZE: { Property::Type type = property.GetType(); - if( type == Property::VECTOR2 ) + if(type == Property::VECTOR2) { - actor.SetSize( property.Get< Vector2 >() ); + actor.SetSize(property.Get()); } - else if ( type == Property::VECTOR3 ) + else if(type == Property::VECTOR3) { - actor.SetSize( property.Get< Vector3 >() ); + actor.SetSize(property.Get()); } break; } case Dali::Actor::Property::SIZE_WIDTH: { - actor.SetWidth( property.Get< float >() ); + actor.SetWidth(property.Get()); break; } case Dali::Actor::Property::SIZE_HEIGHT: { - actor.SetHeight( property.Get< float >() ); + actor.SetHeight(property.Get()); break; } case Dali::Actor::Property::SIZE_DEPTH: { - actor.SetDepth( property.Get< float >() ); + actor.SetDepth(property.Get()); break; } case Dali::Actor::Property::POSITION: { Property::Type type = property.GetType(); - if( type == Property::VECTOR2 ) + if(type == Property::VECTOR2) { - Vector2 position = property.Get< Vector2 >(); - actor.SetPosition( Vector3( position.x, position.y, 0.0f ) ); + Vector2 position = property.Get(); + actor.SetPosition(Vector3(position.x, position.y, 0.0f)); } - else if ( type == Property::VECTOR3 ) + else if(type == Property::VECTOR3) { - actor.SetPosition( property.Get< Vector3 >() ); + actor.SetPosition(property.Get()); } break; } case Dali::Actor::Property::POSITION_X: { - actor.SetX( property.Get< float >() ); + actor.SetX(property.Get()); break; } case Dali::Actor::Property::POSITION_Y: { - actor.SetY( property.Get< float >() ); + actor.SetY(property.Get()); break; } case Dali::Actor::Property::POSITION_Z: { - actor.SetZ( property.Get< float >() ); + actor.SetZ(property.Get()); break; } case Dali::Actor::Property::ORIENTATION: { - actor.SetOrientation( property.Get< Quaternion >() ); + actor.SetOrientation(property.Get()); break; } case Dali::Actor::Property::SCALE: { Property::Type type = property.GetType(); - if( type == Property::FLOAT ) + if(type == Property::FLOAT) { - float scale = property.Get< float >(); - actor.SetScale( scale, scale, scale ); + float scale = property.Get(); + actor.SetScale(scale, scale, scale); } - else if ( type == Property::VECTOR3 ) + else if(type == Property::VECTOR3) { - actor.SetScale( property.Get< Vector3 >() ); + actor.SetScale(property.Get()); } break; } case Dali::Actor::Property::SCALE_X: { - actor.SetScaleX( property.Get< float >() ); + actor.SetScaleX(property.Get()); break; } case Dali::Actor::Property::SCALE_Y: { - actor.SetScaleY( property.Get< float >() ); + actor.SetScaleY(property.Get()); break; } case Dali::Actor::Property::SCALE_Z: { - actor.SetScaleZ( property.Get< float >() ); + actor.SetScaleZ(property.Get()); break; } case Dali::Actor::Property::VISIBLE: { - actor.SetVisible( property.Get< bool >() ); + actor.SetVisible(property.Get()); break; } case Dali::Actor::Property::COLOR: { Property::Type type = property.GetType(); - if( type == Property::VECTOR3 ) + if(type == Property::VECTOR3) { - Vector3 color = property.Get< Vector3 >(); - actor.SetColor( Vector4( color.r, color.g, color.b, 1.0f ) ); + Vector3 color = property.Get(); + actor.SetColor(Vector4(color.r, color.g, color.b, 1.0f)); } - else if( type == Property::VECTOR4 ) + else if(type == Property::VECTOR4) { - actor.SetColor( property.Get< Vector4 >() ); + actor.SetColor(property.Get()); } break; } case Dali::Actor::Property::COLOR_RED: { - actor.SetColorRed( property.Get< float >() ); + actor.SetColorRed(property.Get()); break; } case Dali::Actor::Property::COLOR_GREEN: { - actor.SetColorGreen( property.Get< float >() ); + actor.SetColorGreen(property.Get()); break; } case Dali::Actor::Property::COLOR_BLUE: { - actor.SetColorBlue( property.Get< float >() ); + actor.SetColorBlue(property.Get()); break; } @@ -352,55 +353,55 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::OPACITY: { float value; - if( property.Get( value ) ) + if(property.Get(value)) { - actor.SetOpacity( value ); + actor.SetOpacity(value); } break; } case Dali::Actor::Property::NAME: { - actor.SetName( property.Get< std::string >() ); + actor.SetName(property.Get()); break; } case Dali::Actor::Property::SENSITIVE: { - actor.SetSensitive( property.Get< bool >() ); + actor.SetSensitive(property.Get()); break; } case Dali::Actor::Property::LEAVE_REQUIRED: { - actor.SetLeaveRequired( property.Get< bool >() ); + actor.SetLeaveRequired(property.Get()); break; } case Dali::Actor::Property::INHERIT_POSITION: { - actor.SetInheritPosition( property.Get< bool >() ); + actor.SetInheritPosition(property.Get()); break; } case Dali::Actor::Property::INHERIT_ORIENTATION: { - actor.SetInheritOrientation( property.Get< bool >() ); + actor.SetInheritOrientation(property.Get()); break; } case Dali::Actor::Property::INHERIT_SCALE: { - actor.SetInheritScale( property.Get< bool >() ); + actor.SetInheritScale(property.Get()); break; } case Dali::Actor::Property::COLOR_MODE: { ColorMode mode = actor.mColorMode; - if ( Scripting::GetEnumerationProperty< ColorMode >( property, COLOR_MODE_TABLE, COLOR_MODE_TABLE_COUNT, mode ) ) + if(Scripting::GetEnumerationProperty(property, COLOR_MODE_TABLE, COLOR_MODE_TABLE_COUNT, mode)) { - actor.SetColorMode( mode ); + actor.SetColorMode(mode); } break; } @@ -408,88 +409,88 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::DRAW_MODE: { DrawMode::Type mode = actor.mDrawMode; - if( Scripting::GetEnumerationProperty< DrawMode::Type >( property, DRAW_MODE_TABLE, DRAW_MODE_TABLE_COUNT, mode ) ) + if(Scripting::GetEnumerationProperty(property, DRAW_MODE_TABLE, DRAW_MODE_TABLE_COUNT, mode)) { - actor.SetDrawMode( mode ); + actor.SetDrawMode(mode); } break; } case Dali::Actor::Property::SIZE_MODE_FACTOR: { - actor.SetSizeModeFactor( property.Get< Vector3 >() ); + actor.SetSizeModeFactor(property.Get()); break; } case Dali::Actor::Property::WIDTH_RESIZE_POLICY: { - ResizePolicy::Type type = actor.GetResizePolicy( Dimension::WIDTH ); - if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) ) + ResizePolicy::Type type = actor.mSizer.GetResizePolicy(Dimension::WIDTH); + if(Scripting::GetEnumerationProperty(property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type)) { - actor.SetResizePolicy( type, Dimension::WIDTH ); + actor.mSizer.SetResizePolicy(type, Dimension::WIDTH); } break; } case Dali::Actor::Property::HEIGHT_RESIZE_POLICY: { - ResizePolicy::Type type = actor.GetResizePolicy( Dimension::HEIGHT ); - if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) ) + ResizePolicy::Type type = actor.mSizer.GetResizePolicy(Dimension::HEIGHT); + if(Scripting::GetEnumerationProperty(property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type)) { - actor.SetResizePolicy( type, Dimension::HEIGHT ); + actor.mSizer.SetResizePolicy(type, Dimension::HEIGHT); } break; } case Dali::Actor::Property::SIZE_SCALE_POLICY: { - SizeScalePolicy::Type type = actor.GetSizeScalePolicy(); - if( Scripting::GetEnumerationProperty< SizeScalePolicy::Type >( property, SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) ) + SizeScalePolicy::Type type = actor.mSizer.GetSizeScalePolicy(); + if(Scripting::GetEnumerationProperty(property, SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type)) { - actor.SetSizeScalePolicy( type ); + actor.mSizer.SetSizeScalePolicy(type); } break; } case Dali::Actor::Property::WIDTH_FOR_HEIGHT: { - if( property.Get< bool >() ) + if(property.Get()) { - actor.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::WIDTH ); + actor.mSizer.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::WIDTH); } break; } case Dali::Actor::Property::HEIGHT_FOR_WIDTH: { - if( property.Get< bool >() ) + if(property.Get()) { - actor.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); + actor.mSizer.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT); } break; } case Dali::Actor::Property::PADDING: { - Vector4 padding = property.Get< Vector4 >(); - actor.SetPadding( Vector2( padding.x, padding.y ), Dimension::WIDTH ); - actor.SetPadding( Vector2( padding.z, padding.w ), Dimension::HEIGHT ); + Vector4 padding = property.Get(); + actor.SetPadding(Vector2(padding.x, padding.y), Dimension::WIDTH); + actor.SetPadding(Vector2(padding.z, padding.w), Dimension::HEIGHT); break; } case Dali::Actor::Property::MINIMUM_SIZE: { - Vector2 size = property.Get< Vector2 >(); - actor.SetMinimumSize( size.x, Dimension::WIDTH ); - actor.SetMinimumSize( size.y, Dimension::HEIGHT ); + Vector2 size = property.Get(); + actor.SetMinimumSize(size.x, Dimension::WIDTH); + actor.SetMinimumSize(size.y, Dimension::HEIGHT); break; } case Dali::Actor::Property::MAXIMUM_SIZE: { - Vector2 size = property.Get< Vector2 >(); - actor.SetMaximumSize( size.x, Dimension::WIDTH ); - actor.SetMaximumSize( size.y, Dimension::HEIGHT ); + Vector2 size = property.Get(); + actor.SetMaximumSize(size.x, Dimension::WIDTH); + actor.SetMaximumSize(size.y, Dimension::HEIGHT); break; } @@ -497,9 +498,13 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert { int value; - if( property.Get( value ) ) + if(property.Get(value)) { - actor.SetSiblingOrder( value ); + Actor* parent = actor.GetParent(); + if(parent) + { + parent->SetSiblingOrderOfChild(actor, value); + } } break; } @@ -507,10 +512,10 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::CLIPPING_MODE: { ClippingMode::Type convertedValue = actor.mClippingMode; - if( Scripting::GetEnumerationProperty< ClippingMode::Type >( property, CLIPPING_MODE_TABLE, CLIPPING_MODE_TABLE_COUNT, convertedValue ) ) + if(Scripting::GetEnumerationProperty(property, CLIPPING_MODE_TABLE, CLIPPING_MODE_TABLE_COUNT, convertedValue)) { actor.mClippingMode = convertedValue; - SetClippingModeMessage( actor.GetEventThreadServices(), actor.GetNode(), actor.mClippingMode ); + SetClippingModeMessage(actor.GetEventThreadServices(), actor.GetNode(), actor.mClippingMode); } break; } @@ -518,10 +523,10 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT: { bool value = false; - if( property.Get( value ) && value != actor.mPositionUsesAnchorPoint ) + if(property.Get(value) && value != actor.mPositionUsesAnchorPoint) { actor.mPositionUsesAnchorPoint = value; - SetPositionUsesAnchorPointMessage( actor.GetEventThreadServices(), actor.GetNode(), actor.mPositionUsesAnchorPoint ); + SetPositionUsesAnchorPointMessage(actor.GetEventThreadServices(), actor.GetNode(), actor.mPositionUsesAnchorPoint); } break; } @@ -529,11 +534,11 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::LAYOUT_DIRECTION: { Dali::LayoutDirection::Type direction = actor.mLayoutDirection; - actor.mInheritLayoutDirection = false; + actor.mInheritLayoutDirection = false; - if( Scripting::GetEnumerationProperty< LayoutDirection::Type >( property, LAYOUT_DIRECTION_TABLE, LAYOUT_DIRECTION_TABLE_COUNT, direction ) ) + if(Scripting::GetEnumerationProperty(property, LAYOUT_DIRECTION_TABLE, LAYOUT_DIRECTION_TABLE_COUNT, direction)) { - actor.InheritLayoutDirectionRecursively( &actor, direction, true ); + actor.mParentImpl.InheritLayoutDirectionRecursively(direction, true); } break; } @@ -541,9 +546,9 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION: { bool value = false; - if( property.Get( value ) ) + if(property.Get(value)) { - actor.SetInheritLayoutDirection( value ); + actor.SetInheritLayoutDirection(value); } break; } @@ -551,35 +556,35 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::Actor::Property::KEYBOARD_FOCUSABLE: { bool value = false; - if( property.Get( value ) ) + if(property.Get(value)) { - actor.SetKeyboardFocusable( value ); + actor.SetKeyboardFocusable(value); } break; } case Dali::DevelActor::Property::UPDATE_SIZE_HINT: { - actor.SetUpdateSizeHint( property.Get< Vector2 >() ); + actor.SetUpdateSizeHint(property.Get()); break; } case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START: { bool boolValue = false; - if ( property.Get( boolValue ) ) + if(property.Get(boolValue)) { actor.mCaptureAllTouchAfterStart = boolValue; } break; } - case Dali::DevelActor::Property::TOUCH_AREA: + case Dali::DevelActor::Property::TOUCH_AREA_OFFSET: { - Vector2 vec2Value; - if( property.Get( vec2Value ) ) + Rect rectValue; + if(property.Get(rectValue)) { - actor.SetTouchArea( vec2Value ); + actor.SetTouchAreaOffset(rectValue); } break; } @@ -587,9 +592,29 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert case Dali::DevelActor::Property::BLEND_EQUATION: { int value; - if( property.Get( value ) ) + if(property.Get(value)) + { + actor.SetBlendEquation(static_cast(value)); + } + break; + } + + case Dali::DevelActor::Property::TOUCH_FOCUSABLE: + { + bool value = false; + if(property.Get(value)) + { + actor.SetTouchFocusable(value); + } + break; + } + + case Dali::DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN: + { + bool value = false; + if(property.Get(value)) { - actor.SetBlendEquation( static_cast( value ) ); + actor.SetKeyboardFocusableChildren(value); } break; } @@ -603,64 +628,64 @@ void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Propert } void Actor::PropertyHandler::SetSceneGraphProperty( - Property::Index index, - const PropertyMetadata& entry, - const Property::Value& value, - EventThreadServices& eventThreadServices, - const SceneGraph::Node& node) + Property::Index index, + const PropertyMetadata& entry, + const Property::Value& value, + EventThreadServices& eventThreadServices, + const SceneGraph::Node& node) { - switch( entry.GetType() ) + switch(entry.GetType()) { case Property::BOOLEAN: { - const AnimatableProperty< bool >* property = dynamic_cast< const AnimatableProperty< bool >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); break; } case Property::INTEGER: { - const AnimatableProperty< int >* property = dynamic_cast< const AnimatableProperty< int >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); break; } case Property::FLOAT: { - const AnimatableProperty< float >* property = dynamic_cast< const AnimatableProperty< float >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); break; } case Property::VECTOR2: { - const AnimatableProperty< Vector2 >* property = dynamic_cast< const AnimatableProperty< Vector2 >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property if(entry.componentIndex == 0) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeX, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeX, value.Get()); } else if(entry.componentIndex == 1) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeY, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeY, value.Get()); } else { - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); } break; @@ -668,25 +693,25 @@ void Actor::PropertyHandler::SetSceneGraphProperty( case Property::VECTOR3: { - const AnimatableProperty< Vector3 >* property = dynamic_cast< const AnimatableProperty< Vector3 >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property if(entry.componentIndex == 0) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeX, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeX, value.Get()); } else if(entry.componentIndex == 1) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeY, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeY, value.Get()); } else if(entry.componentIndex == 2) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeZ, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeZ, value.Get()); } else { - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); } break; @@ -694,29 +719,29 @@ void Actor::PropertyHandler::SetSceneGraphProperty( case Property::VECTOR4: { - const AnimatableProperty< Vector4 >* property = dynamic_cast< const AnimatableProperty< Vector4 >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property if(entry.componentIndex == 0) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeX, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeX, value.Get()); } else if(entry.componentIndex == 1) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeY, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeY, value.Get()); } else if(entry.componentIndex == 2) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeZ, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeZ, value.Get()); } else if(entry.componentIndex == 3) { - SceneGraph::NodePropertyComponentMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::BakeW, value.Get() ); + SceneGraph::NodePropertyComponentMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::BakeW, value.Get()); } else { - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); } break; @@ -724,33 +749,33 @@ void Actor::PropertyHandler::SetSceneGraphProperty( case Property::ROTATION: { - const AnimatableProperty< Quaternion >* property = dynamic_cast< const AnimatableProperty< Quaternion >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property,&AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); break; } case Property::MATRIX: { - const AnimatableProperty< Matrix >* property = dynamic_cast< const AnimatableProperty< Matrix >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property,&AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); break; } case Property::MATRIX3: { - const AnimatableProperty< Matrix3 >* property = dynamic_cast< const AnimatableProperty< Matrix3 >* >( entry.GetSceneGraphProperty() ); - DALI_ASSERT_DEBUG( NULL != property ); + const AnimatableProperty* property = dynamic_cast*>(entry.GetSceneGraphProperty()); + DALI_ASSERT_DEBUG(NULL != property); // property is being used in a separate thread; queue a message to set the property - SceneGraph::NodePropertyMessage::Send( eventThreadServices, &node, property,&AnimatableProperty::Bake, value.Get() ); + SceneGraph::NodePropertyMessage::Send(eventThreadServices, &node, property, &AnimatableProperty::Bake, value.Get()); break; } @@ -764,153 +789,141 @@ void Actor::PropertyHandler::SetSceneGraphProperty( void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& actor, Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType) { - switch( animationType ) + switch(animationType) { case Animation::TO: case Animation::BETWEEN: { - switch( index ) + switch(index) { case Dali::Actor::Property::SIZE: { - if( value.Get( actor.mTargetSize ) ) + Vector3 targetSize; + if(value.Get(targetSize)) { - actor.mAnimatedSize = actor.mTargetSize; - actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateSize(animation, targetSize, false); } break; } case Dali::Actor::Property::SIZE_WIDTH: { - if( value.Get( actor.mTargetSize.width ) ) + float width; + if(value.Get(width)) { - actor.mAnimatedSize.width = actor.mTargetSize.width; - actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateWidth(animation, width, false); } break; } case Dali::Actor::Property::SIZE_HEIGHT: { - if( value.Get( actor.mTargetSize.height ) ) + float height; + if(value.Get(height)) { - actor.mAnimatedSize.height = actor.mTargetSize.height; - actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateHeight(animation, height, false); } break; } case Dali::Actor::Property::SIZE_DEPTH: { - if( value.Get( actor.mTargetSize.depth ) ) + float depth; + if(value.Get(depth)) { - actor.mAnimatedSize.depth = actor.mTargetSize.depth; - actor.mUseAnimatedSize |= AnimatedSizeFlag::DEPTH; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateDepth(animation, depth, false); } break; } case Dali::Actor::Property::POSITION: { - value.Get( actor.mTargetPosition ); + value.Get(actor.mTargetPosition); break; } case Dali::Actor::Property::POSITION_X: { - value.Get( actor.mTargetPosition.x ); + value.Get(actor.mTargetPosition.x); break; } case Dali::Actor::Property::POSITION_Y: { - value.Get( actor.mTargetPosition.y ); + value.Get(actor.mTargetPosition.y); break; } case Dali::Actor::Property::POSITION_Z: { - value.Get( actor.mTargetPosition.z ); + value.Get(actor.mTargetPosition.z); break; } case Dali::Actor::Property::ORIENTATION: { - value.Get( actor.mTargetOrientation ); + value.Get(actor.mTargetOrientation); break; } case Dali::Actor::Property::SCALE: { - value.Get( actor.mTargetScale ); + value.Get(actor.mTargetScale); break; } case Dali::Actor::Property::SCALE_X: { - value.Get( actor.mTargetScale.x ); + value.Get(actor.mTargetScale.x); break; } case Dali::Actor::Property::SCALE_Y: { - value.Get( actor.mTargetScale.y ); + value.Get(actor.mTargetScale.y); break; } case Dali::Actor::Property::SCALE_Z: { - value.Get( actor.mTargetScale.z ); + value.Get(actor.mTargetScale.z); break; } case Dali::Actor::Property::VISIBLE: { - actor.SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE ); + actor.SetVisibleInternal(value.Get(), SendMessage::FALSE); break; } case Dali::Actor::Property::COLOR: { - value.Get( actor.mTargetColor ); + value.Get(actor.mTargetColor); break; } case Dali::Actor::Property::COLOR_RED: { - value.Get( actor.mTargetColor.r ); + value.Get(actor.mTargetColor.r); break; } case Dali::Actor::Property::COLOR_GREEN: { - value.Get( actor.mTargetColor.g ); + value.Get(actor.mTargetColor.g); break; } case Dali::Actor::Property::COLOR_BLUE: { - value.Get( actor.mTargetColor.b ); + value.Get(actor.mTargetColor.b); break; } case Dali::Actor::Property::COLOR_ALPHA: case Dali::Actor::Property::OPACITY: { - value.Get( actor.mTargetColor.a ); + value.Get(actor.mTargetColor.a); break; } @@ -925,88 +938,76 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a case Animation::BY: { - switch( index ) + switch(index) { case Dali::Actor::Property::SIZE: { - if( AdjustValue< Vector3 >( actor.mTargetSize, value ) ) + Vector3 targetSize; + if(value.Get(targetSize)) { - actor.mAnimatedSize = actor.mTargetSize; - actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateSize(animation, targetSize, true); } break; } case Dali::Actor::Property::SIZE_WIDTH: { - if( AdjustValue< float >( actor.mTargetSize.width, value ) ) + float width; + if(value.Get(width)) { - actor.mAnimatedSize.width = actor.mTargetSize.width; - actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateWidth(animation, width, true); } break; } case Dali::Actor::Property::SIZE_HEIGHT: { - if( AdjustValue< float >( actor.mTargetSize.height, value ) ) + float height; + if(value.Get(height)) { - actor.mAnimatedSize.height = actor.mTargetSize.height; - actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateHeight(animation, height, true); } break; } case Dali::Actor::Property::SIZE_DEPTH: { - if( AdjustValue< float >( actor.mTargetSize.depth, value ) ) + float depth; + if(value.Get(depth)) { - actor.mAnimatedSize.depth = actor.mTargetSize.depth; - actor.mUseAnimatedSize |= AnimatedSizeFlag::DEPTH; - - // Notify deriving classes - actor.OnSizeAnimation( animation, actor.mTargetSize ); + actor.mSizer.OnAnimateDepth(animation, depth, true); } break; } case Dali::Actor::Property::POSITION: { - AdjustValue< Vector3 >( actor.mTargetPosition, value ); + AdjustValue(actor.mTargetPosition, value); break; } case Dali::Actor::Property::POSITION_X: { - AdjustValue< float >( actor.mTargetPosition.x, value ); + AdjustValue(actor.mTargetPosition.x, value); break; } case Dali::Actor::Property::POSITION_Y: { - AdjustValue< float >( actor.mTargetPosition.y, value ); + AdjustValue(actor.mTargetPosition.y, value); break; } case Dali::Actor::Property::POSITION_Z: { - AdjustValue< float >( actor.mTargetPosition.z, value ); + AdjustValue(actor.mTargetPosition.z, value); break; } case Dali::Actor::Property::ORIENTATION: { Quaternion relativeValue; - if( value.Get( relativeValue ) ) + if(value.Get(relativeValue)) { actor.mTargetOrientation *= relativeValue; } @@ -1015,67 +1016,67 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a case Dali::Actor::Property::SCALE: { - AdjustValue< Vector3 >( actor.mTargetScale, value ); + AdjustValue(actor.mTargetScale, value); break; } case Dali::Actor::Property::SCALE_X: { - AdjustValue< float >( actor.mTargetScale.x, value ); + AdjustValue(actor.mTargetScale.x, value); break; } case Dali::Actor::Property::SCALE_Y: { - AdjustValue< float >( actor.mTargetScale.y, value ); + AdjustValue(actor.mTargetScale.y, value); break; } case Dali::Actor::Property::SCALE_Z: { - AdjustValue< float >( actor.mTargetScale.z, value ); + AdjustValue(actor.mTargetScale.z, value); break; } case Dali::Actor::Property::VISIBLE: { bool relativeValue = false; - if( value.Get( relativeValue ) ) + if(value.Get(relativeValue)) { bool visible = actor.mVisible || relativeValue; - actor.SetVisibleInternal( visible, SendMessage::FALSE ); + actor.SetVisibleInternal(visible, SendMessage::FALSE); } break; } case Dali::Actor::Property::COLOR: { - AdjustValue< Vector4 >( actor.mTargetColor, value ); + AdjustValue(actor.mTargetColor, value); break; } case Dali::Actor::Property::COLOR_RED: { - AdjustValue< float >( actor.mTargetColor.r, value ); + AdjustValue(actor.mTargetColor.r, value); break; } case Dali::Actor::Property::COLOR_GREEN: { - AdjustValue< float >( actor.mTargetColor.g, value ); + AdjustValue(actor.mTargetColor.g, value); break; } case Dali::Actor::Property::COLOR_BLUE: { - AdjustValue< float >( actor.mTargetColor.b, value ); + AdjustValue(actor.mTargetColor.b, value); break; } case Dali::Actor::Property::COLOR_ALPHA: case Dali::Actor::Property::OPACITY: { - AdjustValue< float >( actor.mTargetColor.a, value ); + AdjustValue(actor.mTargetColor.a, value); break; } @@ -1092,9 +1093,9 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a const PropertyBase* Actor::PropertyHandler::GetSceneObjectAnimatableProperty(Property::Index index, const SceneGraph::Node& node) { - const PropertyBase* property( nullptr ); + const PropertyBase* property(nullptr); - switch( index ) + switch(index) { case Dali::Actor::Property::SIZE: // FALLTHROUGH case Dali::Actor::Property::SIZE_WIDTH: // FALLTHROUGH @@ -1151,9 +1152,9 @@ const PropertyBase* Actor::PropertyHandler::GetSceneObjectAnimatableProperty(Pro const PropertyInputImpl* Actor::PropertyHandler::GetSceneObjectInputProperty(Property::Index index, const SceneGraph::Node& node) { - const PropertyInputImpl* property( nullptr ); + const PropertyInputImpl* property(nullptr); - switch( index ) + switch(index) { case Dali::Actor::Property::PARENT_ORIGIN: // FALLTHROUGH case Dali::Actor::Property::PARENT_ORIGIN_X: // FALLTHROUGH @@ -1217,7 +1218,7 @@ int32_t Actor::PropertyHandler::GetPropertyComponentIndex(Property::Index index) { int32_t componentIndex = Property::INVALID_COMPONENT_INDEX; - switch( index ) + switch(index) { case Dali::Actor::Property::PARENT_ORIGIN_X: case Dali::Actor::Property::ANCHOR_POINT_X: @@ -1276,7 +1277,7 @@ bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor { bool valueSet = true; - switch( index ) + switch(index) { case Dali::Actor::Property::PARENT_ORIGIN: { @@ -1443,7 +1444,7 @@ bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor case Dali::Actor::Property::NAME: { - value = actor.GetName(); + value = std::string(actor.GetName()); break; } @@ -1497,51 +1498,51 @@ bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor case Dali::Actor::Property::WIDTH_RESIZE_POLICY: { - value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( actor.GetResizePolicy( Dimension::WIDTH ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT ); + value = Scripting::GetLinearEnumerationName(actor.mSizer.GetResizePolicy(Dimension::WIDTH), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT); break; } case Dali::Actor::Property::HEIGHT_RESIZE_POLICY: { - value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( actor.GetResizePolicy( Dimension::HEIGHT ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT ); + value = Scripting::GetLinearEnumerationName(actor.mSizer.GetResizePolicy(Dimension::HEIGHT), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT); break; } case Dali::Actor::Property::SIZE_SCALE_POLICY: { - value = actor.GetSizeScalePolicy(); + value = actor.mSizer.GetSizeScalePolicy(); break; } case Dali::Actor::Property::WIDTH_FOR_HEIGHT: { - value = ( actor.GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( actor.GetDimensionDependency( Dimension::WIDTH ) == Dimension::HEIGHT ); + value = (actor.mSizer.GetResizePolicy(Dimension::WIDTH) == ResizePolicy::DIMENSION_DEPENDENCY) && (actor.mSizer.GetDimensionDependency(Dimension::WIDTH) == Dimension::HEIGHT); break; } case Dali::Actor::Property::HEIGHT_FOR_WIDTH: { - value = ( actor.GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( actor.GetDimensionDependency( Dimension::HEIGHT ) == Dimension::WIDTH ); + value = (actor.mSizer.GetResizePolicy(Dimension::HEIGHT) == ResizePolicy::DIMENSION_DEPENDENCY) && (actor.mSizer.GetDimensionDependency(Dimension::HEIGHT) == Dimension::WIDTH); break; } case Dali::Actor::Property::PADDING: { - Vector2 widthPadding = actor.GetPadding( Dimension::WIDTH ); - Vector2 heightPadding = actor.GetPadding( Dimension::HEIGHT ); - value = Vector4( widthPadding.x, widthPadding.y, heightPadding.x, heightPadding.y ); + Vector2 widthPadding = actor.GetPadding(Dimension::WIDTH); + Vector2 heightPadding = actor.GetPadding(Dimension::HEIGHT); + value = Vector4(widthPadding.x, widthPadding.y, heightPadding.x, heightPadding.y); break; } case Dali::Actor::Property::MINIMUM_SIZE: { - value = Vector2( actor.GetMinimumSize( Dimension::WIDTH ), actor.GetMinimumSize( Dimension::HEIGHT ) ); + value = Vector2(actor.GetMinimumSize(Dimension::WIDTH), actor.GetMinimumSize(Dimension::HEIGHT)); break; } case Dali::Actor::Property::MAXIMUM_SIZE: { - value = Vector2( actor.GetMaximumSize( Dimension::WIDTH ), actor.GetMaximumSize( Dimension::HEIGHT ) ); + value = Vector2(actor.GetMaximumSize(Dimension::WIDTH), actor.GetMaximumSize(Dimension::HEIGHT)); break; } @@ -1553,7 +1554,15 @@ bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor case Dali::DevelActor::Property::SIBLING_ORDER: { - value = static_cast( actor.GetSiblingOrder() ); + Actor* parent = actor.GetParent(); + if(parent) + { + value = static_cast(parent->GetSiblingOrderOfChild(actor)); + } + else + { + value = 0; + } break; } @@ -1583,7 +1592,7 @@ bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor case Dali::Actor::Property::ID: { - value = static_cast( actor.GetId() ); + value = static_cast(actor.GetId()); break; } @@ -1623,9 +1632,9 @@ bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor break; } - case Dali::DevelActor::Property::TOUCH_AREA: + case Dali::DevelActor::Property::TOUCH_AREA_OFFSET: { - value = actor.GetTouchArea(); + value = actor.GetTouchAreaOffset(); break; } @@ -1635,6 +1644,18 @@ bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor break; } + case Dali::DevelActor::Property::TOUCH_FOCUSABLE: + { + value = actor.IsTouchFocusable(); + break; + } + + case Dali::DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN: + { + value = actor.AreChildrenKeyBoardFocusable(); + break; + } + default: { // Must be a scene-graph only property @@ -1650,7 +1671,7 @@ bool Actor::PropertyHandler::GetCurrentPropertyValue(const Internal::Actor& acto { bool valueSet = true; - switch( index ) + switch(index) { case Dali::Actor::Property::SIZE: { @@ -1817,14 +1838,14 @@ bool Actor::PropertyHandler::GetCurrentPropertyValue(const Internal::Actor& acto case Dali::Actor::Property::CULLED: { - value = actor.GetNode().IsCulled( actor.GetEventThreadServices().GetEventBufferIndex() ); + value = actor.GetNode().IsCulled(actor.GetEventThreadServices().GetEventBufferIndex()); break; } case Dali::DevelActor::Property::UPDATE_SIZE_HINT: { // node is being used in a separate thread, the value from the previous update is the same, set by user - value = Vector2( actor.GetNode().GetUpdateSizeHint() ); + value = Vector2(actor.GetNode().GetUpdateSizeHint()); break; }