From: Seungkeun Date: Mon, 12 Aug 2024 04:04:28 +0000 (+0900) Subject: Update CSharp_Dali_NativeImageSource_SetSource X-Git-Tag: accepted/tizen/unified/20240813.181711~3^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a87f305cd7f84f2a54c3d24a8ea776388b1cc9e5;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git Update CSharp_Dali_NativeImageSource_SetSource - Updated API signature to use tbm_surface_h - Moved code place into tizen dependent place Change-Id: I15d8d33ffe80829e964ebd8111490c3d1f217b27 --- diff --git a/dali-csharp-binder/common/tizen-dependency-wrap.cpp b/dali-csharp-binder/common/tizen-dependency-wrap.cpp index 06eb44c8..7d0ac428 100644 --- a/dali-csharp-binder/common/tizen-dependency-wrap.cpp +++ b/dali-csharp-binder/common/tizen-dependency-wrap.cpp @@ -47,6 +47,33 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Texture_TbmSurface(tbm_surface_h tb return (void*)jresult; } + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_NativeImageSource_SetSource(void* jarg1, tbm_surface_h jarg2) +{ + Dali::NativeImageSource* pImage = (Dali::NativeImageSource*)jarg1; + Dali::Any source = (Dali::Any)jarg2; + + try { + pImage->SetSource(source); + } + catch (std::out_of_range & e) { + SWIG_CSharpException(SWIG_IndexError, const_cast(e.what())); + return; + } + catch (std::exception & e) { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(e.what())); + return; + } + catch (Dali::DaliException e) { + SWIG_CSharpException(SWIG_UnknownError, e.condition); + return; + } + catch (...) { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); + return; + } +} + #ifdef __cplusplus } #endif diff --git a/dali-csharp-binder/dali-adaptor/dali-adaptor-wrap.cpp b/dali-csharp-binder/dali-adaptor/dali-adaptor-wrap.cpp index 877afde6..6514f874 100644 --- a/dali-csharp-binder/dali-adaptor/dali-adaptor-wrap.cpp +++ b/dali-csharp-binder/dali-adaptor/dali-adaptor-wrap.cpp @@ -1362,32 +1362,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_NativeImageSource_Delete(void* jarg1) { } } -SWIGEXPORT void SWIGSTDCALL CSharp_Dali_NativeImageSource_SetSource(void* jarg1, void* jarg2) -{ - NativeImageSource* pImage = (NativeImageSource*)jarg1; - Any source = (Any)jarg2; - - try { - pImage->SetSource(source); - } - catch (std::out_of_range & e) { - SWIG_CSharpException(SWIG_IndexError, const_cast(e.what())); - return; - } - catch (std::exception & e) { - SWIG_CSharpException(SWIG_RuntimeError, const_cast(e.what())); - return; - } - catch (Dali::DaliException e) { - SWIG_CSharpException(SWIG_UnknownError, e.condition); - return; - } - catch (...) { - SWIG_CSharpException(SWIG_UnknownError, "unknown error"); - return; - } -} - SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_NativeImageSource_AcquireBuffer(void* jarg1, int* jarg2, int* jarg3, int* jarg4) { void* jresult;