[NUI] VectorGraphics: Add Shape.Reset api
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 14 Apr 2021 02:09:01 +0000 (11:09 +0900)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 20 Apr 2021 06:13:00 +0000 (15:13 +0900)
There was no way to modify or remote previously added path information.
The user can update the shape by deleting the path information
and adding a new path information by using Reset() API.

src/Tizen.NUI/src/internal/Interop/Interop.Shape.cs
src/Tizen.NUI/src/public/BaseComponents/VectorGraphcis/Shape.cs

index 9838180..71e89c5 100755 (executable)
@@ -45,6 +45,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_Close")]
             public static extern bool Close(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_Reset")]
+            public static extern bool Reset(global::System.Runtime.InteropServices.HandleRef jarg1);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetFillColor")]
             public static extern void SetFillColor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
index fddd1a3..4c7dd4a 100755 (executable)
@@ -362,5 +362,18 @@ namespace Tizen.NUI.BaseComponents.VectorGraphics
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
+
+        /// <summary>
+        /// Reset the added path(rect, circle, path, etc...) information.
+        /// Color and Stroke information are keeped.
+        /// </summary>
+        /// <returns>True when it's successful. False otherwise.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool Reset()
+        {
+            bool ret = Interop.Shape.Reset(BaseHandle.getCPtr(this));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
     }
 }