From bb7a86bbf081579b98a92177822ea0ecf8f744eb Mon Sep 17 00:00:00 2001 From: seungho baek Date: Mon, 15 May 2023 15:47:06 +0900 Subject: [PATCH] [NUI] Binds GetCurrentProperty to Animatable class Signed-off-by: seungho baek --- src/Tizen.NUI/src/internal/Common/Object.cs | 11 +++++++++++ src/Tizen.NUI/src/internal/Interop/Interop.Handle.cs | 3 +++ src/Tizen.NUI/src/public/Animation/Animatable.cs | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Common/Object.cs b/src/Tizen.NUI/src/internal/Common/Object.cs index 86cc9b9..81a5078 100755 --- a/src/Tizen.NUI/src/internal/Common/Object.cs +++ b/src/Tizen.NUI/src/internal/Common/Object.cs @@ -37,6 +37,17 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } + public static PropertyValue GetCurrentProperty(global::System.Runtime.InteropServices.HandleRef handle, int index) + { + if (handle.Handle == System.IntPtr.Zero) + { + throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!"); + } + + PropertyValue ret = new PropertyValue(Interop.Handle.GetCurrentProperty(handle, index), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } public static void SetProperty(global::System.Runtime.InteropServices.HandleRef handle, int index, PropertyValue propertyValue) { diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Handle.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Handle.cs index 2d1104e..c00568c 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Handle.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Handle.cs @@ -68,6 +68,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Handle_GetProperty")] public static extern global::System.IntPtr GetProperty(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Handle_GetCurrentProperty")] + public static extern global::System.IntPtr GetCurrentProperty(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Handle_AddPropertyNotification__SWIG_0")] public static extern global::System.IntPtr AddPropertyNotification(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); diff --git a/src/Tizen.NUI/src/public/Animation/Animatable.cs b/src/Tizen.NUI/src/public/Animation/Animatable.cs index e77f667..91233e6 100755 --- a/src/Tizen.NUI/src/public/Animation/Animatable.cs +++ b/src/Tizen.NUI/src/public/Animation/Animatable.cs @@ -200,6 +200,18 @@ namespace Tizen.NUI } /// + /// Retrieves the latest rendered frame value of the property. + /// + /// The index of the property. + /// The property value. + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyValue GetCurrentProperty(int index) + { + PropertyValue ret = Tizen.NUI.Object.GetCurrentProperty(SwigCPtr, index); + return ret; + } + + /// /// Adds a property notification to this object. /// /// The name of the property. -- 2.7.4