- case Dali::Actor::Property::NAME:
- {
- SetName( property.Get< std::string >() );
- break;
- }
-
- case Dali::Actor::Property::SENSITIVE:
- {
- SetSensitive( property.Get< bool >() );
- break;
- }
-
- case Dali::Actor::Property::LEAVE_REQUIRED:
- {
- SetLeaveRequired( property.Get< bool >() );
- break;
- }
-
- case Dali::Actor::Property::INHERIT_POSITION:
- {
- SetInheritPosition( property.Get< bool >() );
- break;
- }
-
- case Dali::Actor::Property::INHERIT_ORIENTATION:
- {
- SetInheritOrientation( property.Get< bool >() );
- break;
- }
-
- case Dali::Actor::Property::INHERIT_SCALE:
- {
- SetInheritScale( property.Get< bool >() );
- break;
- }
-
- case Dali::Actor::Property::COLOR_MODE:
- {
- ColorMode mode = mColorMode;
- if ( Scripting::GetEnumerationProperty< ColorMode >( property, COLOR_MODE_TABLE, COLOR_MODE_TABLE_COUNT, mode ) )
- {
- SetColorMode( mode );
- }
- break;
- }
-
- case Dali::Actor::Property::DRAW_MODE:
- {
- DrawMode::Type mode = mDrawMode;
- if( Scripting::GetEnumerationProperty< DrawMode::Type >( property, DRAW_MODE_TABLE, DRAW_MODE_TABLE_COUNT, mode ) )
- {
- SetDrawMode( mode );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_MODE_FACTOR:
- {
- SetSizeModeFactor( property.Get< Vector3 >() );
- break;
- }
-
- case Dali::Actor::Property::WIDTH_RESIZE_POLICY:
- {
- ResizePolicy::Type type = GetResizePolicy( Dimension::WIDTH );
- if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) )
- {
- SetResizePolicy( type, Dimension::WIDTH );
- }
- break;
- }
-
- case Dali::Actor::Property::HEIGHT_RESIZE_POLICY:
- {
- ResizePolicy::Type type = GetResizePolicy( Dimension::HEIGHT );
- if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) )
- {
- SetResizePolicy( type, Dimension::HEIGHT );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_SCALE_POLICY:
- {
- SizeScalePolicy::Type type = GetSizeScalePolicy();
- if( Scripting::GetEnumerationProperty< SizeScalePolicy::Type >( property, SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) )
- {
- SetSizeScalePolicy( type );
- }
- break;
- }
-
- case Dali::Actor::Property::WIDTH_FOR_HEIGHT:
- {
- if( property.Get< bool >() )
- {
- SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::WIDTH );
- }
- break;
- }
-
- case Dali::Actor::Property::HEIGHT_FOR_WIDTH:
- {
- if( property.Get< bool >() )
- {
- SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
- }
- break;
- }
-
- case Dali::Actor::Property::PADDING:
- {
- Vector4 padding = property.Get< Vector4 >();
- SetPadding( Vector2( padding.x, padding.y ), Dimension::WIDTH );
- SetPadding( Vector2( padding.z, padding.w ), Dimension::HEIGHT );
- break;
- }
-
- case Dali::Actor::Property::MINIMUM_SIZE:
- {
- Vector2 size = property.Get< Vector2 >();
- SetMinimumSize( size.x, Dimension::WIDTH );
- SetMinimumSize( size.y, Dimension::HEIGHT );
- break;
- }
-
- case Dali::Actor::Property::MAXIMUM_SIZE:
- {
- Vector2 size = property.Get< Vector2 >();
- SetMaximumSize( size.x, Dimension::WIDTH );
- SetMaximumSize( size.y, Dimension::HEIGHT );
- break;
- }
-
- case Dali::DevelActor::Property::SIBLING_ORDER:
- {
- int value;
-
- if( property.Get( value ) )
- {
- SetSiblingOrder( value );
- }
- break;
- }
-
- case Dali::Actor::Property::CLIPPING_MODE:
- {
- ClippingMode::Type convertedValue = mClippingMode;
- if( Scripting::GetEnumerationProperty< ClippingMode::Type >( property, CLIPPING_MODE_TABLE, CLIPPING_MODE_TABLE_COUNT, convertedValue ) )
- {
- mClippingMode = convertedValue;
- SetClippingModeMessage( GetEventThreadServices(), GetNode(), mClippingMode );
- }
- break;
- }
-
- case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT:
- {
- bool value = false;
- if( property.Get( value ) && value != mPositionUsesAnchorPoint )
- {
- mPositionUsesAnchorPoint = value;
- SetPositionUsesAnchorPointMessage( GetEventThreadServices(), GetNode(), mPositionUsesAnchorPoint );
- }
- break;
- }
-
- case Dali::Actor::Property::LAYOUT_DIRECTION:
- {
- Dali::LayoutDirection::Type direction = mLayoutDirection;
- mInheritLayoutDirection = false;
-
- if( Scripting::GetEnumerationProperty< LayoutDirection::Type >( property, LAYOUT_DIRECTION_TABLE, LAYOUT_DIRECTION_TABLE_COUNT, direction ) )
- {
- InheritLayoutDirectionRecursively( this, direction, true );
- }
- break;
- }
-
- case Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION:
- {
- bool value = false;
- if( property.Get( value ) )
- {
- SetInheritLayoutDirection( value );
- }
- break;
- }
-
- case Dali::Actor::Property::KEYBOARD_FOCUSABLE:
- {
- bool value = false;
- if( property.Get( value ) )
- {
- SetKeyboardFocusable( value );
- }
- break;
- }
-
- case Dali::DevelActor::Property::UPDATE_SIZE_HINT:
- {
- SetUpdateSizeHint( property.Get< Vector2 >() );
- break;
- }
-
- case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
- {
- bool boolValue = false;
- if ( property.Get( boolValue ) )
- {
- mCaptureAllTouchAfterStart = boolValue;
- }
- break;
- }
-
- default:
- {
- // this can happen in the case of a non-animatable default property so just do nothing
- break;
- }
- }
-}
-
-// TODO: This method needs to be removed
-void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value )
-{
- switch( entry.GetType() )
- {
- case Property::BOOLEAN:
- {
- const AnimatableProperty< bool >* property = dynamic_cast< const AnimatableProperty< bool >* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<bool>::Bake, value.Get<bool>() );
-
- break;
- }
-
- case Property::INTEGER:
- {
- const AnimatableProperty< int >* property = dynamic_cast< const AnimatableProperty< int >* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<int>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<int>::Bake, value.Get<int>() );
-
- break;
- }
-
- case Property::FLOAT:
- {
- const AnimatableProperty< float >* property = dynamic_cast< const AnimatableProperty< float >* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<float>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<float>::Bake, value.Get<float>() );
-
- break;
- }
-
- case Property::VECTOR2:
- {
- const AnimatableProperty< Vector2 >* property = dynamic_cast< const AnimatableProperty< Vector2 >* >( 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<Vector2>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector2>::BakeX, value.Get<float>() );
- }
- else if(entry.componentIndex == 1)
- {
- SceneGraph::NodePropertyComponentMessage<Vector2>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector2>::BakeY, value.Get<float>() );
- }
- else
- {
- SceneGraph::NodePropertyMessage<Vector2>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector2>::Bake, value.Get<Vector2>() );
- }
-
- break;
- }
-
- case Property::VECTOR3:
- {
- const AnimatableProperty< Vector3 >* property = dynamic_cast< const AnimatableProperty< Vector3 >* >( 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<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::BakeX, value.Get<float>() );
- }
- else if(entry.componentIndex == 1)
- {
- SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::BakeY, value.Get<float>() );
- }
- else if(entry.componentIndex == 2)
- {
- SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::BakeZ, value.Get<float>() );
- }
- else
- {
- SceneGraph::NodePropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::Bake, value.Get<Vector3>() );
- }
-
- break;
- }
-
- case Property::VECTOR4:
- {
- const AnimatableProperty< Vector4 >* property = dynamic_cast< const AnimatableProperty< Vector4 >* >( 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<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeX, value.Get<float>() );
- }
- else if(entry.componentIndex == 1)
- {
- SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeY, value.Get<float>() );
- }
- else if(entry.componentIndex == 2)
- {
- SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeZ, value.Get<float>() );
- }
- else if(entry.componentIndex == 3)
- {
- SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeW, value.Get<float>() );
- }
- else
- {
- SceneGraph::NodePropertyMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::Bake, value.Get<Vector4>() );
- }
-
- break;
- }
-
- case Property::ROTATION:
- {
- const AnimatableProperty< Quaternion >* property = dynamic_cast< const AnimatableProperty< Quaternion >* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<Quaternion>::Send( GetEventThreadServices(), &GetNode(), property,&AnimatableProperty<Quaternion>::Bake, value.Get<Quaternion>() );
-
- break;
- }
-
- case Property::MATRIX:
- {
- const AnimatableProperty< Matrix >* property = dynamic_cast< const AnimatableProperty< Matrix >* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<Matrix>::Send( GetEventThreadServices(), &GetNode(), property,&AnimatableProperty<Matrix>::Bake, value.Get<Matrix>() );
-
- break;
- }
-
- case Property::MATRIX3:
- {
- const AnimatableProperty< Matrix3 >* property = dynamic_cast< const AnimatableProperty< Matrix3 >* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<Matrix3>::Send( GetEventThreadServices(), &GetNode(), property,&AnimatableProperty<Matrix3>::Bake, value.Get<Matrix3>() );
-
- break;
- }
-
- default:
- {
- // nothing to do for other types
- }
- } // entry.GetType
-}
-
-Property::Value Actor::GetDefaultProperty( Property::Index index ) const
-{
- Property::Value value;
-
- if( ! GetCachedPropertyValue( index, value ) )
- {
- // If property value is not stored in the event-side, then it must be a scene-graph only property
- GetCurrentPropertyValue( index, value );
- }
-
- return value;
-}
-
-Property::Value Actor::GetDefaultPropertyCurrentValue( Property::Index index ) const
-{
- Property::Value value;
-
- if( ! GetCurrentPropertyValue( index, value ) )
- {
- // If unable to retrieve scene-graph property value, then it must be an event-side only property
- GetCachedPropertyValue( index, value );
- }
-
- return value;
-}
-
-void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType )
-{
- switch( animationType )
- {
- case Animation::TO:
- case Animation::BETWEEN:
- {
- switch( index )
- {
- case Dali::Actor::Property::SIZE:
- {
- if( value.Get( mTargetSize ) )
- {
- mAnimatedSize = mTargetSize;
- mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_WIDTH:
- {
- if( value.Get( mTargetSize.width ) )
- {
- mAnimatedSize.width = mTargetSize.width;
- mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_HEIGHT:
- {
- if( value.Get( mTargetSize.height ) )
- {
- mAnimatedSize.height = mTargetSize.height;
- mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_DEPTH:
- {
- if( value.Get( mTargetSize.depth ) )
- {
- mAnimatedSize.depth = mTargetSize.depth;
- mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::POSITION:
- {
- value.Get( mTargetPosition );
- break;
- }
-
- case Dali::Actor::Property::POSITION_X:
- {
- value.Get( mTargetPosition.x );
- break;
- }
-
- case Dali::Actor::Property::POSITION_Y:
- {
- value.Get( mTargetPosition.y );
- break;
- }
-
- case Dali::Actor::Property::POSITION_Z:
- {
- value.Get( mTargetPosition.z );
- break;
- }
-
- case Dali::Actor::Property::ORIENTATION:
- {
- value.Get( mTargetOrientation );
- break;
- }
-
- case Dali::Actor::Property::SCALE:
- {
- value.Get( mTargetScale );
- break;
- }
-
- case Dali::Actor::Property::SCALE_X:
- {
- value.Get( mTargetScale.x );
- break;
- }
-
- case Dali::Actor::Property::SCALE_Y:
- {
- value.Get( mTargetScale.y );
- break;
- }
-
- case Dali::Actor::Property::SCALE_Z:
- {
- value.Get( mTargetScale.z );
- break;
- }
-
- case Dali::Actor::Property::VISIBLE:
- {
- SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE );
- break;
- }
-
- case Dali::Actor::Property::COLOR:
- {
- value.Get( mTargetColor );
- break;
- }
-
- case Dali::Actor::Property::COLOR_RED:
- {
- value.Get( mTargetColor.r );
- break;
- }
-
- case Dali::Actor::Property::COLOR_GREEN:
- {
- value.Get( mTargetColor.g );
- break;
- }
-
- case Dali::Actor::Property::COLOR_BLUE:
- {
- value.Get( mTargetColor.b );
- break;
- }
-
- case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::Actor::Property::OPACITY:
- {
- value.Get( mTargetColor.a );
- break;
- }
-
- default:
- {
- // Not an animatable property. Do nothing.
- break;
- }
- }
- break;
- }
-
- case Animation::BY:
- {
- switch( index )
- {
- case Dali::Actor::Property::SIZE:
- {
- if( AdjustValue< Vector3 >( mTargetSize, value ) )
- {
- mAnimatedSize = mTargetSize;
- mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_WIDTH:
- {
- if( AdjustValue< float >( mTargetSize.width, value ) )
- {
- mAnimatedSize.width = mTargetSize.width;
- mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_HEIGHT:
- {
- if( AdjustValue< float >( mTargetSize.height, value ) )
- {
- mAnimatedSize.height = mTargetSize.height;
- mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::SIZE_DEPTH:
- {
- if( AdjustValue< float >( mTargetSize.depth, value ) )
- {
- mAnimatedSize.depth = mTargetSize.depth;
- mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
- }
- break;
- }
-
- case Dali::Actor::Property::POSITION:
- {
- AdjustValue< Vector3 >( mTargetPosition, value );
- break;
- }
-
- case Dali::Actor::Property::POSITION_X:
- {
- AdjustValue< float >( mTargetPosition.x, value );
- break;
- }
-
- case Dali::Actor::Property::POSITION_Y:
- {
- AdjustValue< float >( mTargetPosition.y, value );
- break;
- }
-
- case Dali::Actor::Property::POSITION_Z:
- {
- AdjustValue< float >( mTargetPosition.z, value );
- break;
- }
-
- case Dali::Actor::Property::ORIENTATION:
- {
- Quaternion relativeValue;
- if( value.Get( relativeValue ) )
- {
- mTargetOrientation *= relativeValue;
- }
- break;
- }
-
- case Dali::Actor::Property::SCALE:
- {
- AdjustValue< Vector3 >( mTargetScale, value );
- break;
- }
-
- case Dali::Actor::Property::SCALE_X:
- {
- AdjustValue< float >( mTargetScale.x, value );
- break;
- }
-
- case Dali::Actor::Property::SCALE_Y:
- {
- AdjustValue< float >( mTargetScale.y, value );
- break;
- }
-
- case Dali::Actor::Property::SCALE_Z:
- {
- AdjustValue< float >( mTargetScale.z, value );
- break;
- }
-
- case Dali::Actor::Property::VISIBLE:
- {
- bool relativeValue = false;
- if( value.Get( relativeValue ) )
- {
- bool visible = mVisible || relativeValue;
- SetVisibleInternal( visible, SendMessage::FALSE );
- }
- break;
- }
-
- case Dali::Actor::Property::COLOR:
- {
- AdjustValue< Vector4 >( mTargetColor, value );
- break;
- }
-
- case Dali::Actor::Property::COLOR_RED:
- {
- AdjustValue< float >( mTargetColor.r, value );
- break;
- }
-
- case Dali::Actor::Property::COLOR_GREEN:
- {
- AdjustValue< float >( mTargetColor.g, value );
- break;
- }
-
- case Dali::Actor::Property::COLOR_BLUE:
- {
- AdjustValue< float >( mTargetColor.b, value );
- break;
- }
-
- case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::Actor::Property::OPACITY:
- {
- AdjustValue< float >( mTargetColor.a, value );
- break;
- }
-
- default:
- {
- // Not an animatable property. Do nothing.
- break;
- }
- }
- break;
- }
- }
-}
-
-const PropertyBase* Actor::GetSceneObjectAnimatableProperty( Property::Index index ) const
-{
- const PropertyBase* property( NULL );
-
- switch( index )
- {
- case Dali::Actor::Property::SIZE: // FALLTHROUGH
- case Dali::Actor::Property::SIZE_WIDTH: // FALLTHROUGH
- case Dali::Actor::Property::SIZE_HEIGHT: // FALLTHROUGH
- case Dali::Actor::Property::SIZE_DEPTH:
- {
- property = &GetNode().mSize;
- break;
- }
- case Dali::Actor::Property::POSITION: // FALLTHROUGH
- case Dali::Actor::Property::POSITION_X: // FALLTHROUGH
- case Dali::Actor::Property::POSITION_Y: // FALLTHROUGH
- case Dali::Actor::Property::POSITION_Z:
- {
- property = &GetNode().mPosition;
- break;
- }
- case Dali::Actor::Property::ORIENTATION:
- {
- property = &GetNode().mOrientation;
- break;
- }
- case Dali::Actor::Property::SCALE: // FALLTHROUGH
- case Dali::Actor::Property::SCALE_X: // FALLTHROUGH
- case Dali::Actor::Property::SCALE_Y: // FALLTHROUGH
- case Dali::Actor::Property::SCALE_Z:
- {
- property = &GetNode().mScale;
- break;
- }
- case Dali::Actor::Property::VISIBLE:
- {
- property = &GetNode().mVisible;
- break;
- }
- case Dali::Actor::Property::COLOR: // FALLTHROUGH
- case Dali::Actor::Property::COLOR_RED: // FALLTHROUGH
- case Dali::Actor::Property::COLOR_GREEN: // FALLTHROUGH
- case Dali::Actor::Property::COLOR_BLUE: // FALLTHROUGH
- case Dali::Actor::Property::COLOR_ALPHA: // FALLTHROUGH
- case Dali::Actor::Property::OPACITY:
- {
- property = &GetNode().mColor;
- break;
- }
- default:
- {
- break;
- }
- }
- if( !property )
- {
- // not our property, ask base
- property = Object::GetSceneObjectAnimatableProperty( index );
- }
-
- return property;
-}
-
-const PropertyInputImpl* Actor::GetSceneObjectInputProperty( Property::Index index ) const
-{
- const PropertyInputImpl* property( NULL );
-
- switch( index )
- {
- case Dali::Actor::Property::PARENT_ORIGIN: // FALLTHROUGH
- case Dali::Actor::Property::PARENT_ORIGIN_X: // FALLTHROUGH
- case Dali::Actor::Property::PARENT_ORIGIN_Y: // FALLTHROUGH
- case Dali::Actor::Property::PARENT_ORIGIN_Z:
- {
- property = &GetNode().mParentOrigin;
- break;
- }
- case Dali::Actor::Property::ANCHOR_POINT: // FALLTHROUGH
- case Dali::Actor::Property::ANCHOR_POINT_X: // FALLTHROUGH
- case Dali::Actor::Property::ANCHOR_POINT_Y: // FALLTHROUGH
- case Dali::Actor::Property::ANCHOR_POINT_Z:
- {
- property = &GetNode().mAnchorPoint;
- break;
- }
- case Dali::Actor::Property::WORLD_POSITION: // FALLTHROUGH
- case Dali::Actor::Property::WORLD_POSITION_X: // FALLTHROUGH
- case Dali::Actor::Property::WORLD_POSITION_Y: // FALLTHROUGH
- case Dali::Actor::Property::WORLD_POSITION_Z:
- {
- property = &GetNode().mWorldPosition;
- break;
- }
- case Dali::Actor::Property::WORLD_ORIENTATION:
- {
- property = &GetNode().mWorldOrientation;
- break;
- }
- case Dali::Actor::Property::WORLD_SCALE:
- {
- property = &GetNode().mWorldScale;
- break;
- }
- case Dali::Actor::Property::WORLD_COLOR:
- {
- property = &GetNode().mWorldColor;
- break;
- }
- case Dali::Actor::Property::WORLD_MATRIX:
- {
- property = &GetNode().mWorldMatrix;
- break;
- }
- case Dali::Actor::Property::CULLED:
- {
- property = &GetNode().mCulled;
- break;
- }
- default:
- {
- break;
- }
- }
- if( !property )
- {
- // reuse animatable property getter as animatable properties are inputs as well
- // animatable property chains back to Object::GetSceneObjectInputProperty() so all properties get covered
- property = GetSceneObjectAnimatableProperty( index );
- }
-
- return property;
-}
-
-int32_t Actor::GetPropertyComponentIndex( Property::Index index ) const
-{
- int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
-
- switch( index )
- {
- case Dali::Actor::Property::PARENT_ORIGIN_X:
- case Dali::Actor::Property::ANCHOR_POINT_X:
- case Dali::Actor::Property::SIZE_WIDTH:
- case Dali::Actor::Property::POSITION_X:
- case Dali::Actor::Property::WORLD_POSITION_X:
- case Dali::Actor::Property::SCALE_X:
- case Dali::Actor::Property::COLOR_RED:
- {
- componentIndex = 0;
- break;
- }
-
- case Dali::Actor::Property::PARENT_ORIGIN_Y:
- case Dali::Actor::Property::ANCHOR_POINT_Y:
- case Dali::Actor::Property::SIZE_HEIGHT:
- case Dali::Actor::Property::POSITION_Y:
- case Dali::Actor::Property::WORLD_POSITION_Y:
- case Dali::Actor::Property::SCALE_Y:
- case Dali::Actor::Property::COLOR_GREEN:
- {
- componentIndex = 1;
- break;
- }
-
- case Dali::Actor::Property::PARENT_ORIGIN_Z:
- case Dali::Actor::Property::ANCHOR_POINT_Z:
- case Dali::Actor::Property::SIZE_DEPTH:
- case Dali::Actor::Property::POSITION_Z:
- case Dali::Actor::Property::WORLD_POSITION_Z:
- case Dali::Actor::Property::SCALE_Z:
- case Dali::Actor::Property::COLOR_BLUE:
- {
- componentIndex = 2;
- break;
- }
-
- case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::Actor::Property::OPACITY:
- {
- componentIndex = 3;
- break;
- }
-
- default:
- {
- // Do nothing
- break;
- }
- }
- if( Property::INVALID_COMPONENT_INDEX == componentIndex )
- {
- // ask base
- componentIndex = Object::GetPropertyComponentIndex( index );
- }
-
- return componentIndex;
-}
-
-void Actor::SetParent( Actor* parent )
-{
- if( parent )
- {
- DALI_ASSERT_ALWAYS( !mParent && "Actor cannot have 2 parents" );
-
- mParent = parent;
-
- mScene = parent->mScene;
-
- if ( EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
- parent->OnScene() )
- {
- // Instruct each actor to create a corresponding node in the scene graph
- ConnectToScene( parent->GetHierarchyDepth() );
- }
-
- // Resolve the name and index for the child properties if any
- ResolveChildProperties();
- }
- else // parent being set to NULL
- {
- DALI_ASSERT_ALWAYS( mParent != NULL && "Actor should have a parent" );
-
- mParent = NULL;
-
- if ( EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
- OnScene() )
- {
- // Disconnect the Node & its children from the scene-graph.
- DisconnectNodeMessage( GetEventThreadServices().GetUpdateManager(), GetNode() );
-
- // Instruct each actor to discard pointers to the scene-graph
- DisconnectFromStage();
- }
-
- mScene = nullptr;
- }
-}
-
-bool Actor::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& /* attributes */ )
-{
- bool done = false;
- Actor* actor = dynamic_cast< Actor* >( object );
-
- if( actor )
- {
- if( 0 == actionName.compare( ACTION_SHOW ) )
- {
- actor->SetVisible( true );
- done = true;
- }
- else if( 0 == actionName.compare( ACTION_HIDE ) )
- {
- actor->SetVisible( false );
- done = true;
- }
- }
-
- return done;
-}
-
-Rect<> Actor::CalculateScreenExtents( ) const
-{
- auto screenPosition = GetCurrentScreenPosition();
- Vector3 size = GetCurrentSize() * GetCurrentWorldScale();
- Vector3 anchorPointOffSet = size * ( mPositionUsesAnchorPoint ? GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
- Vector2 position = Vector2( screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y );
- return { position.x, position.y, size.x, size.y };
-}
-
-bool Actor::GetCachedPropertyValue( Property::Index index, Property::Value& value ) const
-{
- bool valueSet = true;
-
- switch( index )
- {
- case Dali::Actor::Property::PARENT_ORIGIN:
- {
- value = GetCurrentParentOrigin();
- break;
- }
-
- case Dali::Actor::Property::PARENT_ORIGIN_X:
- {
- value = GetCurrentParentOrigin().x;
- break;
- }
-
- case Dali::Actor::Property::PARENT_ORIGIN_Y:
- {
- value = GetCurrentParentOrigin().y;
- break;
- }
-
- case Dali::Actor::Property::PARENT_ORIGIN_Z:
- {
- value = GetCurrentParentOrigin().z;
- break;
- }
-
- case Dali::Actor::Property::ANCHOR_POINT:
- {
- value = GetCurrentAnchorPoint();
- break;
- }
-
- case Dali::Actor::Property::ANCHOR_POINT_X:
- {
- value = GetCurrentAnchorPoint().x;
- break;
- }
-
- case Dali::Actor::Property::ANCHOR_POINT_Y:
- {
- value = GetCurrentAnchorPoint().y;
- break;
- }
-
- case Dali::Actor::Property::ANCHOR_POINT_Z:
- {
- value = GetCurrentAnchorPoint().z;
- break;
- }
-
- case Dali::Actor::Property::SIZE:
- {
- value = GetTargetSize();
- break;
- }
-
- case Dali::Actor::Property::SIZE_WIDTH:
- {
- value = GetTargetSize().width;
- break;
- }
-
- case Dali::Actor::Property::SIZE_HEIGHT:
- {
- value = GetTargetSize().height;
- break;
- }
-
- case Dali::Actor::Property::SIZE_DEPTH:
- {
- value = GetTargetSize().depth;
- break;
- }
-
- case Dali::Actor::Property::POSITION:
- {
- value = GetTargetPosition();
- break;
- }
-
- case Dali::Actor::Property::POSITION_X:
- {
- value = GetTargetPosition().x;
- break;
- }
-
- case Dali::Actor::Property::POSITION_Y:
- {
- value = GetTargetPosition().y;
- break;
- }
-
- case Dali::Actor::Property::POSITION_Z:
- {
- value = GetTargetPosition().z;
- break;
- }
-
- case Dali::Actor::Property::ORIENTATION:
- {
- value = mTargetOrientation;
- break;
- }
-
- case Dali::Actor::Property::SCALE:
- {
- value = mTargetScale;
- break;
- }
-
- case Dali::Actor::Property::SCALE_X:
- {
- value = mTargetScale.x;
- break;
- }
-
- case Dali::Actor::Property::SCALE_Y:
- {
- value = mTargetScale.y;
- break;
- }
-
- case Dali::Actor::Property::SCALE_Z:
- {
- value = mTargetScale.z;
- break;
- }
-
- case Dali::Actor::Property::VISIBLE:
- {
- value = mVisible;
- break;
- }
-
- case Dali::Actor::Property::COLOR:
- {
- value = mTargetColor;
- break;
- }
-
- case Dali::Actor::Property::COLOR_RED:
- {
- value = mTargetColor.r;
- break;
- }
-
- case Dali::Actor::Property::COLOR_GREEN:
- {
- value = mTargetColor.g;
- break;
- }
-
- case Dali::Actor::Property::COLOR_BLUE:
- {
- value = mTargetColor.b;
- break;
- }
-
- case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::Actor::Property::OPACITY:
- {
- value = mTargetColor.a;
- break;
- }
-
- case Dali::Actor::Property::NAME:
- {
- value = GetName();
- break;
- }
-
- case Dali::Actor::Property::SENSITIVE:
- {
- value = IsSensitive();
- break;
- }
-
- case Dali::Actor::Property::LEAVE_REQUIRED:
- {
- value = GetLeaveRequired();
- break;
- }
-
- case Dali::Actor::Property::INHERIT_POSITION:
- {
- value = IsPositionInherited();
- break;
- }
-
- case Dali::Actor::Property::INHERIT_ORIENTATION:
- {
- value = IsOrientationInherited();
- break;
- }
-
- case Dali::Actor::Property::INHERIT_SCALE:
- {
- value = IsScaleInherited();
- break;
- }
-
- case Dali::Actor::Property::COLOR_MODE:
- {
- value = GetColorMode();
- break;
- }
-
- case Dali::Actor::Property::DRAW_MODE:
- {
- value = GetDrawMode();
- break;
- }
-
- case Dali::Actor::Property::SIZE_MODE_FACTOR:
- {
- value = GetSizeModeFactor();
- break;
- }
-
- case Dali::Actor::Property::WIDTH_RESIZE_POLICY:
- {
- value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( GetResizePolicy( Dimension::WIDTH ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT );
- break;
- }
-
- case Dali::Actor::Property::HEIGHT_RESIZE_POLICY:
- {
- value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( GetResizePolicy( Dimension::HEIGHT ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT );
- break;
- }
-
- case Dali::Actor::Property::SIZE_SCALE_POLICY:
- {
- value = GetSizeScalePolicy();
- break;
- }
-
- case Dali::Actor::Property::WIDTH_FOR_HEIGHT:
- {
- value = ( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( GetDimensionDependency( Dimension::WIDTH ) == Dimension::HEIGHT );
- break;
- }
-
- case Dali::Actor::Property::HEIGHT_FOR_WIDTH:
- {
- value = ( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( GetDimensionDependency( Dimension::HEIGHT ) == Dimension::WIDTH );
- break;
- }
-
- case Dali::Actor::Property::PADDING:
- {
- Vector2 widthPadding = GetPadding( Dimension::WIDTH );
- Vector2 heightPadding = GetPadding( Dimension::HEIGHT );
- value = Vector4( widthPadding.x, widthPadding.y, heightPadding.x, heightPadding.y );
- break;
- }
-
- case Dali::Actor::Property::MINIMUM_SIZE:
- {
- value = Vector2( GetMinimumSize( Dimension::WIDTH ), GetMinimumSize( Dimension::HEIGHT ) );
- break;
- }
-
- case Dali::Actor::Property::MAXIMUM_SIZE:
- {
- value = Vector2( GetMaximumSize( Dimension::WIDTH ), GetMaximumSize( Dimension::HEIGHT ) );
- break;
- }
-
- case Dali::Actor::Property::CLIPPING_MODE:
- {
- value = mClippingMode;
- break;
- }
-
- case Dali::DevelActor::Property::SIBLING_ORDER:
- {
- value = static_cast<int>( GetSiblingOrder() );
- break;
- }
-
- case Dali::Actor::Property::SCREEN_POSITION:
- {
- value = GetCurrentScreenPosition();
- break;
- }
-
- case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT:
- {
- value = mPositionUsesAnchorPoint;
- break;
- }
-
- case Dali::Actor::Property::LAYOUT_DIRECTION:
- {
- value = mLayoutDirection;
- break;
- }
-
- case Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION:
- {
- value = IsLayoutDirectionInherited();
- break;
- }
-
- case Dali::Actor::Property::ID:
- {
- value = static_cast<int>( GetId() );
- break;
- }
-
- case Dali::Actor::Property::HIERARCHY_DEPTH:
- {
- value = GetHierarchyDepth();
- break;
- }
-
- case Dali::Actor::Property::IS_ROOT:
- {
- value = IsRoot();
- break;
- }
-
- case Dali::Actor::Property::IS_LAYER:
- {
- value = IsLayer();
- break;
- }
-
- case Dali::Actor::Property::CONNECTED_TO_SCENE:
- {
- value = OnScene();
- break;
- }
-
- case Dali::Actor::Property::KEYBOARD_FOCUSABLE:
- {
- value = IsKeyboardFocusable();
- break;
- }
-
- case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
- {
- value = mCaptureAllTouchAfterStart;
- break;
- }
-
- default:
- {
- // Must be a scene-graph only property
- valueSet = false;
- break;
- }
- }
-
- return valueSet;
-}
-
-bool Actor::GetCurrentPropertyValue( Property::Index index, Property::Value& value ) const
-{
- bool valueSet = true;
-
- switch( index )
- {
- case Dali::Actor::Property::SIZE:
- {
- value = GetCurrentSize();
- break;
- }
-
- case Dali::Actor::Property::SIZE_WIDTH:
- {
- value = GetCurrentSize().width;
- break;
- }
-
- case Dali::Actor::Property::SIZE_HEIGHT:
- {
- value = GetCurrentSize().height;
- break;
- }
-
- case Dali::Actor::Property::SIZE_DEPTH:
- {
- value = GetCurrentSize().depth;
- break;
- }
-
- case Dali::Actor::Property::POSITION:
- {
- value = GetCurrentPosition();
- break;
- }
-
- case Dali::Actor::Property::POSITION_X:
- {
- value = GetCurrentPosition().x;
- break;
- }
-
- case Dali::Actor::Property::POSITION_Y:
- {
- value = GetCurrentPosition().y;
- break;
- }
-
- case Dali::Actor::Property::POSITION_Z:
- {
- value = GetCurrentPosition().z;
- break;
- }
-
- case Dali::Actor::Property::WORLD_POSITION:
- {
- value = GetCurrentWorldPosition();
- break;
- }
-
- case Dali::Actor::Property::WORLD_POSITION_X:
- {
- value = GetCurrentWorldPosition().x;
- break;
- }
-
- case Dali::Actor::Property::WORLD_POSITION_Y:
- {
- value = GetCurrentWorldPosition().y;
- break;
- }
-
- case Dali::Actor::Property::WORLD_POSITION_Z:
- {
- value = GetCurrentWorldPosition().z;
- break;
- }
-
- case Dali::Actor::Property::ORIENTATION:
- {
- value = GetCurrentOrientation();
- break;
- }
-
- case Dali::Actor::Property::WORLD_ORIENTATION:
- {
- value = GetCurrentWorldOrientation();
- break;
- }
-
- case Dali::Actor::Property::SCALE:
- {
- value = GetCurrentScale();
- break;
- }
-
- case Dali::Actor::Property::SCALE_X:
- {
- value = GetCurrentScale().x;
- break;
- }
-
- case Dali::Actor::Property::SCALE_Y:
- {
- value = GetCurrentScale().y;
- break;
- }
-
- case Dali::Actor::Property::SCALE_Z:
- {
- value = GetCurrentScale().z;
- break;
- }
-
- case Dali::Actor::Property::WORLD_SCALE:
- {
- value = GetCurrentWorldScale();
- break;
- }
-
- case Dali::Actor::Property::COLOR:
- {
- value = GetCurrentColor();
- break;
- }
-
- case Dali::Actor::Property::COLOR_RED:
- {
- value = GetCurrentColor().r;
- break;
- }
-
- case Dali::Actor::Property::COLOR_GREEN:
- {
- value = GetCurrentColor().g;
- break;
- }
-
- case Dali::Actor::Property::COLOR_BLUE:
- {
- value = GetCurrentColor().b;
- break;
- }
-
- case Dali::Actor::Property::COLOR_ALPHA:
- case Dali::Actor::Property::OPACITY:
- {
- value = GetCurrentColor().a;
- break;
- }
-
- case Dali::Actor::Property::WORLD_COLOR:
- {
- value = GetCurrentWorldColor();
- break;
- }
-
- case Dali::Actor::Property::WORLD_MATRIX:
- {
- value = GetCurrentWorldMatrix();
- break;
- }
-
- case Dali::Actor::Property::VISIBLE:
- {
- value = IsVisible();
- break;
- }
-
- case Dali::Actor::Property::CULLED:
- {
- value = GetNode().IsCulled( GetEventThreadServices().GetEventBufferIndex() );
- break;
- }
-
- case Dali::DevelActor::Property::UPDATE_SIZE_HINT:
- {
- value = GetUpdateSizeHint();
- break;
- }
-
- default:
- {
- // Must be an event-side only property
- valueSet = false;
- break;
- }
- }
-
- return valueSet;
-}
-
-void Actor::EnsureRelayoutData()
-{
- // Assign relayout data.
- if( !mRelayoutData )
- {
- mRelayoutData = new RelayoutData();
- }
-}
-
-bool Actor::RelayoutDependentOnParent( Dimension::Type dimension )
-{
- // Check if actor is dependent on parent
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( ( dimension & ( 1 << i ) ) )
- {
- const ResizePolicy::Type resizePolicy = GetResizePolicy( static_cast< Dimension::Type >( 1 << i ) );
- if( resizePolicy == ResizePolicy::FILL_TO_PARENT || resizePolicy == ResizePolicy::SIZE_RELATIVE_TO_PARENT || resizePolicy == ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT )
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-bool Actor::RelayoutDependentOnChildren( Dimension::Type dimension )
-{
- // Check if actor is dependent on children
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( ( dimension & ( 1 << i ) ) )
- {
- const ResizePolicy::Type resizePolicy = GetResizePolicy( static_cast< Dimension::Type >( 1 << i ) );
- switch( resizePolicy )
- {
- case ResizePolicy::FIT_TO_CHILDREN:
- case ResizePolicy::USE_NATURAL_SIZE: // i.e. For things that calculate their size based on children
- {
- return true;
- }
-
- default:
- {
- break;
- }
- }
- }
- }
-
- return false;
-}
-
-bool Actor::RelayoutDependentOnChildrenBase( Dimension::Type dimension )
-{
- return Actor::RelayoutDependentOnChildren( dimension );
-}
-
-bool Actor::RelayoutDependentOnDimension( Dimension::Type dimension, Dimension::Type dependentDimension )
-{
- // Check each possible dimension and see if it is dependent on the input one
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( dimension & ( 1 << i ) )
- {
- return mRelayoutData->resizePolicies[ i ] == ResizePolicy::DIMENSION_DEPENDENCY && mRelayoutData->dimensionDependencies[ i ] == dependentDimension;
- }
- }
-
- return false;
-}
-
-void Actor::SetNegotiatedDimension( float negotiatedDimension, Dimension::Type dimension )
-{
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( dimension & ( 1 << i ) )
- {
- mRelayoutData->negotiatedDimensions[ i ] = negotiatedDimension;
- }
- }
-}
-
-float Actor::GetNegotiatedDimension( Dimension::Type dimension ) const
-{
- // If more than one dimension is requested, just return the first one found
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( ( dimension & ( 1 << i ) ) )
- {
- return mRelayoutData->negotiatedDimensions[ i ];
- }
- }
-
- return 0.0f; // Default
-}
-
-void Actor::SetPadding( const Vector2& padding, Dimension::Type dimension )
-{
- EnsureRelayoutData();
-
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( dimension & ( 1 << i ) )
- {
- mRelayoutData->dimensionPadding[ i ] = padding;
- }
- }
-}
-
-Vector2 Actor::GetPadding( Dimension::Type dimension ) const
-{
- if ( mRelayoutData )
- {
- // If more than one dimension is requested, just return the first one found
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( ( dimension & ( 1 << i ) ) )
- {
- return mRelayoutData->dimensionPadding[ i ];
- }
- }
- }
-
- return GetDefaultDimensionPadding();
-}
-
-void Actor::SetLayoutNegotiated( bool negotiated, Dimension::Type dimension )
-{
- EnsureRelayoutData();
-
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( dimension & ( 1 << i ) )
- {
- mRelayoutData->dimensionNegotiated[ i ] = negotiated;
- }
- }
-}
-
-bool Actor::IsLayoutNegotiated( Dimension::Type dimension ) const
-{
- if ( mRelayoutData )
- {
- for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
- {
- if( ( dimension & ( 1 << i ) ) && mRelayoutData->dimensionNegotiated[ i ] )
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-float Actor::GetHeightForWidthBase( float width )
-{
- float height = 0.0f;
-
- const Vector3 naturalSize = GetNaturalSize();
- if( naturalSize.width > 0.0f )
- {
- height = naturalSize.height * width / naturalSize.width;
- }
- else // we treat 0 as 1:1 aspect ratio
- {
- height = width;
- }
-
- return height;
-}
-
-float Actor::GetWidthForHeightBase( float height )
-{
- float width = 0.0f;
-
- const Vector3 naturalSize = GetNaturalSize();
- if( naturalSize.height > 0.0f )
- {
- width = naturalSize.width * height / naturalSize.height;
- }
- else // we treat 0 as 1:1 aspect ratio
- {
- width = height;
- }
-
- return width;
-}
-
-float Actor::CalculateChildSizeBase( const Dali::Actor& child, Dimension::Type dimension )
-{
- // Fill to parent, taking size mode factor into account
- switch( child.GetResizePolicy( dimension ) )
- {
- case ResizePolicy::FILL_TO_PARENT:
- {
- return GetLatestSize( dimension );
- }
-
- case ResizePolicy::SIZE_RELATIVE_TO_PARENT:
- {
- 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.GetProperty< Vector3 >( Dali::Actor::Property::SIZE_MODE_FACTOR ), dimension );
- }
-
- default:
- {
- return GetLatestSize( dimension );
- }
- }
-}
-
-float Actor::CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
-{
- // Can be overridden in derived class
- return CalculateChildSizeBase( child, dimension );
-}
-
-float Actor::GetHeightForWidth( float width )
-{
- // Can be overridden in derived class
- return GetHeightForWidthBase( width );
-}
-
-float Actor::GetWidthForHeight( float height )
-{
- // Can be overridden in derived class
- return GetWidthForHeightBase( height );
-}
-
-float Actor::GetLatestSize( Dimension::Type dimension ) const
-{
- return IsLayoutNegotiated( dimension ) ? GetNegotiatedDimension( dimension ) : GetSize( dimension );