X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fbuilder-animations.cpp;h=980fc90748839065e5ee712fb709d67e7e3b1f95;hp=c1c8921f1410662ae04114911cd4bcac2916495d;hb=f3da11c2818c6d17706fbb2417f21b602b3190f5;hpb=306d2f61a1b64179e801fa8a0bb2bd7b4e9dd682 diff --git a/dali-toolkit/internal/builder/builder-animations.cpp b/dali-toolkit/internal/builder/builder-animations.cpp index c1c8921..980fc90 100644 --- a/dali-toolkit/internal/builder/builder-animations.cpp +++ b/dali-toolkit/internal/builder/builder-animations.cpp @@ -16,6 +16,8 @@ */ // EXTERNAL INCLUDES +#include +#include #include // INTERNAL INCLUDES @@ -108,34 +110,20 @@ AlphaFunction GetAlphaFunction( const std::string& alphaFunction ) if( 0 == alphaFunctionLut.size() ) { // coding convention is uppercase enums - alphaFunctionLut["DEFAULT"] = AlphaFunctions::Default; - alphaFunctionLut["LINEAR"] = AlphaFunctions::Linear; - alphaFunctionLut["SQUARE"] = AlphaFunctions::Square; - alphaFunctionLut["REVERSE"] = AlphaFunctions::Reverse; - alphaFunctionLut["EASE_IN"] = AlphaFunctions::EaseIn; - alphaFunctionLut["EASE_OUT"] = AlphaFunctions::EaseOut; - alphaFunctionLut["EASE_IN_OUT"] = AlphaFunctions::EaseInOut; - alphaFunctionLut["EASE_IN_SINE"] = AlphaFunctions::EaseInSine; - alphaFunctionLut["EASE_OUT_SINE"] = AlphaFunctions::EaseOutSine; - alphaFunctionLut["EASE_IN_OUT_SINE"] = AlphaFunctions::EaseInOutSine; - alphaFunctionLut["EASE_IN_SINE_33"] = AlphaFunctions::EaseInSine33; - alphaFunctionLut["EASE_OUT_SINE_33"] = AlphaFunctions::EaseOutSine33; - alphaFunctionLut["EASE_IN_OUT_SINE_33"] = AlphaFunctions::EaseInOutSine33; - alphaFunctionLut["EASE_IN_OUT_SINE_50"] = AlphaFunctions::EaseInOutSine50; - alphaFunctionLut["EASE_IN_OUT_SINE_60"] = AlphaFunctions::EaseInOutSine60; - alphaFunctionLut["EASE_IN_OUT_SINE_70"] = AlphaFunctions::EaseInOutSine70; - alphaFunctionLut["EASE_IN_OUT_SINE_80"] = AlphaFunctions::EaseInOutSine80; - alphaFunctionLut["EASE_IN_OUT_SINE_90"] = AlphaFunctions::EaseInOutSine90; - alphaFunctionLut["DOUBLE_EASE_IN_OUT_SINE_60"] = AlphaFunctions::DoubleEaseInOutSine60; - alphaFunctionLut["EASE_OUT_QUINT_50"] = AlphaFunctions::EaseOutQuint50; - alphaFunctionLut["EASE_OUT_QUINT_80"] = AlphaFunctions::EaseOutQuint80; - alphaFunctionLut["BOUNCE"] = AlphaFunctions::Bounce; - alphaFunctionLut["BOUNCE_BACK"] = AlphaFunctions::BounceBack; - alphaFunctionLut["EASE_IN_BACK"] = AlphaFunctions::EaseInBack; - alphaFunctionLut["EASE_OUT_BACK"] = AlphaFunctions::EaseOutBack; - alphaFunctionLut["EASE_IN_OUT_BACK"] = AlphaFunctions::EaseInOutBack; - alphaFunctionLut["SIN"] = AlphaFunctions::Sin; - alphaFunctionLut["SIN2X"] = AlphaFunctions::Sin2x; + alphaFunctionLut["DEFAULT"] = AlphaFunction(AlphaFunction::DEFAULT); + alphaFunctionLut["LINEAR"] = AlphaFunction(AlphaFunction::LINEAR); + alphaFunctionLut["REVERSE"] = AlphaFunction(AlphaFunction::REVERSE); + alphaFunctionLut["EASE_IN_SQUARE"] = AlphaFunction(AlphaFunction::EASE_IN_SQUARE); + alphaFunctionLut["EASE_OUT_SQUARE"] = AlphaFunction(AlphaFunction::EASE_OUT_SQUARE); + alphaFunctionLut["EASE_IN"] = AlphaFunction(AlphaFunction::EASE_IN); + alphaFunctionLut["EASE_OUT"] = AlphaFunction(AlphaFunction::EASE_OUT); + alphaFunctionLut["EASE_IN_OUT"] = AlphaFunction(AlphaFunction::EASE_IN_OUT); + alphaFunctionLut["EASE_IN_SINE"] = AlphaFunction(AlphaFunction::EASE_IN_SINE); + alphaFunctionLut["EASE_OUT_SINE"] = AlphaFunction(AlphaFunction::EASE_OUT_SINE); + alphaFunctionLut["EASE_IN_OUT_SINE"] = AlphaFunction(AlphaFunction::EASE_IN_OUT_SINE); + alphaFunctionLut["BOUNCE"] = AlphaFunction(AlphaFunction::BOUNCE); + alphaFunctionLut["SIN"] = AlphaFunction(AlphaFunction::SIN); + alphaFunctionLut["EASE_OUT_BACK"] = AlphaFunction(AlphaFunction::EASE_OUT_BACK); } const AlphaFunctionLut::const_iterator iter( alphaFunctionLut.find( alphaFunction ) ); @@ -146,8 +134,8 @@ AlphaFunction GetAlphaFunction( const std::string& alphaFunction ) } else { - DALI_ASSERT_ALWAYS( iter != alphaFunctionLut.end() && "Unknown Anchor Constant" ); - return Dali::AlphaFunctions::Default; + DALI_ASSERT_ALWAYS( iter != alphaFunctionLut.end() && "Unknown Alpha Constant" ); + return Dali::AlphaFunction::DEFAULT; } } @@ -171,7 +159,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D Animation animation( Animation::New( 0.f ) ); - // duration needs to be set before AnimateTo calls for correct operation when AnimateTo has no "time-period". + // duration needs to be set before AnimateTo calls for correct operation when AnimateTo has no "timePeriod". OptionalFloat duration = constant.IsFloat( IsChild(child, "duration" ) ); if( duration ) @@ -184,7 +172,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D animation.SetLooping( *looping ); } - if( OptionalString endAction = constant.IsString( IsChild(child, "end-action" ) ) ) + if( OptionalString endAction = constant.IsString( IsChild(child, "endAction" ) ) ) { if("BAKE" == *endAction) { @@ -200,7 +188,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D } } - if( OptionalString endAction = constant.IsString( IsChild(child, "disconnect-action" ) ) ) + if( OptionalString endAction = constant.IsString( IsChild(child, "disconnectAction" ) ) ) { if("BAKE" == *endAction) { @@ -241,13 +229,13 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D // to allow animating shader uniforms if( propIndex == Property::INVALID_INDEX ) { - RenderableActor renderable = RenderableActor::DownCast( targetHandle ); - if( renderable ) + ImageActor imageActor = ImageActor::DownCast( targetHandle ); + if( imageActor ) { // A limitation here is that its possible that between creation of animation // and running it the ShaderEffect of the actor has been changed. // However this is a unlikely use case especially when using scripts. - if( ShaderEffect effect = renderable.GetShaderEffect() ) + if( ShaderEffect effect = imageActor.GetShaderEffect() ) { propIndex = effect.GetPropertyIndex( *property ); if(propIndex != Property::INVALID_INDEX) @@ -276,10 +264,10 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D } // these are the defaults - AlphaFunction alphaFunction( AlphaFunctions::Default ); + AlphaFunction alphaFunction( AlphaFunction::DEFAULT ); TimePeriod timePeriod( 0.f ); - OptionalChild timeChild = IsChild( pKeyChild.second, "time-period" ); + OptionalChild timeChild = IsChild( pKeyChild.second, "timePeriod" ); if( timeChild ) { @@ -288,12 +276,12 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D durationSum = std::max( durationSum, timePeriod.delaySeconds + timePeriod.durationSeconds ); - if( OptionalString alphaChild = constant.IsString( IsChild(pKeyChild.second, "alpha-function" ) ) ) + if( OptionalString alphaChild = constant.IsString( IsChild(pKeyChild.second, "alphaFunction" ) ) ) { alphaFunction = GetAlphaFunction( *alphaChild ); } - if( OptionalChild keyFrameChild = IsChild(pKeyChild.second, "key-frames") ) + if( OptionalChild keyFrameChild = IsChild(pKeyChild.second, "keyFrames") ) { DALI_ASSERT_ALWAYS( property && "Animation must specify a property name" ); Property prop = Property( targetHandle, propIndex ); @@ -324,8 +312,8 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D throw; } - AlphaFunction kfAlphaFunction( AlphaFunctions::Default ); - if( OptionalString alphaFuncStr = constant.IsString( IsChild(pKeyChild.second, "alpha-function") ) ) + AlphaFunction kfAlphaFunction( AlphaFunction::DEFAULT ); + if( OptionalString alphaFuncStr = constant.IsString( IsChild(pKeyChild.second, "alphaFunction") ) ) { kfAlphaFunction = GetAlphaFunction( *alphaFuncStr ); }