From cb7d66b3e43f9e2a6854b34a03e0bc7800ac6e52 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Wed, 4 Sep 2024 14:25:29 +0900 Subject: [PATCH] [NUI] Bind FrameUpdateCallback / EventThreadCallback / ProcessorController native release API Signed-off-by: Eunki, Hong --- src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs | 3 ++- src/Tizen.NUI/src/internal/Common/ProcessorController.cs | 8 ++++++++ .../src/internal/Interop/Interop.EventThreadCallback.cs | 3 +++ .../Interop/Interop.FrameUpdateCallbackInterface.cs | 3 +++ .../src/internal/Interop/Interop.ProcessorController.cs | 3 +++ .../src/public/Common/FrameUpdateCallbackInterface.cs | 8 ++++++++ 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs b/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs index 9115d078f..8ebd257d4 100755 --- a/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs +++ b/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs @@ -31,7 +31,8 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { - //NDalicManualPINVOKE.DeleteEventThreadCallback(swigCPtr); + Interop.EventThreadCallback.DeleteEventThreadCallback(swigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); } public EventThreadCallback(CallbackDelegate func) : this(Interop.EventThreadCallback.NewEventThreadCallback(func), true) diff --git a/src/Tizen.NUI/src/internal/Common/ProcessorController.cs b/src/Tizen.NUI/src/internal/Common/ProcessorController.cs index e40e9f721..f59aea7e1 100755 --- a/src/Tizen.NUI/src/internal/Common/ProcessorController.cs +++ b/src/Tizen.NUI/src/internal/Common/ProcessorController.cs @@ -52,6 +52,14 @@ namespace Tizen.NUI { } + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ProcessorController.DeleteProcessorController(swigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ProcessorEventHandler(); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs b/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs index af8a9c272..e50919882 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs @@ -24,6 +24,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_EventThreadCallback")] public static extern global::System.IntPtr NewEventThreadCallback(Tizen.NUI.EventThreadCallback.CallbackDelegate delegate1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_EventThreadCallback")] + public static extern void DeleteEventThreadCallback(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_EventThreadCallback_Trigger")] public static extern void Trigger(global::System.Runtime.InteropServices.HandleRef jarg1); } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs b/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs index 2c0ff9384..8a6dbf122 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs @@ -24,6 +24,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_FrameCallbackInterface")] public static extern global::System.IntPtr newFrameUpdateCallbackInterface(); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_FrameCallbackInterface")] + public static extern void DeleteFrameUpdateCallbackInterface(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_director_connect_with_return")] public static extern void FrameUpdateCallbackInterfaceDirectorConnectV1(global::System.Runtime.InteropServices.HandleRef jarg1, Tizen.NUI.FrameUpdateCallbackInterface.DelegateFrameUpdateCallbackInterfaceV1 delegate1); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs index ce3f97c78..bc37d526c 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs @@ -25,6 +25,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ProcessorController_Without_Initialize")] public static extern global::System.IntPtr NewWithoutInitialize(); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ProcessorController")] + public static extern void DeleteProcessorController(global::System.Runtime.InteropServices.HandleRef processorController); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ProcessorController_Initialize")] public static extern void Initialize(global::System.Runtime.InteropServices.HandleRef processorController); diff --git a/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs b/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs index 86405ba44..2a4297153 100755 --- a/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs +++ b/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs @@ -49,6 +49,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.FrameUpdateCallbackInterface.DeleteFrameUpdateCallbackInterface(swigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public uint UpdateCallbackVersion => onUpdateCallbackVersion; -- 2.34.1