X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fobject-impl.cpp;h=2396fd1b99f64bfd1bc3cc50f0d5ff1e26b61e9d;hb=refs%2Fchanges%2F50%2F154650%2F15;hp=da2f58d2549bc19d87c28b10b907b4d6c857ce98;hpb=06fe515b4e32f42fe9ba3723df05a3628aa51ed1;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/object-impl.cpp b/dali/internal/event/common/object-impl.cpp index da2f58d..2396fd1 100644 --- a/dali/internal/event/common/object-impl.cpp +++ b/dali/internal/event/common/object-impl.cpp @@ -736,6 +736,7 @@ Property::Index Object::RegisterSceneGraphProperty(const std::string& name, Prop case Property::STRING: case Property::ARRAY: case Property::MAP: + case Property::EXTENTS: case Property::NONE: { DALI_ASSERT_ALWAYS( !"PropertyType is not animatable" ); @@ -762,7 +763,7 @@ Property::Index Object::RegisterSceneGraphProperty(const std::string& name, Prop } // queue a message to add the property - InstallCustomPropertyMessage( const_cast(GetEventThreadServices()), *scenePropertyOwner, newProperty.Release() ); // Message takes ownership + InstallCustomPropertyMessage( const_cast(GetEventThreadServices()), *scenePropertyOwner, newProperty ); // Message takes ownership // notify the derived class (optional) method in case it needs to do some more work on the new property // note! have to use the local pointer as OwnerPointer now points to NULL as it handed over its ownership @@ -924,28 +925,46 @@ void Object::RemovePropertyNotifications() } } -void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ) +void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType ) { if ( index < DEFAULT_PROPERTY_MAX_COUNT ) { - OnNotifyDefaultPropertyAnimation( animation, index, value ); + OnNotifyDefaultPropertyAnimation( animation, index, value, animationType ); } - else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) ) + else { - AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index ); - if( animatableProperty ) + PropertyMetadata* propertyMetadata = NULL; + if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) ) { - // update the cached property value - animatableProperty->SetPropertyValue( value ); + propertyMetadata = FindAnimatableProperty( index ); } - } - else - { - CustomPropertyMetadata* custom = FindCustomProperty( index ); - if( custom && custom->IsAnimatable() ) + else { - // update the cached property value - custom->SetPropertyValue( value ); + CustomPropertyMetadata* custom = FindCustomProperty( index ); + if( custom && custom->IsAnimatable() ) + { + propertyMetadata = custom; + } + } + + if( propertyMetadata ) + { + switch( animationType ) + { + case Animation::TO: + case Animation::BETWEEN: + { + // Update the cached property value + propertyMetadata->SetPropertyValue( value ); + break; + } + case Animation::BY: + { + // Adjust the cached property value + propertyMetadata->AdjustPropertyValueBy( value ); + break; + } + } } } } @@ -1008,9 +1027,9 @@ void Object::AddUniformMapping( Property::Index propertyIndex, const std::string if( sceneObject != NULL ) { - SceneGraph::UniformPropertyMapping* map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr ); + OwnerPointer< SceneGraph::UniformPropertyMapping > map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr ); // Message takes ownership of Uniform map (and will delete it after copy) - AddUniformMapMessage( const_cast(GetEventThreadServices()), *sceneObject, map); + AddUniformMapMessage( const_cast(GetEventThreadServices()), *sceneObject, map ); } else {