X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Factors%2Factor.cpp;h=b96283f7b49967824178a6eccaef2b5d6d7a99a6;hb=a62dc57b01b08ebcfd0aed24afc8f156fbe7c619;hp=99b2b4e7b0c12150d7622dc2311d65d5c007a72a;hpb=c93722c1550a92fb60b19fa8582cadb0ce43eec9;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/actors/actor.cpp b/dali/public-api/actors/actor.cpp index 99b2b4e..b96283f 100644 --- a/dali/public-api/actors/actor.cpp +++ b/dali/public-api/actors/actor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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. @@ -22,13 +22,12 @@ #include #include #include -#include #include #include #include #include -#include +#include #include #include @@ -106,11 +105,6 @@ void Actor::Add(Actor actor) GetImplementation(*this).Add(GetImplementation(actor)); } -void Actor::Insert(unsigned int index, Actor actor) -{ - GetImplementation(*this).Insert(index, GetImplementation(actor)); -} - void Actor::Remove(Actor actor) { GetImplementation(*this).Remove(GetImplementation(actor)); @@ -128,19 +122,20 @@ unsigned int Actor::GetChildCount() const Actor Actor::GetChildAt(unsigned int index) const { - return GetImplementation(*this).GetChildAt(index); + Internal::ActorPtr child = GetImplementation(*this).GetChildAt( index ); + return Actor( child.Get() ); } Actor Actor::FindChildByName(const std::string& actorName) { - Internal::ActorPtr child = GetImplementation(*this).FindChildByName(actorName); - return Actor(child.Get()); + Internal::ActorPtr child = GetImplementation(*this).FindChildByName( actorName ); + return Actor( child.Get() ); } Actor Actor::FindChildById(const unsigned int id) { - Internal::ActorPtr child = GetImplementation(*this).FindChildById(id); - return Actor(child.Get()); + Internal::ActorPtr child = GetImplementation(*this).FindChildById( id ); + return Actor( child.Get() ); } Actor Actor::GetParent() const @@ -252,17 +247,16 @@ Vector3 Actor::GetCurrentWorldPosition() const void Actor::SetPositionInheritanceMode( PositionInheritanceMode mode ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetPositionInheritanceMode() is deprecated and will be removed from next release. Use SetInheritPosition() instead.\n" ); + GetImplementation(*this).SetPositionInheritanceMode( mode ); } PositionInheritanceMode Actor::GetPositionInheritanceMode() const { - return GetImplementation(*this).GetPositionInheritanceMode(); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetPositionInheritanceMode() is deprecated and will be removed from next release. Use IsPositionInherited() instead.\n" ); -void Actor::SetOrientation(const Degree& angle, const Vector3& axis) -{ - GetImplementation(*this).SetOrientation(Radian(angle), axis); + return GetImplementation(*this).GetPositionInheritanceMode(); } void Actor::SetOrientation(const Radian& angle, const Vector3& axis) @@ -275,11 +269,6 @@ void Actor::SetOrientation(const Quaternion& orientation) GetImplementation(*this).SetOrientation(orientation); } -void Actor::RotateBy(const Degree& angle, const Vector3& axis) -{ - GetImplementation(*this).RotateBy(Radian(angle), axis); -} - void Actor::RotateBy(const Radian& angle, const Vector3& axis) { GetImplementation(*this).RotateBy(angle, axis); @@ -455,32 +444,22 @@ bool Actor::IsKeyboardFocusable() const return GetImplementation(*this).IsKeyboardFocusable(); } -void Actor::SetRelayoutEnabled( bool enabled ) -{ - GetImplementation(*this).SetRelayoutEnabled( enabled ); -} - -bool Actor::IsRelayoutEnabled() const -{ - return GetImplementation(*this).IsRelayoutEnabled(); -} - -void Actor::SetResizePolicy( ResizePolicy policy, Dimension dimension ) +void Actor::SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) { GetImplementation(*this).SetResizePolicy( policy, dimension ); } -ResizePolicy Actor::GetResizePolicy( Dimension dimension ) const +ResizePolicy::Type Actor::GetResizePolicy( Dimension::Type dimension ) const { return GetImplementation(*this).GetResizePolicy( dimension ); } -void Actor::SetSizeScalePolicy( SizeScalePolicy policy ) +void Actor::SetSizeScalePolicy( SizeScalePolicy::Type policy ) { GetImplementation(*this).SetSizeScalePolicy( policy ); } -SizeScalePolicy Actor::GetSizeScalePolicy() const +SizeScalePolicy::Type Actor::GetSizeScalePolicy() const { return GetImplementation(*this).GetSizeScalePolicy(); } @@ -495,38 +474,28 @@ float Actor::GetWidthForHeight( float height ) return GetImplementation(*this).GetWidthForHeight( height ); } -float Actor::GetRelayoutSize( Dimension dimension ) const +float Actor::GetRelayoutSize( Dimension::Type dimension ) const { return GetImplementation(*this).GetRelayoutSize( dimension ); } -void Actor::RelayoutRequestTree() -{ - GetImplementation(*this).RelayoutRequestTree(); -} - -void Actor::PropagateRelayoutFlags() -{ - GetImplementation(*this).PropagateRelayoutFlags(); -} - void Actor::SetPadding( const Padding& padding ) { Internal::Actor& impl = GetImplementation(*this); Vector2 widthPadding( padding.left, padding.right ); - impl.SetPadding( widthPadding, WIDTH ); + impl.SetPadding( widthPadding, Dimension::WIDTH ); Vector2 heightPadding( padding.bottom, padding.top ); - impl.SetPadding( heightPadding, HEIGHT ); + impl.SetPadding( heightPadding, Dimension::HEIGHT ); } void Actor::GetPadding( Padding& paddingOut ) const { const Internal::Actor& impl = GetImplementation(*this); - Vector2 widthPadding = impl.GetPadding( WIDTH ); - Vector2 heightPadding = impl.GetPadding( HEIGHT ); + Vector2 widthPadding = impl.GetPadding( Dimension::WIDTH ); + Vector2 heightPadding = impl.GetPadding( Dimension::HEIGHT ); paddingOut.left = widthPadding.x; paddingOut.right = widthPadding.y; @@ -538,45 +507,57 @@ void Actor::SetMinimumSize( const Vector2& size ) { Internal::Actor& impl = GetImplementation(*this); - impl.SetMinimumSize( size.x, WIDTH ); - impl.SetMinimumSize( size.y, HEIGHT ); + impl.SetMinimumSize( size.x, Dimension::WIDTH ); + impl.SetMinimumSize( size.y, Dimension::HEIGHT ); } Vector2 Actor::GetMinimumSize() { Internal::Actor& impl = GetImplementation(*this); - return Vector2( impl.GetMinimumSize( WIDTH ), impl.GetMinimumSize( HEIGHT ) ); + return Vector2( impl.GetMinimumSize( Dimension::WIDTH ), impl.GetMinimumSize( Dimension::HEIGHT ) ); } void Actor::SetMaximumSize( const Vector2& size ) { Internal::Actor& impl = GetImplementation(*this); - impl.SetMaximumSize( size.x, WIDTH ); - impl.SetMaximumSize( size.y, HEIGHT ); + impl.SetMaximumSize( size.x, Dimension::WIDTH ); + impl.SetMaximumSize( size.y, Dimension::HEIGHT ); } Vector2 Actor::GetMaximumSize() { Internal::Actor& impl = GetImplementation(*this); - return Vector2( impl.GetMaximumSize( WIDTH ), impl.GetMaximumSize( HEIGHT ) ); + return Vector2( impl.GetMaximumSize( Dimension::WIDTH ), impl.GetMaximumSize( Dimension::HEIGHT ) ); +} + +int Actor::GetHierarchyDepth() +{ + return GetImplementation(*this).GetHierarchyDepth(); } Actor::TouchSignalType& Actor::TouchedSignal() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" ); + return GetImplementation(*this).TouchedSignal(); } +Actor::TouchDataSignalType& Actor::TouchSignal() +{ + return GetImplementation( *this ).TouchSignal(); +} + Actor::HoverSignalType& Actor::HoveredSignal() { return GetImplementation(*this).HoveredSignal(); } -Actor::MouseWheelEventSignalType& Actor::MouseWheelEventSignal() +Actor::WheelEventSignalType& Actor::WheelEventSignal() { - return GetImplementation(*this).MouseWheelEventSignal(); + return GetImplementation(*this).WheelEventSignal(); } Actor::OnStageSignalType& Actor::OnStageSignal() @@ -589,6 +570,32 @@ Actor::OffStageSignalType& Actor::OffStageSignal() return GetImplementation(*this).OffStageSignal(); } +unsigned int Actor::AddRenderer( Renderer& renderer ) +{ + return GetImplementation(*this).AddRenderer( GetImplementation( renderer ) ); +} + +unsigned int Actor::GetRendererCount() const +{ + return GetImplementation(*this).GetRendererCount(); +} + +Renderer Actor::GetRendererAt( unsigned int index ) +{ + Internal::RendererPtr renderer = GetImplementation(*this).GetRendererAt( index ); + return Renderer( renderer.Get() ); +} + +void Actor::RemoveRenderer( Renderer& renderer ) +{ + GetImplementation(*this).RemoveRenderer( GetImplementation( renderer ) ); +} + +void Actor::RemoveRenderer( unsigned int index ) +{ + GetImplementation(*this).RemoveRenderer( index ); +} + Actor::OnRelayoutSignalType& Actor::OnRelayoutSignal() { return GetImplementation(*this).OnRelayoutSignal(); @@ -599,13 +606,4 @@ Actor::Actor(Internal::Actor* internal) { } -void UnparentAndReset( Actor& actor ) -{ - if( actor ) - { - actor.Unparent(); - actor.Reset(); - } -} - } // namespace Dali