From: Eunki Hong Date: Sun, 19 May 2024 12:28:35 +0000 (+0900) Subject: [NUI] Add ID value of Animation + Bind more API for RenderTask X-Git-Tag: submit/tizen/20240520.054849~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ade198225013d93fbdc0afefa8f37e7f96eb57aa;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add ID value of Animation + Bind more API for RenderTask Let we bind the getter of Animation and RenderTask's ID integer. Also, bind some more API that we added recently. Required DALI patches : https://review.tizen.org/gerrit/c/platform/core/uifw/dali-csharp-binder/+/311349 Signed-off-by: Eunki Hong --- diff --git a/src/Tizen.NUI/src/internal/Common/RenderTask.cs b/src/Tizen.NUI/src/internal/Common/RenderTask.cs index b4f509521..ac8fbca79 100755 --- a/src/Tizen.NUI/src/internal/Common/RenderTask.cs +++ b/src/Tizen.NUI/src/internal/Common/RenderTask.cs @@ -185,6 +185,7 @@ namespace Tizen.NUI public View GetSourceView() { + // TODO : Fix me, to avoid memory leak issue. View ret = new View(Interop.RenderTask.GetSourceActor(SwigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -241,6 +242,7 @@ namespace Tizen.NUI public FrameBuffer GetFrameBuffer() { + // TODO : Fix me, to avoid memory leak issue. FrameBuffer ret = new FrameBuffer(Interop.RenderTask.GetFrameBuffer(SwigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -268,6 +270,7 @@ namespace Tizen.NUI public View GetScreenToFrameBufferMappingView() { + // TODO : Fix me, to avoid memory leak issue. View ret = new View(Interop.RenderTask.GetScreenToFrameBufferMappingActor(SwigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -366,6 +369,20 @@ namespace Tizen.NUI return ret; } + public void RenderUntil(View view) + { + Interop.RenderTask.RenderUntil(SwigCPtr, View.getCPtr(view)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + + public View GetStopperView() + { + // TODO : Fix me, to avoid memory leak issue. + View ret = new View(Interop.RenderTask.GetStopperView(SwigCPtr), true); + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + public bool WorldToViewport(Vector3 position, out float viewportX, out float viewportY) { bool ret = Interop.RenderTask.WorldToViewport(SwigCPtr, Vector3.getCPtr(position), out viewportX, out viewportY); @@ -462,5 +479,73 @@ namespace Tizen.NUI setVal?.Dispose(); } } + + /// + /// Sets / gets the tag of render pass. It will be used when we want to change render pass without change shader. + /// Default is 0. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint RenderPassTag + { + get + { + uint ret = Interop.RenderTask.GetRenderPassTag(SwigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + set + { + Interop.RenderTask.SetRenderPassTag(SwigCPtr, value); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + } + + /// + /// Sets / gets the rendering order of render task. + /// + /// + /// In the DALi, offscreen renderTasks are rendered earlier than onscreen renderTask. + /// * In each category of OffScreen RenderTask and OnScreen RenderTask, + /// * a RenderTask with a smaller orderIndex is rendered first. + /// * The RenderTasks in RenderTaskList is always sorted as acending order of the OrderIndex. + /// * The OrderIndex value is needed to be set between [-1000, 1000]. + /// * Default orderIndex is 0. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int OrderIndex + { + get + { + int ret = Interop.RenderTask.GetOrderIndex(SwigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + set + { + Interop.RenderTask.SetOrderIndex(SwigCPtr, value); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + } + + /// + /// Gets the render task's ID. 0 if render task is invalid. + /// Read-only + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint ID + { + get + { + uint ret = 0u; + + if(!Disposed && !IsDisposeQueued) + { + ret = Interop.RenderTask.GetRenderTaskId(SwigCPtr); + } + + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Animation.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Animation.cs index 3e4e7186f..d0ea69171 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Animation.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Animation.cs @@ -115,6 +115,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Animation_GetLoopingMode")] public static extern int GetLoopingMode(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Animation_GetAnimationId")] + public static extern uint GetAnimationId(global::System.Runtime.InteropServices.HandleRef nuiAnimation); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Animation_SetProgressNotification")] public static extern void SetProgressNotification(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.RenderTask.cs b/src/Tizen.NUI/src/internal/Interop/Interop.RenderTask.cs index 46f5c77c8..684d0c8c8 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.RenderTask.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.RenderTask.cs @@ -190,6 +190,27 @@ namespace Tizen.NUI [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool ViewportToLocal(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3, float jarg4, out float jarg5, out float jarg6); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_SetRenderPassTag")] + public static extern void SetRenderPassTag(global::System.Runtime.InteropServices.HandleRef nuiRenderTask, uint renderPassTag); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_GetRenderPassTag")] + public static extern uint GetRenderPassTag(global::System.Runtime.InteropServices.HandleRef nuiRenderTask); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_SetOrderIndex")] + public static extern void SetOrderIndex(global::System.Runtime.InteropServices.HandleRef nuiRenderTask, int orderIndex); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_GetOrderIndex")] + public static extern int GetOrderIndex(global::System.Runtime.InteropServices.HandleRef nuiRenderTask); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_GetRenderTaskId")] + public static extern uint GetRenderTaskId(global::System.Runtime.InteropServices.HandleRef nuiRenderTask); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_RenderUntil")] + public static extern void RenderUntil(global::System.Runtime.InteropServices.HandleRef nuiRenderTask, global::System.Runtime.InteropServices.HandleRef nuiStopperView); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_GetStopperActor")] + public static extern global::System.IntPtr GetStopperView(global::System.Runtime.InteropServices.HandleRef nuiRenderTask); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RenderTask_FinishedSignal")] public static extern global::System.IntPtr FinishedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/public/Animation/Animation.cs b/src/Tizen.NUI/src/public/Animation/Animation.cs index e313b0cdc..560c13b5d 100755 --- a/src/Tizen.NUI/src/public/Animation/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation/Animation.cs @@ -528,6 +528,19 @@ namespace Tizen.NUI } } + /// + /// Gets the animation's ID. 0 if animation is invalid. + /// Read-only + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint ID + { + get + { + return GetId(); + } + } + /// /// Gets or sets the properties of the animation. /// @@ -1593,6 +1606,19 @@ namespace Tizen.NUI return ret; } + internal uint GetId() + { + uint ret = 0u; + + if(!Disposed && !IsDisposeQueued) + { + ret = Interop.Animation.GetAnimationId(SwigCPtr); + } + + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + internal AnimationSignal FinishedSignal() { AnimationSignal ret = new AnimationSignal(Interop.Animation.FinishedSignal(SwigCPtr), false);