X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fvisuals%2Fanimated-vector-image-visual-actions-devel.h;h=ecb91ae72302b83b523090b3fa39f33864fa8bb4;hp=92d4e8e5ad480b90841ad3c69ce7192b114366ee;hb=HEAD;hpb=1904135eb98e7c97a060d26f301cac9e6f2f4538 diff --git a/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h b/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h index 92d4e8e..b17e79d 100644 --- a/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h +++ b/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_ACTIONS_DEVEL_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -18,15 +18,19 @@ * */ +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include + namespace Dali { - namespace Toolkit { - namespace DevelAnimatedVectorImageVisual { - /** * @brief Actions that the animated vector image visual can perform. These actions are called through the Visual::Base::DoAction API. */ @@ -37,15 +41,44 @@ namespace Action */ enum Type { - PLAY, ///< Play the animated vector image. - PAUSE, ///< Pause the animated vector image. - STOP, ///< Stop the animated vector image. This is also Default playback mode. - JUMP_TO, ///< Jump to the specified frame. Property::FLOAT value should be passed. - UPDATE_PROPERTY ///< Update the properties of the animated vector image. + // Shared actions with AnimatedImageVisual + PLAY = DevelAnimatedImageVisual::Action::PLAY, ///< Play the animated vector image. + PAUSE = DevelAnimatedImageVisual::Action::PAUSE, ///< Pause the animated vector image. + STOP = DevelAnimatedImageVisual::Action::STOP, ///< Stop the animated vector image. This is also Default playback mode. + JUMP_TO = DevelAnimatedImageVisual::Action::JUMP_TO, ///< Jump to the specified frame. Property::INTEGER value should be passed. + + // AnimatedVectorImageVisual only actions + SET_DYNAMIC_PROPERTY = DevelAnimatedImageVisual::Action::ANIMATED_IMAGE_VISUAL_ACTION_END_INDEX, ///< Set the dynamic property. + + FLUSH, ///< Flush animation data. It will make ensure that changeness of animated vector image properties flushed. }; } // namespace Action +/** + * @brief The dynamic property info + * + * @note A callback of the following type may be used: + * @code + * Property::Value MyFunction(int32_t id, VectorAnimationRenderer::VectorProperty property, uint32_t frameNumber); + * @endcode + * + * id The id to specify the callback. + * property The property that represent what you are trying to change. + * frameNumber The current frame number. + * It returns a Property::Value to set according to the property type. + * + * The callback will be called on the worker thread. You MUST not call other DALi methods in the callback. + * And the object must still be alive when the callback occurs if you make the callback from a class member function. + */ +struct DynamicPropertyInfo +{ + int32_t id; ///< The Id to specify the callback. It should be unique and will be passed when the callback is called. + std::string keyPath; ///< The key path used to target a specific content or a set of contents that will be updated. + int32_t property; ///< The property to set. + CallbackBase* callback; ///< The callback that gets called every time the animation is rendered. Ownership of the callback is passed onto the visual. +}; + } // namespace DevelAnimatedVectorImageVisual } // namespace Toolkit