X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-base-impl.cpp;h=7add0247e08f04212ae94b3094d9d567bd539686;hb=ab5c560f8956e7b795b7cc2072d06a61aef103b7;hp=c61aeba6b672acb289640aff61adf18bc79f3c40;hpb=39d4d89a9cc3bcd134922827d7009b2188fe7ffe;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index c61aeba..7add024 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -221,7 +221,7 @@ void Visual::Base::GetNaturalSize( Vector2& naturalSize ) naturalSize = Vector2::ZERO; } -void Visual::Base::SetDepthIndex( float index ) +void Visual::Base::SetDepthIndex( int index ) { mImpl->mDepthIndex = index; if( mImpl->mRenderer ) @@ -230,7 +230,7 @@ void Visual::Base::SetDepthIndex( float index ) } } -float Visual::Base::GetDepthIndex() const +int Visual::Base::GetDepthIndex() const { return mImpl->mDepthIndex; } @@ -401,6 +401,37 @@ const Vector4& Visual::Base::GetMixColor() const return mImpl->mMixColor; } +void Visual::Base::AddResourceObserver( Visual::ResourceObserver& observer) +{ + mImpl->mResourceObserver = &observer; +} + +void Visual::Base::RemoveResourceObserver( Visual::ResourceObserver& observer ) +{ + mImpl->mResourceObserver = NULL; +} + +void Visual::Base::ResourceReady() +{ + if( mImpl->mResourceReady ) + { + // only inform the observer the first time the resource is ready + return; + } + mImpl->mResourceReady = true; + + if( mImpl->mResourceObserver ) + { + // observer is currently a control impl + mImpl->mResourceObserver->ResourceReady( *this ); + } +} + +bool Visual::Base::IsResourceReady() const +{ + return mImpl->mResourceReady; +} + Renderer Visual::Base::GetRenderer() { return mImpl->mRenderer; @@ -490,8 +521,11 @@ void Visual::Base::AnimateProperty( Property::Map map; DoCreatePropertyMap( map ); Property::Value* valuePtr = map.Find( Toolkit::DevelVisual::Property::TYPE ); - int visualType; - valuePtr->Get(visualType); + int visualType = -1; + if( valuePtr ) + { + valuePtr->Get( visualType ); + } if( animator.propertyKey == Toolkit::DevelVisual::Property::MIX_COLOR || animator.propertyKey == MIX_COLOR || @@ -509,7 +543,7 @@ void Visual::Base::AnimateProperty( } else if( mImpl->mRenderer ) { - AnimateRendererProperty(transition, animator); + AnimateRendererProperty( transition, animator ); } }