From cf65a2b87c3a6646dd6868d0efdb4c700a47840b Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 2 Aug 2021 14:53:02 +0900 Subject: [PATCH] [NUI] CanvasView::DrawableGroup: Add RemoveDrawable method Add a method to selectively remove the added drawable. --- .../src/internal/Interop/Interop.DrawableGroup.cs | 4 ++++ .../BaseComponents/VectorGraphics/DrawableGroup.cs | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.DrawableGroup.cs b/src/Tizen.NUI/src/internal/Interop/Interop.DrawableGroup.cs index ae68e40..81c3602 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.DrawableGroup.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.DrawableGroup.cs @@ -28,6 +28,10 @@ namespace Tizen.NUI [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool AddDrawable(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DrawableGroup_RemoveDrawable")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool RemoveDrawable(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DrawableGroup_RemoveAllDrawables")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool RemoveAllDrawables(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/DrawableGroup.cs b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/DrawableGroup.cs index 3bffc92..2c86635 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/DrawableGroup.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/DrawableGroup.cs @@ -64,6 +64,24 @@ namespace Tizen.NUI.BaseComponents.VectorGraphics } /// + /// Remove drawable object to the DrawableGroup. + /// This method is similar to deregistration. + /// + /// Drawable object + /// Thrown when drawable is null. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RemoveDrawable(Drawable drawable) + { + if (drawable == null) + { + throw new ArgumentNullException(nameof(drawable)); + } + Interop.DrawableGroup.RemoveDrawable(View.getCPtr(this), BaseHandle.getCPtr(drawable)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + drawables.Remove(drawable); + } + + /// /// Clears the drawable object added to the DrawableGroup. /// This method does not free the memory of the added drawable object. /// -- 2.7.4