From: Eunki, Hong Date: Wed, 4 Sep 2024 01:07:37 +0000 (+0900) Subject: [NUI] Deprecate Dali::Property constructor with componentwise X-Git-Tag: submit/tizen/20240911.113710~1^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20095e2725c611bbc46ff17b21700c242606be09;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Deprecate Dali::Property constructor with componentwise Since those usecase break some logic, let we decide to deprecate the componentewise logic. Instead just create new property index - like COLOR_RED, SIZE_HEIGHT. Signed-off-by: Eunki, Hong --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs index 697a0696c..9b7b45355 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs @@ -33,15 +33,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_0")] public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_1")] - public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_2")] public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_3")] - public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Property")] public static extern void DeleteProperty(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -57,12 +51,6 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_propertyIndex_get")] public static extern int PropertyIndexGet(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_componentIndex_set")] - public static extern void ComponentIndexSet(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_componentIndex_get")] - public static extern int ComponentIndexGet(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property_Array__SWIG_0")] public static extern global::System.IntPtr NewPropertyArray(); diff --git a/src/Tizen.NUI/src/public/Common/Property.cs b/src/Tizen.NUI/src/public/Common/Property.cs index 50a210a0b..437f06313 100755 --- a/src/Tizen.NUI/src/public/Common/Property.cs +++ b/src/Tizen.NUI/src/public/Common/Property.cs @@ -29,17 +29,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// This constructor creates a property instance. - /// - /// A valid handle to the target object. - /// The index of a property. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for the main property (default is -1). - public Property(Animatable animatable, int propertyIndex, int componentIndex) : this(Interop.Property.NewProperty(Animatable.getCPtr(animatable), propertyIndex, componentIndex), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// This constructor creates a property instance.
/// This performs a property index query and is therefore slower than constructing a property directly with the index.
@@ -51,18 +40,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// This constructor creates a property instance.
- /// This performs a property index query and is therefore slower than constructing a property directly with the index.
- ///
- /// A valid handle to the target object. - /// The property name. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1). - public Property(Animatable animatable, string propertyName, int componentIndex) : this(Interop.Property.NewProperty(Animatable.getCPtr(animatable), propertyName, componentIndex), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } @@ -85,24 +62,6 @@ namespace Tizen.NUI } } - /// - /// Gets or sets the component index of the property. - /// - public int ComponentIndex - { - set - { - Interop.Property.ComponentIndexSet(SwigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = Interop.Property.ComponentIndexGet(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - internal static int InvalidIndex { get diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs index 4b723f7cf..bb47d0193 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs @@ -60,31 +60,6 @@ namespace Tizen.NUI.Devel.Tests tlog.Debug(tag, $"PropertyConstructor END (OK)"); } - [Test] - [Category("P1")] - [Description("Property constructor. With sub component index")] - [Property("SPEC", "Tizen.NUI.Property.Property C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "guowei.wang@samsung.com")] - public void PropertyConstructorWithSubComponentIndex() - { - tlog.Debug(tag, $"PropertyConstructorWithSubComponentIndex START"); - - var animatable = new Animatable(); - Assert.IsNotNull(animatable, "Should be not null!"); - Assert.IsInstanceOf(animatable, "Should return PropertyValue instance."); - - var dummyIndex = 28000000; - var testingTarget = new Property(animatable, dummyIndex, -1); - Assert.IsNotNull(testingTarget, "Should be not null!"); - Assert.IsInstanceOf(testingTarget, "Should return PropertyValue instance."); - - testingTarget.Dispose(); - animatable.Dispose(); - tlog.Debug(tag, $"PropertyConstructorWithSubComponentIndex END (OK)"); - } - [Test] [Category("P1")] [Description("Property constructor. With property name")] @@ -109,30 +84,6 @@ namespace Tizen.NUI.Devel.Tests tlog.Debug(tag, $"PropertyConstructorWithPropertyName END (OK)"); } - [Test] - [Category("P1")] - [Description("Property constructor. With property name and sub component index")] - [Property("SPEC", "Tizen.NUI.Property.Property C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "guowei.wang@samsung.com")] - public void PropertyConstructorWithPropertyNameSubComponentIndex() - { - tlog.Debug(tag, $"PropertyConstructorWithPropertyNameSubComponentIndex START"); - - var animatable = new Animatable(); - Assert.IsNotNull(animatable, "Should be not null!"); - Assert.IsInstanceOf(animatable, "Should return PropertyValue instance."); - - var testingTarget = new Property(animatable, "image", -1); - Assert.IsNotNull(testingTarget, "Should be not null!"); - Assert.IsInstanceOf(testingTarget, "Should return PropertyValue instance."); - - testingTarget.Dispose(); - animatable.Dispose(); - tlog.Debug(tag, $"PropertyConstructorWithPropertyNameSubComponentIndex END (OK)"); - } - [Test] [Category("P1")] [Description("Property propertyIndex. Get")] @@ -187,60 +138,5 @@ namespace Tizen.NUI.Devel.Tests animatable.Dispose(); tlog.Debug(tag, $"PropertyPropertyIndexSet END (OK)"); } - - [Test] - [Category("P1")] - [Description("Property componentIndex. Get")] - [Property("SPEC", "Tizen.NUI.Property.componentIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "guowei.wang@samsung.com")] - public void PropertyComponentIndexGet() - { - tlog.Debug(tag, $"PropertyComponentIndexGet START"); - - var animatable = new Animatable(); - Assert.IsNotNull(animatable, "Should be not null!"); - Assert.IsInstanceOf(animatable, "Should return PropertyValue instance."); - - var testingTarget = new Property(animatable, 28000000, -1); - Assert.IsNotNull(testingTarget, "Should be not null!"); - Assert.IsInstanceOf(testingTarget, "Should return PropertyValue instance."); - - var result = testingTarget.componentIndex; - Assert.IsTrue(-1 == result); - - testingTarget.Dispose(); - animatable.Dispose(); - tlog.Debug(tag, $"PropertyComponentIndexGet END (OK)"); - } - - [Test] - [Category("P1")] - [Description("Property componentIndex. Get")] - [Property("SPEC", "Tizen.NUI.Property.componentIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "guowei.wang@samsung.com")] - public void PropertyComponentIndexSet() - { - tlog.Debug(tag, $"PropertyComponentIndexSet START"); - - var animatable = new Animatable(); - Assert.IsNotNull(animatable, "Should be not null!"); - Assert.IsInstanceOf(animatable, "Should return PropertyValue instance."); - - var testingTarget = new Property(animatable, 28000000, -1); - Assert.IsNotNull(testingTarget, "Should be not null!"); - Assert.IsInstanceOf(testingTarget, "Should return PropertyValue instance."); - - testingTarget.componentIndex = 30000000; - var result = testingTarget.componentIndex; - Assert.IsTrue(30000000 == result); - - testingTarget.Dispose(); - animatable.Dispose(); - tlog.Debug(tag, $"PropertyComponentIndexSet END (OK)"); - } } }