Moved some Animation Devel APIs to the Public API 67/153767/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 29 Sep 2017 10:04:24 +0000 (11:04 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 29 Sep 2017 12:52:22 +0000 (13:52 +0100)
Change-Id: I00b44927867a3328d4fb59d7221c584eb3e453c6

automated-tests/src/dali/utc-Dali-Animation.cpp
dali/devel-api/animation/animation-devel.cpp
dali/devel-api/animation/animation-devel.h
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/animation-impl.h
dali/public-api/animation/animation.cpp
dali/public-api/animation/animation.h

index 9c2f9be..3327cb7 100644 (file)
@@ -11375,7 +11375,7 @@ int UtcDaliAnimationPlayAfterP(void)
   animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) );
 
   // Play animation after the initial delay time
-  DevelAnimation::PlayAfter( animation, 0.2f );
+  animation.PlayAfter( 0.2f );
   application.SendNotification();
   application.Render(0); // start animation
 
@@ -11435,7 +11435,7 @@ int UtcDaliAnimationPlayAfterP2(void)
   animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) );
 
   // Play animation after the initial delay time
-  DevelAnimation::PlayAfter( animation, 0.2f );
+  animation.PlayAfter( 0.2f );
   application.SendNotification();
   application.Render(0); // start animation
 
@@ -11505,7 +11505,7 @@ int UtcDaliAnimationPlayAfterP3(void)
   animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) );
 
   // When the delay time is negative value, it would treat as play immediately.
-  DevelAnimation::PlayAfter( animation, -2.0f );
+  animation.PlayAfter( -2.0f );
   application.SendNotification();
   application.Render(0); // start animation
 
@@ -11550,7 +11550,7 @@ int UtcDaliAnimationSetLoopingModeP(void)
 
     float durationSeconds( 1.0f );
     Animation animation = Animation::New( durationSeconds );
-    DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::RESTART );
+    DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::RESTART );
 
     Vector3 targetPosition(10.0f, 10.0f, 10.0f);
     animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
@@ -11584,8 +11584,8 @@ int UtcDaliAnimationSetLoopingModeP(void)
     Vector3 targetPosition(100.0f, 100.0f, 100.0f);
     animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
 
-    DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
-    DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+    animation.SetLoopingMode( Animation::LoopingMode::AUTO_REVERSE );
+    DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
 
     // Start the animation
     animation.Play();
@@ -11641,8 +11641,8 @@ int UtcDaliAnimationSetLoopingModeP(void)
     Vector3 targetPosition(100.0f, 100.0f, 100.0f);
     animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
 
-    DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
-    DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+    animation.SetLoopingMode( Animation::AUTO_REVERSE );
+    DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
 
     // Start the animation
     animation.Play();
@@ -11706,8 +11706,8 @@ int UtcDaliAnimationSetLoopingModeP2(void)
     Vector3 targetPosition(100.0f, 100.0f, 100.0f);
     animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
 
-    DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
-    DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+    animation.SetLoopingMode( Animation::AUTO_REVERSE );
+    DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
 
     // Start the animation
     animation.Play();
@@ -11771,8 +11771,8 @@ int UtcDaliAnimationSetLoopingModeP2(void)
     Vector3 targetPosition(100.0f, 100.0f, 100.0f);
     animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
 
-    DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
-    DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+    animation.SetLoopingMode( Animation::AUTO_REVERSE );
+    DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
 
     // Start the animation
     animation.Play();
@@ -11826,10 +11826,10 @@ int UtcDaliAnimationGetLoopingModeP(void)
   Animation animation = Animation::New(1.0f);
 
   // default mode
-  DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::RESTART );
+  DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::RESTART );
 
-  DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
-  DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+  animation.SetLoopingMode( Animation::AUTO_REVERSE );
+  DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
 
   END_TEST;
 }
index 79ebbb3..0840ae7 100644 (file)
@@ -40,21 +40,6 @@ Animation::AnimationSignalType& ProgressReachedSignal( Animation animation )
   return GetImplementation( animation ).ProgressReachedSignal();
 }
 
-void PlayAfter( Animation animation, float delaySeconds )
-{
-  GetImplementation( animation ).PlayAfter( delaySeconds );
-}
-
-void SetLoopingMode( Animation animation, LoopingMode loopingMode )
-{
-  GetImplementation( animation ).SetLoopingMode( loopingMode );
-}
-
-LoopingMode GetLoopingMode( Animation animation )
-{
-  return GetImplementation(animation).GetLoopingMode();
-}
-
 } // namespace DevelAnimation
 
 } // namespace Dali
index 209b4b0..b106f6f 100644 (file)
@@ -28,15 +28,6 @@ namespace DevelAnimation
 {
 
 /**
- * @brief Enumeration for what looping mode is in.
- */
-enum LoopingMode
-{
-  RESTART,      ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning.
-  AUTO_REVERSE  ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again.
-};
-
-/**
  * @brief Set progress percentage marker to trigger ProgressHasBeenReachedSignal
  *
  * @param[in] animation the animation object to perform this operation on
@@ -60,33 +51,6 @@ DALI_IMPORT_API float GetProgressNotification( Animation animation );
  */
 DALI_IMPORT_API Animation::AnimationSignalType& ProgressReachedSignal( Animation animation );
 
-/**
- * @brief Play the animation after a given delay time.
- *
- * The delay time is not included in the looping time.
- * When the delay time is negative value, it would treat as play immediately.
- * @param[in] animation The animation object to perform this operation on
- * @param[in] delaySeconds The delay time
- */
-DALI_IMPORT_API void PlayAfter( Animation animation, float delaySeconds );
-
-/**
- * @brief Sets the looping mode.
- *
- * Animation plays forwards and then restarts from the beginning or runs backwards again.
- * @param[in] animation The animation object to perform this operation on
- * @param[in] loopingMode The looping mode is one of RESTART and AUTO_REVERSE
- */
-DALI_IMPORT_API void SetLoopingMode( Animation animation, LoopingMode loopingMode );
-
-/**
- * @brief Gets one of the current looping mode.
- *
- * @param[in] animation The animation object to perform this operation on
- * @return The current looping mode
- */
-DALI_IMPORT_API LoopingMode GetLoopingMode( Animation animation );
-
 } // namespace DevelAnimation
 
 } // namespace Dali
index 7290bb3..876c7e6 100644 (file)
@@ -1024,17 +1024,17 @@ Vector2 Animation::GetPlayRange() const
   return mPlayRange;
 }
 
-void Animation::SetLoopingMode( DevelAnimation::LoopingMode loopingMode )
+void Animation::SetLoopingMode( Dali::Animation::LoopingMode loopingMode )
 {
-  mAutoReverseEnabled = ( loopingMode == DevelAnimation::LoopingMode::AUTO_REVERSE );
+  mAutoReverseEnabled = ( loopingMode == Dali::Animation::LoopingMode::AUTO_REVERSE );
 
   // mAnimation is being used in a separate thread; queue a message to set play range
   SetLoopingModeMessage( mEventThreadServices, *mAnimation, mAutoReverseEnabled );
 }
 
-DevelAnimation::LoopingMode Animation::GetLoopingMode()
+Dali::Animation::LoopingMode Animation::GetLoopingMode() const
 {
-  return mAutoReverseEnabled ? DevelAnimation::LoopingMode::AUTO_REVERSE : DevelAnimation::LoopingMode::RESTART;
+  return mAutoReverseEnabled ? Dali::Animation::AUTO_REVERSE : Dali::Animation::RESTART;
 }
 
 bool Animation::CompareConnectorEndTimes( const Animation::ConnectorTargetValues& lhs, const Animation::ConnectorTargetValues& rhs )
index 760ef02..ad61dba 100644 (file)
@@ -398,12 +398,12 @@ public:
   /**
    * @copydoc Dali::Animation::SetLoopingMode()
    */
-  void SetLoopingMode( Dali::DevelAnimation::LoopingMode loopingMode );
+  void SetLoopingMode( Dali::Animation::LoopingMode loopingMode );
 
   /**
    * @copydoc Dali::Animation::GetLoopingMode()
    */
-  Dali::DevelAnimation::LoopingMode GetLoopingMode();
+  Dali::Animation::LoopingMode GetLoopingMode() const;
 
 public: // For connecting animators to animations
 
index 0e14bdb..980223d 100644 (file)
@@ -139,6 +139,10 @@ void Animation::PlayFrom(float progress)
   GetImplementation(*this).PlayFrom(progress);
 }
 
+void Animation::PlayAfter( float delaySeconds )
+{
+  GetImplementation( *this ).PlayAfter( delaySeconds );
+}
 
 void Animation::Pause()
 {
@@ -160,6 +164,16 @@ void Animation::Clear()
   GetImplementation(*this).Clear();
 }
 
+void Animation::SetLoopingMode( LoopingMode loopingMode )
+{
+  GetImplementation( *this ).SetLoopingMode( loopingMode );
+}
+
+Animation::LoopingMode Animation::GetLoopingMode() const
+{
+  return GetImplementation( *this ).GetLoopingMode();
+}
+
 Animation::AnimationSignalType& Animation::FinishedSignal()
 {
   return GetImplementation(*this).FinishedSignal();
index c73e2b0..715c8ea 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_ANIMATION_H__
-#define __DALI_ANIMATION_H__
+#ifndef DALI_ANIMATION_H
+#define DALI_ANIMATION_H
 
 /*
  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
@@ -161,6 +161,17 @@ public:
   };
 
   /**
+   * @brief Enumeration for what looping mode is in.
+   *
+   * @SINCE_1_2.60
+   */
+  enum LoopingMode
+  {
+    RESTART,      ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning. @SINCE_1_2.60
+    AUTO_REVERSE  ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again. @SINCE_1_2.60
+  };
+
+  /**
    * @brief Creates an uninitialized Animation; this can be initialized with Animation::New().
    *
    * Calling member functions with an uninitialized Animation handle is not allowed.
@@ -419,6 +430,16 @@ public:
   void PlayFrom( float progress );
 
   /**
+   * @brief Play the animation after a given delay time.
+   *
+   * The delay time is not included in the looping time.
+   * When the delay time is negative value, it would treat as play immediately.
+   * @SINCE_1_2.60
+   * @param[in] delaySeconds The delay time
+   */
+  void PlayAfter( float delaySeconds );
+
+  /**
    * @brief Pauses the animation.
    * @SINCE_1_0.0
    */
@@ -446,6 +467,23 @@ public:
   void Clear();
 
   /**
+   * @brief Sets the looping mode.
+   *
+   * Animation plays forwards and then restarts from the beginning or runs backwards again.
+   * @SINCE_1_2.60
+   * @param[in] loopingMode The looping mode is one of RESTART and AUTO_REVERSE
+   */
+  void SetLoopingMode( LoopingMode loopingMode );
+
+  /**
+   * @brief Gets one of the current looping mode.
+   *
+   * @SINCE_1_2.60
+   * @return The current looping mode
+   */
+  LoopingMode GetLoopingMode() const;
+
+  /**
    * @brief Connects to this signal to be notified when an Animation's animations have finished.
    *
    * @SINCE_1_0.0
@@ -720,4 +758,4 @@ public: // Not intended for use by Application developers
  */
 } // namespace Dali
 
-#endif // __DALI_ANIMATION_H__
+#endif // DALI_ANIMATION_H