X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fanimation%2Factive-constraint-base.cpp;h=05b58c568886705b66325f5e86c0e4ccc829a422;hb=62a036e95cc8447bba0ef068948c8feb15de76b2;hp=55ec3e571cb8e4b327baf68ae1036964e6dacfca;hpb=8295300529456e6693e04d8bc7998db85263c7c5;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/animation/active-constraint-base.cpp b/dali/internal/event/animation/active-constraint-base.cpp index 55ec3e5..05b58c5 100644 --- a/dali/internal/event/animation/active-constraint-base.cpp +++ b/dali/internal/event/animation/active-constraint-base.cpp @@ -61,7 +61,7 @@ namespace // unnamed namespace * We want to discourage the use of property strings (minimize string comparisons), * particularly for the default properties. */ -const std::string DEFAULT_PROPERTY_NAMES[] = +const char* DEFAULT_PROPERTY_NAMES[] = { "weight" }; @@ -315,11 +315,6 @@ unsigned int ActiveConstraintBase::GetTag() const return mTag; } -bool ActiveConstraintBase::IsSceneObjectRemovable() const -{ - return true; // The constraint removed when target SceneGraph::PropertyOwner is destroyed -} - unsigned int ActiveConstraintBase::GetDefaultPropertyCount() const { return DEFAULT_PROPERTY_COUNT; @@ -335,7 +330,7 @@ void ActiveConstraintBase::GetDefaultPropertyIndices( Property::IndexContainer& } } -const std::string& ActiveConstraintBase::GetDefaultPropertyName( Property::Index index ) const +const char* ActiveConstraintBase::GetDefaultPropertyName( Property::Index index ) const { if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) ) { @@ -343,9 +338,7 @@ const std::string& ActiveConstraintBase::GetDefaultPropertyName( Property::Index } else { - // index out of range..return empty string - static const std::string INVALID_PROPERTY_NAME; - return INVALID_PROPERTY_NAME; + return NULL; } } @@ -354,7 +347,7 @@ Property::Index ActiveConstraintBase::GetDefaultPropertyIndex( const std::string Property::Index index = Property::INVALID_INDEX; // Only one name to compare with... - if ( name == DEFAULT_PROPERTY_NAMES[0] ) + if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_NAMES[0] ) ) // dont want to convert rhs to string { index = 0; } @@ -392,54 +385,24 @@ Property::Type ActiveConstraintBase::GetDefaultPropertyType( Property::Index ind void ActiveConstraintBase::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ) { - switch ( index ) + if( Dali::ActiveConstraint::WEIGHT == index ) { - case Dali::ActiveConstraint::WEIGHT: - { - SetWeight( propertyValue.Get() ); - break; - } - - default: - { - DALI_ASSERT_ALWAYS( false && "ActiveConstraint property out of bounds" ); // should not come here - break; - } + SetWeight( propertyValue.Get() ); } } -void ActiveConstraintBase::SetCustomProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value ) -{ - DALI_ASSERT_ALWAYS( false && "ActiveConstraintBase does not have custom properties"); // should not come here -} - Property::Value ActiveConstraintBase::GetDefaultProperty( Property::Index index ) const { Property::Value value; - switch ( index ) + if( Dali::ActiveConstraint::WEIGHT == index ) { - case Dali::ActiveConstraint::WEIGHT: - { - value = GetCurrentWeight(); - break; - } - - default: - { - DALI_ASSERT_ALWAYS( false && "ActiveConstraint property out of bounds" ); // should not come here - break; - } + value = GetCurrentWeight(); } return value; } -void ActiveConstraintBase::InstallSceneObjectProperty( SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index ) -{ - DALI_ASSERT_ALWAYS( false && "ActiveConstraintBase does not have custom properties" ); // should not come here -} - const SceneGraph::PropertyOwner* ActiveConstraintBase::GetSceneObject() const { return mSceneGraphConstraint;