-#ifndef __DALI_INTERNAL_SCENE_GRAPH_ANIMATION_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_ANIMATION_H__
+#ifndef DALI_INTERNAL_SCENE_GRAPH_ANIMATION_H
+#define DALI_INTERNAL_SCENE_GRAPH_ANIMATION_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
namespace SceneGraph
{
-class Animation;
-
-typedef OwnerContainer< Animation* > AnimationContainer;
-
-typedef AnimationContainer::Iterator AnimationIter;
-typedef AnimationContainer::ConstIterator AnimationConstIter;
-
/**
* Animations are used to change the properties of scene graph objects, as part of a scene
* managers "update" phase. An animation is a container of Animator objects; the actual setting
{
public:
- typedef Dali::Animation::EndAction EndAction;
+ using EndAction = Dali::Animation::EndAction;
enum State
{
* @param[in] disconnectAction The action to perform when the property owner of an animator is disconnected.
* @return A new Animation
*/
- static Animation* New( float durationSeconds, float speedFactor, const Vector2& playRange, int loopCount, EndAction endAction, EndAction disconnectAction );
+ static Animation* New( float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, EndAction endAction, EndAction disconnectAction );
/**
* Virtual destructor
* 0 is loop forever, N loop play N times
* @param[in] loopCount The loop count
*/
- void SetLoopCount(int loopCount);
+ void SetLoopCount(int32_t loopCount);
/**
* Query whether the animation will loop.
* Get the loop count
* @return the loop count
*/
- int GetLoopCount() const
+ int32_t GetLoopCount() const
{
return mLoopCount;
}
* Retrive a count of the number of times the animation has been played to completion.
* This can be used to emit "Finised" signals from the public-api
*/
- int GetPlayedCount() const
+ int32_t GetPlayedCount() const
{
return mPlayedCount;
}
/**
* Get the current loop count from zero to GetLoopCount().
*/
- int GetCurrentLoop() const
+ int32_t GetCurrentLoop() const
{
return mCurrentLoop;
}
void AddAnimator( OwnerPointer<AnimatorBase>& animator );
/**
- * Retrieve the animators from an animation.
- * @return The container of animators.
- */
- AnimatorContainer& GetAnimators()
- {
- return mAnimators;
- }
-
- /**
* This causes the animators to change the properties of objects in the scene graph.
* @pre The animation is playing or paused.
* @param[in] bufferIndex The buffer to update.
/**
* Protected constructor. See New()
*/
- Animation( float durationSeconds, float speedFactor, const Vector2& playRange, int loopCount, EndAction endAction, EndAction disconnectAction );
+ Animation( float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, EndAction endAction, EndAction disconnectAction );
private:
protected:
- AnimatorContainer mAnimators;
+ OwnerContainer< AnimatorBase* > mAnimators;
Vector2 mPlayRange;
float mSpeedFactor;
float mProgressMarker; // Progress marker to trigger a notification
- int mPlayedCount; // Incremented at end of animation or completion of all loops
+ int32_t mPlayedCount; // Incremented at end of animation or completion of all loops
// Never incremented when looping forever. Event thread tracks to signal end.
- int mLoopCount; // N loop setting
- int mCurrentLoop; // Current loop number
+ int32_t mLoopCount; // N loop setting
+ int32_t mCurrentLoop; // Current loop number
EndAction mEndAction;
EndAction mDisconnectAction;
inline void SetDurationMessage( EventThreadServices& eventThreadServices, const Animation& animation, float durationSeconds )
{
- typedef MessageValue1< Animation, float > LocalType;
+ using LocalType = MessageValue1< Animation, float >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetDuration, durationSeconds );
inline void SetProgressNotificationMessage( EventThreadServices& eventThreadServices, const Animation& animation, float progress )
{
- typedef MessageValue1< Animation, float > LocalType;
+ using LocalType = MessageValue1< Animation, float >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetProgressNotification, progress );
}
-inline void SetLoopingMessage( EventThreadServices& eventThreadServices, const Animation& animation, int loopCount )
+inline void SetLoopingMessage( EventThreadServices& eventThreadServices, const Animation& animation, int32_t loopCount )
{
- typedef MessageValue1< Animation, int > LocalType;
+ using LocalType = MessageValue1< Animation, int32_t >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetLoopCount, loopCount );
inline void SetEndActionMessage( EventThreadServices& eventThreadServices, const Animation& animation, Dali::Animation::EndAction action )
{
- typedef MessageValue1< Animation, Dali::Animation::EndAction > LocalType;
+ using LocalType = MessageValue1< Animation, Dali::Animation::EndAction >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetEndAction, action );
inline void SetDisconnectActionMessage( EventThreadServices& eventThreadServices, const Animation& animation, Dali::Animation::EndAction action )
{
- typedef MessageValue1< Animation, Dali::Animation::EndAction > LocalType;
+ using LocalType = MessageValue1< Animation, Dali::Animation::EndAction >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetDisconnectAction, action );
inline void SetCurrentProgressMessage( EventThreadServices& eventThreadServices, const Animation& animation, float progress )
{
- typedef MessageValue1< Animation, float > LocalType;
+ using LocalType = MessageValue1< Animation, float >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetCurrentProgress, progress );
inline void SetSpeedFactorMessage( EventThreadServices& eventThreadServices, const Animation& animation, float factor )
{
- typedef MessageValue1< Animation, float > LocalType;
+ using LocalType = MessageValue1< Animation, float >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetSpeedFactor, factor );
inline void SetPlayRangeMessage( EventThreadServices& eventThreadServices, const Animation& animation, const Vector2& range )
{
- typedef MessageValue1< Animation, Vector2 > LocalType;
+ using LocalType = MessageValue1< Animation, Vector2 >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetPlayRange, range );
inline void PlayAnimationMessage( EventThreadServices& eventThreadServices, const Animation& animation )
{
- typedef Message< Animation > LocalType;
+ using LocalType = Message< Animation >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::Play );
inline void PlayAnimationFromMessage( EventThreadServices& eventThreadServices, const Animation& animation, float progress )
{
- typedef MessageValue1< Animation,float > LocalType;
+ using LocalType = MessageValue1< Animation, float >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::PlayFrom, progress );
inline void PauseAnimationMessage( EventThreadServices& eventThreadServices, const Animation& animation )
{
- typedef Message< Animation > LocalType;
+ using LocalType = Message< Animation >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::Pause );
inline void AddAnimatorMessage( EventThreadServices& eventThreadServices, const Animation& animation, AnimatorBase& animator )
{
- typedef MessageValue1< Animation, OwnerPointer<AnimatorBase> > LocalType;
+ using LocalType = MessageValue1< Animation, OwnerPointer<AnimatorBase> >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
OwnerPointer<AnimatorBase> parameter( &animator );
inline void PlayAfterMessage( EventThreadServices& eventThreadServices, const Animation& animation, float delaySeconds )
{
- typedef MessageValue1< Animation, float > LocalType;
+ using LocalType = MessageValue1< Animation, float >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::PlayAfter, delaySeconds );
inline void SetLoopingModeMessage( EventThreadServices& eventThreadServices, const Animation& animation, bool loopingMode )
{
- typedef MessageValue1< Animation, bool > LocalType;
+ using LocalType = MessageValue1< Animation, bool >;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &animation, &Animation::SetLoopingMode, loopingMode );
} // namespace Dali
-#endif // __DALI_INTERNAL_SCENE_GRAPH_ANIMATION_H__
+#endif // DALI_INTERNAL_SCENE_GRAPH_ANIMATION_H