From 38ec7e3b91f2b88da575fb0909b1a6f67d03cc24 Mon Sep 17 00:00:00 2001 From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Thu, 24 Oct 2019 10:18:45 +0900 Subject: [PATCH] [NUI] Property setter is changed (#1097) --- .../src/public/BaseComponents/ImageView.cs | 22 +- .../src/public/BaseComponents/TextEditor.cs | 72 +++- .../src/public/BaseComponents/TextField.cs | 85 ++++- .../src/public/BaseComponents/TextLabel.cs | 33 +- src/Tizen.NUI/src/public/BaseComponents/View.cs | 86 +++-- .../src/public/BaseComponents/ViewInternal.cs | 53 +++ src/Tizen.NUI/src/public/Color.cs | 17 + src/Tizen.NUI/src/public/Extents.cs | 17 + src/Tizen.NUI/src/public/Rectangle.cs | 16 + src/Tizen.NUI/src/public/RelativeVector4.cs | 16 + src/Tizen.NUI/src/public/Vector2.cs | 16 + src/Tizen.NUI/src/public/Vector3.cs | 26 ++ src/Tizen.NUI/src/public/Vector4.cs | 32 ++ .../examples/PropertyCascadeCheckTest.cs | 359 +++++++++++++++++++ .../examples/PropertyCascadeSpeedTest.cs | 386 +++++++++++++++++++++ 15 files changed, 1185 insertions(+), 51 deletions(-) create mode 100644 test/NUITestSample/NUITestSample/examples/PropertyCascadeCheckTest.cs create mode 100644 test/NUITestSample/NUITestSample/examples/PropertyCascadeSpeedTest.cs diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index b819bf4..86a0b92 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -491,12 +491,16 @@ namespace Tizen.NUI.BaseComponents /// ImageView PixelArea, type Vector4 (Animatable property).
/// Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].
/// + /// + /// The property cascade chaining set is possible. For example, this (imageView.PixelArea.X = 0.1f;) is possible. + /// /// 3 public RelativeVector4 PixelArea { get { - return (RelativeVector4)GetValue(PixelAreaProperty); + RelativeVector4 temp = (RelativeVector4)GetValue(PixelAreaProperty); + return new RelativeVector4(OnPixelAreaChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -511,12 +515,16 @@ namespace Tizen.NUI.BaseComponents /// For N-Patch images only.
/// Optional. /// + /// + /// The property cascade chaining set is possible. For example, this (imageView.Border.X = 1;) is possible. + /// /// 3 public Rectangle Border { get { - return (Rectangle)GetValue(BorderProperty); + Rectangle temp = (Rectangle)GetValue(BorderProperty); + return new Rectangle(OnBorderChanged, temp.X, temp.Y, temp.Width, temp.Height); } set { @@ -1070,5 +1078,15 @@ namespace Tizen.NUI.BaseComponents /// Npatch = 2, } + + private void OnBorderChanged(int x, int y, int width, int height) + { + Border = new Rectangle(x, y, width, height); + } + private void OnPixelAreaChanged(float x, float y, float z, float w) + { + PixelArea = new RelativeVector4(x, y, z, w); + } + } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 7f2d44e..464f82d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -148,12 +148,16 @@ namespace Tizen.NUI.BaseComponents /// /// The TextColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 TextColor { get { - return (Vector4)GetValue(TextColorProperty); + Vector4 temp = (Vector4)GetValue(TextColorProperty); + return new Vector4(OnTextColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -267,12 +271,16 @@ namespace Tizen.NUI.BaseComponents /// /// The PrimaryCursorColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 PrimaryCursorColor { get { - return (Vector4)GetValue(PrimaryCursorColorProperty); + Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty); + return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -284,12 +292,16 @@ namespace Tizen.NUI.BaseComponents /// /// The SecondaryCursorColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 SecondaryCursorColor { get { - return (Vector4)GetValue(SecondaryCursorColorProperty); + Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty); + return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -505,12 +517,16 @@ namespace Tizen.NUI.BaseComponents /// /// The SelectionHighlightColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 SelectionHighlightColor { get { - return (Vector4)GetValue(SelectionHighlightColorProperty); + Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty); + return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -522,12 +538,16 @@ namespace Tizen.NUI.BaseComponents /// /// The DecorationBoundingBox property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible. + /// /// 3 public Rectangle DecorationBoundingBox { get { - return (Rectangle)GetValue(DecorationBoundingBoxProperty); + Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty); + return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height); } set { @@ -556,12 +576,16 @@ namespace Tizen.NUI.BaseComponents /// /// The InputColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 InputColor { get { - return (Vector4)GetValue(InputColorProperty); + Vector4 temp = (Vector4)GetValue(InputColorProperty); + return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -927,12 +951,16 @@ namespace Tizen.NUI.BaseComponents /// /// The Placeholder text color. /// + /// + /// The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible. + /// /// 3 public Color PlaceholderTextColor { get { - return (Color)GetValue(PlaceholderTextColorProperty); + Color temp = (Color)GetValue(PlaceholderTextColorProperty); + return new Color(OnPlaceholderTextColorChanged, temp.R, temp.G, temp.B, temp.A); } set { @@ -1241,5 +1269,35 @@ namespace Tizen.NUI.BaseComponents Outline = 0x0100 } } + + private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height) + { + DecorationBoundingBox = new Rectangle(x, y, width, height); + } + private void OnInputColorChanged(float x, float y, float z, float w) + { + InputColor = new Vector4(x, y, z, w); + } + private void OnPlaceholderTextColorChanged(float r, float g, float b, float a) + { + PlaceholderTextColor = new Color(r, g, b, a); + } + private void OnPrimaryCursorColorChanged(float x, float y, float z, float w) + { + PrimaryCursorColor = new Vector4(x, y, z, w); + } + private void OnSecondaryCursorColorChanged(float x, float y, float z, float w) + { + SecondaryCursorColor = new Vector4(x, y, z, w); + } + private void OnSelectionHighlightColorChanged(float x, float y, float z, float w) + { + SelectionHighlightColor = new Vector4(x, y, z, w); + } + private void OnTextColorChanged(float x, float y, float z, float w) + { + TextColor = new Vector4(x, y, z, w); + } + } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 83238d8..b405aed 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -308,12 +308,16 @@ namespace Tizen.NUI.BaseComponents /// /// The TextColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible. + /// /// 3 public Color TextColor { get { - return (Color)GetValue(TextColorProperty); + Color temp = (Color)GetValue(TextColorProperty); + return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A); } set { @@ -325,12 +329,16 @@ namespace Tizen.NUI.BaseComponents /// /// The PlaceholderTextColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 PlaceholderTextColor { get { - return (Vector4)GetValue(PlaceholderTextColorProperty); + Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty); + return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -345,6 +353,7 @@ namespace Tizen.NUI.BaseComponents /// 3 /// /// Deprecated.(API Level 6) Use Shadow instead. + /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible. /// [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")] public Vector2 ShadowOffset @@ -355,7 +364,7 @@ namespace Tizen.NUI.BaseComponents GetProperty(TextField.Property.SHADOW).Get(map); Vector2 shadowOffset = new Vector2(); map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset); - return shadowOffset; + return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y); } set { @@ -372,6 +381,7 @@ namespace Tizen.NUI.BaseComponents /// 3 /// /// Deprecated.(API Level 6) Use Shadow instead. + /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible. /// [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")] public Vector4 ShadowColor @@ -382,7 +392,7 @@ namespace Tizen.NUI.BaseComponents GetProperty(TextField.Property.SHADOW).Get(map); Vector4 shadowColor = new Vector4(); map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor); - return shadowColor; + return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W); } set { @@ -396,12 +406,16 @@ namespace Tizen.NUI.BaseComponents /// /// The PrimaryCursorColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 PrimaryCursorColor { get { - return (Vector4)GetValue(PrimaryCursorColorProperty); + Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty); + return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -413,12 +427,16 @@ namespace Tizen.NUI.BaseComponents /// /// The SecondaryCursorColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 SecondaryCursorColor { get { - return (Vector4)GetValue(SecondaryCursorColorProperty); + Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty); + return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -668,12 +686,16 @@ namespace Tizen.NUI.BaseComponents /// /// The SelectionHighlightColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 SelectionHighlightColor { get { - return (Vector4)GetValue(SelectionHighlightColorProperty); + Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty); + return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -685,12 +707,16 @@ namespace Tizen.NUI.BaseComponents /// /// The DecorationBoundingBox property. /// + /// + /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible. + /// /// 3 public Rectangle DecorationBoundingBox { get { - return (Rectangle)GetValue(DecorationBoundingBoxProperty); + Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty); + return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height); } set { @@ -719,12 +745,16 @@ namespace Tizen.NUI.BaseComponents /// /// The InputColor property. /// + /// + /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible. + /// /// 3 public Vector4 InputColor { get { - return (Vector4)GetValue(InputColorProperty); + Vector4 temp = (Vector4)GetValue(InputColorProperty); + return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -1329,5 +1359,42 @@ namespace Tizen.NUI.BaseComponents Outline = 0x0080 } } + + private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height) + { + DecorationBoundingBox = new Rectangle(x, y, width, height); + } + private void OnInputColorChanged(float x, float y, float z, float w) + { + InputColor = new Vector4(x, y, z, w); + } + private void OnPlaceholderTextColorChanged(float r, float g, float b, float a) + { + PlaceholderTextColor = new Vector4(r, g, b, a); + } + private void OnPrimaryCursorColorChanged(float x, float y, float z, float w) + { + PrimaryCursorColor = new Vector4(x, y, z, w); + } + private void OnSecondaryCursorColorChanged(float x, float y, float z, float w) + { + SecondaryCursorColor = new Vector4(x, y, z, w); + } + private void OnSelectionHighlightColorChanged(float x, float y, float z, float w) + { + SelectionHighlightColor = new Vector4(x, y, z, w); + } + private void OnShadowColorChanged(float x, float y, float z, float w) + { + ShadowColor = new Vector4(x, y, z, w); + } + private void OnShadowOffsetChanged(float x, float y) + { + ShadowOffset = new Vector2(x, y); + } + private void OnTextColorChanged(float r, float g, float b, float a) + { + TextColor = new Color(r, g, b, a); + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index a99f5a4..dc5b3a6 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -763,12 +763,16 @@ namespace Tizen.NUI.BaseComponents /// Animation framework can be used to change the color of the text when not using mark up.
/// Cannot animate the color when text is auto scrolling.
/// + /// + /// The property cascade chaining set is possible. For example, this (textLabel.TextColor.X = 0.1f;) is possible. + /// /// 3 public Color TextColor { get { - return (Color)GetValue(TextColorProperty); + Color temp = (Color)GetValue(TextColorProperty); + return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A); } set { @@ -784,6 +788,7 @@ namespace Tizen.NUI.BaseComponents /// 3 /// /// Deprecated.(API Level 6) Use Shadow instead. + /// The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible. /// [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")] public Vector2 ShadowOffset @@ -792,7 +797,7 @@ namespace Tizen.NUI.BaseComponents { Vector2 shadowOffset = new Vector2(); Shadow.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset); - return shadowOffset; + return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y); } set { @@ -814,6 +819,7 @@ namespace Tizen.NUI.BaseComponents /// 3 /// /// Deprecated.(API Level 6) Use Shadow instead. + /// The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible. /// [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")] public Vector4 ShadowColor @@ -822,7 +828,7 @@ namespace Tizen.NUI.BaseComponents { Vector4 shadowColor = new Vector4(); Shadow.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor); - return shadowColor; + return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W); } set { @@ -875,6 +881,7 @@ namespace Tizen.NUI.BaseComponents /// 3 /// /// Deprecated.(API Level 6) Use Underline instead. + /// The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible. /// [Obsolete("Please do not use this UnderlineColor(Deprecated). Please use Underline instead.")] public Vector4 UnderlineColor @@ -883,7 +890,7 @@ namespace Tizen.NUI.BaseComponents { Vector4 underlineColor = new Vector4(); Underline.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor); - return underlineColor; + return new Vector4(OnUnderlineColorChanged, underlineColor.X, underlineColor.Y, underlineColor.Z, underlineColor.W); } set { @@ -1393,5 +1400,23 @@ namespace Tizen.NUI.BaseComponents internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextLabel.TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get(); internal static readonly int TEXT_FIT = Interop.TextLabel.TextLabel_Property_TEXT_FIT_get(); } + + private void OnShadowColorChanged(float x, float y, float z, float w) + { + ShadowColor = new Vector4(x, y, z, w); + } + private void OnShadowOffsetChanged(float x, float y) + { + ShadowOffset = new Vector2(x, y); + } + private void OnTextColorChanged(float r, float g, float b, float a) + { + TextColor = new Color(r, g, b, a); + } + private void OnUnderlineColorChanged(float x, float y, float z, float w) + { + UnderlineColor = new Vector4(x, y, z, w); + } + } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index a319f4f..ffa4e18 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -159,12 +159,16 @@ namespace Tizen.NUI.BaseComponents /// /// The mutually exclusive with "backgroundImage" and "background" type Vector4. /// + /// + /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible. + /// /// 3 public Color BackgroundColor { get { - return (Color)GetValue(BackgroundColorProperty); + Color temp = (Color)GetValue(BackgroundColorProperty); + return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A); } set { @@ -312,12 +316,16 @@ namespace Tizen.NUI.BaseComponents /// The Child property of FlexContainer.
/// The space around the flex item.
/// + /// + /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible. + /// /// 3 public Vector4 FlexMargin { get { - return (Vector4)GetValue(FlexMarginProperty); + Vector4 temp = (Vector4)GetValue(FlexMarginProperty); + return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W); } set { @@ -329,12 +337,16 @@ namespace Tizen.NUI.BaseComponents /// /// The top-left cell this child occupies, if not set, the first available cell is used. /// + /// + /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible. + /// /// 3 public Vector2 CellIndex { get { - return (Vector2)GetValue(CellIndexProperty); + Vector2 temp = (Vector2)GetValue(CellIndexProperty); + return new Vector2(OnCellIndexChanged, temp.X, temp.Y); } set { @@ -530,11 +542,6 @@ namespace Tizen.NUI.BaseComponents /// /// This NUI object (Size2D) typed property can be configured by multiple cascade setting.
/// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ).
- /// Please note that this multi-cascade setting is especially possible for this NUI object (Size2D).
- /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
- /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
- /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
- /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimum size is set.
///
/// 3 public Size2D Size2D @@ -596,10 +603,6 @@ namespace Tizen.NUI.BaseComponents /// /// This NUI object (Position2D) typed property can be configured by multiple cascade setting.
/// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ).
- /// Please note that this multi-cascade setting is especially possible for this NUI object (Position2D).
- /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
- /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
- /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
///
/// 3 public Position2D Position2D @@ -791,6 +794,9 @@ namespace Tizen.NUI.BaseComponents /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.
///
The view has been initialized.
/// + /// + /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible. + /// /// 3 public Position PivotPoint { @@ -861,6 +867,7 @@ namespace Tizen.NUI.BaseComponents /// /// Animatable - This property can be animated using Animation class. /// + /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible. /// /// 3 public Position Position @@ -1004,13 +1011,15 @@ namespace Tizen.NUI.BaseComponents /// /// Animatable - This property can be animated using Animation class. /// + /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible. /// /// 3 public Vector3 Scale { get { - return (Vector3)GetValue(ScaleProperty); + Vector3 temp = (Vector3)GetValue(ScaleProperty); + return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z); } set { @@ -1273,12 +1282,16 @@ namespace Tizen.NUI.BaseComponents /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.
/// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.
/// + /// + /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible. + /// /// 3 public Vector3 SizeModeFactor { get { - return (Vector3)GetValue(SizeModeFactorProperty); + Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty); + return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z); } set { @@ -1420,6 +1433,9 @@ namespace Tizen.NUI.BaseComponents /// /// Gets or sets the padding for use in layout. /// + /// + /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible. + /// /// 5 public Extents Padding { @@ -1432,7 +1448,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (Extents)GetValue(PaddingProperty); + Extents temp = (Extents)GetValue(PaddingProperty); + return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom); } // Two return points to prevent creating a zeroed Extent native object before assignment } @@ -1462,6 +1479,9 @@ namespace Tizen.NUI.BaseComponents /// /// Gets or sets the minimum size the view can be assigned in size negotiation. /// + /// + /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible. + /// /// 3 public Size2D MinimumSize { @@ -1488,6 +1508,9 @@ namespace Tizen.NUI.BaseComponents /// /// Gets or sets the maximum size the view can be assigned in size negotiation. /// + /// + /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible. + /// /// 3 public Size2D MaximumSize { @@ -1564,6 +1587,9 @@ namespace Tizen.NUI.BaseComponents /// /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! /// + /// + /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible. + /// /// 3 [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " + "Like: " + @@ -1577,7 +1603,7 @@ namespace Tizen.NUI.BaseComponents { Position temp = new Position(0.0f, 0.0f, 0.0f); GetProperty(View.Property.ANCHOR_POINT).Get(temp); - return temp; + return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z); } set { @@ -1594,15 +1620,9 @@ namespace Tizen.NUI.BaseComponents /// /// /// - /// Please note that multi-cascade setting is not possible for this NUI object.
- /// It is recommended that NUI object typed properties are configured by their constructor with parameters.
- /// For example, this code is working fine : view.Size = new Size( 1.0f, 1.0f, 0.0f);
- /// but this will not work! : view.Size.Width = 2.0f; view.Size.Height = 2.0f;
- /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimu size is set.
- ///
- /// /// Animatable - This property can be animated using Animation class. /// + /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible. ///
/// 5 public Size Size @@ -1701,6 +1721,7 @@ namespace Tizen.NUI.BaseComponents /// /// Margin property is supported by Layout algorithms and containers. /// Please Set Layout if you want to use Margin property. + /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible. /// /// 4 public Extents Margin @@ -1715,7 +1736,8 @@ namespace Tizen.NUI.BaseComponents else { // If Layout not set then return margin stored in View. - return (Extents)GetValue(MarginProperty); + Extents temp = (Extents)GetValue(MarginProperty); + return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom); } // Two return points to prevent creating a zeroed Extent native object before assignment } @@ -1826,6 +1848,9 @@ namespace Tizen.NUI.BaseComponents /// /// Deprecated in API5; Will be removed in API8. Please use Padding instead. /// + /// + /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible. + /// /// 4 [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")] [EditorBrowsable(EditorBrowsableState.Never)] @@ -1835,7 +1860,7 @@ namespace Tizen.NUI.BaseComponents { Extents temp = new Extents(0, 0, 0, 0); GetProperty(View.Property.PADDING).Get(temp); - return temp; + return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom); } set { @@ -1867,18 +1892,21 @@ namespace Tizen.NUI.BaseComponents /// /// Animatable - This property can be animated using Animation class. /// + /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible. /// /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Color Color { - set + get { - SetColor(value); + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + GetProperty(Interop.ActorProperty.Actor_Property_COLOR_get()).Get(temp); + return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A); } - get + set { - return GetCurrentColor(); + SetColor(value); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs index 01fe228..666621d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -1189,5 +1189,58 @@ namespace Tizen.NUI.BaseComponents } } } + + + private void OnScaleChanged(float x, float y, float z) + { + Scale = new Vector3(x, y, z); + } + + private void OnBackgroundColorChanged(float r, float g, float b, float a) + { + BackgroundColor = new Color(r, g, b, a); + } + + private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom) + { + Padding = new Extents(start, end, top, bottom); + } + + private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom) + { + Margin = new Extents(start, end, top, bottom); + } + + private void OnColorChanged(float r, float g, float b, float a) + { + Color = new Color(r, g, b, a); + } + + private void OnAnchorPointChanged(float x, float y, float z) + { + AnchorPoint = new Position(x, y, z); + } + + private void OnCellIndexChanged(float x, float y) + { + CellIndex = new Vector2(x, y); + } + + private void OnFlexMarginChanged(float x, float y, float z, float w) + { + FlexMargin = new Vector4(x, y, z, w); + } + + private void OnPaddingEXChanged(ushort start, ushort end, ushort top, ushort bottom) + { + PaddingEX = new Extents(start, end, top, bottom); + } + + private void OnSizeModeFactorChanged(float x, float y, float z) + { + SizeModeFactor = new Vector3(x, y, z); + } + + } } diff --git a/src/Tizen.NUI/src/public/Color.cs b/src/Tizen.NUI/src/public/Color.cs index 1c2890c..e47343c 100755 --- a/src/Tizen.NUI/src/public/Color.cs +++ b/src/Tizen.NUI/src/public/Color.cs @@ -131,6 +131,15 @@ namespace Tizen.NUI hashDummy = false; } + internal Color(ColorChangedCallback cb, float r, float g, float b, float a) : this(Interop.Vector4.new_Vector4__SWIG_1(ValueCheck(r), ValueCheck(g), ValueCheck(b), ValueCheck(a)), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal delegate void ColorChangedCallback(float r, float g, float b, float a); + private ColorChangedCallback callback = null; + /// /// The red component. /// @@ -141,6 +150,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_r_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(R, G, B, A); } get { @@ -160,6 +171,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_g_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(R, G, B, A); } get { @@ -179,6 +192,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_b_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(R, G, B, A); } get { @@ -198,6 +213,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_a_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(R, G, B, A); } get { diff --git a/src/Tizen.NUI/src/public/Extents.cs b/src/Tizen.NUI/src/public/Extents.cs index a6d7f69..82ca906 100755 --- a/src/Tizen.NUI/src/public/Extents.cs +++ b/src/Tizen.NUI/src/public/Extents.cs @@ -73,6 +73,15 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + internal Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort botton); + private ExtentsChangedCallback callback = null; + /// /// The Start extent. /// @@ -83,6 +92,8 @@ namespace Tizen.NUI { Interop.Extents.Extents_start_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(Start, End, Top, Bottom); } get { @@ -102,6 +113,8 @@ namespace Tizen.NUI { Interop.Extents.Extents_end_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(Start, End, Top, Bottom); } get { @@ -121,6 +134,8 @@ namespace Tizen.NUI { Interop.Extents.Extents_top_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(Start, End, Top, Bottom); } get { @@ -140,6 +155,8 @@ namespace Tizen.NUI { Interop.Extents.Extents_bottom_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(Start, End, Top, Bottom); } get { diff --git a/src/Tizen.NUI/src/public/Rectangle.cs b/src/Tizen.NUI/src/public/Rectangle.cs index 3d14b1a..9ba904d 100755 --- a/src/Tizen.NUI/src/public/Rectangle.cs +++ b/src/Tizen.NUI/src/public/Rectangle.cs @@ -62,6 +62,14 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + internal Rectangle(RectangleChangedCallback cb, int x, int y, int width, int height) : this(Interop.Rectangle.new_Rectangle__SWIG_1(x, y, width, height), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal delegate void RectangleChangedCallback(int x, int y, int width, int height); + private RectangleChangedCallback callback = null; + /// /// The x position of the rectangle. /// @@ -71,6 +79,8 @@ namespace Tizen.NUI set { x = (value); + + callback?.Invoke(X, Y, Width, Height); } get { @@ -87,6 +97,8 @@ namespace Tizen.NUI set { y = (value); + + callback?.Invoke(X, Y, Width, Height); } get { @@ -103,6 +115,8 @@ namespace Tizen.NUI set { width = (value); + + callback?.Invoke(X, Y, Width, Height); } get { @@ -119,6 +133,8 @@ namespace Tizen.NUI set { height = (value); + + callback?.Invoke(X, Y, Width, Height); } get { diff --git a/src/Tizen.NUI/src/public/RelativeVector4.cs b/src/Tizen.NUI/src/public/RelativeVector4.cs index e0dc591..0c4dead 100755 --- a/src/Tizen.NUI/src/public/RelativeVector4.cs +++ b/src/Tizen.NUI/src/public/RelativeVector4.cs @@ -77,6 +77,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal RelativeVector4(RelativeVector4ChangedCallback cb, float x, float y, float z, float w) : this(Interop.Vector4.new_Vector4__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z), ValueCheck(w)), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal delegate void RelativeVector4ChangedCallback(float x, float y, float z, float w); + private RelativeVector4ChangedCallback callback = null; + /// /// The x component. /// @@ -87,6 +95,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_X_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -106,6 +116,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_Y_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -125,6 +137,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_Z_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -144,6 +158,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_W_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { diff --git a/src/Tizen.NUI/src/public/Vector2.cs b/src/Tizen.NUI/src/public/Vector2.cs index a5d2149..537e76a 100755 --- a/src/Tizen.NUI/src/public/Vector2.cs +++ b/src/Tizen.NUI/src/public/Vector2.cs @@ -91,6 +91,14 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + internal Vector2(Vector2ChangedCallback cb, float x, float y) : this(Interop.Vector2.new_Vector2__SWIG_1(x, y), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal delegate void Vector2ChangedCallback(float x, float y); + private Vector2ChangedCallback callback = null; + /// /// (1.0f,1.0f). /// @@ -191,6 +199,8 @@ namespace Tizen.NUI { Interop.Vector2.Vector2_X_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y); } get { @@ -210,6 +220,8 @@ namespace Tizen.NUI { Interop.Vector2.Vector2_Width_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y); } get { @@ -229,6 +241,8 @@ namespace Tizen.NUI { Interop.Vector2.Vector2_Y_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y); } get { @@ -248,6 +262,8 @@ namespace Tizen.NUI { Interop.Vector2.Vector2_Height_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y); } get { diff --git a/src/Tizen.NUI/src/public/Vector3.cs b/src/Tizen.NUI/src/public/Vector3.cs index aa3a0b0..8490698 100755 --- a/src/Tizen.NUI/src/public/Vector3.cs +++ b/src/Tizen.NUI/src/public/Vector3.cs @@ -91,6 +91,14 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + internal Vector3(Vector3ChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal delegate void Vector3ChangedCallback(float x, float y, float z); + private Vector3ChangedCallback callback = null; + /// /// (1.0f,1.0f,1.0f). /// @@ -221,6 +229,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_X_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -240,6 +250,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_Width_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -259,6 +271,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_r_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -278,6 +292,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_Y_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -297,6 +313,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_Height_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -316,6 +334,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_g_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -335,6 +355,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_Z_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -354,6 +376,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_Depth_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { @@ -373,6 +397,8 @@ namespace Tizen.NUI { Interop.Vector3.Vector3_b_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z); } get { diff --git a/src/Tizen.NUI/src/public/Vector4.cs b/src/Tizen.NUI/src/public/Vector4.cs index deb7bd6..13bf1c4 100755 --- a/src/Tizen.NUI/src/public/Vector4.cs +++ b/src/Tizen.NUI/src/public/Vector4.cs @@ -93,6 +93,14 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + internal Vector4(Vector4ChangedCallback cb, float x, float y, float z, float w) : this(Interop.Vector4.new_Vector4__SWIG_1(x, y, z, w), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal delegate void Vector4ChangedCallback(float x, float y, float z, float w); + private Vector4ChangedCallback callback = null; + /// /// (1.0f,1.0f,1.0f,1.0f). /// @@ -178,6 +186,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_X_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -197,6 +207,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_r_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -216,6 +228,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_s_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -235,6 +249,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_Y_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -254,6 +270,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_g_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -273,6 +291,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_t_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -292,6 +312,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_Z_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -311,6 +333,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_b_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -330,6 +354,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_p_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -349,6 +375,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_W_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -368,6 +396,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_a_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { @@ -387,6 +417,8 @@ namespace Tizen.NUI { Interop.Vector4.Vector4_q_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y, Z, W); } get { diff --git a/test/NUITestSample/NUITestSample/examples/PropertyCascadeCheckTest.cs b/test/NUITestSample/NUITestSample/examples/PropertyCascadeCheckTest.cs new file mode 100644 index 0000000..3e8b304 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/PropertyCascadeCheckTest.cs @@ -0,0 +1,359 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Samples +{ + public class MyPropertyCheckTest : IExample + { + View root; + ImageView iv1; + TextEditor te1; + TextField tf1; + TextLabel tl1; + View v1; + float valueFloatShouldBe = 0.1f; float valueFloatIncreament = 0.01f; + int valueIntShouldBe = 10; int valueIntIncreament = 2; + ushort valueUshortShouldBe = 3; ushort valueUshortIncreament = 1; + + void initMultiCascadePropertySet() + { + root = new View(); + root.Focusable = true; + Window.Instance.Add(root); + root.KeyEvent += Root_KeyEvent; + FocusManager.Instance.SetCurrentFocusView(root); + Window.Instance.BackgroundColor = Color.White; + + //ImageView + iv1 = new ImageView(); + iv1.ResourceUrl = Applications.Application.Current.DirectoryInfo.Resource + "gallary-1.jpg"; + iv1.Size2D = new Size(100, 100); + iv1.Position2D = new Position2D(100, 100); + root.Add(iv1); + //TextEditor + te1 = new TextEditor(); + te1.Text = "test TextEditor"; + te1.Size2D = new Size(100, 100); + te1.Position2D = new Position2D(200, 200); + root.Add(te1); + //TextField + tf1 = new TextField(); + tf1.Text = "test TextField"; + tf1.Size2D = new Size(100, 100); + tf1.Position2D = new Position2D(300, 300); + root.Add(tf1); + //TextLabel + tl1 = new TextLabel(); + tl1.Text = "test TextLabel"; + tl1.Size2D = new Size(100, 100); + tl1.Position2D = new Position2D(400, 400); + root.Add(tl1); + //View + v1 = new View(); + v1.Size2D = new Size(100, 100); + v1.Position2D = new Position2D(500, 500); + root.Add(v1); + + + // ImageView.PixelArea + iv1.PixelArea = new RelativeVector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + // ImageView.Border + iv1.Border = new Rectangle(valueIntShouldBe, valueIntShouldBe, valueIntShouldBe, valueIntShouldBe); + + //TextEditor.DecorationBoundingBox + te1.DecorationBoundingBox = new Rectangle(valueIntShouldBe, valueIntShouldBe, valueIntShouldBe, valueIntShouldBe); + //TextEditor.InputColor + te1.InputColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextEditor.PlaceholderTextColor + te1.PlaceholderTextColor = new Color(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextEditor.PrimaryCursorColor + te1.PrimaryCursorColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextEditor.SecondaryCursorColor + te1.SecondaryCursorColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextEditor.SelectionHighlightColor + te1.SelectionHighlightColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextEditor.TextColor + te1.TextColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + + //TextField.DecorationBoundingBox + tf1.DecorationBoundingBox = new Rectangle(valueIntShouldBe, valueIntShouldBe, valueIntShouldBe, valueIntShouldBe); + //TextField.InputColor + tf1.InputColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextField.PlaceholderTextColor + tf1.PlaceholderTextColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextField.PrimaryCursorColor + tf1.PrimaryCursorColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextField.SecondaryCursorColor + tf1.SecondaryCursorColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextField.SelectionHighlightColor + tf1.SelectionHighlightColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextField.ShadowColor + tf1.ShadowColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextField.ShadowOffset + tf1.ShadowOffset = new Vector2(valueFloatShouldBe, valueFloatShouldBe); + //TextField.TextColor + tf1.TextColor = new Color(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + + //TextLabel.ShadowColor + tl1.ShadowColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextLabel.ShadowOffset + tl1.ShadowOffset = new Vector2(valueFloatShouldBe, valueFloatShouldBe); + //TextLabel.TextColor + tl1.TextColor = new Color(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //TextLabel.UnderlineColor + tl1.UnderlineColor = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + + //View.Scale + v1.Scale = new Vector3(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //View.BackgroundColor + v1.BackgroundColor = new Color(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //View.Padding + v1.Padding = new Extents(valueUshortShouldBe, valueUshortShouldBe, valueUshortShouldBe, valueUshortShouldBe); + //View.Margin + v1.Margin = new Extents(valueUshortShouldBe, valueUshortShouldBe, valueUshortShouldBe, valueUshortShouldBe); + //View.Color + v1.Color = new Color(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, 1.0f); + //View.AnchorPoint + v1.AnchorPoint = new Position(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //View.CellIndex + v1.CellIndex = new Vector2(valueFloatShouldBe, valueFloatShouldBe); + //View.FlexMargin + v1.FlexMargin = new Vector4(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + //View.PaddingEX + v1.PaddingEX = new Extents(valueUshortShouldBe, valueUshortShouldBe, valueUshortShouldBe, valueUshortShouldBe); + //View.SizeModeFactor + v1.SizeModeFactor = new Vector3(valueFloatShouldBe, valueFloatShouldBe, valueFloatShouldBe); + + } + + private bool Root_KeyEvent(object source, View.KeyEventArgs e) + { + if (e.Key.State == Key.StateType.Down) + { + if (e.Key.KeyPressedName == "1") + { + //ImageView + iv1.PixelArea.X += valueFloatIncreament; iv1.PixelArea.Y += valueFloatIncreament; iv1.PixelArea.Z += valueFloatIncreament; iv1.PixelArea.W += valueFloatIncreament; + iv1.Border.X += valueIntIncreament; iv1.Border.Y += valueIntIncreament; iv1.Border.Width += valueIntIncreament; iv1.Border.Height += valueIntIncreament; + + //TextEditor + te1.DecorationBoundingBox.X += valueIntIncreament; te1.DecorationBoundingBox.Y += valueIntIncreament; te1.DecorationBoundingBox.Width += valueIntIncreament; te1.DecorationBoundingBox.Height += valueIntIncreament; + te1.InputColor.X += valueFloatIncreament; te1.InputColor.Y += valueFloatIncreament; te1.InputColor.Z += valueFloatIncreament; te1.InputColor.W += valueFloatIncreament; + te1.PlaceholderTextColor.R += valueFloatIncreament; te1.PlaceholderTextColor.G += valueFloatIncreament; te1.PlaceholderTextColor.B += valueFloatIncreament; te1.PlaceholderTextColor.A += valueFloatIncreament; + te1.PrimaryCursorColor.X += valueFloatIncreament; te1.PrimaryCursorColor.Y += valueFloatIncreament; te1.PrimaryCursorColor.Z += valueFloatIncreament; te1.PrimaryCursorColor.W += valueFloatIncreament; + te1.SecondaryCursorColor.X += valueFloatIncreament; te1.SecondaryCursorColor.Y += valueFloatIncreament; te1.SecondaryCursorColor.Z += valueFloatIncreament; te1.SecondaryCursorColor.W += valueFloatIncreament; + te1.SelectionHighlightColor.X += valueFloatIncreament; te1.SelectionHighlightColor.Y += valueFloatIncreament; te1.SelectionHighlightColor.Z += valueFloatIncreament; te1.SelectionHighlightColor.W += valueFloatIncreament; + te1.TextColor.X += valueFloatIncreament; te1.TextColor.Y += valueFloatIncreament; te1.TextColor.Z += valueFloatIncreament; te1.TextColor.W += valueFloatIncreament; + + //TextField + tf1.DecorationBoundingBox.X += valueIntIncreament; tf1.DecorationBoundingBox.Y += valueIntIncreament; tf1.DecorationBoundingBox.Width += valueIntIncreament; tf1.DecorationBoundingBox.Height += valueIntIncreament; + tf1.InputColor.X += valueFloatIncreament; tf1.InputColor.Y += valueFloatIncreament; tf1.InputColor.Z += valueFloatIncreament; tf1.InputColor.W += valueFloatIncreament; + tf1.PlaceholderTextColor.X += valueFloatIncreament; tf1.PlaceholderTextColor.Y += valueFloatIncreament; tf1.PlaceholderTextColor.Z += valueFloatIncreament; tf1.PlaceholderTextColor.W += valueFloatIncreament; + tf1.PrimaryCursorColor.X += valueFloatIncreament; tf1.PrimaryCursorColor.Y += valueFloatIncreament; tf1.PrimaryCursorColor.Z += valueFloatIncreament; tf1.PrimaryCursorColor.W += valueFloatIncreament; + tf1.SecondaryCursorColor.X += valueFloatIncreament; tf1.SecondaryCursorColor.Y += valueFloatIncreament; tf1.SecondaryCursorColor.Z += valueFloatIncreament; tf1.SecondaryCursorColor.W += valueFloatIncreament; + tf1.SelectionHighlightColor.X += valueFloatIncreament; tf1.SelectionHighlightColor.Y += valueFloatIncreament; tf1.SelectionHighlightColor.Z += valueFloatIncreament; tf1.SelectionHighlightColor.W += valueFloatIncreament; + tf1.ShadowColor.X += valueFloatIncreament; tf1.ShadowColor.Y += valueFloatIncreament; tf1.ShadowColor.Z += valueFloatIncreament; tf1.ShadowColor.W += valueFloatIncreament; + tf1.ShadowOffset.X += valueFloatIncreament; tf1.ShadowOffset.Y += valueFloatIncreament; + tf1.TextColor.R += valueFloatIncreament; tf1.TextColor.G += valueFloatIncreament; tf1.TextColor.B += valueFloatIncreament; tf1.TextColor.A += valueFloatIncreament; + + //TextLabel + tl1.ShadowColor.X += valueFloatIncreament; tl1.ShadowColor.Y += valueFloatIncreament; tl1.ShadowColor.Z += valueFloatIncreament; tl1.ShadowColor.W += valueFloatIncreament; + tl1.ShadowOffset.X += valueFloatIncreament; tl1.ShadowOffset.Y += valueFloatIncreament; + tl1.TextColor.R += valueFloatIncreament; tl1.TextColor.G += valueFloatIncreament; tl1.TextColor.B += valueFloatIncreament; tl1.TextColor.A += valueFloatIncreament; + tl1.UnderlineColor.X += valueFloatIncreament; tl1.UnderlineColor.Y += valueFloatIncreament; tl1.UnderlineColor.Z += valueFloatIncreament; tl1.UnderlineColor.W += valueFloatIncreament; + + + //View.Scale + v1.Scale.X += valueFloatIncreament; v1.Scale.Y += valueFloatIncreament; v1.Scale.Z += valueFloatIncreament; + //View.BackgroundColor + v1.BackgroundColor.R += valueFloatIncreament; v1.BackgroundColor.G += valueFloatIncreament; v1.BackgroundColor.B += valueFloatIncreament; v1.BackgroundColor.A += valueFloatIncreament; + //View.Padding + v1.Padding.Start += valueUshortIncreament; v1.Padding.End += valueUshortIncreament; v1.Padding.Top += valueUshortIncreament; v1.Padding.Bottom += valueUshortIncreament; + //View.Margin + v1.Margin.Start += valueUshortIncreament; v1.Margin.End += valueUshortIncreament; v1.Margin.Top += valueUshortIncreament; v1.Margin.Bottom += valueUshortIncreament; + //View.Color + v1.Color.R += valueFloatIncreament; v1.Color.G += valueFloatIncreament; v1.Color.B += valueFloatIncreament; + //View.AnchorPoint + v1.AnchorPoint.X += valueFloatIncreament; v1.AnchorPoint.Y += valueFloatIncreament; v1.AnchorPoint.Z += valueFloatIncreament; + //View.CellIndex + v1.CellIndex.X += valueFloatIncreament; v1.CellIndex.Y += valueFloatIncreament; + //View.FlexMargin + v1.FlexMargin.X += valueFloatIncreament; v1.FlexMargin.Y += valueFloatIncreament; v1.FlexMargin.Z += valueFloatIncreament; v1.FlexMargin.W += valueFloatIncreament; + //View.PaddingEX + //Padding and PaddingEX are same property + //v1.PaddingEX.Start += valueUshortIncreament; v1.PaddingEX.End += valueUshortIncreament; v1.PaddingEX.Top += valueUshortIncreament; v1.PaddingEX.Bottom += valueUshortIncreament; + //View.SizeModeFactor + v1.SizeModeFactor.X += valueFloatIncreament; v1.SizeModeFactor.Y += valueFloatIncreament; v1.SizeModeFactor.Z += valueFloatIncreament; + + valueFloatShouldBe += valueFloatIncreament; + valueIntShouldBe += valueIntIncreament; + valueUshortShouldBe += valueUshortIncreament; + + //ImageView + if (iv1.PixelArea.X != valueFloatShouldBe || iv1.PixelArea.Y != valueFloatShouldBe || iv1.PixelArea.Z != valueFloatShouldBe || iv1.PixelArea.W != valueFloatShouldBe) + { + throw new ApplicationException("ImageView.PixelArea property check ERROR!"); + } + if (iv1.Border.X != valueIntShouldBe || iv1.Border.Y != valueIntShouldBe || iv1.Border.Width != valueIntShouldBe || iv1.Border.Height != valueIntShouldBe) + { + throw new ApplicationException("ImageView.Border property check ERROR!"); + } + + //TextEditor + if (te1.DecorationBoundingBox.X != valueIntShouldBe || te1.DecorationBoundingBox.Y != valueIntShouldBe || te1.DecorationBoundingBox.Width != valueIntShouldBe || te1.DecorationBoundingBox.Height != valueIntShouldBe) + { + throw new ApplicationException("TextEditor.DecorationBoundingBox property check ERROR!"); + } + if (te1.InputColor.X != valueFloatShouldBe || te1.InputColor.Y != valueFloatShouldBe || te1.InputColor.Z != valueFloatShouldBe || te1.InputColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextEditor.InputColor property check ERROR!"); + } + if (te1.PlaceholderTextColor.R != valueFloatShouldBe || te1.PlaceholderTextColor.G != valueFloatShouldBe || te1.PlaceholderTextColor.B != valueFloatShouldBe || te1.PlaceholderTextColor.A != valueFloatShouldBe) + { + throw new ApplicationException("TextEditor.PlaceholderTextColor property check ERROR!"); + } + if (te1.PrimaryCursorColor.X != valueFloatShouldBe || te1.PrimaryCursorColor.Y != valueFloatShouldBe || te1.PrimaryCursorColor.Z != valueFloatShouldBe || te1.PrimaryCursorColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextEditor.PrimaryCursorColor property check ERROR!"); + } + if (te1.SecondaryCursorColor.X != valueFloatShouldBe || te1.SecondaryCursorColor.Y != valueFloatShouldBe || te1.SecondaryCursorColor.Z != valueFloatShouldBe || te1.SecondaryCursorColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextEditor.SecondaryCursorColor property check ERROR!"); + } + if (te1.SelectionHighlightColor.X != valueFloatShouldBe || te1.SelectionHighlightColor.Y != valueFloatShouldBe || te1.SelectionHighlightColor.Z != valueFloatShouldBe || te1.SelectionHighlightColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextEditor.SelectionHighlightColor property check ERROR!"); + } + if (te1.TextColor.X != valueFloatShouldBe || te1.TextColor.Y != valueFloatShouldBe || te1.TextColor.Z != valueFloatShouldBe || te1.TextColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextEditor.TextColor property check ERROR!"); + } + + //TextField + if (tf1.DecorationBoundingBox.X != valueIntShouldBe || tf1.DecorationBoundingBox.Y != valueIntShouldBe || tf1.DecorationBoundingBox.Width != valueIntShouldBe || tf1.DecorationBoundingBox.Height != valueIntShouldBe) + { + throw new ApplicationException("TextField.DecorationBoundingBox property check ERROR!"); + } + if (tf1.InputColor.X != valueFloatShouldBe || tf1.InputColor.Y != valueFloatShouldBe || tf1.InputColor.Z != valueFloatShouldBe || tf1.InputColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextField.InputColor property check ERROR!"); + } + if (tf1.PlaceholderTextColor.X != valueFloatShouldBe || tf1.PlaceholderTextColor.Y != valueFloatShouldBe || tf1.PlaceholderTextColor.Z != valueFloatShouldBe || tf1.PlaceholderTextColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextField.PlaceholderTextColor property check ERROR!"); + } + if (tf1.PrimaryCursorColor.X != valueFloatShouldBe || tf1.PrimaryCursorColor.Y != valueFloatShouldBe || tf1.PrimaryCursorColor.Z != valueFloatShouldBe || tf1.PrimaryCursorColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextField.PrimaryCursorColor property check ERROR!"); + } + if (tf1.SecondaryCursorColor.X != valueFloatShouldBe || tf1.SecondaryCursorColor.Y != valueFloatShouldBe || tf1.SecondaryCursorColor.Z != valueFloatShouldBe || tf1.SecondaryCursorColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextField.SecondaryCursorColor property check ERROR!"); + } + if (tf1.SelectionHighlightColor.X != valueFloatShouldBe || tf1.SelectionHighlightColor.Y != valueFloatShouldBe || tf1.SelectionHighlightColor.Z != valueFloatShouldBe || tf1.SelectionHighlightColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextField.SelectionHighlightColor property check ERROR!"); + } + if (tf1.SelectionHighlightColor.X != valueFloatShouldBe || tf1.SelectionHighlightColor.Y != valueFloatShouldBe || tf1.SelectionHighlightColor.Z != valueFloatShouldBe || tf1.SelectionHighlightColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextField.SelectionHighlightColor property check ERROR!"); + } + if (tf1.ShadowColor.X != valueFloatShouldBe || tf1.ShadowColor.Y != valueFloatShouldBe || tf1.ShadowColor.Z != valueFloatShouldBe || tf1.ShadowColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextField.ShadowColor property check ERROR!"); + } + if (tf1.ShadowOffset.X != valueFloatShouldBe || tf1.ShadowOffset.Y != valueFloatShouldBe) + { + throw new ApplicationException("TextField.ShadowOffset property check ERROR!"); + } + if (tf1.TextColor.R != valueFloatShouldBe || tf1.TextColor.G != valueFloatShouldBe || tf1.TextColor.B != valueFloatShouldBe || tf1.TextColor.A != valueFloatShouldBe) + { + throw new ApplicationException("TextField.TextColor property check ERROR!"); + } + + //TextLabel + if (tl1.ShadowColor.X != valueFloatShouldBe || tl1.ShadowColor.Y != valueFloatShouldBe || tl1.ShadowColor.Z != valueFloatShouldBe || tl1.ShadowColor.W != valueFloatShouldBe) + { + throw new ApplicationException("TextLabel.ShadowColor property check ERROR!"); + } + if (tl1.ShadowOffset.X != valueFloatShouldBe || tl1.ShadowOffset.Y != valueFloatShouldBe) + { + throw new ApplicationException("TextLabel.ShadowOffset property check ERROR!"); + } + if (tl1.TextColor.R != valueFloatShouldBe || tl1.TextColor.G != valueFloatShouldBe || tl1.TextColor.B != valueFloatShouldBe || tl1.TextColor.A != valueFloatShouldBe) + { + throw new ApplicationException("TextLabel.TextColor property check ERROR!"); + } + //This is because When TextColor is increased, this UnderlineColor is also updated sychronousely. + if (tl1.UnderlineColor.X != (float)(valueFloatShouldBe + valueFloatIncreament) || tl1.UnderlineColor.Y != (float)(valueFloatShouldBe + valueFloatIncreament) || tl1.UnderlineColor.Z != (float)(valueFloatShouldBe + valueFloatIncreament) || tl1.UnderlineColor.W != (float)(valueFloatShouldBe + valueFloatIncreament)) + { + throw new ApplicationException("TextLabel.UnderlineColor property check ERROR!"); + } + + //View + if (v1.Scale.X != valueFloatShouldBe || v1.Scale.Y != valueFloatShouldBe || v1.Scale.Z != valueFloatShouldBe) + { + throw new ApplicationException("View.Scale property check ERROR!"); + } + if (v1.BackgroundColor.R != valueFloatShouldBe || v1.BackgroundColor.G != valueFloatShouldBe || v1.BackgroundColor.B != valueFloatShouldBe || v1.BackgroundColor.A != valueFloatShouldBe) + { + throw new ApplicationException("View.BackgroundColor property check ERROR!"); + } + //Padding and PaddingEX are same property, this is why increament is added one more time. + if ( v1.Padding.Start != valueUshortShouldBe || v1.Padding.End != valueUshortShouldBe || v1.Padding.Top != valueUshortShouldBe || v1.Padding.Bottom != valueUshortShouldBe) + { + throw new ApplicationException("View.Padding property check ERROR!"); + } + if (v1.Margin.Start != valueUshortShouldBe || v1.Margin.End != valueUshortShouldBe || v1.Margin.Top != valueUshortShouldBe || v1.Margin.Bottom != valueUshortShouldBe) + { + throw new ApplicationException("View.Margin property check ERROR!"); + } + + if (v1.Color.R != valueFloatShouldBe || v1.Color.G != valueFloatShouldBe || v1.Color.B != valueFloatShouldBe) + { + throw new ApplicationException("View.Color property check ERROR!"); + } + + if (v1.AnchorPoint.X != valueFloatShouldBe || v1.AnchorPoint.Y != valueFloatShouldBe || v1.AnchorPoint.Z != valueFloatShouldBe) + { + throw new ApplicationException("View.AnchorPoint property check ERROR!"); + } + if (v1.CellIndex.X != valueFloatShouldBe || v1.CellIndex.Y != valueFloatShouldBe) + { + throw new ApplicationException("View.CellIndex property check ERROR!"); + } + if (v1.FlexMargin.X != valueFloatShouldBe || v1.FlexMargin.Y != valueFloatShouldBe || v1.FlexMargin.Z != valueFloatShouldBe || v1.FlexMargin.W != valueFloatShouldBe) + { + throw new ApplicationException("View.FlexMargin property check ERROR!"); + } + if (v1.PaddingEX.Start != valueUshortShouldBe || v1.PaddingEX.End != valueUshortShouldBe || v1.PaddingEX.Top != valueUshortShouldBe || v1.PaddingEX.Bottom != valueUshortShouldBe) + { + throw new ApplicationException("View.PaddingEX property check ERROR!"); + } + if (v1.SizeModeFactor.X != valueFloatShouldBe || v1.SizeModeFactor.Y != valueFloatShouldBe || v1.SizeModeFactor.Z != valueFloatShouldBe) + { + throw new ApplicationException("View.SizeModeFactor property check ERROR!"); + } + + } + } + return true; + } + + void checkMultiCascadePropertySet() + { + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + public void Activate() + { + initMultiCascadePropertySet(); + } + public void Deactivate() + { + root.KeyEvent -= Root_KeyEvent; + } + } +} + diff --git a/test/NUITestSample/NUITestSample/examples/PropertyCascadeSpeedTest.cs b/test/NUITestSample/NUITestSample/examples/PropertyCascadeSpeedTest.cs new file mode 100644 index 0000000..0046f14 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/PropertyCascadeSpeedTest.cs @@ -0,0 +1,386 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Example +{ + public class MyPropertyCheckSpeedTest : IExample + { + View root; + ImageView iv1; + TextEditor te1; + TextField tf1; + TextLabel tl1; + View v1; + float valueFloatShouldBe = 0.1f; float valueFloatIncreament = 0.01f; + int valueIntShouldBe = 10; int valueIntIncreament = 2; + ushort valueUshortShouldBe = 3; ushort valueUshortIncreament = 1; + + void setProperty1() + { + Random r = new Random(); + float float1 = (float)r.NextDouble(); + float float2 = (float)r.NextDouble(); + float float3 = (float)r.NextDouble(); + float float4 = (float)r.NextDouble(); + int int1 = (int)r.Next(0, 1000); + int int2 = (int)r.Next(0, 1000); + int int3 = (int)r.Next(0, 1000); + int int4 = (int)r.Next(0, 1000); + ushort ushort1 = (ushort)r.Next(0, 1000); + ushort ushort2 = (ushort)r.Next(0, 1000); + ushort ushort3 = (ushort)r.Next(0, 1000); + ushort ushort4 = (ushort)r.Next(0, 1000); + + double start = DateTime.Now.Ticks; + + // ImageView.PixelArea + iv1.PixelArea = new RelativeVector4(float1, float2, float3, float4); + // ImageView.Border + iv1.Border = new Rectangle(int1, int2, int3, int4); + + //TextEditor.DecorationBoundingBox + te1.DecorationBoundingBox = new Rectangle(int1, int2, int3, int4); + //TextEditor.InputColor + te1.InputColor = new Vector4(float1, float2, float3, float4); + //TextEditor.PlaceholderTextColor + te1.PlaceholderTextColor = new Color(float1, float2, float3, float4); + //TextEditor.PrimaryCursorColor + te1.PrimaryCursorColor = new Vector4(float1, float2, float3, float4); + //TextEditor.SecondaryCursorColor + te1.SecondaryCursorColor = new Vector4(float1, float2, float3, float4); + //TextEditor.SelectionHighlightColor + te1.SelectionHighlightColor = new Vector4(float1, float2, float3, float4); + //TextEditor.TextColor + te1.TextColor = new Vector4(float1, float2, float3, float4); + + //TextField.DecorationBoundingBox + tf1.DecorationBoundingBox = new Rectangle(int1, int2, int3, int4); + //TextField.InputColor + tf1.InputColor = new Vector4(float1, float2, float3, float4); + //TextField.PlaceholderTextColor + tf1.PlaceholderTextColor = new Vector4(float1, float2, float3, float4); + //TextField.PrimaryCursorColor + tf1.PrimaryCursorColor = new Vector4(float1, float2, float3, float4); + //TextField.SecondaryCursorColor + tf1.SecondaryCursorColor = new Vector4(float1, float2, float3, float4); + //TextField.SelectionHighlightColor + tf1.SelectionHighlightColor = new Vector4(float1, float2, float3, float4); + //TextField.ShadowColor + tf1.ShadowColor = new Vector4(float1, float2, float3, float4); + //TextField.ShadowOffset + tf1.ShadowOffset = new Vector2(float1, float2); + //TextField.TextColor + tf1.TextColor = new Color(float1, float2, float3, float4); + + //TextLabel.ShadowColor + tl1.ShadowColor = new Vector4(float1, float2, float3, float4); + //TextLabel.ShadowOffset + tl1.ShadowOffset = new Vector2(float1, float2); + //TextLabel.TextColor + tl1.TextColor = new Color(float1, float2, float3, float4); + //TextLabel.UnderlineColor + tl1.UnderlineColor = new Vector4(float1, float2, float3, float4); + + //View.Scale + v1.Scale = new Vector3(float1, float2, float3); + //View.BackgroundColor + v1.BackgroundColor = new Color(float1, float2, float3, float4); + //View.Padding + v1.Padding = new Extents(ushort1, ushort2, ushort3, ushort4); + //View.Margin + v1.Margin = new Extents(ushort1, ushort2, ushort3, ushort4); + //View.Color + v1.Color = new Color(float1, float2, float3, float4); + //View.AnchorPoint + v1.AnchorPoint = new Position(float1, float2, float3); + //View.CellIndex + v1.CellIndex = new Vector2(float1, float2); + //View.FlexMargin + v1.FlexMargin = new Vector4(float1, float2, float3, float4); + //View.PaddingEX + v1.PaddingEX = new Extents(ushort1, ushort2, ushort3, ushort4); + //View.SizeModeFactor + v1.SizeModeFactor = new Vector3(float1, float2, float3); + + double end = DateTime.Now.Ticks; + Tizen.Log.Fatal("NUITEST", $"setProperty1() elapsed time={(double)(end - start) / (double)TimeSpan.TicksPerMillisecond}ms"); + } + void setProperty2() + { + double start = DateTime.Now.Ticks; + + // ImageView.PixelArea + var var1 = iv1.PixelArea; + iv1.PixelArea = new RelativeVector4(var1.X + valueFloatIncreament, var1.Y + valueFloatIncreament, var1.Z + valueFloatIncreament, var1.W + valueFloatIncreament); + // ImageView.Border + var var2 = iv1.Border; + iv1.Border = new Rectangle(var2.X + valueIntIncreament, var2.Y + valueIntIncreament, var2.Width + valueIntIncreament, var2.Height + valueIntIncreament); + + //TextEditor.DecorationBoundingBox + var var3 = te1.DecorationBoundingBox; + te1.DecorationBoundingBox = new Rectangle(var3.X + valueIntIncreament, var3.Y + valueIntIncreament, var3.Width + valueIntIncreament, var3.Height + valueIntIncreament); + //TextEditor.InputColor + var var4 = te1.InputColor; + te1.InputColor = new Vector4(var4.X + valueFloatIncreament, var4.Y + valueFloatIncreament, var4.Z + valueFloatIncreament, var4.W + valueFloatIncreament); + //TextEditor.PlaceholderTextColor + var var5 = te1.PlaceholderTextColor; + te1.PlaceholderTextColor = new Color(var5.R + valueFloatIncreament, var5.G + valueFloatIncreament, var5.B + valueFloatIncreament, var5.A + valueFloatIncreament); + //TextEditor.PrimaryCursorColor + var var6 = te1.PrimaryCursorColor; + te1.PrimaryCursorColor = new Vector4(var6.X + valueFloatIncreament, var6.Y + valueFloatIncreament, var6.Z + valueFloatIncreament, var6.W + valueFloatIncreament); + //TextEditor.SecondaryCursorColor + var var7 = te1.SecondaryCursorColor; + te1.SecondaryCursorColor = new Vector4(var7.X + valueFloatIncreament, var7.Y + valueFloatIncreament, var7.Z + valueFloatIncreament, var7.W + valueFloatIncreament); + //TextEditor.SelectionHighlightColor + var var8 = te1.SelectionHighlightColor; + te1.SelectionHighlightColor = new Vector4(var8.X + valueFloatIncreament, var8.Y + valueFloatIncreament, var8.Z + valueFloatIncreament, var8.W + valueFloatIncreament); + //TextEditor.TextColor + var var9 = te1.TextColor; + te1.TextColor = new Vector4(var9.X + valueFloatIncreament, var9.Y + valueFloatIncreament, var9.Z + valueFloatIncreament, var9.W + valueFloatIncreament); + //TextField.DecorationBoundingBox + var var10 = tf1.DecorationBoundingBox; + tf1.DecorationBoundingBox = new Rectangle(var10.X + valueIntIncreament, var10.Y + valueIntIncreament, var10.Width + valueIntIncreament, var10.Height + valueIntIncreament); + //TextField.InputColor + var var11 = tf1.InputColor; + tf1.InputColor = new Vector4(var11.X + valueFloatIncreament, var11.Y + valueFloatIncreament, var11.Z + valueFloatIncreament, var11.W + valueFloatIncreament); + //TextField.PlaceholderTextColor + var var12 = tf1.PlaceholderTextColor; + tf1.PlaceholderTextColor = new Vector4(var12.X + valueFloatIncreament, var12.Y + valueFloatIncreament, var12.Z + valueFloatIncreament, var12.W + valueFloatIncreament); + //TextField.PrimaryCursorColor + var var13 = tf1.PrimaryCursorColor; + tf1.PrimaryCursorColor = new Vector4(var13.X + valueFloatIncreament, var13.Y + valueFloatIncreament, var13.Z + valueFloatIncreament, var13.W + valueFloatIncreament); + //TextField.SecondaryCursorColor + var var14 = tf1.SecondaryCursorColor; + tf1.SecondaryCursorColor = new Vector4(var14.X + valueFloatIncreament, var14.Y + valueFloatIncreament, var14.Z + valueFloatIncreament, var14.W + valueFloatIncreament); + //TextField.SelectionHighlightColor + var var15 = tf1.SelectionHighlightColor; + tf1.SelectionHighlightColor = new Vector4(var15.X + valueFloatIncreament, var15.Y + valueFloatIncreament, var15.Z + valueFloatIncreament, var15.W + valueFloatIncreament); + //TextField.ShadowColor + var var16 = tf1.ShadowColor; + tf1.ShadowColor = new Vector4(var16.X + valueFloatIncreament, var16.Y + valueFloatIncreament, var16.Z + valueFloatIncreament, var16.W + valueFloatIncreament); + //TextField.ShadowOffset + var var17 = tf1.ShadowOffset; + tf1.ShadowOffset = new Vector2(var17.X + valueFloatIncreament, var17.Y + valueFloatIncreament); + //TextField.TextColor + var var18 = tf1.TextColor; + tf1.TextColor = new Color(var18.R + valueFloatIncreament, var18.G + valueFloatIncreament, var18.B + valueFloatIncreament, var18.A + valueFloatIncreament); + + //TextLabel.ShadowColor + var var19 = tl1.ShadowColor; + tl1.ShadowColor = new Vector4(var19.X + valueFloatIncreament, var19.Y + valueFloatIncreament, var19.Z + valueFloatIncreament, var19.W + valueFloatIncreament); + //TextLabel.ShadowOffset + var var20 = tl1.ShadowOffset; + tl1.ShadowOffset = new Vector2(var20.X + valueFloatIncreament, var20.Y + valueFloatIncreament); + //TextLabel.TextColor + var var21 = tl1.TextColor; + tl1.TextColor = new Color(var21.R + valueFloatIncreament, var21.G + valueFloatIncreament, var21.B + valueFloatIncreament, var21.A + valueFloatIncreament); + //TextLabel.UnderlineColor + var var22 = tl1.UnderlineColor; + tl1.UnderlineColor = new Vector4(var22.X + valueFloatIncreament, var22.Y + valueFloatIncreament, var22.Z + valueFloatIncreament, var22.W + valueFloatIncreament); + + //View.Scale + var var23 = v1.Scale; + v1.Scale = new Vector3(var23.X + valueFloatIncreament, var23.Y + valueFloatIncreament, var23.Z + valueFloatIncreament); + //View.BackgroundColor + var var24 = v1.BackgroundColor; + v1.BackgroundColor = new Color(var24.R + valueFloatIncreament, var24.G + valueFloatIncreament, var24.B + valueFloatIncreament, var24.A + valueFloatIncreament); + //View.Padding + var var25 = v1.Padding; + v1.Padding = new Extents((ushort)(var25.Start + valueUshortIncreament), (ushort)(var25.End + valueUshortIncreament), (ushort)(var25.Top + valueUshortIncreament), (ushort)(var25.Bottom + valueUshortIncreament)); + //View.Margin + var var26 = v1.Margin; + v1.Margin = new Extents((ushort)(var26.Start + valueUshortIncreament), (ushort)(var26.End + valueUshortIncreament), (ushort)(var26.Top + valueUshortIncreament), (ushort)(var26.Bottom + valueUshortIncreament)); + //View.Color + var var27 = v1.Color; + v1.Color = new Color(var27.R + valueFloatIncreament, var27.G + valueFloatIncreament, var27.B + valueFloatIncreament, var27.A + valueFloatIncreament); + //View.AnchorPoint + var var28 = v1.AnchorPoint; + v1.AnchorPoint = new Position(var28.X + valueFloatIncreament, var28.Y + valueFloatIncreament, var28.Z + valueFloatIncreament); + //View.CellIndex + var var29 = v1.CellIndex; + v1.CellIndex = new Vector2(var29.X + valueFloatIncreament, var29.Y + valueFloatIncreament); + //View.FlexMargin + var var30 = v1.FlexMargin; + v1.FlexMargin = new Vector4(var30.X + valueFloatIncreament, var30.Y + valueFloatIncreament, var30.Z + valueFloatIncreament, var30.W + valueFloatIncreament); + //View.PaddingEX + var var31 = v1.PaddingEX; + v1.PaddingEX = new Extents((ushort)(var31.Start + valueUshortIncreament), (ushort)(var31.End + valueUshortIncreament), (ushort)(var31.Top + valueUshortIncreament), (ushort)(var31.Bottom + valueUshortIncreament)); + //View.SizeModeFactor + var var32 = v1.SizeModeFactor; + v1.SizeModeFactor = new Vector3(var32.X + valueFloatIncreament, var32.Y + valueFloatIncreament, var32.Z + valueFloatIncreament); + + + double end = DateTime.Now.Ticks; + Tizen.Log.Fatal("NUITEST", $"setProperty2() elapsed time={(double)(end - start) / (double)TimeSpan.TicksPerMillisecond}ms"); + } + + void setProperty3() + { + iv1.PixelArea = new RelativeVector4(0.5f, 0.5f, 0.5f, 0.5f); + iv1.PixelArea.X = 0.4f; + + if(iv1.PixelArea.X == 0.4f) + { + Tizen.Log.Fatal("NUITEST", $"property cascading set patch is applied!"); + } + else if(iv1.PixelArea.X == 0.5f) + { + Tizen.Log.Fatal("NUITEST", $"property cascading set patch is NOT applied!"); + } + else + { + Tizen.Log.Fatal("NUITEST", $"Something wrong! this log shold not be shown!"); + } + + double start = DateTime.Now.Ticks; + + // ImageView.PixelArea + iv1.PixelArea.X += valueFloatIncreament; iv1.PixelArea.Y += valueFloatIncreament; iv1.PixelArea.Z += valueFloatIncreament; iv1.PixelArea.W += valueFloatIncreament; + // ImageView.Border + iv1.Border.X += valueIntIncreament; iv1.Border.Y += valueIntIncreament; iv1.Border.Width += valueIntIncreament; iv1.Border.Height += valueIntIncreament; + + //TextEditor.DecorationBoundingBox + te1.DecorationBoundingBox.X += valueIntIncreament; te1.DecorationBoundingBox.Y += valueIntIncreament; te1.DecorationBoundingBox.Width += valueIntIncreament; te1.DecorationBoundingBox.Height += valueIntIncreament; + //TextEditor.InputColor + te1.InputColor.X += valueFloatIncreament; te1.InputColor.Y += valueFloatIncreament; te1.InputColor.Z += valueFloatIncreament; te1.InputColor.W += valueFloatIncreament; + //TextEditor.PlaceholderTextColor + te1.PlaceholderTextColor.R += valueFloatIncreament; te1.PlaceholderTextColor.G += valueFloatIncreament; te1.PlaceholderTextColor.B += valueFloatIncreament; te1.PlaceholderTextColor.A += valueFloatIncreament; + //TextEditor.PrimaryCursorColor + te1.PrimaryCursorColor.X += valueFloatIncreament; te1.PrimaryCursorColor.Y += valueFloatIncreament; te1.PrimaryCursorColor.Z += valueFloatIncreament; te1.PrimaryCursorColor.W += valueFloatIncreament; + //TextEditor.SecondaryCursorColor + te1.SecondaryCursorColor.X += valueFloatIncreament; te1.SecondaryCursorColor.Y += valueFloatIncreament; te1.SecondaryCursorColor.Z += valueFloatIncreament; te1.SecondaryCursorColor.W += valueFloatIncreament; + //TextEditor.SelectionHighlightColor + te1.SelectionHighlightColor.X += valueFloatIncreament; te1.SelectionHighlightColor.Y += valueFloatIncreament; te1.SelectionHighlightColor.Z += valueFloatIncreament; te1.SelectionHighlightColor.W += valueFloatIncreament; + //TextEditor.TextColor + te1.TextColor.X += valueFloatIncreament; te1.TextColor.Y += valueFloatIncreament; te1.TextColor.Z += valueFloatIncreament; te1.TextColor.W += valueFloatIncreament; + //TextField.DecorationBoundingBox + tf1.DecorationBoundingBox.X += valueIntIncreament; tf1.DecorationBoundingBox.Y += valueIntIncreament; tf1.DecorationBoundingBox.Width += valueIntIncreament; tf1.DecorationBoundingBox.Height += valueIntIncreament; + //TextField.InputColor + tf1.InputColor.X += valueFloatIncreament; tf1.InputColor.Y += valueFloatIncreament; tf1.InputColor.Z += valueFloatIncreament; tf1.InputColor.W += valueFloatIncreament; + //TextField.PlaceholderTextColor + tf1.PlaceholderTextColor.X += valueFloatIncreament; tf1.PlaceholderTextColor.Y += valueFloatIncreament; tf1.PlaceholderTextColor.Z += valueFloatIncreament; tf1.PlaceholderTextColor.W += valueFloatIncreament; + //TextField.PrimaryCursorColor + tf1.PrimaryCursorColor.X += valueFloatIncreament; tf1.PrimaryCursorColor.Y += valueFloatIncreament; tf1.PrimaryCursorColor.Z += valueFloatIncreament; tf1.PrimaryCursorColor.W += valueFloatIncreament; + //TextField.SecondaryCursorColor + tf1.SecondaryCursorColor.X += valueFloatIncreament; tf1.SecondaryCursorColor.Y += valueFloatIncreament; tf1.SecondaryCursorColor.Z += valueFloatIncreament; tf1.SecondaryCursorColor.W += valueFloatIncreament; + //TextField.SelectionHighlightColor + tf1.SelectionHighlightColor.X += valueFloatIncreament; tf1.SelectionHighlightColor.Y += valueFloatIncreament; tf1.SelectionHighlightColor.Z += valueFloatIncreament; tf1.SelectionHighlightColor.W += valueFloatIncreament; + //TextField.ShadowColor + tf1.ShadowColor.X += valueFloatIncreament; tf1.ShadowColor.Y += valueFloatIncreament; tf1.ShadowColor.Z += valueFloatIncreament; tf1.ShadowColor.W += valueFloatIncreament; + //TextField.ShadowOffset + tf1.ShadowOffset.X += valueFloatIncreament; tf1.ShadowOffset.Y += valueFloatIncreament; + //TextField.TextColor + tf1.TextColor.R += valueFloatIncreament; tf1.TextColor.G += valueFloatIncreament; tf1.TextColor.B += valueFloatIncreament; tf1.TextColor.A += valueFloatIncreament; + + //TextLabel.ShadowColor + tl1.ShadowColor.X += valueFloatIncreament; tl1.ShadowColor.Y += valueFloatIncreament; tl1.ShadowColor.Z += valueFloatIncreament; tl1.ShadowColor.W += valueFloatIncreament; + //TextLabel.ShadowOffset + tl1.ShadowOffset.X += valueFloatIncreament; tl1.ShadowOffset.Y += valueFloatIncreament; + //TextLabel.TextColor + tl1.TextColor.R += valueFloatIncreament; tl1.TextColor.G += valueFloatIncreament; tl1.TextColor.B += valueFloatIncreament; tl1.TextColor.A += valueFloatIncreament; + //TextLabel.UnderlineColor + tl1.UnderlineColor.X += valueFloatIncreament; tl1.UnderlineColor.Y += valueFloatIncreament; tl1.UnderlineColor.Z += valueFloatIncreament; tl1.UnderlineColor.W += valueFloatIncreament; + + //View.Scale + v1.Scale.X += valueFloatIncreament; v1.Scale.Y += valueFloatIncreament; v1.Scale.Z += valueFloatIncreament; + //View.BackgroundColor + v1.BackgroundColor.R += valueFloatIncreament; v1.BackgroundColor.G += valueFloatIncreament; v1.BackgroundColor.B += valueFloatIncreament; v1.BackgroundColor.A += valueFloatIncreament; + //View.Padding + v1.Padding.Start += valueUshortIncreament; v1.Padding.End += valueUshortIncreament; v1.Padding.Top += valueUshortIncreament; v1.Padding.Bottom += valueUshortIncreament; + //View.Margin + v1.Margin.Start += valueUshortIncreament; v1.Margin.End += valueUshortIncreament; v1.Margin.Top += valueUshortIncreament; v1.Margin.Bottom += valueUshortIncreament; + //View.Color + v1.Color.R += valueFloatIncreament; v1.Color.G += valueFloatIncreament; v1.Color.B += valueFloatIncreament; v1.Color.A += valueFloatIncreament; + //View.AnchorPoint + v1.AnchorPoint.X += valueFloatIncreament; v1.AnchorPoint.Y += valueFloatIncreament; v1.AnchorPoint.Z += valueFloatIncreament; + //View.CellIndex + v1.CellIndex.X += valueFloatIncreament; v1.CellIndex.Y += valueFloatIncreament; + //View.FlexMargin + v1.FlexMargin.X += valueFloatIncreament; v1.FlexMargin.Y += valueFloatIncreament; v1.FlexMargin.Z += valueFloatIncreament; v1.FlexMargin.W += valueFloatIncreament; + //View.PaddingEX + v1.PaddingEX.Start += valueUshortIncreament; v1.PaddingEX.End += valueUshortIncreament; v1.PaddingEX.Top += valueUshortIncreament; v1.PaddingEX.Bottom += valueUshortIncreament; + //View.SizeModeFactor + v1.SizeModeFactor.X += valueFloatIncreament; v1.SizeModeFactor.Y += valueFloatIncreament; v1.SizeModeFactor.Z += valueFloatIncreament; + + double end = DateTime.Now.Ticks; + Tizen.Log.Fatal("NUITEST", $"setProperty3() elapsed time={(double)(end - start) / (double)TimeSpan.TicksPerMillisecond}ms"); + } + void initMultiCascadePropertySetSpeedCheck() + { + root = new View(); + root.Focusable = true; + Window.Instance.Add(root); + root.KeyEvent += Root_KeyEvent; + FocusManager.Instance.SetCurrentFocusView(root); + Window.Instance.BackgroundColor = Color.White; + + //ImageView + iv1 = new ImageView(); + iv1.ResourceUrl = Applications.Application.Current.DirectoryInfo.Resource + "/images/gallery-0.jpg"; + iv1.Size2D = new Size2D(100, 100); + iv1.Position2D = new Position2D(100, 100); + root.Add(iv1); + //TextEditor + te1 = new TextEditor(); + te1.Text = "test TextEditor"; + te1.Size2D = new Size2D(100, 100); + te1.Position2D = new Position2D(200, 200); + root.Add(te1); + //TextField + tf1 = new TextField(); + tf1.Text = "test TextField"; + tf1.Size2D = new Size2D(100, 100); + tf1.Position2D = new Position2D(300, 300); + root.Add(tf1); + //TextLabel + tl1 = new TextLabel(); + tl1.Text = "test TextLabel"; + tl1.Size2D = new Size2D(100, 100); + tl1.Position2D = new Position2D(400, 400); + root.Add(tl1); + //View + v1 = new View(); + v1.Size2D = new Size2D(100, 100); + v1.Position2D = new Position2D(500, 500); + root.Add(v1); + } + + private bool Root_KeyEvent(object source, View.KeyEventArgs e) + { + if (e.Key.State == Key.StateType.Down) + { + if (e.Key.KeyPressedName == "1") + { + } + } + return true; + } + + void checkMultiCascadePropertySet() + { + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + public void Activate() + { + initMultiCascadePropertySetSpeedCheck(); + setProperty1(); + setProperty1(); + setProperty1(); + + setProperty2(); + setProperty2(); + setProperty2(); + + setProperty3(); + setProperty3(); + setProperty3(); + } + public void Deactivate() + { + root.KeyEvent -= Root_KeyEvent; + } + } +} + -- 2.7.4