X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fcommon%2Fproperty-owner.cpp;h=ec3d17a95d532162945ad566b68f6353996bc62e;hb=6e7f48188a239b060512231cc6acbe821c703caa;hp=8050bb1f0b0bdd23301d9e338741bcde12c4a4ff;hpb=7dcb0a38005dd8c6d71e466c1ea0ec4d7d57239f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/common/property-owner.cpp b/dali/internal/update/common/property-owner.cpp index 8050bb1..ec3d17a 100644 --- a/dali/internal/update/common/property-owner.cpp +++ b/dali/internal/update/common/property-owner.cpp @@ -41,7 +41,7 @@ PropertyOwner* PropertyOwner::New() PropertyOwner::~PropertyOwner() { - DisconnectFromSceneGraph(); + Destroy(); } void PropertyOwner::AddObserver(Observer& observer) @@ -72,7 +72,7 @@ bool PropertyOwner::IsObserved() return mObservers.Count() != 0u; } -void PropertyOwner::DisconnectFromSceneGraph() +void PropertyOwner::Destroy() { // Notification for observers const ConstObserverIter endIter = mObservers.End(); @@ -87,6 +87,29 @@ void PropertyOwner::DisconnectFromSceneGraph() mConstraints.Clear(); } +void PropertyOwner::ConnectToSceneGraph() +{ + // Notification for observers + const ConstObserverIter endIter = mObservers.End(); + for( ConstObserverIter iter = mObservers.Begin(); iter != endIter; ++iter) + { + (*iter)->PropertyOwnerConnected( *this ); + } +} + +void PropertyOwner::DisconnectFromSceneGraph( BufferIndex updateBufferIndex ) +{ + // Notification for observers + const ConstObserverIter endIter = mObservers.End(); + for( ConstObserverIter iter = mObservers.Begin(); iter != endIter; ++iter) + { + (*iter)->PropertyOwnerDisconnected( updateBufferIndex, *this ); + } + + // Remove all constraints when disconnected from scene-graph + mConstraints.Clear(); +} + void PropertyOwner::InstallCustomProperty(PropertyBase* property) { DALI_ASSERT_DEBUG( NULL != property ); @@ -103,13 +126,6 @@ void PropertyOwner::ResetToBaseValues( BufferIndex updateBufferIndex ) (*iter)->ResetToBaseValue( updateBufferIndex ); } - // Reset constraint weights - const ConstraintIter constraintEndIter = mConstraints.End(); - for( ConstraintIter iter = mConstraints.Begin(); constraintEndIter != iter; ++iter ) - { - (*iter)->mWeight.ResetToBaseValue( updateBufferIndex ); - } - // Notification for derived classes, to reset default properties ResetDefaultProperties( updateBufferIndex ); } @@ -128,7 +144,6 @@ void PropertyOwner::ApplyConstraint( ConstraintBase* constraint ) void PropertyOwner::RemoveConstraint( ConstraintBase* constraint ) { - // Reset constraint weights const ConstraintIter constraintEndIter = mConstraints.End(); for( ConstraintIter iter = mConstraints.Begin(); constraintEndIter != iter; ++iter ) { @@ -147,6 +162,33 @@ PropertyOwner::PropertyOwner() { } +void PropertyOwner::AddUniformMapping( UniformPropertyMapping* map ) +{ + mUniformMaps.Add( map ); +} + +void PropertyOwner::RemoveUniformMapping( const std::string& uniformName ) +{ + mUniformMaps.Remove( uniformName ); +} + +const UniformMap& PropertyOwner::GetUniformMap() const +{ + return mUniformMaps; +} + +void PropertyOwner::AddUniformMapObserver( UniformMap::Observer& observer ) +{ + mUniformMaps.AddObserver( observer ); +} + +void PropertyOwner::RemoveUniformMapObserver( UniformMap::Observer& observer ) +{ + mUniformMaps.RemoveObserver( observer ); +} + + + } // namespace SceneGraph } // namespace Internal