#include <dali/internal/event/actors/layer-impl.h>
#include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
#include <dali/internal/event/animation/constraint-impl.h>
-
-#include <dali/public-api/dynamics/dynamics-body.h>
-#include <dali/public-api/dynamics/dynamics-joint.h>
-#include <dali/public-api/dynamics/dynamics-body-config.h>
-
-#ifdef DYNAMICS_SUPPORT
-#include <dali/internal/event/dynamics/dynamics-declarations.h>
-#include <dali/internal/event/dynamics/dynamics-body-config-impl.h>
-#include <dali/internal/event/dynamics/dynamics-body-impl.h>
-#include <dali/internal/event/dynamics/dynamics-joint-impl.h>
-#include <dali/internal/event/dynamics/dynamics-world-impl.h>
-#endif
+#include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
namespace Dali
{
}
Actor::Actor(const Actor& copy)
-: Constrainable(copy)
+: Handle(copy)
{
}
return Actor(child.Get());
}
-Actor Actor::FindChildByAlias(const std::string& actorAlias)
-{
- Actor child = GetImplementation(*this).FindChildByAlias(actorAlias);
- return child;
-}
-
Actor Actor::FindChildById(const unsigned int id)
{
Internal::ActorPtr child = GetImplementation(*this).FindChildById(id);
void Actor::SetSize(const Vector2& size)
{
- GetImplementation(*this).SetSize(size);
+ GetImplementation(*this).SetSize( size );
}
void Actor::SetSize(const Vector3& size)
{
- GetImplementation(*this).SetSize(size);
+ GetImplementation(*this).SetSize( size );
}
-Vector3 Actor::GetSize() const
+Vector3 Actor::GetTargetSize() const
{
- return GetImplementation(*this).GetSize();
+ return GetImplementation(*this).GetTargetSize();
}
Vector3 Actor::GetCurrentSize() const
GetImplementation(*this).SetZ(z);
}
-void Actor::MoveBy(const Vector3& distance)
+void Actor::TranslateBy(const Vector3& distance)
{
- GetImplementation(*this).MoveBy(distance);
+ GetImplementation(*this).TranslateBy(distance);
}
Vector3 Actor::GetCurrentPosition() const
return GetImplementation(*this).GetPositionInheritanceMode();
}
-void Actor::SetRotation(const Degree& angle, const Vector3& axis)
+void Actor::SetOrientation(const Degree& angle, const Vector3& axis)
{
- GetImplementation(*this).SetRotation(Radian(angle), axis);
+ GetImplementation(*this).SetOrientation(Radian(angle), axis);
}
-void Actor::SetRotation(const Radian& angle, const Vector3& axis)
+void Actor::SetOrientation(const Radian& angle, const Vector3& axis)
{
- GetImplementation(*this).SetRotation(angle, axis);
+ GetImplementation(*this).SetOrientation(angle, axis);
}
-void Actor::SetRotation(const Quaternion& rotation)
+void Actor::SetOrientation(const Quaternion& orientation)
{
- GetImplementation(*this).SetRotation(rotation);
+ GetImplementation(*this).SetOrientation(orientation);
}
void Actor::RotateBy(const Degree& angle, const Vector3& axis)
GetImplementation(*this).RotateBy(relativeRotation);
}
-Quaternion Actor::GetCurrentRotation() const
+Quaternion Actor::GetCurrentOrientation() const
{
- return GetImplementation(*this).GetCurrentRotation();
+ return GetImplementation(*this).GetCurrentOrientation();
}
-void Actor::SetInheritRotation(bool inherit)
+void Actor::SetInheritOrientation(bool inherit)
{
- GetImplementation(*this).SetInheritRotation(inherit);
+ GetImplementation(*this).SetInheritOrientation(inherit);
}
-bool Actor::IsRotationInherited() const
+bool Actor::IsOrientationInherited() const
{
- return GetImplementation(*this).IsRotationInherited();
+ return GetImplementation(*this).IsOrientationInherited();
}
-Quaternion Actor::GetCurrentWorldRotation() const
+Quaternion Actor::GetCurrentWorldOrientation() const
{
- return GetImplementation(*this).GetCurrentWorldRotation();
+ return GetImplementation(*this).GetCurrentWorldOrientation();
}
void Actor::SetScale(float scale)
return GetImplementation(*this).IsScaleInherited();
}
-void Actor::SetSizeMode(SizeMode mode)
-{
- GetImplementation(*this).SetSizeMode(mode);
-}
-
-SizeMode Actor::GetSizeMode() const
-{
- return GetImplementation(*this).GetSizeMode();
-}
-
void Actor::SetSizeModeFactor(const Vector3& factor)
{
GetImplementation(*this).SetSizeModeFactor(factor);
GetImplementation(*this).SetOpacity(opacity);
}
-void Actor::OpacityBy(float relativeOpacity)
-{
- GetImplementation(*this).OpacityBy(relativeOpacity);
-}
-
float Actor::GetCurrentOpacity() const
{
return GetImplementation(*this).GetCurrentOpacity();
GetImplementation(*this).SetColor(color);
}
-void Actor::ColorBy(const Vector4& relativeColor)
-{
- GetImplementation(*this).ColorBy(relativeColor);
-}
-
Vector4 Actor::GetCurrentColor() const
{
return GetImplementation(*this).GetCurrentColor();
return GetImplementation(*this).IsKeyboardFocusable();
}
-Actor::TouchSignalType& Actor::TouchedSignal()
+void Actor::SetRelayoutEnabled( bool enabled )
{
- return GetImplementation(*this).TouchedSignal();
+ GetImplementation(*this).SetRelayoutEnabled( enabled );
}
-Actor::HoverSignalType& Actor::HoveredSignal()
+bool Actor::IsRelayoutEnabled() const
{
- return GetImplementation(*this).HoveredSignal();
+ return GetImplementation(*this).IsRelayoutEnabled();
}
-Actor::MouseWheelEventSignalType& Actor::MouseWheelEventSignal()
+void Actor::SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
{
- return GetImplementation(*this).MouseWheelEventSignal();
+ GetImplementation(*this).SetResizePolicy( policy, dimension );
}
-Actor::OnStageSignalType& Actor::OnStageSignal()
+ResizePolicy::Type Actor::GetResizePolicy( Dimension::Type dimension ) const
{
- return GetImplementation(*this).OnStageSignal();
+ return GetImplementation(*this).GetResizePolicy( dimension );
}
-Actor::OffStageSignalType& Actor::OffStageSignal()
+void Actor::SetSizeScalePolicy( SizeScalePolicy::Type policy )
{
- return GetImplementation(*this).OffStageSignal();
+ GetImplementation(*this).SetSizeScalePolicy( policy );
+}
+
+SizeScalePolicy::Type Actor::GetSizeScalePolicy() const
+{
+ return GetImplementation(*this).GetSizeScalePolicy();
+}
+
+float Actor::GetHeightForWidth( float width )
+{
+ return GetImplementation(*this).GetHeightForWidth( width );
}
-DynamicsBody Actor::EnableDynamics(DynamicsBodyConfig bodyConfig)
+float Actor::GetWidthForHeight( float height )
{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsBodyConfig& internal = GetImplementation(bodyConfig);
+ return GetImplementation(*this).GetWidthForHeight( height );
+}
- Internal::DynamicsBodyPtr body( GetImplementation(*this).EnableDynamics( &internal ) );
+float Actor::GetRelayoutSize( Dimension::Type dimension ) const
+{
+ return GetImplementation(*this).GetRelayoutSize( dimension );
+}
- return DynamicsBody( body.Get() );
-#else
- return DynamicsBody();
-#endif
+void Actor::RelayoutRequestTree()
+{
+ GetImplementation(*this).RelayoutRequestTree();
}
-DynamicsJoint Actor::AddDynamicsJoint( Actor attachedActor, const Vector3& offset )
+void Actor::PropagateRelayoutFlags()
{
-#ifdef DYNAMICS_SUPPORT
- Internal::ActorPtr internalActor( &GetImplementation(attachedActor) );
- Internal::DynamicsJointPtr joint( GetImplementation(*this).AddDynamicsJoint( internalActor, offset) );
+ GetImplementation(*this).PropagateRelayoutFlags();
+}
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
+void Actor::SetPadding( const Padding& padding )
+{
+ Internal::Actor& impl = GetImplementation(*this);
+
+ Vector2 widthPadding( padding.left, padding.right );
+ impl.SetPadding( widthPadding, Dimension::WIDTH );
+
+ Vector2 heightPadding( padding.bottom, padding.top );
+ impl.SetPadding( heightPadding, Dimension::HEIGHT );
}
-DynamicsJoint Actor::AddDynamicsJoint( Actor attachedActor, const Vector3& offsetA, const Vector3& offsetB )
+void Actor::GetPadding( Padding& paddingOut ) const
{
-#ifdef DYNAMICS_SUPPORT
- Internal::ActorPtr internalActor( &GetImplementation(attachedActor) );
- Internal::DynamicsJointPtr joint( GetImplementation(*this).AddDynamicsJoint( internalActor, offsetA, offsetB) );
+ const Internal::Actor& impl = GetImplementation(*this);
+
+ Vector2 widthPadding = impl.GetPadding( Dimension::WIDTH );
+ Vector2 heightPadding = impl.GetPadding( Dimension::HEIGHT );
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
+ paddingOut.left = widthPadding.x;
+ paddingOut.right = widthPadding.y;
+ paddingOut.bottom = heightPadding.x;
+ paddingOut.top = heightPadding.y;
}
-int Actor::GetNumberOfJoints() const
+void Actor::SetMinimumSize( const Vector2& size )
{
-#ifdef DYNAMICS_SUPPORT
- return GetImplementation(*this).GetNumberOfJoints();
-#else
- return int();
-#endif
+ Internal::Actor& impl = GetImplementation(*this);
+
+ impl.SetMinimumSize( size.x, Dimension::WIDTH );
+ impl.SetMinimumSize( size.y, Dimension::HEIGHT );
+}
+
+Vector2 Actor::GetMinimumSize()
+{
+ Internal::Actor& impl = GetImplementation(*this);
+
+ return Vector2( impl.GetMinimumSize( Dimension::WIDTH ), impl.GetMinimumSize( Dimension::HEIGHT ) );
}
-DynamicsJoint Actor::GetDynamicsJointByIndex( const int index )
+void Actor::SetMaximumSize( const Vector2& size )
{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsJointPtr joint( GetImplementation(*this).GetDynamicsJointByIndex( index ) );
+ Internal::Actor& impl = GetImplementation(*this);
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
+ impl.SetMaximumSize( size.x, Dimension::WIDTH );
+ impl.SetMaximumSize( size.y, Dimension::HEIGHT );
}
-DynamicsJoint Actor::GetDynamicsJoint( Actor attachedActor )
+Vector2 Actor::GetMaximumSize()
{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsJointPtr joint( GetImplementation(*this).GetDynamicsJoint( &GetImplementation(attachedActor) ) );
+ Internal::Actor& impl = GetImplementation(*this);
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
+ return Vector2( impl.GetMaximumSize( Dimension::WIDTH ), impl.GetMaximumSize( Dimension::HEIGHT ) );
}
-void Actor::RemoveDynamicsJoint( DynamicsJoint joint )
+Actor::TouchSignalType& Actor::TouchedSignal()
{
-#ifdef DYNAMICS_SUPPORT
- GetImplementation(*this).RemoveDynamicsJoint( &GetImplementation(joint) );
-#endif
+ return GetImplementation(*this).TouchedSignal();
}
-void Actor::DisableDynamics()
+Actor::HoverSignalType& Actor::HoveredSignal()
{
-#ifdef DYNAMICS_SUPPORT
- GetImplementation(*this).DisableDynamics();
-#endif
+ return GetImplementation(*this).HoveredSignal();
+}
+
+Actor::MouseWheelEventSignalType& Actor::MouseWheelEventSignal()
+{
+ return GetImplementation(*this).MouseWheelEventSignal();
+}
+
+Actor::OnStageSignalType& Actor::OnStageSignal()
+{
+ return GetImplementation(*this).OnStageSignal();
+}
+
+Actor::OffStageSignalType& Actor::OffStageSignal()
+{
+ return GetImplementation(*this).OffStageSignal();
}
-DynamicsBody Actor::GetDynamicsBody()
+Actor::OnRelayoutSignalType& Actor::OnRelayoutSignal()
{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsBodyPtr internal(GetImplementation(*this).GetDynamicsBody());
- return DynamicsBody( internal.Get() );
-#else
- return DynamicsBody();
-#endif
+ return GetImplementation(*this).OnRelayoutSignal();
}
Actor::Actor(Internal::Actor* internal)
-: Constrainable(internal)
+: Handle(internal)
{
}