X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fshader-effects%2Fdissolve-effect.h;h=4953e4db027618c87cf9af66496753e8f7491a7f;hp=f97f4f44336025ee2be629478c45f6ca3ab52c75;hb=6b5f0c3c0b6ca0269081fe79280586357ec36ae2;hpb=af4073fd7a4f946e26110ecd608ef8e748c078aa diff --git a/dali-toolkit/devel-api/shader-effects/dissolve-effect.h b/dali-toolkit/devel-api/shader-effects/dissolve-effect.h index f97f4f4..4953e4d 100644 --- a/dali-toolkit/devel-api/shader-effects/dissolve-effect.h +++ b/dali-toolkit/devel-api/shader-effects/dissolve-effect.h @@ -22,43 +22,58 @@ #include #include -namespace +namespace Dali +{ + +namespace Toolkit +{ + +/** + * @brief Only registers the required property if it has not registered it before. + * + * @tparam T The type of the property. + * + * @param[in] actor The actor to register the property with. + * @param[in] name The name of the property. + * @param[in] value The value the property should be set to. + */ +template < typename T> +DALI_INTERNAL void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value ) { - template < typename T> - void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value ) + Dali::Property::Index index = actor.GetPropertyIndex( name ); + if ( Dali::Property::INVALID_INDEX == index ) { - Dali::Property::Index index = actor.GetPropertyIndex( name ); - if ( Dali::Property::INVALID_INDEX == index ) - { - index = actor.RegisterProperty( name, value ); - } - else - { - actor.SetProperty( index, value ); - } + index = actor.RegisterProperty( name, value ); } - - template < typename T> - void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value, Dali::Property::AccessMode accessMode ) + else { - Dali::Property::Index index = actor.GetPropertyIndex( name ); - if ( Dali::Property::INVALID_INDEX == index ) - { - index = actor.RegisterProperty( name, value, accessMode ); - } - else - { - actor.SetProperty( index, value ); - } + actor.SetProperty( index, value ); } +} -}; - -namespace Dali -{ - -namespace Toolkit +/** + * @brief Only registers the required property if it has not registered it before. + * + * @tparam T The type of the property. + * + * @param[in] actor The actor to register the property with. + * @param[in] name The name of the property. + * @param[in] value The value the property should be set to. + * @param[in] accessMode The accessMode required for the property. + */ +template < typename T> +DALI_INTERNAL void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value, Dali::Property::AccessMode accessMode ) { + Dali::Property::Index index = actor.GetPropertyIndex( name ); + if ( Dali::Property::INVALID_INDEX == index ) + { + index = actor.RegisterProperty( name, value, accessMode ); + } + else + { + actor.SetProperty( index, value ); + } +} /** * @brief Set the dissolve central line.