X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftransition-effects%2Fcube-transition-effect-impl.h;h=f31728a7132438919921c63b75eb6b85779bd072;hp=25d1e1c2bc82aef4708ffd638ff2bbb98c38ace9;hb=7018f61b640b6fcf9cb576b537bafcb6bb8240e8;hpb=3f3cb4f8020f60d4d5dc672ddc426cb73126f80d diff --git a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h index 25d1e1c..f31728a 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h +++ b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__ -#define __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__ +#ifndef DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H +#define DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -20,7 +20,7 @@ // EXTERNAL INCLUDES #include -#include +#include // INTERNAL INCLUDES #include @@ -28,23 +28,18 @@ namespace Dali { - namespace Toolkit { - class CubeTransitionEffect; namespace Internal { - /** * CubeTransitionEffect implementation class */ class CubeTransitionEffect : public Control { - public: - /** * Destructor */ @@ -53,7 +48,7 @@ public: /** * @copydoc Toolkit::CubeTransitionEffect::SetTransitionDuration */ - void SetTransitionDuration( float duration ); + void SetTransitionDuration(float duration); /** * @copydoc Toolkit::CubeTransitionEffect::GetTransitionDuration @@ -63,7 +58,7 @@ public: /** * @copydoc Toolkit::CubeTransitionEffect::SetCubeDisplacement */ - void SetCubeDisplacement( float displacement ); + void SetCubeDisplacement(float displacement); /** * @copydoc Toolkit::CubeTransitionEffect::GetCubeDisplacement @@ -76,24 +71,24 @@ public: bool IsTransitioning(); /** - * @copydoc Toolkit::CubeTransitionEffect::SetFirstImage + * @copydoc Toolkit::CubeTransitionEffect::SetCurrentTexture */ - void SetCurrentImage( Image image ); + void SetCurrentTexture(Texture texture); /** - * @copydoc Toolkit::CubeTransitionEffect::SetTargetImage + * @copydoc Toolkit::CubeTransitionEffect::SetTargetTexture */ - void SetTargetImage( Image image ); + void SetTargetTexture(Texture texture); /** * @copydoc Toolkit::CubeTransitionEffect::StartTransition(bool) */ - void StartTransition( bool toNextImage = true ); + void StartTransition(bool toNextImage = true); /** * @copydoc Toolkit::CubeTransitionEffect::StartTransition(Vector2, Vector2) */ - void StartTransition( Vector2 panPosition, Vector2 panDisplacement ); + void StartTransition(Vector2 panPosition, Vector2 panDisplacement); /** * @copydoc Toolkit::CubeTransitionEffect::PauseTransition() @@ -111,7 +106,6 @@ public: void StopTransition(); public: //Signal - /** * @copydoc Toolkit::CubeTransitionEffect::TransitionCompletedSignal() */ @@ -126,28 +120,27 @@ public: //Signal * @return True if the signal was connected. * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor); protected: /** - * @copydoc CustomActorImpl::OnStageConnection() + * @copydoc CustomActorImpl::OnSceneConnection() */ - virtual void OnStageConnection( int depth ); + void OnSceneConnection(int depth) override; /** - * @copydoc CustomActorImpl::OnStageDisconnection() + * @copydoc CustomActorImpl::OnSceneDisconnection() */ - virtual void OnStageDisconnection(); + void OnSceneDisconnection() override; protected: - /** * Construct a new CubeTransitionEffect object * Called in the constructor of subclasses * @param[in] numRows How many rows of cubes * @param[in] numColumns How many columns of cubes */ - CubeTransitionEffect( unsigned int numRows, unsigned int numColumns ); + CubeTransitionEffect(unsigned int numRows, unsigned int numColumns); /** * Initialization steps: creating a layer, two groups of tiles, @@ -155,18 +148,16 @@ protected: */ void Initialize(); - protected: - void SetTargetLeft( unsigned int idx ); - void SetTargetRight( unsigned int idx ); - void SetTargetTop( unsigned int idx ); - void SetTargetBottom( unsigned int idx ); + void SetTargetLeft(unsigned int idx); + void SetTargetRight(unsigned int idx); + void SetTargetTop(unsigned int idx); + void SetTargetBottom(unsigned int idx); private: - /** * Callback function of transition animation finished - * Hide transition layer, show current imageActor, and set isAnimating flag to false + * Hide transition layer, show current image, and set isAnimating flag to false * @param[in] source The cube transition animation */ void OnTransitionFinished(Animation& source); @@ -175,7 +166,9 @@ private: * This method is called after the CubeTransitionEffect has been initialized. Derived classes should do * any second phase initialization by overriding this method. */ - virtual void OnInitialize() { } + virtual void OnInitialize() + { + } /** * This method is called after the a new transition is activated. @@ -183,56 +176,64 @@ private: * @param[in] panPosition The press down position of panGesture * @param[in] panDisplacement The displacement vector of panGesture */ - virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement ) {} + virtual void OnStartTransition(Vector2 panPosition, Vector2 panDisplacement) + { + } /** * This method is called when the transition is forced stop in the middle of animation. * Derived classed should set the rotation status of the cubes to the same as the final state when the animation is finished completely. * So that the next transition would be started correctly. */ - virtual void OnStopTransition() {} + virtual void OnStopTransition() + { + } - virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ); + void OnRelayout(const Vector2& size, RelayoutContainer& container) override; void ResetToInitialState(); - protected: - typedef std::vector< Actor > ActorArray; - enum FACE { TOP, BOTTOM, LEFT, RIGHT }; + typedef std::vector ActorArray; + enum FACE + { + TOP, + BOTTOM, + LEFT, + RIGHT + }; - ActorArray mBoxes; - Vector< FACE > mBoxType; - ActorArray mCurrentTiles; - ActorArray mTargetTiles; + ActorArray mBoxes; + Vector mBoxType; + ActorArray mCurrentTiles; + ActorArray mTargetTiles; - Actor mBoxRoot; + Actor mBoxRoot; - unsigned int mRows; - unsigned int mColumns; + unsigned int mRows; + unsigned int mColumns; - Renderer mCurrentRenderer; - Renderer mTargetRenderer; + Renderer mCurrentRenderer; + Renderer mTargetRenderer; - Image mCurrentImage; - Image mTargetImage; - Animation mAnimation; + Texture mCurrentTexture; + Texture mTargetTexture; - Vector2 mTileSize; + Animation mAnimation; - bool mIsAnimating; - bool mIsPaused; + Vector2 mTileSize; - float mAnimationDuration; - float mCubeDisplacement; + bool mIsAnimating; + bool mIsPaused; - static const Vector4 FULL_BRIGHTNESS; - static const Vector4 HALF_BRIGHTNESS; + float mAnimationDuration; + float mCubeDisplacement; -private: + static const Vector4 FULL_BRIGHTNESS; + static const Vector4 HALF_BRIGHTNESS; +private: Toolkit::CubeTransitionEffect::TransitionCompletedSignalType mTransitionCompletedSignal; - }; } // namespace Internal @@ -261,4 +262,4 @@ inline const Internal::CubeTransitionEffect& GetImpl(const Dali::Toolkit::CubeTr } // namespace Dali -#endif /* __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__ */ +#endif // DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H