Add binding function for Window::SetPositionSize() 95/192895/2
authorJiyun Yang <ji.yang@samsung.com>
Mon, 12 Nov 2018 10:44:15 +0000 (19:44 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Fri, 16 Nov 2018 06:07:34 +0000 (15:07 +0900)
Window::SetPositionSize() is an in-house API for
atomic "move" and "resize" of the window.

Change-Id: I64017a6da47edc89141daa20926d742d55860357
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
dali-csharp-binder/src/window.cpp

index 6c7f0be..0ff624b 100755 (executable)
@@ -20,6 +20,7 @@
 
 #include "common.h"
 #include <dali/devel-api/adaptor-framework/drag-and-drop-detector.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/public-api/adaptor-framework/window.h>
 #include <dali/integration-api/adaptors/adaptor.h>
 
@@ -2452,6 +2453,43 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_GetPosition(void * jarg1) {
   return jresult;
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_SetPositionSize(void* jarg1, void* jarg2)
+{
+  Dali::Window* window = (Dali::Window*)jarg1;
+  if (!window) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Window", 0);
+    return ;
+  }
+
+  Dali::Rect<int>* positionSize = (Dali::Rect<int>*)jarg2;
+  if (!positionSize) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Rect< int > const & type is null", 0);
+    return ;
+  }
+  {
+    try {
+      Dali::DevelWindow::SetPositionSize(*window, *positionSize);
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(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_Window_SetTransparency(void * jarg1, unsigned int jarg2) {
   Dali::Window arg1 ;
   bool arg2 ;