Add CanvasView::Shape::AddPath api binder 30/262530/3
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 13 Aug 2021 02:06:30 +0000 (11:06 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Mon, 23 Aug 2021 01:32:20 +0000 (10:32 +0900)
Change-Id: I3484511ce5a694542a7d8b50032dab749a4cbfb3

dali-csharp-binder/src/canvas-view-wrap.cpp

index abdf90f..d92d0f8 100644 (file)
@@ -657,6 +657,48 @@ SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddCubicTo(
   return result;
 }
 
+SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddPath(
+    char *pShape, int *pCommands, unsigned int commandCount, float *pPoints,
+    unsigned int pointCount) {
+  Dali::CanvasRenderer::Shape shape;
+  bool result = false;
+
+  if (!pShape) {
+    SWIG_CSharpSetPendingExceptionArgument(
+        SWIG_CSharpArgumentNullException,
+        "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
+    return false;
+  }
+  shape = *(Dali::CanvasRenderer::Shape *)pShape;
+
+  if (!pCommands) {
+    SWIG_CSharpSetPendingExceptionArgument(
+        SWIG_CSharpArgumentNullException,
+        "Attempt to dereference null Commands", 0);
+    return false;
+  }
+
+  if (!pPoints) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
+                                           "Attempt to dereference null Points",
+                                           0);
+    return false;
+  }
+
+  {
+    try {
+      Dali::CanvasRenderer::Shape::PathCommands pathCommands = {
+          (Dali::CanvasRenderer::Shape::PathCommandType *)pCommands,
+          commandCount, pPoints, pointCount};
+
+      result = shape.AddPath(pathCommands);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return result;
+}
+
 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_Close(char *pShape) {
   Dali::CanvasRenderer::Shape shape;
   bool result = false;