X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fanimation%2Fanimation.cpp;h=fbb8a934600dc570b93732ad218bacff2ec73b5f;hb=0b501ba800a263b97d99adf224fc42d0c2aa8b37;hp=4663f95ec138cd5afaf67fdc8c69678cf1457195;hpb=3ebd19dd0b1e9beec0b01da6ac6c812dc6f6b95c;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/animation/animation.cpp b/dali/public-api/animation/animation.cpp index 4663f95..fbb8a93 100644 --- a/dali/public-api/animation/animation.cpp +++ b/dali/public-api/animation/animation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 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. @@ -19,18 +19,15 @@ #include // INTERNAL INCLUDES -#include -#include #include #include -#include +#include +#include +#include namespace Dali { - -Animation::Animation() -{ -} +Animation::Animation() = default; Animation::Animation(Internal::Animation* animation) : BaseHandle(animation) @@ -44,25 +41,20 @@ Animation Animation::New(float durationSeconds) return Animation(internal.Get()); } -Animation Animation::DownCast( BaseHandle handle ) +Animation Animation::DownCast(BaseHandle handle) { - return Animation( dynamic_cast(handle.GetObjectPtr()) ); + return Animation(dynamic_cast(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) { @@ -79,17 +71,17 @@ void Animation::SetLooping(bool looping) GetImplementation(*this).SetLooping(looping); } -void Animation::SetLoopCount(int count) +void Animation::SetLoopCount(int32_t count) { GetImplementation(*this).SetLoopCount(count); } -int Animation::GetLoopCount() +int32_t Animation::GetLoopCount() { return GetImplementation(*this).GetLoopCount(); } -int Animation::GetCurrentLoop() +int32_t Animation::GetCurrentLoop() { return GetImplementation(*this).GetCurrentLoop(); } @@ -109,9 +101,9 @@ Dali::Animation::EndAction Animation::GetEndAction() const 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 @@ -139,6 +131,10 @@ void Animation::PlayFrom(float progress) GetImplementation(*this).PlayFrom(progress); } +void Animation::PlayAfter(float delaySeconds) +{ + GetImplementation(*this).PlayAfter(delaySeconds); +} void Animation::Pause() { @@ -160,6 +156,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(); @@ -167,52 +173,52 @@ Animation::AnimationSignalType& Animation::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) @@ -222,7 +228,7 @@ void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod 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) @@ -235,7 +241,6 @@ void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunct 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); @@ -246,27 +251,26 @@ void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunct GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, period, interpolation); } - // Actor specific animations -void Animation::Animate( Actor actor, Path path, const Vector3& forward ) +void Animation::Animate(Actor actor, Path path, const Vector3& forward) { - GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward ); + GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward); } -void Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha ) +void Animation::Animate(Actor actor, Path path, const Vector3& forward, AlphaFunction alpha) { - GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, alpha ); + GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward, alpha); } -void Animation::Animate( Actor actor, Path path, const Vector3& forward, TimePeriod period ) +void Animation::Animate(Actor actor, Path path, const Vector3& forward, TimePeriod period) { - GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, period); + GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward, period); } -void Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod 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 ); + GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation(path), forward, alpha, period); } void Animation::Show(Actor actor, float delaySeconds) @@ -279,9 +283,9 @@ void Animation::Hide(Actor actor, float delaySeconds) GetImplementation(*this).Hide(GetImplementation(actor), delaySeconds); } -void Animation::SetCurrentProgress( float progress ) +void Animation::SetCurrentProgress(float progress) { - return GetImplementation(*this).SetCurrentProgress( progress ); + return GetImplementation(*this).SetCurrentProgress(progress); } float Animation::GetCurrentProgress() @@ -289,9 +293,9 @@ 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 @@ -299,7 +303,7 @@ float Animation::GetSpeedFactor() const return GetImplementation(*this).GetSpeedFactor(); } -void Animation::SetPlayRange( const Vector2& range ) +void Animation::SetPlayRange(const Vector2& range) { GetImplementation(*this).SetPlayRange(range); }