(VectorRenderer) Add a method to get a default size 30/202630/3
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 2 Apr 2019 05:03:40 +0000 (14:03 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 10 Apr 2019 01:24:49 +0000 (01:24 +0000)
Change-Id: Ia1b19695bcf3a9f8b71ed3bf5627c135911e645b

dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h
dali/devel-api/adaptor-framework/vector-animation-renderer.cpp
dali/devel-api/adaptor-framework/vector-animation-renderer.h
dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp
dali/internal/vector-animation/common/vector-animation-renderer-impl.h
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h

index b371733..a9f25c6 100644 (file)
@@ -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* (*)();
index c02bc16..e7f8129 100755 (executable)
@@ -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
index f7faf21..abb911e 100755 (executable)
@@ -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
index 0ff6586..3f1d9ea 100644 (file)
@@ -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
index d3e53b4..56ab9b2 100755 (executable)
@@ -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:
 
   /**
index 6217e1d..dff90c3 100644 (file)
@@ -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
index 30e0da3..119c0c4 100644 (file)
@@ -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