From 3800c7756c9f6b064c96ba288e39bc23d7e5fba5 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Tue, 2 Apr 2019 14:03:40 +0900 Subject: [PATCH] (VectorRenderer) Add a method to get a default size Change-Id: Ia1b19695bcf3a9f8b71ed3bf5627c135911e645b --- .../vector-animation-renderer-plugin.h | 18 +++++++++--------- .../vector-animation-renderer.cpp | 10 +++++----- .../adaptor-framework/vector-animation-renderer.h | 14 +++++++------- .../common/vector-animation-renderer-impl.cpp | 12 ++++++------ .../common/vector-animation-renderer-impl.h | 10 +++++----- .../vector-animation-renderer-plugin-proxy.cpp | 22 +++++++++++----------- .../vector-animation-renderer-plugin-proxy.h | 14 +++++++------- 7 files changed, 50 insertions(+), 50 deletions(-) diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h b/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h index b371733..a9f25c6 100644 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h @@ -45,11 +45,11 @@ public: virtual ~VectorAnimationRendererPlugin() {} /** - * @brief Sets the url of the animation file. + * @brief Second-phase constructor. * * @param[in] url The url of the animation file */ - virtual void SetUrl( const std::string& url ) = 0; + virtual bool Initialize( const std::string& url ) = 0; /** * @brief Sets the renderer used to display the result image. @@ -67,13 +67,6 @@ public: virtual void SetSize( uint32_t width, uint32_t height ) = 0; /** - * @brief Starts the rendering. - * - * @return True if the renderer is successfully started, false otherwise - */ - virtual bool StartRender() = 0; - - /** * @brief Stops the rendering. */ virtual void StopRender() = 0; @@ -100,6 +93,13 @@ public: virtual float GetFrameRate() const = 0; /** + * @brief Gets the default size of the file,. + * + * @return The default size of the file + */ + virtual void GetDefaultSize( uint32_t& width, uint32_t& height ) const = 0; + + /** * @brief Function pointer called in adaptor to create a plugin instance. */ using CreateVectorAnimationRendererFunction = VectorAnimationRendererPlugin* (*)(); diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp b/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp index c02bc16..e7f8129 100755 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp @@ -69,11 +69,6 @@ void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height ) GetImplementation( *this ).SetSize( width, height ); } -bool VectorAnimationRenderer::StartRender() -{ - return GetImplementation( *this ).StartRender(); -} - void VectorAnimationRenderer::StopRender() { GetImplementation( *this ).StopRender(); @@ -94,4 +89,9 @@ float VectorAnimationRenderer::GetFrameRate() const return GetImplementation( *this ).GetFrameRate(); } +void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height ) const +{ + GetImplementation( *this ).GetDefaultSize( width, height ); +} + } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer.h b/dali/devel-api/adaptor-framework/vector-animation-renderer.h index f7faf21..abb911e 100755 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer.h +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer.h @@ -97,13 +97,6 @@ public: void SetSize( uint32_t width, uint32_t height ); /** - * @brief Starts the rendering. - * - * @return True if the renderer is successfully started, false otherwise. - */ - bool StartRender(); - - /** * @brief Stops the rendering. */ void StopRender(); @@ -129,6 +122,13 @@ public: */ float GetFrameRate() const; + /** + * @brief Gets the default size of the file,. + * + * @return The default size of the file + */ + void GetDefaultSize( uint32_t& width, uint32_t& height ) const; + public: // Signals public: // Not intended for application developers diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp b/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp index 0ff6586..3f1d9ea 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp +++ b/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp @@ -62,7 +62,7 @@ VectorAnimationRenderer::~VectorAnimationRenderer() void VectorAnimationRenderer::Initialize( const std::string& url ) { - mPlugin.SetUrl( url ); + mPlugin.Initialize( url ); } void VectorAnimationRenderer::SetRenderer( Dali::Renderer renderer ) @@ -75,11 +75,6 @@ void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height ) mPlugin.SetSize( width, height ); } -bool VectorAnimationRenderer::StartRender() -{ - return mPlugin.StartRender(); -} - void VectorAnimationRenderer::StopRender() { mPlugin.StopRender(); @@ -100,6 +95,11 @@ float VectorAnimationRenderer::GetFrameRate() const return mPlugin.GetFrameRate(); } +void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height ) const +{ + mPlugin.GetDefaultSize( width, height ); +} + } // namespace Adaptor } // namespace internal diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-impl.h b/dali/internal/vector-animation/common/vector-animation-renderer-impl.h index d3e53b4..56ab9b2 100755 --- a/dali/internal/vector-animation/common/vector-animation-renderer-impl.h +++ b/dali/internal/vector-animation/common/vector-animation-renderer-impl.h @@ -67,11 +67,6 @@ public: void SetSize( uint32_t width, uint32_t height ); /** - * @copydoc Dali::VectorAnimationRenderer::StartRender() - */ - bool StartRender(); - - /** * @copydoc Dali::VectorAnimationRenderer::StopRender() */ void StopRender(); @@ -91,6 +86,11 @@ public: */ float GetFrameRate() const; + /** + * @copydoc Dali::VectorAnimationRenderer::GetDefaultSize() + */ + void GetDefaultSize( uint32_t& width, uint32_t& height ) const; + private: /** diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp index 6217e1d..dff90c3 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp +++ b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp @@ -100,12 +100,13 @@ void VectorAnimationRendererPluginProxy::Initialize() } } -void VectorAnimationRendererPluginProxy::SetUrl( const std::string& url ) +bool VectorAnimationRendererPluginProxy::Initialize( const std::string& url ) { if( mPlugin ) { - mPlugin->SetUrl( url ); + return mPlugin->Initialize( url ); } + return false; } void VectorAnimationRendererPluginProxy::SetRenderer( Dali::Renderer renderer ) @@ -124,15 +125,6 @@ void VectorAnimationRendererPluginProxy::SetSize( uint32_t width, uint32_t heigh } } -bool VectorAnimationRendererPluginProxy::StartRender() -{ - if( mPlugin ) - { - return mPlugin->StartRender(); - } - return false; -} - void VectorAnimationRendererPluginProxy::StopRender() { if( mPlugin ) @@ -167,6 +159,14 @@ float VectorAnimationRendererPluginProxy::GetFrameRate() const return 0.0f; } +void VectorAnimationRendererPluginProxy::GetDefaultSize( uint32_t& width, uint32_t& height ) const +{ + if( mPlugin ) + { + mPlugin->GetDefaultSize( width, height ); + } +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h index 30e0da3..119c0c4 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h +++ b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h @@ -48,9 +48,9 @@ public: ~VectorAnimationRendererPluginProxy(); /** - * @copydoc Dali::VectorAnimationRendererPlugin::SetUrl() + * @copydoc Dali::VectorAnimationRendererPlugin::Initialize() */ - void SetUrl( const std::string& url ); + bool Initialize( const std::string& url ); /** * @copydoc Dali::VectorAnimationRendererPlugin::SetRenderer() @@ -63,11 +63,6 @@ public: void SetSize( uint32_t width, uint32_t height ); /** - * @copydoc Dali::VectorAnimationRendererPlugin::StartRender() - */ - bool StartRender(); - - /** * @copydoc Dali::VectorAnimationRendererPlugin::StopRender() */ void StopRender(); @@ -87,6 +82,11 @@ public: */ float GetFrameRate() const; + /** + * @copydoc Dali::VectorAnimationRendererPlugin::GetDefaultSize() + */ + void GetDefaultSize( uint32_t& width, uint32_t& height ) const; + // Not copyable or movable VectorAnimationRendererPluginProxy( const VectorAnimationRendererPluginProxy& ) = delete; ///< Deleted copy constructor VectorAnimationRendererPluginProxy( VectorAnimationRendererPluginProxy&& ) = delete; ///< Deleted move constructor -- 2.7.4