Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / animation-impl.h
index a23223e..6d715fe 100644 (file)
@@ -61,12 +61,11 @@ using AnimationConstIter = AnimationContainer::const_iterator;
 class Animation : public BaseObject
 {
 public:
-
-  enum Type
+  enum Type : uint8_t
   {
-    TO,      ///< Animating TO the given value
-    BY,      ///< Animating BY the given value
-    BETWEEN  ///< Animating BETWEEN key-frames
+    TO,     ///< Animating TO the given value
+    BY,     ///< Animating BY the given value
+    BETWEEN ///< Animating BETWEEN key-frames
   };
 
   using EndAction     = Dali::Animation::EndAction;
@@ -245,42 +244,42 @@ public:
   /**
    * @copydoc Dali::Animation::AnimateBy(Property target, Property::Value relativeValue)
    */
-  void AnimateBy(Property& target, Property::Value& relativeValue);
+  void AnimateBy(Property& target, Property::Value relativeValue);
 
   /**
    * @copydoc Dali::Animation::AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha)
    */
-  void AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha);
+  void AnimateBy(Property& target, Property::Value relativeValue, AlphaFunction alpha);
 
   /**
    * @copydoc Dali::Animation::AnimateBy(Property target, Property::Value relativeValue, TimePeriod period)
    */
-  void AnimateBy(Property& target, Property::Value& relativeValue, TimePeriod period);
+  void AnimateBy(Property& target, Property::Value relativeValue, TimePeriod period);
 
   /**
    * @copydoc Dali::Animation::AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period)
    */
-  void AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period);
+  void AnimateBy(Property& target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period);
 
   /**
    * @copydoc Dali::Animation::AnimateTo(Property target, Property::Value destinationValue)
    */
-  void AnimateTo(Property& target, Property::Value& destinationValue);
+  void AnimateTo(Property& target, Property::Value destinationValue);
 
   /**
    * @copydoc Dali::Animation::AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha)
    */
-  void AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha);
+  void AnimateTo(Property& target, Property::Value destinationValue, AlphaFunction alpha);
 
   /**
    * @copydoc Dali::Animation::AnimateTo(Property target, Property::Value destinationValue, TimePeriod period)
    */
-  void AnimateTo(Property& target, Property::Value& destinationValue, TimePeriod period);
+  void AnimateTo(Property& target, Property::Value destinationValue, TimePeriod period);
 
   /**
    * @copydoc Dali::Animation::AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period)
    */
-  void AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period);
+  void AnimateTo(Property& target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period);
 
   /**
    * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames)
@@ -476,21 +475,23 @@ private:
 
   struct ConnectorTargetValues
   {
-    ConnectorTargetValues()
-    : targetValue(),
-      timePeriod( 0.0f ),
-      connectorIndex( 0 ),
-      animatorType( TO )
+    ConnectorTargetValues() = default;
+
+    ConnectorTargetValues(Property::Value value, TimePeriod time, std::size_t index, Animation::Type type)
+    : targetValue(std::move(value)),
+      timePeriod(time),
+      connectorIndex(index),
+      animatorType(type)
     {
     }
 
     Property::Value targetValue;
-    TimePeriod timePeriod;
-    std::size_t connectorIndex;
-    Animation::Type animatorType;
+    TimePeriod      timePeriod{0.f};
+    std::size_t     connectorIndex{0};
+    Animation::Type animatorType{TO};
   };
 
-  enum class Notify
+  enum class Notify : uint8_t
   {
     USE_CURRENT_VALUE,   ///< Set the current value for the property
     USE_TARGET_VALUE,    ///< Set the animator's target value for the property
@@ -519,36 +520,33 @@ private:
   void SendFinalProgressNotificationMessage();
 
 private:
+  using AnimatorConnectorContainer     = OwnerContainer<AnimatorConnectorBase*>;
+  using ConnectorTargetValuesContainer = std::vector<ConnectorTargetValues>;
 
-  const SceneGraph::Animation* mAnimation;
+  const SceneGraph::Animation* mAnimation{ nullptr };
 
   EventThreadServices& mEventThreadServices;
-  AnimationPlaylist& mPlaylist;
-
-  Dali::Animation::AnimationSignalType mFinishedSignal;
-
-  Dali::Animation::AnimationSignalType mProgressReachedSignal;
-
-  using AnimatorConnectorContainer = OwnerContainer<AnimatorConnectorBase*>;
-  AnimatorConnectorContainer mConnectors; ///< Owned by the Animation
-
-  using ConnectorTargetValuesContainer = std::vector<ConnectorTargetValues>;
-  ConnectorTargetValuesContainer mConnectorTargetValues; //< Used to store animating property target value information
-
-  Vector2 mPlayRange;
-
-  float mDurationSeconds;
-  float mSpeedFactor;
-  int32_t mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
-  int32_t mLoopCount;
-  int32_t mCurrentLoop;
-  EndAction mEndAction;
-  EndAction mDisconnectAction;
-  AlphaFunction mDefaultAlpha;
-  Dali::Animation::State mState;
-  float mProgressReachedMarker;
-  float mDelaySeconds;
-  bool mAutoReverseEnabled;  ///< Flag to identify that the looping mode is auto reverse.
+  AnimationPlaylist&   mPlaylist;
+
+  Dali::Animation::AnimationSignalType mFinishedSignal{};
+  Dali::Animation::AnimationSignalType mProgressReachedSignal{};
+
+  AnimatorConnectorContainer     mConnectors{};            ///< Owned by the Animation
+  ConnectorTargetValuesContainer mConnectorTargetValues{}; //< Used to store animating property target value information
+
+  AlphaFunction          mDefaultAlpha;
+  Vector2                mPlayRange{0.0f, 1.0f};
+  float                  mDurationSeconds;
+  float                  mSpeedFactor{1.0f};
+  int32_t                mNotificationCount{0}; ///< Keep track of how many Finished signals have been emitted.
+  int32_t                mLoopCount{1};
+  int32_t                mCurrentLoop{0};
+  float                  mProgressReachedMarker{0.0f};
+  float                  mDelaySeconds{0.0f};
+  EndAction              mEndAction;
+  EndAction              mDisconnectAction;
+  Dali::Animation::State mState{Dali::Animation::STOPPED};
+  bool                   mAutoReverseEnabled{false}; ///< Flag to identify that the looping mode is auto reverse.
 };
 
 } // namespace Internal