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 )
DALI_PROPERTY( "screenPosition", VECTOR2, false, false, false, Dali::DevelActor::Property::SCREEN_POSITION )
DALI_PROPERTY( "positionUsesAnchorPoint", BOOLEAN, true, false, false, Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT )
DALI_PROPERTY( "culled", BOOLEAN, false, false, true, Dali::DevelActor::Property::CULLED )
-DALI_PROPERTY( "updateSizeHint", VECTOR2, true, false, true, Dali::DevelActor::Property::UPDATE_SIZE_HINT )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties )
// Signals
SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, width );
}
+ mUseAnimatedSize &= ~AnimatedSizeFlag::WIDTH;
+
RelayoutRequest();
}
SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, height );
}
+ mUseAnimatedSize &= ~AnimatedSizeFlag::HEIGHT;
+
RelayoutRequest();
}
{
mTargetSize.depth = depth;
+ mUseAnimatedSize &= ~AnimatedSizeFlag::DEPTH;
+
// node is being used in a separate thread; queue a message to set the value & base value
SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, depth );
}
{
Vector3 size = mTargetSize;
- // Should return preferred size if size is fixed as set by SetSize
- if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
+ if( mUseAnimatedSize & AnimatedSizeFlag::WIDTH )
+ {
+ // Should return animated size if size is animated
+ size.width = mAnimatedSize.width;
+ }
+ else
+ {
+ // Should return preferred size if size is fixed as set by SetSize
+ if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
+ {
+ size.width = GetPreferredSize().width;
+ }
+ }
+
+ if( mUseAnimatedSize & AnimatedSizeFlag::HEIGHT )
+ {
+ size.height = mAnimatedSize.height;
+ }
+ else
{
- size.width = GetPreferredSize().width;
+ if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
+ {
+ size.height = GetPreferredSize().height;
+ }
}
- if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
+
+ if( mUseAnimatedSize & AnimatedSizeFlag::DEPTH )
{
- size.height = GetPreferredSize().height;
+ size.depth = mAnimatedSize.depth;
}
return size;
mTargetSize( Vector3::ZERO ),
mTargetPosition( Vector3::ZERO ),
mTargetScale( Vector3::ONE ),
+ mAnimatedSize( Vector3::ZERO ),
mName(),
mSortedDepth( 0u ),
mDepth( 0u ),
+ mUseAnimatedSize( AnimatedSizeFlag::CLEAR ),
mIsRoot( ROOT_LAYER == derivedType ),
mIsLayer( LAYER == derivedType || ROOT_LAYER == derivedType ),
mIsOnStage( false ),
case Dali::Actor::Property::COLOR:
{
- SetColor( property.Get< Vector4 >() );
+ Property::Type type = property.GetType();
+ if( type == Property::VECTOR3 )
+ {
+ Vector3 color = property.Get< Vector3 >();
+ SetColor( Vector4( color.r, color.g, color.b, 1.0f ) );
+ }
+ else if( type == Property::VECTOR4 )
+ {
+ SetColor( property.Get< Vector4 >() );
+ }
break;
}
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 );
}
break;
}
- case Dali::DevelActor::Property::UPDATE_SIZE_HINT:
- {
- SetUpdateSizeHint( property.Get< Vector2 >() );
- break;
- }
-
default:
{
// this can happen in the case of a non-animatable default property so just do nothing
{
if( value.Get( mTargetSize ) )
{
+ mAnimatedSize = mTargetSize;
+ mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( value.Get( mTargetSize.width ) )
{
+ mAnimatedSize.width = mTargetSize.width;
+ mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( value.Get( mTargetSize.height ) )
{
+ mAnimatedSize.height = mTargetSize.height;
+ mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( value.Get( mTargetSize.depth ) )
{
+ mAnimatedSize.depth = mTargetSize.depth;
+ mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( AdjustValue< Vector3 >( mTargetSize, value ) )
{
+ mAnimatedSize = mTargetSize;
+ mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( AdjustValue< float >( mTargetSize.width, value ) )
{
+ mAnimatedSize.width = mTargetSize.width;
+ mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( AdjustValue< float >( mTargetSize.height, value ) )
{
+ mAnimatedSize.height = mTargetSize.height;
+ mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( AdjustValue< float >( mTargetSize.depth, value ) )
{
+ mAnimatedSize.depth = mTargetSize.depth;
+ mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
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;
}
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;
}
break;
}
- case Dali::DevelActor::Property::UPDATE_SIZE_HINT:
- {
- value = GetUpdateSizeHint();
- break;
- }
-
default:
{
// Must be an event-side only property
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:
// A 0 width or height may also be required so if the resize policy has not been changed, i.e. is still set to DEFAULT,
// then change to FIXED as well
- if( size.width > 0.0f || GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::DEFAULT )
+ if( size.width > 0.0f )
{
SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH );
}
- if( size.height > 0.0f || GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::DEFAULT )
+ if( size.height > 0.0f )
{
SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
}
mRelayoutData->preferredSize = size;
+ mUseAnimatedSize = AnimatedSizeFlag::CLEAR;
+
RelayoutRequest();
}
return FLT_MAX; // Default
}
-void Actor::SetUpdateSizeHint( const Vector2& updateSizeHint )
-{
- // node is being used in a separate thread; queue a message to set the value & base value
- SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mUpdateSizeHint, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, Vector3(updateSizeHint.width, updateSizeHint.height, 0.f ) );
-}
-
-Vector2 Actor::GetUpdateSizeHint() const
-{
- // node is being used in a separate thread; copy the value from the previous update
- Vector3 updateSizeHint = Vector3::ZERO;
- GetNode().GetUpdateSizeHint( GetEventThreadServices().GetEventBufferIndex(), updateSizeHint );
- return Vector2( updateSizeHint.width, updateSizeHint.height );
-}
-
Object* Actor::GetParentObject() const
{
return mParent;