Binder for the Image utility functions 20/248120/1
authorSeungho Baek <sbsh.baek@samsung.com>
Mon, 23 Nov 2020 00:54:54 +0000 (09:54 +0900)
committerSeungho Baek <sbsh.baek@samsung.com>
Mon, 23 Nov 2020 01:01:03 +0000 (10:01 +0900)
Change-Id: I1481f09e84f0896fe80fda9ea03e548f53814a10
Signed-off-by: Seungho Baek <sbsh.baek@samsung.com>
dali-csharp-binder/src/dali_wrap.cpp

index 6404804..b4f1ed4 100755 (executable)
@@ -498,6 +498,8 @@ void SWIG_CSharpException(int code, const char *msg) {
 #include <dali/devel-api/update/frame-callback-interface.h>
 #include <dali/devel-api/update/update-proxy.h>
 
+#include <dali-toolkit/public-api/image-loader/image.h>
+
 
 // add here SWIG version check
 
@@ -15271,6 +15273,45 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Dali_PixelData_GetPixelFormat(void * jarg1) {
   return jresult;
 }
 
+SWIGEXPORT char* SWIGSTDCALL CSharp_Dali_PixelData_GenerateUrl(void* handle)
+{
+  std::string url = "";
+  Dali::PixelData* pixelData = (Dali::PixelData*)handle;
+
+  if (!pixelData)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "some argument is null", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      url = Dali::Toolkit::Image::GenerateUrl(*pixelData);
+    }
+    catch (std::out_of_range& e)
+    {
+      SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what()));
+      return 0;
+    }
+    catch (std::exception& e)
+    {
+      SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what()));
+      return 0;
+    }
+    catch (Dali::DaliException e)
+    {
+      SWIG_CSharpException(SWIG_UnknownError, e.condition);
+      return 0;
+    }
+    catch (...)
+    {
+      SWIG_CSharpException(SWIG_UnknownError, "unknown error");
+      return 0;
+    }
+  }
+  return SWIG_csharp_string_callback( (const char *)url.c_str() );
+}
+
 
 SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_POSITIVE_X_get() {
   unsigned int jresult ;
@@ -58605,6 +58646,45 @@ SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_NativeImageSource_ReleaseBuffer(void* ja
   return jresult;
 }
 
+SWIGEXPORT char* SWIGSTDCALL CSharp_Dali_NativeImageSource_GenerateUrl(void* handle)
+{
+  std::string url = "";
+  NativeImageSource* nativeImageSource = (NativeImageSource*)handle;
+
+  if (!nativeImageSource)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "some argument is null", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      url = Dali::Toolkit::Image::GenerateUrl(nativeImageSource);
+    }
+    catch (std::out_of_range& e)
+    {
+      SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what()));
+      return 0;
+    }
+    catch (std::exception& e)
+    {
+      SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what()));
+      return 0;
+    }
+    catch (Dali::DaliException e)
+    {
+      SWIG_CSharpException(SWIG_UnknownError, e.condition);
+      return 0;
+    }
+    catch (...)
+    {
+      SWIG_CSharpException(SWIG_UnknownError, "unknown error");
+      return 0;
+    }
+  }
+  return SWIG_csharp_string_callback( (const char *)url.c_str() );
+}
+
 
 #ifdef __cplusplus
 }