X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fanimation%2Fanimation-impl.h;h=8554ff48fe122eaa29644531f4121181891527af;hb=2e85738caf39e6a650879de4a53c6ebe3cd7d6ac;hp=1985998e837a823a710cb92f57ea481603d427d2;hpb=8f2c7a1c1ad470b02521b862607a60d966e217f1;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/animation/animation-impl.h b/dali/internal/event/animation/animation-impl.h index 1985998..8554ff4 100644 --- a/dali/internal/event/animation/animation-impl.h +++ b/dali/internal/event/animation/animation-impl.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_ANIMATION_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include #include +#include namespace Dali { @@ -41,8 +42,7 @@ class UpdateManager; class Actor; class Animation; class AnimationPlaylist; -class ProxyObject; -class ShaderEffect; +class Object; typedef IntrusivePtr AnimationPtr; typedef std::vector AnimationContainer; @@ -60,8 +60,7 @@ class Animation : public BaseObject public: typedef Dali::Animation::EndAction EndAction; - - typedef void (*FinishedCallback)(Object* object); + typedef Dali::Animation::Interpolation Interpolation; /** * Create a new Animation object. @@ -71,56 +70,62 @@ public: static AnimationPtr New(float durationSeconds); /** - * Set the duration of an animation. - * @pre durationSeconds must be greater than zero. - * @param[in] seconds The duration in seconds. + * @copydoc Dali::Animation::SetDuration() */ void SetDuration(float seconds); /** - * Retrieve the duration of an animation. - * @return The duration in seconds. + * @copydoc Dali::Animation::GetDuration() */ float GetDuration() const; /** - * Set whether the animation will loop. - * @param[in] looping True if the animation will loop. + * @copydoc Dali::Animation::SetLooping() + */ + void SetLooping(bool on); + + /** + * @copydoc Dali::Animation::SetLoopCount() + */ + void SetLoopCount(int count); + + /** + * @copydoc Dali::Animation::GetLoopCount() + */ + int GetLoopCount(); + + /** + * @copydoc Dali::Animation::GetCurrentLoop() */ - void SetLooping(bool looping); + int GetCurrentLoop(); /** - * Query whether the animation will loop. - * @return True if the animation will loop. + * @copydoc Dali::Animation::IsLooping() */ bool IsLooping() const; /** - * Set the end action of the animation. - * @param[in] action The end action. + * @copydoc Dali::Animation::SetEndAction() */ void SetEndAction(EndAction action); /** - * Returns the end action of the animation. + * @copydoc Dali::Animation::GetEndAction() */ EndAction GetEndAction() const; /** - * Set the disconnect action of the animation. - * @param[in] action The disconnect action. + * @copydoc Dali::Animation::SetDisconnectAction() */ void SetDisconnectAction(EndAction action); /** - * Returns the disconnect action of the animation. + * @copydoc Dali::Animation::GetDisconnectAction() */ EndAction GetDisconnectAction() const; /** - * Set the default alpha function for an animation. - * This is applied to individual property animations, if no further alpha functions are supplied. - * @param[in] alpha The default alpha function. + * @copydoc Dali::Animation::SetDefaultAlphaFunction() */ void SetDefaultAlphaFunction(AlphaFunction alpha) { @@ -128,8 +133,7 @@ public: } /** - * Retrieve the default alpha function for an animation. - * @return The default alpha function. + * @copydoc Dali::Animation::GetDefaultAlphaFunction() */ AlphaFunction GetDefaultAlphaFunction() const { @@ -137,29 +141,32 @@ public: } /** - * (Re)start the animation. + * @copydoc Dali::Animation::Play() */ void Play(); /** - * (Re)start the animation from a given point. - * @param[in] progress The progress between [0,1] from where the animation should start + * @copydoc Dali::Animation::PlayFrom() */ void PlayFrom( float progress ); /** - * Pause the animation. + * @copydoc Dali::Animation::Pause() */ void Pause(); /** - * Stop the animation. + * @copydoc Dali::Animation::GetState() + */ + Dali::Animation::State GetState() const; + + /** + * @copydoc Dali::Animation::Stop() */ void Stop(); /** - * Clear the animation. - * This disconnects any objects that were being animated, effectively stopping the animation. + * @copydoc Dali::Animation::Clear() */ void Clear(); @@ -173,7 +180,7 @@ public: /** * @copydoc Dali::Animation::FinishedSignal() */ - Dali::Animation::AnimationSignalV2& FinishedSignal(); + Dali::Animation::AnimationSignalType& FinishedSignal(); /** * Emit the Finished signal @@ -198,14 +205,7 @@ public: * @param[in] attributes The attributes with which to perfrom this action. * @return true if action was done */ - static bool DoAction(BaseObject* object, const std::string& actionName, const std::vector& attributes); - - /** - * This callback is intended for internal use only, to avoid the overhead of using a signal. - * @param[in] callback The callback function to connect. - * @param[in] object The internal object requesting the callback, or NULL. - */ - void SetFinishedCallback( FinishedCallback callback, Object* object ); + static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes); /** * @copydoc Dali::Animation::AnimateBy(Property target, Property::Value relativeValue) @@ -256,471 +256,80 @@ public: * @param [in] alpha The alpha function to apply. * @param [in] period The effect will occur during this time period. */ - void AnimateTo(ProxyObject& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period); - + void AnimateTo(Object& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period); /** - * Animate a property between the keyframe time / value pairs. - * It uses the current duration of the animation to run the key - * frame animator. Note, If the animation duration is subsequently - * changed, this does not change to match. - * - * @param[in] target The target object + property to animate - * @param[in] keyFrames The set of time / value pairs between which to animate. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames) */ void AnimateBetween(Property target, const KeyFrames& keyFrames); /** - * Animate a property between the keyframe time / value pairs. - * @param[in] target The target object + property to animate - * @param[in] keyFrames The set of time / value pairs between which to animate. - * @param[in] period The effect will occur duing this time period. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation) */ - void AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period); + void AnimateBetween(Property target, const KeyFrames& keyFrames, Interpolation interpolation ); /** - * Animate a property between the keyframe time / value pairs. - * @param[in] target The target object + property to animate - * @param[in] keyFrames The set of time / value pairs between which to animate. - * @param[in] alpha The alpha function to apply to the overall progress. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period) */ - void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha); - - /** - * Animate a property between the keyframe time / value pairs. - * @param[in] target The target object + property to animate - * @param[in] keyFrames The set of time / value pairs between which to animate. - * @param[in] alpha The alpha function to apply to the overall progress. - * @param[in] period The effect will occur duing this time period. - */ - void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period); - - // Action-specific convenience functions - - /** - * Translate an actor. - * The default alpha function will be used. - * The translation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] x Translation in the X-direction. - * @param [in] y Translation in the Y-direction. - * @param [in] z Translation in the Z-direction. - */ - void MoveBy(Actor& actor, float x, float y, float z); - - /** - * Translate an actor. This overload allows the alpha function to be customized. - * The translation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] translation The translation. - * @param [in] alpha The alpha function to apply. - */ - void MoveBy(Actor& actor, const Vector3& translation, AlphaFunction alpha); - - /** - * Translate an actor. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] translation The translation. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void MoveBy(Actor& actor, const Vector3& translation, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Translate an actor to a target position. - * The default alpha function will be used. - * The translation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] x Translation in the X-direction. - * @param [in] y Translation in the Y-direction. - * @param [in] z Translation in the Z-direction. - */ - void MoveTo(Actor& actor, float x, float y, float z); - - /** - * Translate an actor to a target position. This overload allows the alpha function to be customized. - * The translation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] translation The translation. - * @param [in] alpha The alpha function to apply. - */ - void MoveTo(Actor& actor, const Vector3& translation, AlphaFunction alpha); - - /** - * Translate an actor to a target position. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] translation The translation. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void MoveTo(Actor& actor, const Vector3& translation, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Rotate an actor around an arbitrary axis. - * The default alpha function will be used. - * The rotation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] angle The angle in radians. - * @param [in] axis The axis of rotation. - */ - void RotateBy(Actor& actor, Radian angle, const Vector3& axis); - - /** - * Rotate an actor around an arbitrary axis. This overload allows the alpha function to be customized. - * The rotation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] angle The angle in radians. - * @param [in] axis The axis of rotation. - * @param [in] alpha The alpha function to apply. - */ - void RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha); - - /** - * Rotate an actor around an arbitrary axis. This overload allows the rotation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values. - * @param [in] actor The actor to animate. - * @param [in] angle The angle in radians. - * @param [in] axis The axis of rotation. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the rotation. - */ - void RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Rotate an actor to a target orientation. - * The default alpha function will be used. - * The rotation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] angle The target rotation angle in radians. - * @param [in] axis The target axis of rotation. - */ - void RotateTo(Actor& actor, Radian angle, const Vector3& axis); + void AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period); /** - * Rotate an actor to a target orientation. - * The default alpha function will be used. - * The rotation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] orientation The target orientation. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation) */ - void RotateTo(Actor& actor, const Quaternion& orientation); + void AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation); /** - * Rotate an actor to a target orientation. This overload allows the alpha function to be customized. - * The rotation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] angle The target rotation angle in radians. - * @param [in] axis The target axis of rotation. - * @param [in] alpha The alpha function to apply. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha) */ - void RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha); + void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha); /** - * Rotate an actor to a target orientation. This overload allows the alpha function to be customized. - * The rotation will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] orientation The target orientation. - * @param [in] alpha The alpha function to apply. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation) */ - void RotateTo(Actor& actor, const Quaternion& orientation, AlphaFunction alpha); + void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation); /** - * Rotate an actor to a target orientation. This overload allows the rotation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] orientation The target orientation. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the rotation. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period) */ - void RotateTo(Actor& actor, const Quaternion& orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Rotate an actor to a target orientation. This overload allows the rotation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] angle The target rotation angle in radians. - * @param [in] axis The target axis of rotation. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the rotation. - */ - void RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds); + void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period); /** - * Scale an actor. - * The default alpha function will be used. - * The scaling will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] x Scale factor in the X-direction. - * @param [in] y Scale factor in the Y-direction. - * @param [in] z Scale factor in the Z-direction. + * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation ) */ - void ScaleBy(Actor& actor, float x, float y, float z); + void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation ); - /** - * Scale an actor. This overload allows the alpha function to be customized. - * The scaling will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] scale The scale factor. - * @param [in] alpha The alpha function to apply. - */ - void ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha); + // Actor-specific convenience functions /** - * Scale an actor. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] scale The scale factor. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. + * @copydoc Dali::Animation::Animate( Actor actor, Path path, const Vector3& forward ) */ - void ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds); + void Animate( Actor& actor, const Path& path, const Vector3& forward ); /** - * Scale an actor to a target scale factor. - * The default alpha function will be used. - * The scaling will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] x Target scale-factor in the X-direction. - * @param [in] y Target scale-factor in the Y-direction. - * @param [in] z Target scale-factor in the Z-direction. + * @copydoc Dali::Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha ) */ - void ScaleTo(Actor& actor, float x, float y, float z); + void Animate( Actor& actor, const Path& path, const Vector3& forward, AlphaFunction alpha ); /** - * Scale an actor to a target scale factor. This overload allows the alpha function to be customized. - * The scaling will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] scale The target scale factor. - * @param [in] alpha The alpha function to apply. + * @copydoc Dali::Animation::Animate( Actor actor, Path path, const Vector3& forward, TimePeriod period ) */ - void ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha); + void Animate( Actor& actor, const Path& path, const Vector3& forward, TimePeriod period ); /** - * Scale an actor to a target scale factor. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] scale The target scale factor. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. + * @copydoc Dali::Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period) */ - void ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds); + void Animate( Actor& actor, const Path& path, const Vector3& forward, AlphaFunction alpha, TimePeriod period); /** - * Show an actor during the animation. - * @param [in] actor The actor to animate. - * @param [in] delaySeconds The initial delay from the start of the animation. + * @copydoc Dali::Animation::Show() */ void Show(Actor& actor, float delaySeconds); /** - * Hide an actor during the animation. - * @param [in] actor The actor to animate. - * @param [in] delaySeconds The initial delay from the start of the animation. + * @copydoc Dali::Animation::Hide() */ void Hide(Actor& actor, float delaySeconds); - /** - * Animate the opacity of an actor. - * The default alpha function will be used. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] opacity The relative change in opacity. - */ - void OpacityBy(Actor& actor, float opacity); - - /** - * Animate the opacity of an actor. This overload allows the alpha function to be customized. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] opacity The relative change in opacity. - * @param [in] alpha The alpha function to apply. - */ - void OpacityBy(Actor& actor, float opacity, AlphaFunction alpha); - - /** - * Animate the opacity of an actor. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] opacity The relative change in opacity. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void OpacityBy(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Animate an actor to a target opacity. - * The default alpha function will be used. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] opacity The target opacity. - */ - void OpacityTo(Actor& actor, float opacity); - - /** - * Animate an actor to a target opacity. This overload allows the alpha function to be customized. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] opacity The target opacity. - * @param [in] alpha The alpha function to apply. - */ - void OpacityTo(Actor& actor, float opacity, AlphaFunction alpha); - - /** - * Animate an actor to a target opacity. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] opacity The target opacity. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void OpacityTo(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Animate the color of an actor. - * The default alpha function will be used. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] color The relative change in color. - */ - void ColorBy(Actor& actor, const Vector4& color); - - /** - * Animate the color of an actor. This overload allows the alpha function to be customized. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] color The relative change in color. - * @param [in] alpha The alpha function to apply. - */ - void ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha); - - /** - * Animate the color of an actor. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values. - * @param [in] actor The actor to animate. - * @param [in] color The relative change in color. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Animate an actor to a target color. - * The default alpha function will be used. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] color The target color. - */ - void ColorTo(Actor& actor, const Vector4& color); - - /** - * Animate an actor to a target color. This overload allows the alpha function to be customized. - * The effect will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] color The target color. - * @param [in] alpha The alpha function to apply. - */ - void ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha); - - /** - * Animate an actor to a target color. This overload allows the translation start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values. - * @param [in] actor The actor to animate. - * @param [in] color The target color. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Resize an actor. - * The default alpha function will be used. - * The resizing will start & end when the animation begins & ends. - * The depth defaults to the minimum of width & height. - * @param [in] actor The actor to animate. - * @param [in] width The target width. - * @param [in] height The target height. - */ - void Resize(Actor& actor, float width, float height); - - /** - * Resize an actor. This overload allows the alpha function to be customized. - * The resizing will start & end when the animation begins & ends. - * The depth defaults to the minimum of width & height. - * @param [in] actor The actor to animate. - * @param [in] width The target width. - * @param [in] height The target height. - * @param [in] alpha The alpha function to apply. - */ - void Resize(Actor& actor, float width, float height, AlphaFunction alpha); - - /** - * Resize an actor. This overload allows the resizing start & end time to be customized. - * The depth defaults to the minimum of width & height. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] width The target width. - * @param [in] height The target height. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void Resize(Actor& actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds); - - /** - * Resize an actor. - * The default alpha function will be used. - * The resizing will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] size The target size. - */ - void Resize(Actor& actor, const Vector3& size); - - /** - * Resize an actor. This overload allows the alpha function to be customized. - * The resizing will start & end when the animation begins & ends. - * @param [in] actor The actor to animate. - * @param [in] size The target size. - * @param [in] alpha The alpha function to apply. - */ - void Resize(Actor& actor, const Vector3& size, AlphaFunction alpha); - - /** - * Resize an actor. This overload allows the resizing start & end time to be customized. - * @pre delaySeconds must be zero or greater. - * @pre durationSeconds must be greater than zero. - * @param [in] actor The actor to animate. - * @param [in] size The target size. - * @param [in] alpha The alpha function to apply. - * @param [in] delaySeconds The initial delay from the start of the animation. - * @param [in] durationSeconds The duration of the translation. - */ - void Resize(Actor& actor, const Vector3& size, AlphaFunction alpha, float delaySeconds, float durationSeconds); - /* * @copydoc Dali::Animation::SetCurrentProgress() */ @@ -769,26 +378,26 @@ public: // For connecting animators to animations } /** - * Retrieve the UpdateManager associated with this animation. - * @return The UpdateManager. + * Retrieve the event thread services object + * @return The interface for sending messages to the scene graph */ - SceneGraph::UpdateManager& GetUpdateManager() + EventThreadServices& GetEventThreadServices() { - return mUpdateManager; + return mEventThreadServices; } protected: /** * Construct a new Animation. - * @param[in] updateManager The UpdateManager associated with this animation. + * @param[in] eventThreadServices The interface for sending messages to the scene graph * @param[in] playlist The list of currently playing animations. * @param[in] durationSeconds The duration of the animation in seconds. * @param[in] endAction The action to perform when the animation ends. * @param[in] disconnectAction The action to perform when the property owner of an animator is disconnected. * @param[in] defaultAlpha The default alpha function to apply to animators. */ - Animation( SceneGraph::UpdateManager& updateManager, + Animation( EventThreadServices& eventThreadServices, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, @@ -831,29 +440,34 @@ private: private: - SceneGraph::UpdateManager& mUpdateManager; - AnimationPlaylist& mPlaylist; + struct ConnectorTargetValues + { + unsigned int connectorIndex; + Property::Value targetValue; + }; const SceneGraph::Animation* mAnimation; - int mNotificationCount; ///< Keep track of how many Finished signals have been emitted. - - Dali::Animation::AnimationSignalV2 mFinishedSignal; + EventThreadServices& mEventThreadServices; + AnimationPlaylist& mPlaylist; - FinishedCallback mFinishedCallback; - Object* mFinishedCallbackObject; + Dali::Animation::AnimationSignalType mFinishedSignal; AnimatorConnectorContainer mConnectors; ///< Owned by the Animation - // Cached for public getters + std::vector< ConnectorTargetValues > mConnectorTargetValues; //< Used to store animating property target value information + + Vector2 mPlayRange; + float mDurationSeconds; float mSpeedFactor; - bool mIsLooping; - Vector2 mPlayRange; + int mNotificationCount; ///< Keep track of how many Finished signals have been emitted. + int mLoopCount; + int mCurrentLoop; EndAction mEndAction; EndAction mDisconnectAction; AlphaFunction mDefaultAlpha; - + Dali::Animation::State mState; }; } // namespace Internal