(Vector) Add a signal for texture uploading 68/212468/2
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 22 Aug 2019 01:22:58 +0000 (10:22 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 26 Aug 2019 02:02:26 +0000 (02:02 +0000)
Change-Id: I094f6e724e4498377640b6a89eff98efd57fa0b5

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 3669695..6fa992d 100644 (file)
@@ -22,6 +22,9 @@
 #include <dali/public-api/rendering/renderer.h>
 #include <string>
 
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
+
 namespace Dali
 {
 
@@ -34,6 +37,8 @@ class VectorAnimationRendererPlugin
 {
 public:
 
+  using UploadCompletedSignalType = Dali::VectorAnimationRenderer::UploadCompletedSignalType;
+
   /**
    * @brief Constructor
    */
@@ -96,6 +101,13 @@ public:
   virtual void GetDefaultSize( uint32_t& width, uint32_t& height ) const = 0;
 
   /**
+   * @brief Connect to this signal to be notified when the texture upload is completed.
+   *
+   * @return The signal to connect to.
+   */
+  virtual UploadCompletedSignalType& UploadCompletedSignal() = 0;
+
+  /**
    * @brief Function pointer called in adaptor to create a plugin instance.
    */
   using CreateVectorAnimationRendererFunction = VectorAnimationRendererPlugin* (*)();
index 906e87c..e9fe5e0 100755 (executable)
@@ -89,4 +89,9 @@ void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height
   GetImplementation( *this ).GetDefaultSize( width, height );
 }
 
+VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
+{
+  return GetImplementation( *this ).UploadCompletedSignal();
+}
+
 } // namespace Dali
index cc8a6c3..0c0a24a 100755 (executable)
@@ -47,6 +47,9 @@ class DALI_ADAPTOR_API VectorAnimationRenderer : public BaseHandle
 {
 public:
 
+  /// @brief UploadCompleted signal type.
+  using UploadCompletedSignalType = Signal< void () >;
+
   /**
    * @brief Creates an initialized handle to a new VectorAnimationRenderer.
    *
@@ -127,6 +130,13 @@ public:
 
 public: // Signals
 
+  /**
+   * @brief Connect to this signal to be notified when the texture upload is completed.
+   *
+   * @return The signal to connect to.
+   */
+  UploadCompletedSignalType& UploadCompletedSignal();
+
 public: // Not intended for application developers
 
   /// @cond internal
index 8c7a649..885861f 100644 (file)
@@ -95,6 +95,11 @@ void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height
   mPlugin.GetDefaultSize( width, height );
 }
 
+Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
+{
+  return mPlugin.UploadCompletedSignal();
+}
+
 } // namespace Adaptor
 
 } // namespace internal
index 7bdafb5..1bc7bac 100755 (executable)
@@ -40,7 +40,7 @@ using VectorAnimationRendererPtr = IntrusivePtr< VectorAnimationRenderer >;
 /**
  * Dali internal VectorAnimationRenderer.
  */
-class VectorAnimationRenderer : public BaseObject
+class VectorAnimationRenderer : public BaseObject, public ConnectionTracker
 {
 public:
 
@@ -86,6 +86,11 @@ public:
    */
   void GetDefaultSize( uint32_t& width, uint32_t& height ) const;
 
+  /**
+   * @copydoc Dali::VectorAnimationRenderer::UploadCompletedSignal()
+   */
+  Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal();
+
 private:
 
   /**
index c3cb5b4..b704c58 100644 (file)
@@ -43,7 +43,8 @@ VectorAnimationRendererPluginProxy::VectorAnimationRendererPluginProxy( const st
 : mSharedObjectName(),
   mLibHandle( NULL ),
   mPlugin( NULL ),
-  mCreateVectorAnimationRendererPtr( NULL )
+  mCreateVectorAnimationRendererPtr( NULL ),
+  mDefaultSignal()
 {
   if( !sharedObjectName.empty() )
   {
@@ -160,6 +161,15 @@ void VectorAnimationRendererPluginProxy::GetDefaultSize( uint32_t& width, uint32
   }
 }
 
+VectorAnimationRendererPlugin::UploadCompletedSignalType& VectorAnimationRendererPluginProxy::UploadCompletedSignal()
+{
+  if( mPlugin )
+  {
+    return mPlugin->UploadCompletedSignal();
+  }
+  return mDefaultSignal;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 4f56692..2c6267b 100644 (file)
@@ -82,6 +82,11 @@ public:
    */
   void GetDefaultSize( uint32_t& width, uint32_t& height ) const;
 
+  /**
+   * @copydoc Dali::VectorAnimationRendererPlugin::UploadCompletedSignal()
+   */
+  VectorAnimationRendererPlugin::UploadCompletedSignalType& UploadCompletedSignal();
+
   // Not copyable or movable
   VectorAnimationRendererPluginProxy( const VectorAnimationRendererPluginProxy& ) = delete; ///< Deleted copy constructor
   VectorAnimationRendererPluginProxy( VectorAnimationRendererPluginProxy&& ) = delete; ///< Deleted move constructor
@@ -104,6 +109,7 @@ private:
   Dali::VectorAnimationRendererPlugin*   mPlugin;             ///< Plugin handle
 
   CreateVectorAnimationRendererFunction  mCreateVectorAnimationRendererPtr;   ///< Function pointer called in adaptor to create a plugin instance
+  VectorAnimationRendererPlugin::UploadCompletedSignalType mDefaultSignal;
 
 };