/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <dali/public-api/animation/animation.h>
// INTERNAL INCLUDES
-#include <dali/public-api/animation/alpha-functions.h>
-#include <dali/public-api/animation/time-period.h>
-#include <dali/public-api/math/quaternion.h>
-#include <dali/public-api/math/degree.h>
-#include <dali/public-api/math/radian.h>
-#include <dali/public-api/math/vector2.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/animation/animation-impl.h>
-#include <dali/internal/event/effects/shader-effect-impl.h>
+#include <dali/internal/event/animation/path-impl.h>
+#include <dali/public-api/animation/alpha-function.h>
+#include <dali/public-api/animation/time-period.h>
namespace Dali
{
-
-Animation::Animation()
-{
-}
+Animation::Animation() = default;
Animation::Animation(Internal::Animation* animation)
: BaseHandle(animation)
return Animation(internal.Get());
}
-Animation Animation::DownCast( BaseHandle handle )
+Animation Animation::DownCast(BaseHandle handle)
{
- return Animation( dynamic_cast<Dali::Internal::Animation*>(handle.GetObjectPtr()) );
+ return Animation(dynamic_cast<Dali::Internal::Animation*>(handle.GetObjectPtr()));
}
-Animation::~Animation()
-{
-}
+Animation::~Animation() = default;
-Animation::Animation(const Animation& handle)
-: BaseHandle(handle)
-{
-}
+Animation::Animation(const Animation& handle) = default;
-Animation& Animation::operator=(const Animation& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+Animation& Animation::operator=(const Animation& rhs) = default;
+
+Animation::Animation(Animation&& rhs) noexcept = default;
+
+Animation& Animation::operator=(Animation&& rhs) noexcept = default;
void Animation::SetDuration(float durationSeconds)
{
GetImplementation(*this).SetLooping(looping);
}
+void Animation::SetLoopCount(int32_t count)
+{
+ GetImplementation(*this).SetLoopCount(count);
+}
+
+int32_t Animation::GetLoopCount()
+{
+ return GetImplementation(*this).GetLoopCount();
+}
+
+int32_t Animation::GetCurrentLoop()
+{
+ return GetImplementation(*this).GetCurrentLoop();
+}
+
bool Animation::IsLooping() const
{
return GetImplementation(*this).IsLooping();
return GetImplementation(*this).GetEndAction();
}
-void Animation::SetDisconnectAction( Animation::EndAction disconnectAction )
+void Animation::SetDisconnectAction(Animation::EndAction disconnectAction)
{
- GetImplementation(*this).SetDisconnectAction( disconnectAction );
+ GetImplementation(*this).SetDisconnectAction(disconnectAction);
}
Animation::EndAction Animation::GetDisconnectAction() const
GetImplementation(*this).PlayFrom(progress);
}
+void Animation::PlayAfter(float delaySeconds)
+{
+ GetImplementation(*this).PlayAfter(delaySeconds);
+}
void Animation::Pause()
{
GetImplementation(*this).Pause();
}
+Dali::Animation::State Animation::GetState() const
+{
+ return GetImplementation(*this).GetState();
+}
+
void Animation::Stop()
{
GetImplementation(*this).Stop();
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();
void Animation::AnimateBy(Property target, Property::Value relativeValue)
{
- GetImplementation(*this).AnimateBy(target, relativeValue);
+ GetImplementation(*this).AnimateBy(target, std::move(relativeValue));
}
void Animation::AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha)
{
- GetImplementation(*this).AnimateBy(target, relativeValue, alpha);
+ GetImplementation(*this).AnimateBy(target, std::move(relativeValue), alpha);
}
void Animation::AnimateBy(Property target, Property::Value relativeValue, TimePeriod period)
{
- GetImplementation(*this).AnimateBy(target, relativeValue, period);
+ GetImplementation(*this).AnimateBy(target, std::move(relativeValue), period);
}
void Animation::AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period)
{
- GetImplementation(*this).AnimateBy(target, relativeValue, alpha, period);
+ GetImplementation(*this).AnimateBy(target, std::move(relativeValue), alpha, period);
}
void Animation::AnimateTo(Property target, Property::Value destinationValue)
{
- GetImplementation(*this).AnimateTo(target, destinationValue);
+ GetImplementation(*this).AnimateTo(target, std::move(destinationValue));
}
void Animation::AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha)
{
- GetImplementation(*this).AnimateTo(target, destinationValue, alpha);
+ GetImplementation(*this).AnimateTo(target, std::move(destinationValue), alpha);
}
void Animation::AnimateTo(Property target, Property::Value destinationValue, TimePeriod period)
{
- GetImplementation(*this).AnimateTo(target, destinationValue, period);
+ GetImplementation(*this).AnimateTo(target, std::move(destinationValue), period);
}
void Animation::AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period)
{
- GetImplementation(*this).AnimateTo(target, destinationValue, alpha, period);
+ GetImplementation(*this).AnimateTo(target, std::move(destinationValue), alpha, period);
}
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames )
+void Animation::AnimateBetween(Property target, KeyFrames& keyFrames)
{
- GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames) );
+ GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames));
}
void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation)
{
- GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), interpolation );
+ GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), interpolation);
}
void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period)
void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
{
- GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), period, interpolation );
+ GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), period, interpolation);
}
void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha)
GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, interpolation);
}
-
void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
{
GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, period);
GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, period, interpolation);
}
-
// Actor specific animations
-void Animation::Animate( Actor actor, Path path, const Vector3& forward )
-{
- GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward );
-}
-
-void Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha )
-{
- GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, alpha );
-}
-
-void Animation::Animate( Actor actor, Path path, const Vector3& forward, TimePeriod period )
-{
- GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, period);
-}
-
-void Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period)
-{
- GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, alpha, period );
-}
-
-void Animation::MoveBy(Actor actor, float x, float y, float z)
-{
- GetImplementation(*this).MoveBy(GetImplementation(actor), x, y, z);
-}
-
-void Animation::MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha)
-{
- GetImplementation(*this).MoveBy(GetImplementation(actor), displacement, alpha);
-}
-
-void Animation::MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).MoveBy(GetImplementation(actor), displacement, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::MoveTo(Actor actor, float x, float y, float z)
-{
- GetImplementation(*this).MoveTo(GetImplementation(actor), x, y, z);
-}
-
-void Animation::MoveTo(Actor actor, Vector3 position, AlphaFunction alpha)
-{
- GetImplementation(*this).MoveTo(GetImplementation(actor), position, alpha);
-}
-
-void Animation::MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).MoveTo(GetImplementation(actor), position, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateBy(Actor actor, Degree angle, Vector3 axis)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), Radian(angle), axis);
-}
-
-void Animation::RotateBy(Actor actor, Radian angle, Vector3 axis)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), angle, axis);
-}
-
-void Animation::RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), Radian(angle), axis, alpha);
-}
-
-void Animation::RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), angle, axis, alpha);
-}
-
-void Animation::RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), Radian(angle), axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), angle, axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor actor, Degree angle, Vector3 axis)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), Radian(angle), axis);
-}
-
-void Animation::RotateTo(Actor actor, Radian angle, Vector3 axis)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), angle, axis);
-}
-
-void Animation::RotateTo(Actor actor, Quaternion rotation)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), rotation);
-}
-
-void Animation::RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), Radian(angle), axis, alpha);
-}
-
-void Animation::RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), angle, axis, alpha);
-}
-
-void Animation::RotateTo(Actor actor, Quaternion rotation, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), rotation, alpha);
-}
-
-void Animation::RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), Radian(angle), axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), angle, axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor actor, Quaternion rotation, AlphaFunction alpha, float delaySeconds, float durationSeconds)
+void Animation::Animate(Actor actor, Path path, const Vector3& forward)
{
- GetImplementation(*this).RotateTo(GetImplementation(actor), rotation, alpha, delaySeconds, durationSeconds);
+ GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward);
}
-void Animation::ScaleBy(Actor actor, float x, float y, float z)
+void Animation::Animate(Actor actor, Path path, const Vector3& forward, AlphaFunction alpha)
{
- GetImplementation(*this).ScaleBy(GetImplementation(actor), x, y, z);
+ GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward, alpha);
}
-void Animation::ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha)
+void Animation::Animate(Actor actor, Path path, const Vector3& forward, TimePeriod period)
{
- GetImplementation(*this).ScaleBy(GetImplementation(actor), scale, alpha);
+ GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward, period);
}
-void Animation::ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
+void Animation::Animate(Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period)
{
- GetImplementation(*this).ScaleBy(GetImplementation(actor), scale, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::ScaleTo(Actor actor, float x, float y, float z)
-{
- GetImplementation(*this).ScaleTo(GetImplementation(actor), x, y, z);
-}
-
-void Animation::ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha)
-{
- GetImplementation(*this).ScaleTo(GetImplementation(actor), scale, alpha);
-}
-
-void Animation::ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).ScaleTo(GetImplementation(actor), scale, alpha, delaySeconds, durationSeconds);
+ GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward, alpha, period);
}
void Animation::Show(Actor actor, float delaySeconds)
GetImplementation(*this).Hide(GetImplementation(actor), delaySeconds);
}
-void Animation::OpacityBy(Actor actor, float opacity)
-{
- GetImplementation(*this).OpacityBy(GetImplementation(actor), opacity);
-}
-
-void Animation::OpacityBy(Actor actor, float opacity, AlphaFunction alpha)
-{
- GetImplementation(*this).OpacityBy(GetImplementation(actor), opacity, alpha);
-}
-
-void Animation::OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).OpacityBy(GetImplementation(actor), opacity, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::OpacityTo(Actor actor, float opacity)
-{
- GetImplementation(*this).OpacityTo(GetImplementation(actor), opacity);
-}
-
-void Animation::OpacityTo(Actor actor, float opacity, AlphaFunction alpha)
-{
- GetImplementation(*this).OpacityTo(GetImplementation(actor), opacity, alpha);
-}
-
-void Animation::OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).OpacityTo(GetImplementation(actor), opacity, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::ColorBy(Actor actor, Vector4 color)
-{
- GetImplementation(*this).ColorBy(GetImplementation(actor), color);
-}
-
-void Animation::ColorBy(Actor actor, Vector4 color, AlphaFunction alpha)
-{
- GetImplementation(*this).ColorBy(GetImplementation(actor), color, alpha);
-}
-
-void Animation::ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).ColorBy(GetImplementation(actor), color, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::ColorTo(Actor actor, Vector4 color)
-{
- GetImplementation(*this).ColorTo(GetImplementation(actor), color);
-}
-
-void Animation::ColorTo(Actor actor, Vector4 color, AlphaFunction alpha)
-{
- GetImplementation(*this).ColorTo(GetImplementation(actor), color, alpha);
-}
-
-void Animation::ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).ColorTo(GetImplementation(actor), color, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::Resize(Actor actor, float width, float height)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), width, height);
-}
-
-void Animation::Resize(Actor actor, float width, float height, AlphaFunction alpha)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), width, height, alpha);
-}
-
-void Animation::Resize(Actor actor,float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), width, height, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::Resize(Actor actor, Vector3 size)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), size);
-}
-
-void Animation::Resize(Actor actor, Vector3 size, AlphaFunction alpha)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), size, alpha);
-}
-
-void Animation::Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), size, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::SetCurrentProgress( float progress )
+void Animation::SetCurrentProgress(float progress)
{
- return GetImplementation(*this).SetCurrentProgress( progress );
+ return GetImplementation(*this).SetCurrentProgress(progress);
}
float Animation::GetCurrentProgress()
return GetImplementation(*this).GetCurrentProgress();
}
-void Animation::SetSpeedFactor( float factor )
+void Animation::SetSpeedFactor(float factor)
{
- GetImplementation(*this).SetSpeedFactor( factor );
+ GetImplementation(*this).SetSpeedFactor(factor);
}
float Animation::GetSpeedFactor() const
return GetImplementation(*this).GetSpeedFactor();
}
-void Animation::SetPlayRange( const Vector2& range )
+void Animation::SetPlayRange(const Vector2& range)
{
GetImplementation(*this).SetPlayRange(range);
}