From: dongsug.song Date: Mon, 1 Jul 2024 13:16:19 +0000 (+0900) Subject: [NUI] Avoid boxing,unboxing overhead X-Git-Tag: submit/tizen/20240710.091550~1^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ea4b58a521bb936a02f19e0a1d393c856c2a8da;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Avoid boxing,unboxing overhead --- diff --git a/src/Tizen.NUI/Tizen.NUI.csproj b/src/Tizen.NUI/Tizen.NUI.csproj index 40211c222..3ec641551 100755 --- a/src/Tizen.NUI/Tizen.NUI.csproj +++ b/src/Tizen.NUI/Tizen.NUI.csproj @@ -5,7 +5,7 @@ 8.0 - $(DefineConstants);NUI_DEBUG_OFF;REMOVE_READONLY_FOR_BINDABLE_PROPERTY; + $(DefineConstants);NUI_DEBUG_OFF; diff --git a/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageViewBindableProperty.cs index 7a13e053b..b0958e48a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageViewBindableProperty.cs @@ -26,11 +26,8 @@ namespace Tizen.NUI.BaseComponents /// ResourceURLProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ResourceURLProperty = null; -#else public static readonly BindableProperty ResourceURLProperty = null; -#endif + internal static void SetInternalResourceURLProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable; @@ -50,11 +47,8 @@ namespace Tizen.NUI.BaseComponents /// Should use new keyword! /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static new BindableProperty ResourceUrlProperty = null; -#else public static readonly new BindableProperty ResourceUrlProperty = null; -#endif + internal static new void SetInternalResourceUrlProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable; @@ -70,11 +64,8 @@ namespace Tizen.NUI.BaseComponents /// RepeatCountProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty RepeatCountProperty = null; -#else public static readonly BindableProperty RepeatCountProperty = null; -#endif + internal static void SetInternalRepeatCountProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable; @@ -97,11 +88,8 @@ namespace Tizen.NUI.BaseComponents /// Should use new keyword! /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static new BindableProperty CurrentFrameProperty = null; -#else public static readonly new BindableProperty CurrentFrameProperty = null; -#endif + internal static new void SetInternalCurrentFrameProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable; @@ -120,11 +108,8 @@ namespace Tizen.NUI.BaseComponents /// RepeatModeProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty RepeatModeProperty = null; -#else public static readonly BindableProperty RepeatModeProperty = null; -#endif + static internal void SetInternalRepeatModeProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.AnimatedVectorImageView)bindable; diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index ed748ad96..59740e6cc 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -98,9 +98,6 @@ namespace Tizen.NUI.BaseComponents { if (NUIApplication.IsUsingXaml) { -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - CreateBindableProperties(); -#else StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(View), string.Empty, propertyChanged: SetInternalStyleNameProperty, defaultValueCreator: GetInternalStyleNameProperty); @@ -112,7 +109,7 @@ namespace Tizen.NUI.BaseComponents ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(View), null, propertyChanged: SetInternalColorProperty, defaultValueCreator: GetInternalColorProperty); - + ColorRedProperty = BindableProperty.Create(nameof(ColorRed), typeof(float), typeof(View), default(float), propertyChanged: SetInternalColorRedProperty, defaultValueCreator: GetInternalColorRedProperty); @@ -379,7 +376,7 @@ namespace Tizen.NUI.BaseComponents AnchorPointProperty = BindableProperty.Create(nameof(AnchorPoint), typeof(Tizen.NUI.Position), typeof(View), null, propertyChanged: SetInternalAnchorPointProperty, defaultValueCreator: GetInternalAnchorPointProperty); - + WidthSpecificationProperty = BindableProperty.Create(nameof(WidthSpecification), typeof(int), typeof(View), 0, propertyChanged: SetInternalWidthSpecificationProperty, defaultValueCreator: GetInternalWidthSpecificationProperty); @@ -446,7 +443,6 @@ namespace Tizen.NUI.BaseComponents RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup); RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup); RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup); -#endif } RegisterAccessibilityDelegate(); } @@ -777,7 +773,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalExcludeLayoutingProperty(this); + return GetInternalExcludeLayouting(); } } set @@ -788,12 +784,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalExcludeLayoutingProperty(this, null, value); + SetInternalExcludeLayouting(value); } NotifyPropertyChanged(); } } + internal bool GetInternalExcludeLayouting() + { + return InternalExcludeLayouting; + } + internal void SetInternalExcludeLayouting(bool excludeLayouting) + { + InternalExcludeLayouting = excludeLayouting; + } + private bool InternalExcludeLayouting { get @@ -857,7 +862,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalKeyInputFocusProperty(this); + return GetInternalKeyInputFocus(); } } set @@ -868,12 +873,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalKeyInputFocusProperty(this, null, value); + SetInternalKeyInputFocus(value); } NotifyPropertyChanged(); } } + internal void SetInternalKeyInputFocus(bool keyInputFocus) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.KeyInputFocus, keyInputFocus); + } + internal bool GetInternalKeyInputFocus() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.KeyInputFocus); + } + /// /// The mutually exclusive with "backgroundImage" and "background" type Vector4. /// @@ -1174,7 +1188,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (VisualTransformPolicyType)GetInternalCornerRadiusPolicyProperty(this); + return GetInternalCornerRadiusPolicy(); } } set @@ -1185,10 +1199,23 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalCornerRadiusPolicyProperty(this, null, value); + SetInternalCornerRadiusPolicy(value); } } } + internal void SetInternalCornerRadiusPolicy(VisualTransformPolicyType value) + { + (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerRadiusPolicy = value; + + if (backgroundExtraData.CornerRadius != null) + { + UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius); + } + } + internal VisualTransformPolicyType GetInternalCornerRadiusPolicy() + { + return backgroundExtraData == null ? VisualTransformPolicyType.Absolute : backgroundExtraData.CornerRadiusPolicy; + } /// /// The width for the borderline of the View. @@ -1213,7 +1240,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalBorderlineWidthProperty(this); + return GetInternalBorderlineWidth(); } } set @@ -1224,11 +1251,20 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalBorderlineWidthProperty(this, null, value); + SetInternalBorderlineWidth(value); } NotifyPropertyChanged(); } } + internal void SetInternalBorderlineWidth(float borderlineWidth) + { + (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BorderlineWidth = borderlineWidth; + UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline); + } + internal float GetInternalBorderlineWidth() + { + return backgroundExtraData == null ? 0.0f : backgroundExtraData.BorderlineWidth; + } /// /// The color for the borderline of the View. @@ -1329,7 +1365,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalBorderlineOffsetProperty(this); + return GetInternalBorderlineOffset(); } } set @@ -1340,12 +1376,22 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalBorderlineOffsetProperty(this, null, value); + SetInternalBorderlineOffset(value); } NotifyPropertyChanged(); } } + internal void SetInternalBorderlineOffset(float borderlineOffset) + { + (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BorderlineOffset = borderlineOffset; + UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline); + } + internal float GetInternalBorderlineOffset() + { + return backgroundExtraData == null ? 0.0f : backgroundExtraData.BorderlineOffset; + } + /// /// The current state of the view. /// @@ -1360,7 +1406,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (States)GetInternalStateProperty(this); + return GetInternalState(); } } set @@ -1371,12 +1417,28 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalStateProperty(this, null, value); + SetInternalState(value); } NotifyPropertyChanged(); } } + internal void SetInternalState(States value) + { + Object.InternalSetPropertyInt(SwigCPtr, Property.STATE, (int)value); + } + internal States GetInternalState() + { + int temp = Object.InternalGetPropertyInt(SwigCPtr, Property.STATE); + switch (temp) + { + case 0: return States.Normal; + case 1: return States.Focused; + case 2: return States.Disabled; + default: return States.Normal; + } + } + /// /// The current sub state of the view. /// @@ -1391,7 +1453,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (States)GetInternalSubStateProperty(this); + return GetInternalSubState(); } } set @@ -1402,12 +1464,23 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalSubStateProperty(this, null, value); + SetInternalSubState(value); } NotifyPropertyChanged(); } } + internal void SetInternalSubState(States value) + { + string valueToString = value.GetDescription(); + Object.InternalSetPropertyString(SwigCPtr, Property.SubState, valueToString); + } + internal States GetInternalSubState() + { + string temp = Object.InternalGetPropertyString(SwigCPtr, Property.SubState); + return temp.GetValueByDescription(); + } + /// /// Displays a tooltip /// @@ -1521,7 +1594,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalFlexProperty(this); + return GetInternalFlex(); + } } set @@ -1532,12 +1606,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalFlexProperty(this, null, value); + SetInternalFlex(value); } NotifyPropertyChanged(); } } + internal void SetInternalFlex(float flex) + { + Object.InternalSetPropertyFloat(SwigCPtr, FlexContainer.ChildProperty.FLEX, flex); + } + internal float GetInternalFlex() + { + return Object.InternalGetPropertyFloat(SwigCPtr, FlexContainer.ChildProperty.FLEX); + } + /// /// The Child property of FlexContainer.
/// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.
@@ -1554,7 +1637,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (int)GetInternalAlignSelfProperty(this); + return GetInternalAlignSelf(); } } set @@ -1565,12 +1648,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalAlignSelfProperty(this, null, value); + SetInternalAlignSelf(value); } NotifyPropertyChanged(); } } + internal void SetInternalAlignSelf(int alignSelf) + { + Object.InternalSetPropertyInt(SwigCPtr, FlexContainer.ChildProperty.AlignSelf, alignSelf); + } + internal int GetInternalAlignSelf() + { + return Object.InternalGetPropertyInt(SwigCPtr, FlexContainer.ChildProperty.AlignSelf); + } + /// /// The Child property of FlexContainer.
/// The space around the flex item.
@@ -1640,8 +1732,6 @@ namespace Tizen.NUI.BaseComponents { return (Vector2)GetInternalCellIndexProperty(this); } - - } set { @@ -1653,8 +1743,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalCellIndexProperty(this, null, value); } - - NotifyPropertyChanged(); } } @@ -1676,7 +1764,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalRowSpanProperty(this); + return GetInternalRowSpan(); } } set @@ -1687,12 +1775,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalRowSpanProperty(this, null, value); + SetInternalRowSpan(value); } NotifyPropertyChanged(); } } + internal void SetInternalRowSpan(float rowSpan) + { + Object.InternalSetPropertyFloat(SwigCPtr, TableView.ChildProperty.RowSpan, rowSpan); + } + internal float GetInternalRowSpan() + { + return Object.InternalGetPropertyFloat(SwigCPtr, TableView.ChildProperty.RowSpan); + } + /// /// The number of columns this child occupies, if not set, the default value is 1. /// @@ -1710,7 +1807,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalColumnSpanProperty(this); + return GetInternalColumnSpan(); } } set @@ -1721,12 +1818,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalColumnSpanProperty(this, null, value); + SetInternalColumnSpan(value); } NotifyPropertyChanged(); } } + internal void SetInternalColumnSpan(float columnSpan) + { + Object.InternalSetPropertyFloat(SwigCPtr, TableView.ChildProperty.ColumnSpan, columnSpan); + } + internal float GetInternalColumnSpan() + { + return Object.InternalGetPropertyFloat(SwigCPtr, TableView.ChildProperty.ColumnSpan); + } + /// /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'. /// @@ -1744,7 +1850,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (HorizontalAlignmentType)GetInternalCellHorizontalAlignmentProperty(this); + return GetInternalCellHorizontalAlignment(); } } set @@ -1755,12 +1861,23 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalCellHorizontalAlignmentProperty(this, null, value); + SetInternalCellHorizontalAlignment(value); } NotifyPropertyChanged(); } } + internal void SetInternalCellHorizontalAlignment(HorizontalAlignmentType value) + { + string valueToString = value.GetDescription(); + Object.InternalSetPropertyString(SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment, valueToString); + } + internal HorizontalAlignmentType GetInternalCellHorizontalAlignment() + { + string temp = Object.InternalGetPropertyString(SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment); + return temp.GetValueByDescription(); + } + /// /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'. /// @@ -1778,7 +1895,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (VerticalAlignmentType)GetInternalCellVerticalAlignmentProperty(this); + return GetInternalCellVerticalAlignment(); } } set @@ -1789,12 +1906,23 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalCellVerticalAlignmentProperty(this, null, value); + SetInternalCellVerticalAlignment(value); } NotifyPropertyChanged(); } } + internal void SetInternalCellVerticalAlignment(VerticalAlignmentType value) + { + string valueToString = value.GetDescription(); + Object.InternalSetPropertyString(SwigCPtr, TableView.ChildProperty.CellVerticalAlignment, valueToString); + } + internal VerticalAlignmentType GetInternalCellVerticalAlignment() + { + string temp = Object.InternalGetPropertyString(SwigCPtr, TableView.ChildProperty.CellVerticalAlignment); + return temp.GetValueByDescription(); + } + /// /// The left focusable view.
/// This will return null if not set.
@@ -2013,7 +2141,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalFocusableProperty(this); + return GetInternalFocusable(); } } set @@ -2024,12 +2152,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalFocusableProperty(this, null, value); + SetInternalFocusable(value); } NotifyPropertyChanged(); } } + internal void SetInternalFocusable(bool focusable) + { + SetKeyboardFocusable(focusable); + } + internal bool GetInternalFocusable() + { + return IsKeyboardFocusable(); + } + /// /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused. /// Note : Default value is true. @@ -2045,7 +2182,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalFocusableChildrenProperty(this); + return GetInternalFocusableChildren(); } } set @@ -2056,12 +2193,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalFocusableChildrenProperty(this, null, value); + SetInternalFocusableChildren(value); } NotifyPropertyChanged(); } } + internal void SetInternalFocusableChildren(bool focusableChildren) + { + SetKeyboardFocusableChildren(focusableChildren); + } + internal bool GetInternalFocusableChildren() + { + return AreChildrenKeyBoardFocusable(); + } + /// /// Whether this view can focus by touch. /// If Focusable is false, FocusableInTouch is disabled. @@ -2079,7 +2225,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalFocusableInTouchProperty(this); + return GetInternalFocusableInTouch(); } } set @@ -2090,12 +2236,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalFocusableInTouchProperty(this, null, value); + SetInternalFocusableInTouch(value); } NotifyPropertyChanged(); } } + internal void SetInternalFocusableInTouch(bool focusableInTouch) + { + SetFocusableInTouch(focusableInTouch); + } + internal bool GetInternalFocusableInTouch() + { + return IsFocusableInTouch(); + } + /// /// Retrieves the position of the view. /// The coordinates are relative to the view's parent. @@ -2216,7 +2371,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalOpacityProperty(this); + return GetInternalOpacity(); } } set @@ -2227,12 +2382,22 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalOpacityProperty(this, null, value); + SetInternalOpacity(value); } NotifyPropertyChanged(); } } + internal void SetInternalOpacity(float opacity) + { + //Selector using code has been removed because the Selector is not used when IsUsingXaml is false + SetOpacity(opacity); + } + internal float GetInternalOpacity() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.OPACITY); + } + /// /// Sets the position of the view for X and Y.
/// By default, sets the position vector between the parent origin and the pivot point (default).
@@ -2276,7 +2441,6 @@ namespace Tizen.NUI.BaseComponents else { SetInternalPosition2DProperty(this, null, value); - } NotifyPropertyChanged(); } @@ -2329,7 +2493,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalPositionUsesPivotPointProperty(this); + return GetInternalPositionUsesPivotPoint(); } } set @@ -2340,12 +2504,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalPositionUsesPivotPointProperty(this, null, value); + SetInternalPositionUsesPivotPoint(value); } NotifyPropertyChanged(); } } + internal void SetInternalPositionUsesPivotPoint(bool positionUsesPivotPoint) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.PositionUsesAnchorPoint, positionUsesPivotPoint); + } + internal bool GetInternalPositionUsesPivotPoint() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.PositionUsesAnchorPoint); + } + /// /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead. /// @@ -2367,7 +2540,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalPositionUsesAnchorPointProperty(this); + return GetInternalPositionUsesAnchorPoint(); } } set @@ -2378,11 +2551,20 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalPositionUsesAnchorPointProperty(this, null, value); + SetInternalPositionUsesAnchorPoint(value); } } } + internal void SetInternalPositionUsesAnchorPoint(bool positionUsesAnchorPoint) + { + InternalPositionUsesAnchorPoint = positionUsesAnchorPoint; + } + internal bool GetInternalPositionUsesAnchorPoint() + { + return InternalPositionUsesAnchorPoint; + } + private bool InternalPositionUsesAnchorPoint { get @@ -2440,7 +2622,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (int)GetInternalSiblingOrderProperty(this); + return GetInternalSiblingOrder(); } } set @@ -2451,13 +2633,49 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalSiblingOrderProperty(this, null, value); + SetInternalSiblingOrder(value); } Layout?.ChangeLayoutSiblingOrder(value); NotifyPropertyChanged(); } } + internal void SetInternalSiblingOrder(int siblingOrder) + { + if (siblingOrder < 0) + { + NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0."); + return; + } + var siblings = GetParent()?.Children; + if (siblings != null) + { + int currentOrder = siblings.IndexOf(this); + if (siblingOrder != currentOrder) + { + if (siblingOrder == 0) { LowerToBottom(); } + else if (siblingOrder < siblings.Count - 1) + { + if (siblingOrder > currentOrder) { RaiseAbove(siblings[siblingOrder]); } + else { LowerBelow(siblings[siblingOrder]); } + } + else { RaiseToTop(); } + } + } + } + internal int GetInternalSiblingOrder() + { + var parentChildren = GetParent()?.Children; + if (parentChildren != null) + { + int currentOrder = parentChildren.IndexOf(this); + + if (currentOrder < 0) { return 0; } + else if (currentOrder < parentChildren.Count) { return currentOrder; } + } + return 0; + } + /// /// Returns the natural size of the view. /// @@ -2607,10 +2825,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalSizeWidthProperty(this); + return GetInternalSizeWidth(); } - - } set { @@ -2620,13 +2836,37 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalSizeWidthProperty(this, null, value); + SetInternalSizeWidth(value); } - NotifyPropertyChanged(); } } + internal void SetInternalSizeWidth(float sizeWidth) + { + // Size property setter is only used by user. + // Framework code uses SetSize() instead of Size property setter. + // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height. + // SuggestedMinimumWidth/Height is used by Layout calculation. + float width = sizeWidth; + userSizeWidth = width; + + // To avoid duplicated size setup, change internal policy directly. + // change temporary value's name as widthPolicyCeiling + int widthPolicyCeiling = (int)System.Math.Ceiling(width); + if (widthPolicy != widthPolicyCeiling) + { + widthPolicy = widthPolicyCeiling; + layout?.RequestLayout(); + } + + Object.InternalSetPropertyFloat(SwigCPtr, Property.SizeWidth, width); + } + internal float GetInternalSizeWidth() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.SizeWidth); + } + /// /// Gets or sets the size height of the view. /// @@ -2649,10 +2889,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalSizeHeightProperty(this); + return GetInternalSizeHeight(); } - - } set { @@ -2662,14 +2900,38 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalSizeHeightProperty(this, null, value); + SetInternalSizeHeight(value); } + NotifyPropertyChanged(); + } + } + internal void SetInternalSizeHeight(float sizeHeight) + { + // Size property setter is only used by user. + // Framework code uses SetSize() instead of Size property setter. + // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height. + // SuggestedMinimumWidth/Height is used by Layout calculation. + float height = sizeHeight; + userSizeHeight = height; - NotifyPropertyChanged(); + // To avoid duplicated size setup, change internal policy directly. + // change temporary value's name as heightPolicyCeiling + int heightPolicyCeiling = (int)System.Math.Ceiling(height); + if (heightPolicy != heightPolicyCeiling) + { + heightPolicy = heightPolicyCeiling; + layout?.RequestLayout(); } + + Object.InternalSetPropertyFloat(SwigCPtr, Property.SizeHeight, height); + } + internal float GetInternalSizeHeight() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.SizeHeight); } + /// /// Gets or sets the position of the view.
/// By default, sets the position vector between the parent origin and pivot point (default).
@@ -2745,7 +3007,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalPositionXProperty(this); + return GetInternalPositionX(); } } set @@ -2756,12 +3018,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalPositionXProperty(this, null, value); + SetInternalPositionX(value); } NotifyPropertyChanged(); } } + internal void SetInternalPositionX(float positionX) + { + Object.InternalSetPropertyFloat(SwigCPtr, Property.PositionX, positionX); + } + internal float GetInternalPositionX() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.PositionX); + } + /// /// Gets or sets the position Y of the view. /// @@ -2784,7 +3055,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalPositionYProperty(this); + return GetInternalPositionY(); } } set @@ -2795,12 +3066,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalPositionYProperty(this, null, value); + SetInternalPositionY(value); } NotifyPropertyChanged(); } } + internal void SetInternalPositionY(float positionY) + { + Object.InternalSetPropertyFloat(SwigCPtr, Property.PositionY, positionY); + } + internal float GetInternalPositionY() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.PositionY); + } + /// /// Gets or sets the position Z of the view. /// @@ -2823,7 +3103,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalPositionZProperty(this); + return GetInternalPositionZ(); } } set @@ -2834,12 +3114,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalPositionZProperty(this, null, value); + SetInternalPositionZ(value); } NotifyPropertyChanged(); } } + internal void SetInternalPositionZ(float positionZ) + { + Object.InternalSetPropertyFloat(SwigCPtr, Property.PositionZ, positionZ); + } + internal float GetInternalPositionZ() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.PositionZ); + } + /// /// Gets or sets the world position of the view. /// @@ -2947,8 +3236,6 @@ namespace Tizen.NUI.BaseComponents { return (Vector3)GetInternalScaleProperty(this); } - - } set { @@ -2960,8 +3247,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalScaleProperty(this, null, value); } - - NotifyPropertyChanged(); } } @@ -2988,10 +3273,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalScaleXProperty(this); + return GetInternalScaleX(); } - - } set { @@ -3001,14 +3284,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalScaleXProperty(this, null, value); + SetInternalScaleX(value); } - - NotifyPropertyChanged(); } } + internal void SetInternalScaleX(float scaleX) + { + Object.InternalSetPropertyFloat(SwigCPtr, Property.ScaleX, scaleX); + } + internal float GetInternalScaleX() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.ScaleX); + } + /// /// Gets or sets the scale Y factor applied to the view. /// @@ -3031,10 +3321,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalScaleYProperty(this); + return GetInternalScaleY(); } - - } set { @@ -3044,14 +3332,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalScaleYProperty(this, null, value); + SetInternalScaleY(value); } - - NotifyPropertyChanged(); } } + internal void SetInternalScaleY(float scaleY) + { + Object.InternalSetPropertyFloat(SwigCPtr, Property.ScaleY, scaleY); + } + internal float GetInternalScaleY() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.ScaleY); + } + /// /// Gets or sets the scale Z factor applied to the view. /// @@ -3074,10 +3369,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalScaleZProperty(this); + return GetInternalScaleZ(); } - - } set { @@ -3087,14 +3380,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalScaleZProperty(this, null, value); + SetInternalScaleZ(value); } - - NotifyPropertyChanged(); } } + internal void SetInternalScaleZ(float scaleZ) + { + Object.InternalSetPropertyFloat(SwigCPtr, Property.ScaleZ, scaleZ); + } + internal float GetInternalScaleZ() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.ScaleZ); + } + /// /// Gets the world scale of the view. /// @@ -3159,8 +3459,6 @@ namespace Tizen.NUI.BaseComponents { return (string)GetInternalNameProperty(this); } - - } set { @@ -3172,8 +3470,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalNameProperty(this, null, value); } - - NotifyPropertyChanged(); } } @@ -3218,7 +3514,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalSensitiveProperty(this); + return GetInternalSensitive(); } } set @@ -3229,12 +3525,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalSensitiveProperty(this, null, value); + SetInternalSensitive(value); } NotifyPropertyChanged(); } } + internal void SetInternalSensitive(bool sensitive) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.SENSITIVE, sensitive); + } + internal bool GetInternalSensitive() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.SENSITIVE); + } + /// /// Gets or sets the status of whether the view should be enabled user interactions. /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled. @@ -3251,7 +3556,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalIsEnabledProperty(this); + return GetInternalIsEnabled(); } } set @@ -3262,12 +3567,22 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalIsEnabledProperty(this, null, value); + SetInternalIsEnabled(value); } NotifyPropertyChanged(); } } + internal void SetInternalIsEnabled(bool isEnabled) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.UserInteractionEnabled, isEnabled); + OnEnabled(isEnabled); + } + internal bool GetInternalIsEnabled() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.UserInteractionEnabled); + } + /// /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view. /// @@ -3282,7 +3597,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalLeaveRequiredProperty(this); + return GetInternalLeaveRequired(); } } set @@ -3293,12 +3608,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalLeaveRequiredProperty(this, null, value); + SetInternalLeaveRequired(value); } NotifyPropertyChanged(); } } + internal void SetInternalLeaveRequired(bool leaveRequired) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.LeaveRequired, leaveRequired); + } + internal bool GetInternalLeaveRequired() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.LeaveRequired); + } + /// /// Gets or sets the status of whether a child view inherits it's parent's orientation. /// @@ -3313,7 +3637,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalInheritOrientationProperty(this); + return GetInternalInheritOrientation(); } } set @@ -3324,12 +3648,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalInheritOrientationProperty(this, null, value); + SetInternalInheritOrientation(value); } NotifyPropertyChanged(); } } + internal void SetInternalInheritOrientation(bool inheritOrientation) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.InheritOrientation, inheritOrientation); + } + internal bool GetInternalInheritOrientation() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritOrientation); + } + /// /// Gets or sets the status of whether a child view inherits it's parent's scale. /// @@ -3344,7 +3677,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalInheritScaleProperty(this); + return GetInternalInheritScale(); } } set @@ -3355,12 +3688,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalInheritScaleProperty(this, null, value); + SetInternalInheritScale(value); } NotifyPropertyChanged(); } } + internal void SetInternalInheritScale(bool inheritScale) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.InheritScale, inheritScale); + } + internal bool GetInternalInheritScale() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritScale); + } + /// /// Gets or sets the status of how the view and its children should be drawn.
/// Not all views are renderable, but DrawMode can be inherited from any view.
@@ -3380,7 +3722,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (DrawModeType)GetInternalDrawModeProperty(this); + return GetInternalDrawMode(); } } set @@ -3391,12 +3733,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalDrawModeProperty(this, null, value); + SetInternalDrawMode(value); } NotifyPropertyChanged(); } } + internal void SetInternalDrawMode(DrawModeType value) + { + Object.InternalSetPropertyInt(SwigCPtr, Property.DrawMode, (int)value); + } + internal DrawModeType GetInternalDrawMode() + { + return (DrawModeType)Object.InternalGetPropertyInt(SwigCPtr, Property.DrawMode); + } + /// /// Gets or sets the relative to parent size factor of the view.
/// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.
@@ -3429,8 +3780,6 @@ namespace Tizen.NUI.BaseComponents { return (Vector3)GetInternalSizeModeFactorProperty(this); } - - } set { @@ -3442,8 +3791,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalSizeModeFactorProperty(this, null, value); } - - NotifyPropertyChanged(); } } @@ -3462,7 +3809,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (ResizePolicyType)GetInternalWidthResizePolicyProperty(this); + return GetInternalWidthResizePolicy(); } } set @@ -3473,11 +3820,58 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalWidthResizePolicyProperty(this, null, value); + SetInternalWidthResizePolicy(value); } NotifyPropertyChanged(); } } + internal void SetInternalWidthResizePolicy(ResizePolicyType value) + { + if (value == ResizePolicyType.KeepSizeFollowingParent) + { + if (widthConstraint == null) + { + widthConstraint = new EqualConstraintWithParentFloat(SwigCPtr, Property.SizeWidth, Property.SizeWidth); + widthConstraint.Apply(); + } + Object.InternalSetPropertyInt(SwigCPtr, Property.WidthResizePolicy, (int)ResizePolicyType.FillToParent); + } + else + { + widthConstraint?.Remove(); + widthConstraint?.Dispose(); + widthConstraint = null; + + Object.InternalSetPropertyInt(SwigCPtr, Property.WidthResizePolicy, (int)value); + } + // Match ResizePolicy to new Layouting. + // Parent relative policies can not be mapped at this point as parent size unknown. + switch (value) + { + case ResizePolicyType.UseNaturalSize: + { + WidthSpecification = LayoutParamPolicies.WrapContent; + break; + } + case ResizePolicyType.FillToParent: + { + WidthSpecification = LayoutParamPolicies.MatchParent; + break; + } + case ResizePolicyType.FitToChildren: + { + WidthSpecification = LayoutParamPolicies.WrapContent; + break; + } + default: + break; + } + } + internal ResizePolicyType GetInternalWidthResizePolicy() + { + string temp = Object.InternalGetPropertyString(SwigCPtr, Property.WidthResizePolicy); + return temp.GetValueByDescription(); + } /// /// Gets or sets the height resize policy to be used. @@ -3493,7 +3887,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (ResizePolicyType)GetInternalHeightResizePolicyProperty(this); + return GetInternalHeightResizePolicy(); } } set @@ -3504,11 +3898,59 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalHeightResizePolicyProperty(this, null, value); + SetInternalHeightResizePolicy(value); } NotifyPropertyChanged(); } } + internal void SetInternalHeightResizePolicy(ResizePolicyType value) + { + if (value == ResizePolicyType.KeepSizeFollowingParent) + { + if (heightConstraint == null) + { + heightConstraint = new EqualConstraintWithParentFloat(SwigCPtr, Property.SizeHeight, Property.SizeHeight); + heightConstraint.Apply(); + } + + Object.InternalSetPropertyInt(SwigCPtr, Property.HeightResizePolicy, (int)ResizePolicyType.FillToParent); + } + else + { + heightConstraint?.Remove(); + heightConstraint?.Dispose(); + heightConstraint = null; + + Object.InternalSetPropertyInt(SwigCPtr, Property.HeightResizePolicy, (int)value); + } + // Match ResizePolicy to new Layouting. + // Parent relative policies can not be mapped at this point as parent size unknown. + switch (value) + { + case ResizePolicyType.UseNaturalSize: + { + HeightSpecification = LayoutParamPolicies.WrapContent; + break; + } + case ResizePolicyType.FillToParent: + { + HeightSpecification = LayoutParamPolicies.MatchParent; + break; + } + case ResizePolicyType.FitToChildren: + { + HeightSpecification = LayoutParamPolicies.WrapContent; + break; + } + default: + break; + } + } + internal ResizePolicyType GetInternalHeightResizePolicy() + { + string temp = Object.InternalGetPropertyString(SwigCPtr, Property.HeightResizePolicy); + return temp.GetValueByDescription(); + } /// /// Gets or sets the policy to use when setting size with size negotiation.
@@ -3525,7 +3967,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (SizeScalePolicyType)GetInternalSizeScalePolicyProperty(this); + return GetInternalSizeScalePolicy(); } } set @@ -3536,11 +3978,20 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalSizeScalePolicyProperty(this, null, value); + SetInternalSizeScalePolicy(value); } NotifyPropertyChanged(); } } + internal void SetInternalSizeScalePolicy(SizeScalePolicyType value) + { + string valueToString = value.GetDescription(); + Object.InternalSetPropertyString(SwigCPtr, Property.SizeScalePolicy, valueToString); + } + internal SizeScalePolicyType GetInternalSizeScalePolicy() + { + return (SizeScalePolicyType)Object.InternalGetPropertyInt(SwigCPtr, Property.SizeScalePolicy); + } /// /// Gets or sets the status of whether the width size is dependent on the height size. @@ -3556,7 +4007,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalWidthForHeightProperty(this); + return GetInternalWidthForHeight(); } } set @@ -3567,12 +4018,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalWidthForHeightProperty(this, null, value); + SetInternalWidthForHeight(value); } NotifyPropertyChanged(); } } + internal void SetInternalWidthForHeight(bool widthForHeight) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.WidthForHeight, widthForHeight); + } + internal bool GetInternalWidthForHeight() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.WidthForHeight); + } + /// /// Gets or sets the status of whether the height size is dependent on the width size. /// @@ -3587,7 +4047,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalHeightForWidthProperty(this); + return GetInternalHeightForWidth(); } } set @@ -3598,11 +4058,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalHeightForWidthProperty(this, null, value); + SetInternalHeightForWidth(value); } NotifyPropertyChanged(); } } + internal void SetInternalHeightForWidth(bool heightForWidth) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.HeightForWidth, heightForWidth); + } + internal bool GetInternalHeightForWidth() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.HeightForWidth); + } /// /// Gets or sets the padding for use in layout. @@ -3634,8 +4102,6 @@ namespace Tizen.NUI.BaseComponents { return (Extents)GetInternalPaddingProperty(this); } - - } set { @@ -3647,8 +4113,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalPaddingProperty(this, null, value); } - - NotifyPropertyChanged(); } } @@ -3684,7 +4148,6 @@ namespace Tizen.NUI.BaseComponents { return (Size2D)GetInternalMinimumSizeProperty(this); } - } set { @@ -3708,7 +4171,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalMinimumSizeProperty(this, null, value); } - NotifyPropertyChanged(); } } @@ -3758,7 +4220,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalMaximumSizeProperty(this, null, value); } - NotifyPropertyChanged(); } } @@ -3779,7 +4240,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalInheritPositionProperty(this); + return GetInternalInheritPosition(); } } set @@ -3790,11 +4251,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalInheritPositionProperty(this, null, value); + SetInternalInheritPosition(value); } NotifyPropertyChanged(); } } + internal void SetInternalInheritPosition(bool inheritPosition) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.InheritPosition, inheritPosition); + } + internal bool GetInternalInheritPosition() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritPosition); + } /// /// Gets or sets the clipping behavior (mode) of it's children. @@ -3810,7 +4279,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (ClippingModeType)GetInternalClippingModeProperty(this); + return GetInternalClippingMode(); } } set @@ -3821,11 +4290,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalClippingModeProperty(this, null, value); + SetInternalClippingMode(value); } NotifyPropertyChanged(); } } + internal void SetInternalClippingMode(ClippingModeType value) + { + Object.InternalSetPropertyInt(SwigCPtr, Property.ClippingMode, (int)value); + } + internal ClippingModeType GetInternalClippingMode() + { + return (ClippingModeType)Object.InternalGetPropertyInt(SwigCPtr, Property.ClippingMode); + } /// /// Gets the number of renderers held by the view. @@ -3864,8 +4341,6 @@ namespace Tizen.NUI.BaseComponents { return (Position)GetInternalAnchorPointProperty(this); } - - } set { @@ -3877,7 +4352,6 @@ namespace Tizen.NUI.BaseComponents { SetInternalAnchorPointProperty(this, null, value); } - } } @@ -3998,7 +4472,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalInheritLayoutDirectionProperty(this); + return GetInternalInheritLayoutDirection(); } } set @@ -4009,11 +4483,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalInheritLayoutDirectionProperty(this, null, value); + SetInternalInheritLayoutDirection(value); } NotifyPropertyChanged(); } } + internal void SetInternalInheritLayoutDirection(bool inheritLayoutDirection) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.InheritLayoutDirection, inheritLayoutDirection); + } + internal bool GetInternalInheritLayoutDirection() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritLayoutDirection); + } /// /// Gets/Sets the layout Direction. @@ -4029,7 +4511,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (ViewLayoutDirectionType)GetInternalLayoutDirectionProperty(this); + return GetInternalLayoutDirection(); } } set @@ -4040,13 +4522,22 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalLayoutDirectionProperty(this, null, value); + SetInternalLayoutDirection(value); } NotifyPropertyChanged(); layout?.RequestLayout(); } } + internal void SetInternalLayoutDirection(ViewLayoutDirectionType value) + { + Object.InternalSetPropertyInt(SwigCPtr, Property.LayoutDirection, (int)value); + } + internal ViewLayoutDirectionType GetInternalLayoutDirection() + { + return (ViewLayoutDirectionType)Object.InternalGetPropertyInt(SwigCPtr, Property.LayoutDirection); + } + /// /// Gets or sets the Margin for use in layout. /// @@ -4126,7 +4617,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (int)GetInternalWidthSpecificationProperty(this); + return GetInternalWidthSpecification(); } } set @@ -4137,11 +4628,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalWidthSpecificationProperty(this, null, value); + SetInternalWidthSpecification(value); } NotifyPropertyChanged(); } } + internal void SetInternalWidthSpecification(int widthSpecification) + { + InternalWidthSpecification = widthSpecification; + } + internal int GetInternalWidthSpecification() + { + return InternalWidthSpecification; + } private int InternalWidthSpecification { @@ -4193,7 +4692,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (int)GetInternalHeightSpecificationProperty(this); + return GetInternalHeightSpecification(); } } set @@ -4204,11 +4703,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalHeightSpecificationProperty(this, null, value); + SetInternalHeightSpecification(value); } NotifyPropertyChanged(); } } + internal void SetInternalHeightSpecification(int heightSpecification) + { + InternalHeightSpecification = heightSpecification; + } + internal int GetInternalHeightSpecification() + { + return InternalHeightSpecification; + } private int InternalHeightSpecification { @@ -4438,10 +4945,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalColorRedProperty(this); + return GetInternalColorRed(); } - - } set { @@ -4451,13 +4956,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalColorRedProperty(this, null, value); + SetInternalColorRed(value); } - - NotifyPropertyChanged(); } } + internal void SetInternalColorRed(float colorRed) + { + SetColorRed(colorRed); + } + internal float GetInternalColorRed() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.ColorRed); + } /// /// The Green component of View.Color. @@ -4478,10 +4989,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalColorGreenProperty(this); + return GetInternalColorGreen(); } - - } set { @@ -4491,13 +5000,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalColorGreenProperty(this, null, value); + SetInternalColorGreen(value); } - - NotifyPropertyChanged(); } } + internal void SetInternalColorGreen(float colorGreen) + { + SetColorGreen(colorGreen); + } + internal float GetInternalColorGreen() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.ColorGreen); + } /// /// The Blue component of View.Color. @@ -4518,10 +5033,8 @@ namespace Tizen.NUI.BaseComponents } else { - return (float)GetInternalColorBlueProperty(this); + return GetInternalColorBlue(); } - - } set { @@ -4531,13 +5044,19 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalColorBlueProperty(this, null, value); + SetInternalColorBlue(value); } - - NotifyPropertyChanged(); } } + internal void SetInternalColorBlue(float colorBlue) + { + SetColorBlue(colorBlue); + } + internal float GetInternalColorBlue() + { + return Object.InternalGetPropertyFloat(SwigCPtr, Property.ColorBlue); + } /// /// Set the layout on this View. Replaces any existing Layout. @@ -4707,7 +5226,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalBackgroundImageSynchronosLoadingProperty(this); + return GetInternalBackgroundImageSynchronosLoading(); } } set @@ -4718,12 +5237,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalBackgroundImageSynchronosLoadingProperty(this, null, value); + SetInternalBackgroundImageSynchronosLoading(value); } NotifyPropertyChanged(); } } + internal void SetInternalBackgroundImageSynchronosLoading(bool backgroundImageSynchronousLoading) + { + InternalBackgroundImageSynchronosLoading = backgroundImageSynchronousLoading; + } + internal bool GetInternalBackgroundImageSynchronosLoading() + { + return InternalBackgroundImageSynchronosLoading; + } + private bool InternalBackgroundImageSynchronosLoading { get @@ -4753,7 +5281,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalBackgroundImageSynchronousLoadingProperty(this); + return GetInternalBackgroundImageSynchronousLoading(); } } set @@ -4764,12 +5292,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalBackgroundImageSynchronousLoadingProperty(this, null, value); + SetInternalBackgroundImageSynchronousLoading(value); } NotifyPropertyChanged(); } } + internal void SetInternalBackgroundImageSynchronousLoading(bool backgroundImageSynchronousLoading) + { + InternalBackgroundImageSynchronousLoading = backgroundImageSynchronousLoading; + } + internal bool GetInternalBackgroundImageSynchronousLoading() + { + return InternalBackgroundImageSynchronousLoading; + } + private bool InternalBackgroundImageSynchronousLoading { get @@ -4840,7 +5377,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalEnableControlStatePropagationProperty(this); + return GetInternalEnableControlStatePropagation(); } } set @@ -4851,12 +5388,21 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalEnableControlStatePropagationProperty(this, null, value); + SetInternalEnableControlStatePropagation(value); } NotifyPropertyChanged(); } } + internal void SetInternalEnableControlStatePropagation(bool enableControlStatePropagation) + { + InternalEnableControlStatePropagation = enableControlStatePropagation; + } + internal bool GetInternalEnableControlStatePropagation() + { + return InternalEnableControlStatePropagation; + } + private bool InternalEnableControlStatePropagation { get => themeData?.ControlStatePropagation ?? false; @@ -4931,7 +5477,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalEnableControlStateProperty(this); + return GetInternalEnableControlState(); } } set @@ -4942,10 +5488,31 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalEnableControlStateProperty(this, null, value); + SetInternalEnableControlState(value); } } } + internal void SetInternalEnableControlState(bool enableControlStateArg) + { + bool prev = enableControlState; + enableControlState = enableControlStateArg; + + if (prev != enableControlState) + { + if (prev) + { + TouchEvent -= EmptyOnTouch; + } + else + { + TouchEvent += EmptyOnTouch; + } + } + } + internal bool GetInternalEnableControlState() + { + return enableControlState; + } /// /// Whether the actor grab all touches even if touch leaves its boundary. @@ -4962,7 +5529,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalGrabTouchAfterLeaveProperty(this); + return GetInternalGrabTouchAfterLeave(); } } set @@ -4973,10 +5540,18 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalGrabTouchAfterLeaveProperty(this, null, value); + SetInternalGrabTouchAfterLeave(value); } } } + internal void SetInternalGrabTouchAfterLeave(bool grabTouchAfterLeave) + { + InternalGrabTouchAfterLeave = grabTouchAfterLeave; + } + internal bool GetInternalGrabTouchAfterLeave() + { + return InternalGrabTouchAfterLeave; + } private bool InternalGrabTouchAfterLeave { @@ -5017,7 +5592,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalAllowOnlyOwnTouchProperty(this); + return GetInternalAllowOnlyOwnTouch(); } } set @@ -5028,10 +5603,18 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalAllowOnlyOwnTouchProperty(this, null, value); + SetInternalAllowOnlyOwnTouch(value); } } } + internal void SetInternalAllowOnlyOwnTouch(bool allowOnlyOwnTouch) + { + InternalAllowOnlyOwnTouch = allowOnlyOwnTouch; + } + internal bool GetInternalAllowOnlyOwnTouch() + { + return InternalAllowOnlyOwnTouch; + } private bool InternalAllowOnlyOwnTouch { @@ -5062,7 +5645,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (BlendEquationType)GetInternalBlendEquationProperty(this); + return GetInternalBlendEquation(); } } set @@ -5073,10 +5656,18 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalBlendEquationProperty(this, null, value); + SetInternalBlendEquation(value); } } } + internal void SetInternalBlendEquation(BlendEquationType value) + { + InternalBlendEquation = value; + } + internal BlendEquationType GetInternalBlendEquation() + { + return InternalBlendEquation; + } private BlendEquationType InternalBlendEquation { @@ -5106,7 +5697,7 @@ namespace Tizen.NUI.BaseComponents } else { - return (bool)GetInternalThemeChangeSensitiveProperty(this); + return GetInternalThemeChangeSensitive(); } } set @@ -5117,11 +5708,35 @@ namespace Tizen.NUI.BaseComponents } else { - SetInternalThemeChangeSensitiveProperty(this, null, value); + SetInternalThemeChangeSensitive(value); } } } + internal void SetInternalThemeChangeSensitive(bool themeChangeSensitive) + { + if (ThemeChangeSensitive == themeChangeSensitive) return; + + if (themeData == null) themeData = new ThemeData(); + + themeData.ThemeChangeSensitive = themeChangeSensitive; + + if (themeData.ThemeChangeSensitive && !themeData.ListeningThemeChangeEvent) + { + themeData.ListeningThemeChangeEvent = true; + ThemeManager.ThemeChangedInternal.Add(OnThemeChanged); + } + else if (!themeData.ThemeChangeSensitive && themeData.ListeningThemeChangeEvent) + { + themeData.ListeningThemeChangeEvent = false; + ThemeManager.ThemeChangedInternal.Remove(OnThemeChanged); + } + } + internal bool GetInternalThemeChangeSensitive() + { + return themeData?.ThemeChangeSensitive ?? ThemeManager.ApplicationThemeChangeSensitive; + } + /// /// Create Style, it is abstract function and must be override. /// diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index b751460eb..c5fc4a8b9 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -34,11 +34,8 @@ namespace Tizen.NUI.BaseComponents /// StyleNameProperty (DALi json) /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty StyleNameProperty = null; -#else public static readonly BindableProperty StyleNameProperty = null; -#endif + internal static void SetInternalStyleNameProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -73,34 +70,28 @@ namespace Tizen.NUI.BaseComponents /// KeyInputFocusProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty KeyInputFocusProperty = null; -#else public static readonly BindableProperty KeyInputFocusProperty = null; -#endif + internal static void SetInternalKeyInputFocusProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.KeyInputFocus, (bool)newValue); + view.SetInternalKeyInputFocus((bool)newValue); } } internal static object GetInternalKeyInputFocusProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.KeyInputFocus); + return view.GetInternalKeyInputFocus(); } /// /// BackgroundColorProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BackgroundColorProperty = null; -#else public static readonly BindableProperty BackgroundColorProperty = null; -#endif + internal static void SetInternalBackgroundColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -147,11 +138,8 @@ namespace Tizen.NUI.BaseComponents /// ColorProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ColorProperty = null; -#else public static readonly BindableProperty ColorProperty = null; -#endif + internal static void SetInternalColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -184,75 +172,61 @@ namespace Tizen.NUI.BaseComponents /// ColorRedProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ColorRedProperty = null; -#else public static readonly BindableProperty ColorRedProperty = null; -#endif + internal static void SetInternalColorRedProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - view.SetColorRed((float?)newValue); + view.SetInternalColorRed((float)newValue); } internal static object GetInternalColorRedProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorRed); + return view.GetInternalColorRed(); } /// /// ColorGreenProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ColorGreenProperty = null; -#else public static readonly BindableProperty ColorGreenProperty = null; -#endif + internal static void SetInternalColorGreenProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - view.SetColorGreen((float?)newValue); + view.SetInternalColorGreen((float)newValue); } internal static object GetInternalColorGreenProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorGreen); - + return view.GetInternalColorGreen(); } /// /// ColorBlueProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ColorBlueProperty = null; -#else public static readonly BindableProperty ColorBlueProperty = null; -#endif + internal static void SetInternalColorBlueProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - view.SetColorBlue((float?)newValue); + view.SetInternalColorBlue((float)newValue); } internal static object GetInternalColorBlueProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorBlue); - + return view.GetInternalColorBlue(); } /// /// BackgroundImageProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BackgroundImageProperty = null; -#else public static readonly BindableProperty BackgroundImageProperty = null; -#endif + internal static void SetInternalBackgroundImageProperty(BindableObject bindable, object oldValue, object newValue) { if (NUIApplication.IsUsingXaml) @@ -294,11 +268,8 @@ namespace Tizen.NUI.BaseComponents /// BackgroundImageBorderProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BackgroundImageBorderProperty = null; -#else public static readonly BindableProperty BackgroundImageBorderProperty = null; -#endif + internal static void SetInternalBackgroundImageBorderProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -326,11 +297,8 @@ namespace Tizen.NUI.BaseComponents /// BackgroundProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BackgroundProperty = null; -#else public static readonly BindableProperty BackgroundProperty = null; -#endif + internal static void SetInternalBackgroundProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -382,69 +350,48 @@ namespace Tizen.NUI.BaseComponents /// StateProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty StateProperty = null; -#else public static readonly BindableProperty StateProperty = null; -#endif + internal static void SetInternalStateProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.STATE, (int)newValue); + view.SetInternalState((States)newValue); } } internal static object GetInternalStateProperty(BindableObject bindable) { var view = (View)bindable; - int temp = 0; - temp = Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.STATE); - switch (temp) - { - case 0: return States.Normal; - case 1: return States.Focused; - case 2: return States.Disabled; - default: return States.Normal; - } + return view.GetInternalState(); } /// /// SubStateProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SubStateProperty = null; -#else public static readonly BindableProperty SubStateProperty = null; -#endif + internal static void SetInternalSubStateProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - string valueToString = ""; if (newValue != null) { - valueToString = ((States)newValue).GetDescription(); - Object.InternalSetPropertyString(view.SwigCPtr, View.Property.SubState, valueToString); + view.SetInternalSubState((States)newValue); } } internal static object GetInternalSubStateProperty(BindableObject bindable) { var view = (View)bindable; - string temp; - temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.SubState); - return temp.GetValueByDescription(); + return view.GetInternalSubState(); } /// /// TooltipProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty TooltipProperty = null; -#else public static readonly BindableProperty TooltipProperty = null; -#endif + internal static void SetInternalTooltipProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -465,57 +412,48 @@ namespace Tizen.NUI.BaseComponents /// FlexProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty FlexProperty = null; -#else public static readonly BindableProperty FlexProperty = null; -#endif + internal static void SetInternalFlexProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, FlexContainer.ChildProperty.FLEX, (float)newValue); + view.SetInternalFlex((float)newValue); } } internal static object GetInternalFlexProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, FlexContainer.ChildProperty.FLEX); + return view.GetInternalFlex(); } /// /// AlignSelfProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AlignSelfProperty = null; -#else public static readonly BindableProperty AlignSelfProperty = null; -#endif + internal static void SetInternalAlignSelfProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyInt(view.SwigCPtr, FlexContainer.ChildProperty.AlignSelf, (int)newValue); + view.SetInternalAlignSelf((int)newValue); } } internal static object GetInternalAlignSelfProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyInt(view.SwigCPtr, FlexContainer.ChildProperty.AlignSelf); + return view.GetInternalAlignSelf(); } /// /// FlexMarginProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty FlexMarginProperty = null; -#else public static readonly BindableProperty FlexMarginProperty = null; -#endif + internal static void SetInternalFlexMarginProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -536,11 +474,8 @@ namespace Tizen.NUI.BaseComponents /// CellIndexProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty CellIndexProperty = null; -#else public static readonly BindableProperty CellIndexProperty = null; -#endif + internal static void SetInternalCellIndexProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -566,102 +501,80 @@ namespace Tizen.NUI.BaseComponents /// RowSpanProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty RowSpanProperty = null; -#else public static readonly BindableProperty RowSpanProperty = null; -#endif + internal static void SetInternalRowSpanProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.RowSpan, (float)newValue); + view.SetInternalRowSpan((float)newValue); } } internal static object GetInternalRowSpanProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.RowSpan); + return view.GetInternalRowSpan(); } /// /// ColumnSpanProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ColumnSpanProperty = null; -#else public static readonly BindableProperty ColumnSpanProperty = null; -#endif + internal static void SetInternalColumnSpanProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.ColumnSpan, (float)newValue); + view.SetInternalColumnSpan((float)newValue); } } internal static object GetInternalColumnSpanProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.ColumnSpan); + return view.GetInternalColumnSpan(); } /// /// CellHorizontalAlignmentProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty CellHorizontalAlignmentProperty = null; -#else public static readonly BindableProperty CellHorizontalAlignmentProperty = null; -#endif + internal static void SetInternalCellHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - string valueToString = ""; - if (newValue != null) { - valueToString = ((HorizontalAlignmentType)newValue).GetDescription(); - Object.InternalSetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment, valueToString); + view.SetInternalCellHorizontalAlignment((HorizontalAlignmentType)newValue); } } internal static object GetInternalCellHorizontalAlignmentProperty(BindableObject bindable) { var view = (View)bindable; - string temp; - temp = Object.InternalGetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment); - return temp.GetValueByDescription(); + return view.GetInternalCellHorizontalAlignment(); } /// /// CellVerticalAlignmentProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty CellVerticalAlignmentProperty = null; -#else public static readonly BindableProperty CellVerticalAlignmentProperty = null; -#endif + internal static void SetInternalCellVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - string valueToString = ""; - if (newValue != null) { - valueToString = ((VerticalAlignmentType)newValue).GetDescription(); - Object.InternalSetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellVerticalAlignment, valueToString); + view.SetInternalCellVerticalAlignment((VerticalAlignmentType)newValue); } } internal static object GetInternalCellVerticalAlignmentProperty(BindableObject bindable) { var view = (View)bindable; - string temp; - temp = Object.InternalGetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellVerticalAlignment); - return temp.GetValueByDescription(); + return view.GetInternalCellVerticalAlignment(); } /// @@ -669,11 +582,8 @@ namespace Tizen.NUI.BaseComponents /// This needs to be hidden as inhouse API until all applications using it have been updated. Do not make public. /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty WeightProperty = null; -#else public static readonly BindableProperty WeightProperty = null; -#endif + internal static void SetInternalWeightProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -692,11 +602,8 @@ namespace Tizen.NUI.BaseComponents /// LeftFocusableViewProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty LeftFocusableViewProperty = null; -#else public static readonly BindableProperty LeftFocusableViewProperty = null; -#endif + internal static void SetInternalLeftFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -714,11 +621,8 @@ namespace Tizen.NUI.BaseComponents /// RightFocusableViewProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty RightFocusableViewProperty = null; -#else public static readonly BindableProperty RightFocusableViewProperty = null; -#endif + internal static void SetInternalRightFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -736,11 +640,8 @@ namespace Tizen.NUI.BaseComponents /// UpFocusableViewProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty UpFocusableViewProperty = null; -#else public static readonly BindableProperty UpFocusableViewProperty = null; -#endif + internal static void SetInternalUpFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -758,11 +659,8 @@ namespace Tizen.NUI.BaseComponents /// DownFocusableViewProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty DownFocusableViewProperty = null; -#else public static readonly BindableProperty DownFocusableViewProperty = null; -#endif + internal static void SetInternalDownFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -780,11 +678,8 @@ namespace Tizen.NUI.BaseComponents /// ClockwiseFocusableViewProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ClockwiseFocusableViewProperty = null; -#else public static readonly BindableProperty ClockwiseFocusableViewProperty = null; -#endif + internal static void SetInternalClockwiseFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -802,11 +697,8 @@ namespace Tizen.NUI.BaseComponents /// CounterClockwiseFocusableViewProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty CounterClockwiseFocusableViewProperty = null; -#else public static readonly BindableProperty CounterClockwiseFocusableViewProperty = null; -#endif + internal static void SetInternalCounterClockwiseFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -824,71 +716,59 @@ namespace Tizen.NUI.BaseComponents /// FocusableProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty FocusableProperty = null; -#else public static readonly BindableProperty FocusableProperty = null; -#endif + internal static void SetInternalFocusableProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); } + if (newValue != null) { view.SetInternalFocusable((bool)newValue); } } internal static object GetInternalFocusableProperty(BindableObject bindable) { var view = (View)bindable; - return view.IsKeyboardFocusable(); + return view.GetInternalFocusable(); } /// /// FocusableChildrenProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty FocusableChildrenProperty = null; -#else public static readonly BindableProperty FocusableChildrenProperty = null; -#endif + internal static void SetInternalFocusableChildrenProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null) { view.SetKeyboardFocusableChildren((bool)newValue); } + if (newValue != null) { view.SetInternalFocusableChildren((bool)newValue); } } internal static object GetInternalFocusableChildrenProperty(BindableObject bindable) { var view = (View)bindable; - return view.AreChildrenKeyBoardFocusable(); + return view.GetInternalFocusableChildren(); } /// /// FocusableInTouchProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty FocusableInTouchProperty = null; -#else public static readonly BindableProperty FocusableInTouchProperty = null; -#endif + internal static void SetInternalFocusableInTouchProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null) { view.SetFocusableInTouch((bool)newValue); } + if (newValue != null) { view.SetInternalFocusableInTouch((bool)newValue); } } internal static object GetInternalFocusableInTouchProperty(BindableObject bindable) { var view = (View)bindable; - return view.IsFocusableInTouch(); + return view.GetInternalFocusableInTouch(); } /// /// Size2DProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty Size2DProperty = null; -#else public static readonly BindableProperty Size2DProperty = null; -#endif + internal static void SetInternalSize2DProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -939,11 +819,8 @@ namespace Tizen.NUI.BaseComponents /// OpacityProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty OpacityProperty = null; -#else public static readonly BindableProperty OpacityProperty = null; -#endif + internal static void SetInternalOpacityProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -957,24 +834,21 @@ namespace Tizen.NUI.BaseComponents } else { - view.SetOpacity((float?)newValue); + view.SetInternalOpacity((float)newValue); } } internal static object GetInternalOpacityProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.OPACITY); + return view.GetInternalOpacity(); } /// /// Position2DProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty Position2DProperty = null; -#else public static readonly BindableProperty Position2DProperty = null; -#endif + internal static void SetInternalPosition2DProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -998,88 +872,48 @@ namespace Tizen.NUI.BaseComponents /// PositionUsesPivotPointProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PositionUsesPivotPointProperty = null; -#else public static readonly BindableProperty PositionUsesPivotPointProperty = null; -#endif + internal static void SetInternalPositionUsesPivotPointProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.PositionUsesAnchorPoint, (bool)newValue); + view.SetInternalPositionUsesPivotPoint((bool)newValue); } } internal static object GetInternalPositionUsesPivotPointProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.PositionUsesAnchorPoint); + return view.GetInternalPositionUsesPivotPoint(); } /// /// SiblingOrderProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SiblingOrderProperty = null; -#else public static readonly BindableProperty SiblingOrderProperty = null; -#endif + internal static void SetInternalSiblingOrderProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - int value; if (newValue != null) { - value = (int)newValue; - if (value < 0) - { - NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0."); - return; - } - var siblings = view.GetParent()?.Children; - if (siblings != null) - { - int currentOrder = siblings.IndexOf(view); - if (value != currentOrder) - { - if (value == 0) { view.LowerToBottom(); } - else if (value < siblings.Count - 1) - { - if (value > currentOrder) { view.RaiseAbove(siblings[value]); } - else { view.LowerBelow(siblings[value]); } - } - else { view.RaiseToTop(); } - } - } + view.SetInternalSiblingOrder((int)newValue); } } internal static object GetInternalSiblingOrderProperty(BindableObject bindable) { var view = (View)bindable; - var parentChildren = view.GetParent()?.Children; - int currentOrder = 0; - if (parentChildren != null) - { - currentOrder = parentChildren.IndexOf(view); - - if (currentOrder < 0) { return 0; } - else if (currentOrder < parentChildren.Count) { return currentOrder; } - } - - return 0; + return view.GetInternalSiblingOrder(); } /// /// ParentOriginProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ParentOriginProperty = null; -#else public static readonly BindableProperty ParentOriginProperty = null; -#endif + internal static void SetInternalParentOriginProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1101,11 +935,8 @@ namespace Tizen.NUI.BaseComponents /// PivotPointProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PivotPointProperty = null; -#else public static readonly BindableProperty PivotPointProperty = null; -#endif + internal static void SetInternalPivotPointProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1129,87 +960,48 @@ namespace Tizen.NUI.BaseComponents /// SizeWidthProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SizeWidthProperty = null; -#else public static readonly BindableProperty SizeWidthProperty = null; -#endif + internal static void SetInternalSizeWidthProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - // Size property setter is only used by user. - // Framework code uses SetSize() instead of Size property setter. - // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height. - // SuggestedMinimumWidth/Height is used by Layout calculation. - float width = (float)newValue; - view.userSizeWidth = width; - - // To avoid duplicated size setup, change internal policy directly. - int widthPolicy = (int)System.Math.Ceiling(width); - if (view.widthPolicy != widthPolicy) - { - view.widthPolicy = widthPolicy; - view.layout?.RequestLayout(); - } - - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.SizeWidth, width); + view.SetInternalSizeWidth((float)newValue); } } internal static object GetInternalSizeWidthProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeWidth); + return view.GetInternalSizeWidth(); } /// /// SizeHeightProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SizeHeightProperty = null; -#else public static readonly BindableProperty SizeHeightProperty = null; -#endif + internal static void SetInternalSizeHeightProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - // Size property setter is only used by user. - // Framework code uses SetSize() instead of Size property setter. - // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height. - // SuggestedMinimumWidth/Height is used by Layout calculation. - float height = (float)newValue; - view.userSizeHeight = height; - - // To avoid duplicated size setup, change internal policy directly. - int heightPolicy = (int)System.Math.Ceiling(height); - if (view.heightPolicy != heightPolicy) - { - view.heightPolicy = heightPolicy; - view.layout?.RequestLayout(); - } - - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight, height); + view.SetInternalSizeHeight((float)newValue); } } internal static object GetInternalSizeHeightProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight); + return view.GetInternalSizeHeight(); } /// /// PositionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PositionProperty = null; -#else public static readonly BindableProperty PositionProperty = null; -#endif + internal static void SetInternalPositionProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1233,81 +1025,68 @@ namespace Tizen.NUI.BaseComponents /// PositionXProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PositionXProperty = null; -#else public static readonly BindableProperty PositionXProperty = null; -#endif + internal static void SetInternalPositionXProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionX, (float)newValue); + view.SetInternalPositionX((float)newValue); } } internal static object GetInternalPositionXProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionX); + return view.GetInternalPositionX(); } /// /// PositionYProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PositionYProperty = null; -#else public static readonly BindableProperty PositionYProperty = null; -#endif + internal static void SetInternalPositionYProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionY, (float)newValue); + view.SetInternalPositionY((float)newValue); } } internal static object GetInternalPositionYProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionY); + return view.GetInternalPositionY(); } /// /// PositionZProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PositionZProperty = null; -#else public static readonly BindableProperty PositionZProperty = null; -#endif + internal static void SetInternalPositionZProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionZ, (float)newValue); + view.SetInternalPositionZ((float)newValue); } - } internal static object GetInternalPositionZProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionZ); + return view.GetInternalPositionZ(); } /// /// OrientationProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty OrientationProperty = null; -#else public static readonly BindableProperty OrientationProperty = null; -#endif + internal static void SetInternalOrientationProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1328,11 +1107,8 @@ namespace Tizen.NUI.BaseComponents /// ScaleProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ScaleProperty = null; -#else public static readonly BindableProperty ScaleProperty = null; -#endif + internal static void SetInternalScaleProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1357,80 +1133,68 @@ namespace Tizen.NUI.BaseComponents /// ScaleXProperty ///
[EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ScaleXProperty = null; -#else public static readonly BindableProperty ScaleXProperty = null; -#endif + internal static void SetInternalScaleXProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleX, (float)newValue); + view.SetInternalScaleX((float)newValue); } } internal static object GetInternalScaleXProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleX); + return view.GetInternalScaleX(); } /// /// ScaleYProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ScaleYProperty = null; -#else public static readonly BindableProperty ScaleYProperty = null; -#endif + internal static void SetInternalScaleYProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleY, (float)newValue); + view.SetInternalScaleY((float)newValue); } } internal static object GetInternalScaleYProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleY); + return view.GetInternalScaleY(); } /// /// ScaleZProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ScaleZProperty = null; -#else public static readonly BindableProperty ScaleZProperty = null; -#endif + internal static void SetInternalScaleZProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ, (float)newValue); + view.SetInternalScaleZ((float)newValue); } } internal static object GetInternalScaleZProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ); + return view.GetInternalScaleZ(); } /// /// NameProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty NameProperty = null; -#else public static readonly BindableProperty NameProperty = null; -#endif + internal static void SetInternalNameProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1450,58 +1214,48 @@ namespace Tizen.NUI.BaseComponents /// SensitiveProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SensitiveProperty = null; -#else public static readonly BindableProperty SensitiveProperty = null; -#endif + internal static void SetInternalSensitiveProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.SENSITIVE, (bool)newValue); + view.SetInternalSensitive((bool)newValue); } } internal static object GetInternalSensitiveProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.SENSITIVE); + return view.GetInternalSensitive(); } /// /// IsEnabledProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty IsEnabledProperty = null; -#else public static readonly BindableProperty IsEnabledProperty = null; -#endif + internal static void SetInternalIsEnabledProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.UserInteractionEnabled, (bool)newValue); - view.OnEnabled((bool)newValue); + view.SetInternalIsEnabled((bool)newValue); } } internal static object GetInternalIsEnabledProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.UserInteractionEnabled); + return view.GetInternalIsEnabled(); } /// /// DispatchKeyEventsProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty DispatchKeyEventsProperty = null; -#else public static readonly BindableProperty DispatchKeyEventsProperty = null; -#endif + internal static void SetInternalDispatchKeyEventsProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1520,103 +1274,88 @@ namespace Tizen.NUI.BaseComponents /// LeaveRequiredProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty LeaveRequiredProperty = null; -#else public static readonly BindableProperty LeaveRequiredProperty = null; -#endif + internal static void SetInternalLeaveRequiredProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.LeaveRequired, (bool)newValue); + view.SetInternalLeaveRequired((bool)newValue); } } internal static object GetInternalLeaveRequiredProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.LeaveRequired); + return view.GetInternalLeaveRequired(); } /// /// InheritOrientationProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty InheritOrientationProperty = null; -#else public static readonly BindableProperty InheritOrientationProperty = null; -#endif + internal static void SetInternalInheritOrientationProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritOrientation, (bool)newValue); + view.SetInternalInheritOrientation((bool)newValue); } } internal static object GetInternalInheritOrientationProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritOrientation); + return view.GetInternalInheritOrientation(); } /// /// InheritScaleProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty InheritScaleProperty = null; -#else public static readonly BindableProperty InheritScaleProperty = null; -#endif + internal static void SetInternalInheritScaleProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritScale, (bool)newValue); + view.SetInternalInheritScale((bool)newValue); } } internal static object GetInternalInheritScaleProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritScale); + return view.GetInternalInheritScale(); } /// /// DrawModeProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty DrawModeProperty = null; -#else public static readonly BindableProperty DrawModeProperty = null; -#endif + internal static void SetInternalDrawModeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.DrawMode, (int)newValue); + view.SetInternalDrawMode((DrawModeType)newValue); } } internal static object GetInternalDrawModeProperty(BindableObject bindable) { var view = (View)bindable; - return (DrawModeType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.DrawMode); + return view.GetInternalDrawMode(); } /// /// SizeModeFactorProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SizeModeFactorProperty = null; -#else public static readonly BindableProperty SizeModeFactorProperty = null; -#endif + internal static void SetInternalSizeModeFactorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1641,216 +1380,108 @@ namespace Tizen.NUI.BaseComponents /// WidthResizePolicyProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty WidthResizePolicyProperty = null; -#else public static readonly BindableProperty WidthResizePolicyProperty = null; -#endif + internal static void SetInternalWidthResizePolicyProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - if ((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent) - { - if (view.widthConstraint == null) - { - view.widthConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeWidth, View.Property.SizeWidth); - view.widthConstraint.Apply(); - } - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.WidthResizePolicy, (int)ResizePolicyType.FillToParent); - } - else - { - view.widthConstraint?.Remove(); - view.widthConstraint?.Dispose(); - view.widthConstraint = null; - - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.WidthResizePolicy, (int)newValue); - } - // Match ResizePolicy to new Layouting. - // Parent relative policies can not be mapped at this point as parent size unknown. - switch ((ResizePolicyType)newValue) - { - case ResizePolicyType.UseNaturalSize: - { - view.WidthSpecification = LayoutParamPolicies.WrapContent; - break; - } - case ResizePolicyType.FillToParent: - { - view.WidthSpecification = LayoutParamPolicies.MatchParent; - break; - } - case ResizePolicyType.FitToChildren: - { - view.WidthSpecification = LayoutParamPolicies.WrapContent; - break; - } - default: - break; - } + view.SetInternalWidthResizePolicy((ResizePolicyType)newValue); } } internal static object GetInternalWidthResizePolicyProperty(BindableObject bindable) { var view = (View)bindable; - string temp; - - temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.WidthResizePolicy); - return temp.GetValueByDescription(); + return view.GetInternalWidthResizePolicy(); } /// /// HeightResizePolicyProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty HeightResizePolicyProperty = null; -#else public static readonly BindableProperty HeightResizePolicyProperty = null; -#endif + internal static void SetInternalHeightResizePolicyProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - if ((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent) - { - if (view.heightConstraint == null) - { - view.heightConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeHeight, View.Property.SizeHeight); - view.heightConstraint.Apply(); - } - - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.HeightResizePolicy, (int)ResizePolicyType.FillToParent); - } - else - { - view.heightConstraint?.Remove(); - view.heightConstraint?.Dispose(); - view.heightConstraint = null; - - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.HeightResizePolicy, (int)newValue); - } - // Match ResizePolicy to new Layouting. - // Parent relative policies can not be mapped at this point as parent size unknown. - switch ((ResizePolicyType)newValue) - { - case ResizePolicyType.UseNaturalSize: - { - view.HeightSpecification = LayoutParamPolicies.WrapContent; - break; - } - case ResizePolicyType.FillToParent: - { - view.HeightSpecification = LayoutParamPolicies.MatchParent; - break; - } - case ResizePolicyType.FitToChildren: - { - view.HeightSpecification = LayoutParamPolicies.WrapContent; - break; - } - default: - break; - } + view.SetInternalHeightResizePolicy((ResizePolicyType)newValue); } } internal static object GetInternalHeightResizePolicyProperty(BindableObject bindable) { var view = (View)bindable; - string temp; - - temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.HeightResizePolicy); - return temp.GetValueByDescription(); + return view.GetInternalHeightResizePolicy(); } /// /// SizeScalePolicyProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SizeScalePolicyProperty = null; -#else public static readonly BindableProperty SizeScalePolicyProperty = null; -#endif + internal static void SetInternalSizeScalePolicyProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - string valueToString = ""; if (newValue != null) { - valueToString = ((SizeScalePolicyType)newValue).GetDescription(); - - Object.InternalSetPropertyString(view.SwigCPtr, View.Property.SizeScalePolicy, valueToString); + view.SetInternalSizeScalePolicy((SizeScalePolicyType)newValue); } } internal static object GetInternalSizeScalePolicyProperty(BindableObject bindable) { var view = (View)bindable; - - return (SizeScalePolicyType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.SizeScalePolicy); + return view.GetInternalSizeScalePolicy(); } /// /// WidthForHeightProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty WidthForHeightProperty = null; -#else public static readonly BindableProperty WidthForHeightProperty = null; -#endif + internal static void SetInternalWidthForHeightProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.WidthForHeight, (bool)newValue); + view.SetInternalWidthForHeight((bool)newValue); } } internal static object GetInternalWidthForHeightProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.WidthForHeight); + return view.GetInternalWidthForHeight(); } /// /// HeightForWidthProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty HeightForWidthProperty = null; -#else public static readonly BindableProperty HeightForWidthProperty = null; -#endif + internal static void SetInternalHeightForWidthProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.HeightForWidth, (bool)newValue); + view.SetInternalHeightForWidth((bool)newValue); } } internal static object GetInternalHeightForWidthProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.HeightForWidth); + return view.GetInternalHeightForWidth(); } /// /// PaddingProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PaddingProperty = null; -#else public static readonly BindableProperty PaddingProperty = null; -#endif + internal static void SetInternalPaddingProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1908,11 +1539,8 @@ namespace Tizen.NUI.BaseComponents /// SizeProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty SizeProperty = null; -#else public static readonly BindableProperty SizeProperty = null; -#endif + internal static void SetInternalSizeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1971,11 +1599,8 @@ namespace Tizen.NUI.BaseComponents /// MinimumSizeProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty MinimumSizeProperty = null; -#else public static readonly BindableProperty MinimumSizeProperty = null; -#endif + internal static void SetInternalMinimumSizeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2001,11 +1626,8 @@ namespace Tizen.NUI.BaseComponents /// MaximumSizeProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty MaximumSizeProperty = null; -#else public static readonly BindableProperty MaximumSizeProperty = null; -#endif + internal static void SetInternalMaximumSizeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2031,110 +1653,88 @@ namespace Tizen.NUI.BaseComponents /// InheritPositionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty InheritPositionProperty = null; -#else public static readonly BindableProperty InheritPositionProperty = null; -#endif + internal static void SetInternalInheritPositionProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritPosition, (bool)newValue); + view.SetInternalInheritPosition((bool)newValue); } } internal static object GetInternalInheritPositionProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritPosition); + return view.GetInternalInheritPosition(); } /// /// ClippingModeProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ClippingModeProperty = null; -#else public static readonly BindableProperty ClippingModeProperty = null; -#endif + internal static void SetInternalClippingModeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.ClippingMode, (int)newValue); + view.SetInternalClippingMode((ClippingModeType)newValue); } } internal static object GetInternalClippingModeProperty(BindableObject bindable) { var view = (View)bindable; - - return (ClippingModeType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.ClippingMode); + return view.GetInternalClippingMode(); } /// /// InheritLayoutDirectionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty InheritLayoutDirectionProperty = null; -#else public static readonly BindableProperty InheritLayoutDirectionProperty = null; -#endif + internal static void SetInternalInheritLayoutDirectionProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritLayoutDirection, (bool)newValue); + view.SetInternalInheritLayoutDirection((bool)newValue); } } internal static object GetInternalInheritLayoutDirectionProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritLayoutDirection); + return view.GetInternalInheritLayoutDirection(); } /// /// LayoutDirectionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty LayoutDirectionProperty = null; -#else public static readonly BindableProperty LayoutDirectionProperty = null; -#endif + internal static void SetInternalLayoutDirectionProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.LayoutDirection, (int)newValue); + view.SetInternalLayoutDirection((ViewLayoutDirectionType)newValue); } } internal static object GetInternalLayoutDirectionProperty(BindableObject bindable) { var view = (View)bindable; - - return (ViewLayoutDirectionType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.LayoutDirection); + return view.GetInternalLayoutDirection(); } /// /// MarginProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty MarginProperty = null; -#else public static readonly BindableProperty MarginProperty = null; -#endif + internal static void SetInternalMarginProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2193,11 +1793,8 @@ namespace Tizen.NUI.BaseComponents /// UpdateAreaHintProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty UpdateAreaHintProperty = null; -#else public static readonly BindableProperty UpdateAreaHintProperty = null; -#endif + internal static void SetInternalUpdateAreaHintProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2220,11 +1817,8 @@ namespace Tizen.NUI.BaseComponents /// ImageShadow Property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ImageShadowProperty = null; -#else public static readonly BindableProperty ImageShadowProperty = null; -#endif + internal static void SetInternalImageShadowProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2259,11 +1853,8 @@ namespace Tizen.NUI.BaseComponents /// Shadow Property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BoxShadowProperty = null; -#else public static readonly BindableProperty BoxShadowProperty = null; -#endif + internal static void SetInternalBoxShadowProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2298,11 +1889,8 @@ namespace Tizen.NUI.BaseComponents /// CornerRadius Property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty CornerRadiusProperty = null; -#else public static readonly BindableProperty CornerRadiusProperty = null; -#endif + internal static void SetInternalCornerRadiusProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2319,57 +1907,42 @@ namespace Tizen.NUI.BaseComponents /// CornerRadiusPolicy Property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty CornerRadiusPolicyProperty = null; -#else public static readonly BindableProperty CornerRadiusPolicyProperty = null; -#endif + internal static void SetInternalCornerRadiusPolicyProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadiusPolicy = (VisualTransformPolicyType)newValue; - - if (view.backgroundExtraData.CornerRadius != null) - { - view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius); - } + view.SetInternalCornerRadiusPolicy((VisualTransformPolicyType)newValue); } internal static object GetInternalCornerRadiusPolicyProperty(BindableObject bindable) { var view = (View)bindable; - return view.backgroundExtraData == null ? VisualTransformPolicyType.Absolute : view.backgroundExtraData.CornerRadiusPolicy; + return view.GetInternalCornerRadiusPolicy(); } /// /// BorderlineWidth Property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BorderlineWidthProperty = null; -#else public static readonly BindableProperty BorderlineWidthProperty = null; -#endif + internal static void SetInternalBorderlineWidthProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineWidth = (float)newValue; - view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline); + view.SetInternalBorderlineWidth((float)newValue); } internal static object GetInternalBorderlineWidthProperty(BindableObject bindable) { var view = (View)bindable; - return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineWidth; + return view.GetInternalBorderlineWidth(); } /// /// BorderlineColor Property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BorderlineColorProperty = null; -#else public static readonly BindableProperty BorderlineColorProperty = null; -#endif + internal static void SetInternalBorderlineColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2398,11 +1971,8 @@ namespace Tizen.NUI.BaseComponents /// So this API is internally used only. /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BorderlineColorSelectorProperty = null; -#else public static readonly BindableProperty BorderlineColorSelectorProperty = null; -#endif + internal static void SetInternalBorderlineColorSelectorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2430,99 +2000,57 @@ namespace Tizen.NUI.BaseComponents /// BorderlineOffset Property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BorderlineOffsetProperty = null; -#else public static readonly BindableProperty BorderlineOffsetProperty = null; -#endif + internal static void SetInternalBorderlineOffsetProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineOffset = (float)newValue; - view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline); + view.SetInternalBorderlineOffset((float)newValue); } internal static object GetInternalBorderlineOffsetProperty(BindableObject bindable) { var view = (View)bindable; - return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineOffset; + return view.GetInternalBorderlineOffset(); } /// /// EnableControlState property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty EnableControlStateProperty = null; -#else public static readonly BindableProperty EnableControlStateProperty = null; -#endif + internal static void SetInternalEnableControlStateProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - bool prev = view.enableControlState; - view.enableControlState = (bool)newValue; - - if (prev != view.enableControlState) - { - if (prev) - { - view.TouchEvent -= view.EmptyOnTouch; - } - else - { - view.TouchEvent += view.EmptyOnTouch; - } - } + view.SetInternalEnableControlState((bool)newValue); } internal static object GetInternalEnableControlStateProperty(BindableObject bindable) { - return ((View)bindable).enableControlState; + return ((View)bindable).GetInternalEnableControlState(); } /// /// ThemeChangeSensitive property /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ThemeChangeSensitiveProperty = null; -#else public static readonly BindableProperty ThemeChangeSensitiveProperty = null; -#endif + internal static void SetInternalThemeChangeSensitiveProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - if (view.ThemeChangeSensitive == (bool)newValue) return; - - if (view.themeData == null) view.themeData = new ThemeData(); - - view.themeData.ThemeChangeSensitive = (bool)newValue; - - if (view.themeData.ThemeChangeSensitive && !view.themeData.ListeningThemeChangeEvent) - { - view.themeData.ListeningThemeChangeEvent = true; - ThemeManager.ThemeChangedInternal.Add(view.OnThemeChanged); - } - else if (!view.themeData.ThemeChangeSensitive && view.themeData.ListeningThemeChangeEvent) - { - view.themeData.ListeningThemeChangeEvent = false; - ThemeManager.ThemeChangedInternal.Remove(view.OnThemeChanged); - } + view.SetInternalThemeChangeSensitive((bool)newValue); } internal static object GetInternalThemeChangeSensitiveProperty(BindableObject bindable) { - return ((View)bindable).themeData?.ThemeChangeSensitive ?? ThemeManager.ApplicationThemeChangeSensitive; + return ((View)bindable).GetInternalThemeChangeSensitive(); } /// /// AccessibilityNameProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AccessibilityNameProperty = null; -#else public static readonly BindableProperty AccessibilityNameProperty = null; -#endif + internal static void SetInternalAccessibilityNameProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2541,11 +2069,8 @@ namespace Tizen.NUI.BaseComponents /// AccessibilityDescriptionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AccessibilityDescriptionProperty = null; -#else public static readonly BindableProperty AccessibilityDescriptionProperty = null; -#endif + internal static void SetInternalAccessibilityDescriptionProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2566,11 +2091,8 @@ namespace Tizen.NUI.BaseComponents /// AccessibilityTranslationDomainProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AccessibilityTranslationDomainProperty = null; -#else public static readonly BindableProperty AccessibilityTranslationDomainProperty = null; -#endif + internal static void SetInternalAccessibilityTranslationDomainProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2591,11 +2113,8 @@ namespace Tizen.NUI.BaseComponents /// AccessibilityRoleProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AccessibilityRoleProperty = null; -#else public static readonly BindableProperty AccessibilityRoleProperty = null; -#endif + internal static void SetInternalAccessibilityRoleProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2616,11 +2135,8 @@ namespace Tizen.NUI.BaseComponents /// AccessibilityHighlightableProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AccessibilityHighlightableProperty = null; -#else public static readonly BindableProperty AccessibilityHighlightableProperty = null; -#endif + internal static void SetInternalAccessibilityHighlightableProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2641,11 +2157,8 @@ namespace Tizen.NUI.BaseComponents /// AccessibilityHiddenProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AccessibilityHiddenProperty = null; -#else public static readonly BindableProperty AccessibilityHiddenProperty = null; -#endif + internal static void SetInternalAccessibilityHiddenProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2666,34 +2179,28 @@ namespace Tizen.NUI.BaseComponents /// ExcludeLayoutingProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty ExcludeLayoutingProperty = null; -#else public static readonly BindableProperty ExcludeLayoutingProperty = null; -#endif + internal static void SetInternalExcludeLayoutingProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; if (newValue != null) { - instance.InternalExcludeLayouting = (bool)newValue; + instance.SetInternalExcludeLayouting((bool)newValue); } } internal static object GetInternalExcludeLayoutingProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalExcludeLayouting; + var instance = (View)bindable; + return instance.GetInternalExcludeLayouting(); } /// /// TooltipTextProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty TooltipTextProperty = null; -#else public static readonly BindableProperty TooltipTextProperty = null; -#endif + internal static void SetInternalTooltipTextProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -2712,34 +2219,28 @@ namespace Tizen.NUI.BaseComponents /// PositionUsesAnchorPointProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PositionUsesAnchorPointProperty = null; -#else public static readonly BindableProperty PositionUsesAnchorPointProperty = null; -#endif + internal static void SetInternalPositionUsesAnchorPointProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalPositionUsesAnchorPoint = (bool)newValue; + instance.SetInternalPositionUsesAnchorPoint((bool)newValue); } } internal static object GetInternalPositionUsesAnchorPointProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalPositionUsesAnchorPoint; + return instance.GetInternalPositionUsesAnchorPoint(); } /// /// AnchorPointProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AnchorPointProperty = null; -#else public static readonly BindableProperty AnchorPointProperty = null; -#endif + internal static void SetInternalAnchorPointProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -2758,57 +2259,48 @@ namespace Tizen.NUI.BaseComponents /// WidthSpecificationProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty WidthSpecificationProperty = null; -#else public static readonly BindableProperty WidthSpecificationProperty = null; -#endif + internal static void SetInternalWidthSpecificationProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalWidthSpecification = (int)newValue; + instance.SetInternalWidthSpecification((int)newValue); } } internal static object GetInternalWidthSpecificationProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalWidthSpecification; + return instance.GetInternalWidthSpecification(); } /// /// HeightSpecificationProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty HeightSpecificationProperty = null; -#else public static readonly BindableProperty HeightSpecificationProperty = null; -#endif + internal static void SetInternalHeightSpecificationProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalHeightSpecification = (int)newValue; + instance.SetInternalHeightSpecification((int)newValue); } } internal static object GetInternalHeightSpecificationProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalHeightSpecification; + return instance.GetInternalHeightSpecification(); } /// /// LayoutTransitionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty LayoutTransitionProperty = null; -#else public static readonly BindableProperty LayoutTransitionProperty = null; -#endif + internal static void SetInternalLayoutTransitionProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -2827,11 +2319,8 @@ namespace Tizen.NUI.BaseComponents /// PaddingEXProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PaddingEXProperty = null; -#else public static readonly BindableProperty PaddingEXProperty = null; -#endif + internal static void SetInternalPaddingEXProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -2850,11 +2339,8 @@ namespace Tizen.NUI.BaseComponents /// LayoutProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty LayoutProperty = null; -#else public static readonly BindableProperty LayoutProperty = null; -#endif + internal static void SetInternalLayoutProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -2873,80 +2359,68 @@ namespace Tizen.NUI.BaseComponents /// BackgroundImageSynchronosLoadingProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BackgroundImageSynchronosLoadingProperty = null; -#else public static readonly BindableProperty BackgroundImageSynchronosLoadingProperty = null; -#endif + internal static void SetInternalBackgroundImageSynchronosLoadingProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalBackgroundImageSynchronosLoading = (bool)newValue; + instance.SetInternalBackgroundImageSynchronosLoading((bool)newValue); } } internal static object GetInternalBackgroundImageSynchronosLoadingProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalBackgroundImageSynchronosLoading; + return instance.GetInternalBackgroundImageSynchronosLoading(); } /// /// BackgroundImageSynchronousLoadingProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BackgroundImageSynchronousLoadingProperty = null; -#else public static readonly BindableProperty BackgroundImageSynchronousLoadingProperty = null; -#endif + internal static void SetInternalBackgroundImageSynchronousLoadingProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalBackgroundImageSynchronousLoading = (bool)newValue; + instance.SetInternalBackgroundImageSynchronousLoading((bool)newValue); } } internal static object GetInternalBackgroundImageSynchronousLoadingProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalBackgroundImageSynchronousLoading; + return instance.GetInternalBackgroundImageSynchronousLoading(); } /// /// EnableControlStatePropagationProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty EnableControlStatePropagationProperty = null; -#else public static readonly BindableProperty EnableControlStatePropagationProperty = null; -#endif + internal static void SetInternalEnableControlStatePropagationProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalEnableControlStatePropagation = (bool)newValue; + instance.SetInternalEnableControlStatePropagation((bool)newValue); } } internal static object GetInternalEnableControlStatePropagationProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalEnableControlStatePropagation; + return instance.GetInternalEnableControlStatePropagation(); } /// /// PropagatableControlStatesProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty PropagatableControlStatesProperty = null; -#else public static readonly BindableProperty PropagatableControlStatesProperty = null; -#endif + internal static void SetInternalPropagatableControlStatesProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -2965,80 +2439,68 @@ namespace Tizen.NUI.BaseComponents /// GrabTouchAfterLeaveProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty GrabTouchAfterLeaveProperty = null; -#else public static readonly BindableProperty GrabTouchAfterLeaveProperty = null; -#endif + internal static void SetInternalGrabTouchAfterLeaveProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalGrabTouchAfterLeave = (bool)newValue; + instance.SetInternalGrabTouchAfterLeave((bool)newValue); } } internal static object GetInternalGrabTouchAfterLeaveProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalGrabTouchAfterLeave; + return instance.GetInternalGrabTouchAfterLeave(); } /// /// AllowOnlyOwnTouchProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AllowOnlyOwnTouchProperty = null; -#else public static readonly BindableProperty AllowOnlyOwnTouchProperty = null; -#endif + internal static void SetInternalAllowOnlyOwnTouchProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalAllowOnlyOwnTouch = (bool)newValue; + instance.SetInternalAllowOnlyOwnTouch((bool)newValue); } } internal static object GetInternalAllowOnlyOwnTouchProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalAllowOnlyOwnTouch; + return instance.GetInternalAllowOnlyOwnTouch(); } /// /// BlendEquationProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty BlendEquationProperty = null; -#else public static readonly BindableProperty BlendEquationProperty = null; -#endif + internal static void SetInternalBlendEquationProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalBlendEquation = (Tizen.NUI.BlendEquationType)newValue; + instance.SetInternalBlendEquation((BlendEquationType)newValue); } } internal static object GetInternalBlendEquationProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalBlendEquation; + return instance.GetInternalBlendEquation(); } /// /// TransitionOptionsProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty TransitionOptionsProperty = null; -#else public static readonly BindableProperty TransitionOptionsProperty = null; -#endif + internal static void SetInternalTransitionOptionsProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -3057,11 +2519,8 @@ namespace Tizen.NUI.BaseComponents /// AutomationIdProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty AutomationIdProperty = null; -#else public static readonly BindableProperty AutomationIdProperty = null; -#endif + internal static void SetInternalAutomationIdProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -3082,11 +2541,8 @@ namespace Tizen.NUI.BaseComponents /// TouchAreaOffsetProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty TouchAreaOffsetProperty = null; -#else public static readonly BindableProperty TouchAreaOffsetProperty = null; -#endif + internal static void SetInternalTouchAreaOffsetProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -3105,11 +2561,8 @@ namespace Tizen.NUI.BaseComponents /// DispatchTouchMotionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty DispatchTouchMotionProperty = null; -#else public static readonly BindableProperty DispatchTouchMotionProperty = null; -#endif + internal static void SetInternalDispatchTouchMotionProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -3128,11 +2581,8 @@ namespace Tizen.NUI.BaseComponents /// DispatchHoverMotionProperty /// [EditorBrowsable(EditorBrowsableState.Never)] -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - public static BindableProperty DispatchHoverMotionProperty = null; -#else public static readonly BindableProperty DispatchHoverMotionProperty = null; -#endif + internal static void SetInternalDispatchHoverMotionProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -3148,363 +2598,6 @@ namespace Tizen.NUI.BaseComponents return instance.InternalDispatchHoverMotion; } -#if REMOVE_READONLY_FOR_BINDABLE_PROPERTY - internal static void CreateBindableProperties() - { - if (NUIApplication.IsUsingXaml) - { - StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(View), string.Empty, - propertyChanged: SetInternalStyleNameProperty, defaultValueCreator: GetInternalStyleNameProperty); - - KeyInputFocusProperty = BindableProperty.Create(nameof(KeyInputFocus), typeof(bool), typeof(View), false, - propertyChanged: SetInternalKeyInputFocusProperty, defaultValueCreator: GetInternalKeyInputFocusProperty); - - BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(View), null, - propertyChanged: SetInternalBackgroundColorProperty, defaultValueCreator: GetInternalBackgroundColorProperty); - - ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(View), null, - propertyChanged: SetInternalColorProperty, defaultValueCreator: GetInternalColorProperty); - - ColorRedProperty = BindableProperty.Create(nameof(ColorRed), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalColorRedProperty, defaultValueCreator: GetInternalColorRedProperty); - - ColorGreenProperty = BindableProperty.Create(nameof(ColorGreen), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalColorGreenProperty, defaultValueCreator: GetInternalColorGreenProperty); - - ColorBlueProperty = BindableProperty.Create(nameof(ColorBlue), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalColorBlueProperty, defaultValueCreator: GetInternalColorBlueProperty); - - BackgroundImageProperty = BindableProperty.Create(nameof(BackgroundImage), typeof(string), typeof(View), default(string), - propertyChanged: SetInternalBackgroundImageProperty, defaultValueCreator: GetInternalBackgroundImageProperty); - - BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Rectangle), typeof(View), default(Rectangle), - propertyChanged: SetInternalBackgroundImageBorderProperty, defaultValueCreator: GetInternalBackgroundImageBorderProperty); - - BackgroundProperty = BindableProperty.Create(nameof(Background), typeof(PropertyMap), typeof(View), null, - propertyChanged: SetInternalBackgroundProperty, defaultValueCreator: GetInternalBackgroundProperty); - - StateProperty = BindableProperty.Create(nameof(State), typeof(States), typeof(View), States.Normal, - propertyChanged: SetInternalStateProperty, defaultValueCreator: GetInternalStateProperty); - - SubStateProperty = BindableProperty.Create(nameof(SubState), typeof(States), typeof(View), States.Normal, - propertyChanged: SetInternalSubStateProperty, defaultValueCreator: GetInternalSubStateProperty); - - TooltipProperty = BindableProperty.Create(nameof(Tooltip), typeof(PropertyMap), typeof(View), null, - propertyChanged: SetInternalTooltipProperty, defaultValueCreator: GetInternalTooltipProperty); - - FlexProperty = BindableProperty.Create(nameof(Flex), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalFlexProperty, defaultValueCreator: GetInternalFlexProperty); - - AlignSelfProperty = BindableProperty.Create(nameof(AlignSelf), typeof(int), typeof(View), default(int), - propertyChanged: SetInternalAlignSelfProperty, defaultValueCreator: GetInternalAlignSelfProperty); - - FlexMarginProperty = BindableProperty.Create(nameof(FlexMargin), typeof(Vector4), typeof(View), null, - propertyChanged: SetInternalFlexMarginProperty, defaultValueCreator: GetInternalFlexMarginProperty); - - CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(View), null, - propertyChanged: SetInternalCellIndexProperty, defaultValueCreator: GetInternalCellIndexProperty); - - RowSpanProperty = BindableProperty.Create(nameof(RowSpan), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalRowSpanProperty, defaultValueCreator: GetInternalRowSpanProperty); - - ColumnSpanProperty = BindableProperty.Create(nameof(ColumnSpan), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalColumnSpanProperty, defaultValueCreator: GetInternalColumnSpanProperty); - - CellHorizontalAlignmentProperty = BindableProperty.Create(nameof(CellHorizontalAlignment), typeof(HorizontalAlignmentType), typeof(View), HorizontalAlignmentType.Left, - propertyChanged: SetInternalCellHorizontalAlignmentProperty, defaultValueCreator: GetInternalCellHorizontalAlignmentProperty); - - CellVerticalAlignmentProperty = BindableProperty.Create(nameof(CellVerticalAlignment), typeof(VerticalAlignmentType), typeof(View), VerticalAlignmentType.Top, - propertyChanged: SetInternalCellVerticalAlignmentProperty, defaultValueCreator: GetInternalCellVerticalAlignmentProperty); - - WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalWeightProperty, defaultValueCreator: GetInternalWeightProperty); - - LeftFocusableViewProperty = BindableProperty.Create(nameof(View.LeftFocusableView), typeof(View), typeof(View), null, - propertyChanged: SetInternalLeftFocusableViewProperty, defaultValueCreator: GetInternalLeftFocusableViewProperty); - - RightFocusableViewProperty = BindableProperty.Create(nameof(View.RightFocusableView), typeof(View), typeof(View), null, - propertyChanged: SetInternalRightFocusableViewProperty, defaultValueCreator: GetInternalRightFocusableViewProperty); - - UpFocusableViewProperty = BindableProperty.Create(nameof(View.UpFocusableView), typeof(View), typeof(View), null, - propertyChanged: SetInternalUpFocusableViewProperty, defaultValueCreator: GetInternalUpFocusableViewProperty); - - DownFocusableViewProperty = BindableProperty.Create(nameof(View.DownFocusableView), typeof(View), typeof(View), null, - propertyChanged: SetInternalDownFocusableViewProperty, defaultValueCreator: GetInternalDownFocusableViewProperty); - - ClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.ClockwiseFocusableView), typeof(View), typeof(View), null, - propertyChanged: SetInternalClockwiseFocusableViewProperty, defaultValueCreator: GetInternalClockwiseFocusableViewProperty); - - CounterClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.CounterClockwiseFocusableView), typeof(View), typeof(View), null, - propertyChanged: SetInternalCounterClockwiseFocusableViewProperty, defaultValueCreator: GetInternalCounterClockwiseFocusableViewProperty); - - FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool), typeof(View), false, - propertyChanged: SetInternalFocusableProperty, defaultValueCreator: GetInternalFocusableProperty); - - FocusableChildrenProperty = BindableProperty.Create(nameof(FocusableChildren), typeof(bool), typeof(View), true, - propertyChanged: SetInternalFocusableChildrenProperty, defaultValueCreator: GetInternalFocusableChildrenProperty); - - FocusableInTouchProperty = BindableProperty.Create(nameof(FocusableInTouch), typeof(bool), typeof(View), false, - propertyChanged: SetInternalFocusableInTouchProperty, defaultValueCreator: GetInternalFocusableInTouchProperty); - - Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(View), null, - propertyChanged: SetInternalSize2DProperty, defaultValueCreator: GetInternalSize2DProperty); - - OpacityProperty = BindableProperty.Create(nameof(Opacity), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalOpacityProperty, defaultValueCreator: GetInternalOpacityProperty); - - Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(View), null, - propertyChanged: SetInternalPosition2DProperty, defaultValueCreator: GetInternalPosition2DProperty); - - PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool), typeof(View), true, - propertyChanged: SetInternalPositionUsesPivotPointProperty, defaultValueCreator: GetInternalPositionUsesPivotPointProperty); - - SiblingOrderProperty = BindableProperty.Create(nameof(SiblingOrder), typeof(int), typeof(View), default(int), - propertyChanged: SetInternalSiblingOrderProperty, defaultValueCreator: GetInternalSiblingOrderProperty); - - ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(View), null, - propertyChanged: SetInternalParentOriginProperty, defaultValueCreator: GetInternalParentOriginProperty); - - PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(View), null, - propertyChanged: SetInternalPivotPointProperty, defaultValueCreator: GetInternalPivotPointProperty); - - SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalSizeWidthProperty, defaultValueCreator: GetInternalSizeWidthProperty); - - SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalSizeHeightProperty, defaultValueCreator: GetInternalSizeHeightProperty); - - PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(View), null, - propertyChanged: SetInternalPositionProperty, defaultValueCreator: GetInternalPositionProperty); - - PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalPositionXProperty, defaultValueCreator: GetInternalPositionXProperty); - - PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalPositionYProperty, defaultValueCreator: GetInternalPositionYProperty); - - PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalPositionZProperty, defaultValueCreator: GetInternalPositionZProperty); - - OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(View), null, - propertyChanged: SetInternalOrientationProperty, defaultValueCreator: GetInternalOrientationProperty); - - ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(View), null, - propertyChanged: SetInternalScaleProperty, defaultValueCreator: GetInternalScaleProperty); - - ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalScaleXProperty, defaultValueCreator: GetInternalScaleXProperty); - - ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalScaleYProperty, defaultValueCreator: GetInternalScaleYProperty); - - ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalScaleZProperty, defaultValueCreator: GetInternalScaleZProperty); - - NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(View), string.Empty, - propertyChanged: SetInternalNameProperty, defaultValueCreator: GetInternalNameProperty); - - SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool), typeof(View), false, - propertyChanged: SetInternalSensitiveProperty, defaultValueCreator: GetInternalSensitiveProperty); - - IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(View), false, - propertyChanged: SetInternalIsEnabledProperty, defaultValueCreator: GetInternalIsEnabledProperty); - - DispatchKeyEventsProperty = BindableProperty.Create(nameof(DispatchKeyEvents), typeof(bool), typeof(View), false, - propertyChanged: SetInternalDispatchKeyEventsProperty, defaultValueCreator: GetInternalDispatchKeyEventsProperty); - - LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool), typeof(View), false, - propertyChanged: SetInternalLeaveRequiredProperty, defaultValueCreator: GetInternalLeaveRequiredProperty); - - InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool), typeof(View), false, - propertyChanged: SetInternalInheritOrientationProperty, defaultValueCreator: GetInternalInheritOrientationProperty); - - InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool), typeof(View), false, - propertyChanged: SetInternalInheritScaleProperty, defaultValueCreator: GetInternalInheritScaleProperty); - - DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType), typeof(View), DrawModeType.Normal, - propertyChanged: SetInternalDrawModeProperty, defaultValueCreator: GetInternalDrawModeProperty); - - SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(View), null, - propertyChanged: SetInternalSizeModeFactorProperty, defaultValueCreator: GetInternalSizeModeFactorProperty); - - WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, - propertyChanged: SetInternalWidthResizePolicyProperty, defaultValueCreator: GetInternalWidthResizePolicyProperty); - - HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, - propertyChanged: SetInternalHeightResizePolicyProperty, defaultValueCreator: GetInternalHeightResizePolicyProperty); - - SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType), typeof(View), SizeScalePolicyType.UseSizeSet, - propertyChanged: SetInternalSizeScalePolicyProperty, defaultValueCreator: GetInternalSizeScalePolicyProperty); - - WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool), typeof(View), false, - propertyChanged: SetInternalWidthForHeightProperty, defaultValueCreator: GetInternalWidthForHeightProperty); - - HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool), typeof(View), false, - propertyChanged: SetInternalHeightForWidthProperty, defaultValueCreator: GetInternalHeightForWidthProperty); - - PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(View), null, - propertyChanged: SetInternalPaddingProperty, defaultValueCreator: GetInternalPaddingProperty); - - SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(View), null, - propertyChanged: SetInternalSizeProperty, defaultValueCreator: GetInternalSizeProperty); - - MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(View), null, - propertyChanged: SetInternalMinimumSizeProperty, defaultValueCreator: GetInternalMinimumSizeProperty); - - MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(View), null, - propertyChanged: SetInternalMaximumSizeProperty, defaultValueCreator: GetInternalMaximumSizeProperty); - - InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool), typeof(View), false, - propertyChanged: SetInternalInheritPositionProperty, defaultValueCreator: GetInternalInheritPositionProperty); - - ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType), typeof(View), ClippingModeType.Disabled, - propertyChanged: SetInternalClippingModeProperty, defaultValueCreator: GetInternalClippingModeProperty); - - InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool), typeof(View), false, - propertyChanged: SetInternalInheritLayoutDirectionProperty, defaultValueCreator: GetInternalInheritLayoutDirectionProperty); - - LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType), typeof(View), ViewLayoutDirectionType.LTR, - propertyChanged: SetInternalLayoutDirectionProperty, defaultValueCreator: GetInternalLayoutDirectionProperty); - - MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(View), null, - propertyChanged: SetInternalMarginProperty, defaultValueCreator: GetInternalMarginProperty); - - UpdateAreaHintProperty = BindableProperty.Create(nameof(UpdateAreaHint), typeof(Vector4), typeof(View), null, - propertyChanged: SetInternalUpdateAreaHintProperty, defaultValueCreator: GetInternalUpdateAreaHintProperty); - - ImageShadowProperty = BindableProperty.Create(nameof(ImageShadow), typeof(ImageShadow), typeof(View), null, - propertyChanged: SetInternalImageShadowProperty, defaultValueCreator: GetInternalImageShadowProperty); - - BoxShadowProperty = BindableProperty.Create(nameof(BoxShadow), typeof(Shadow), typeof(View), null, - propertyChanged: SetInternalBoxShadowProperty, defaultValueCreator: GetInternalBoxShadowProperty); - - CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(Vector4), typeof(View), null, - propertyChanged: SetInternalCornerRadiusProperty, defaultValueCreator: GetInternalCornerRadiusProperty); - - CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType), typeof(View), VisualTransformPolicyType.Absolute, - propertyChanged: SetInternalCornerRadiusPolicyProperty, defaultValueCreator: GetInternalCornerRadiusPolicyProperty); - - BorderlineWidthProperty = BindableProperty.Create(nameof(BorderlineWidth), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalBorderlineWidthProperty, defaultValueCreator: GetInternalBorderlineWidthProperty); - - BorderlineColorProperty = BindableProperty.Create(nameof(BorderlineColor), typeof(Color), typeof(View), null, - propertyChanged: SetInternalBorderlineColorProperty, defaultValueCreator: GetInternalBorderlineColorProperty); - - BorderlineColorSelectorProperty = BindableProperty.Create(nameof(BorderlineColorSelector), typeof(Selector), typeof(View), null, - propertyChanged: SetInternalBorderlineColorSelectorProperty, defaultValueCreator: GetInternalBorderlineColorSelectorProperty); - - BorderlineOffsetProperty = BindableProperty.Create(nameof(BorderlineOffset), typeof(float), typeof(View), default(float), - propertyChanged: SetInternalBorderlineOffsetProperty, defaultValueCreator: GetInternalBorderlineOffsetProperty); - - EnableControlStateProperty = BindableProperty.Create(nameof(EnableControlState), typeof(bool), typeof(View), false, - propertyChanged: SetInternalEnableControlStateProperty, defaultValueCreator: GetInternalEnableControlStateProperty); - - ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool), typeof(View), false, - propertyChanged: SetInternalThemeChangeSensitiveProperty, defaultValueCreator: GetInternalThemeChangeSensitiveProperty); - - AccessibilityNameProperty = BindableProperty.Create(nameof(AccessibilityName), typeof(string), typeof(View), string.Empty, - propertyChanged: SetInternalAccessibilityNameProperty, defaultValueCreator: GetInternalAccessibilityNameProperty); - - AccessibilityDescriptionProperty = BindableProperty.Create(nameof(AccessibilityDescription), typeof(string), typeof(View), string.Empty, - propertyChanged: SetInternalAccessibilityDescriptionProperty, defaultValueCreator: GetInternalAccessibilityDescriptionProperty); - - AccessibilityTranslationDomainProperty = BindableProperty.Create(nameof(AccessibilityTranslationDomain), typeof(string), typeof(View), string.Empty, - propertyChanged: SetInternalAccessibilityTranslationDomainProperty, defaultValueCreator: GetInternalAccessibilityTranslationDomainProperty); - - AccessibilityRoleProperty = BindableProperty.Create(nameof(AccessibilityRole), typeof(Role), typeof(View), default(Role), - propertyChanged: SetInternalAccessibilityRoleProperty, defaultValueCreator: GetInternalAccessibilityRoleProperty); - - AccessibilityHighlightableProperty = BindableProperty.Create(nameof(AccessibilityHighlightable), typeof(bool), typeof(View), false, - propertyChanged: SetInternalAccessibilityHighlightableProperty, defaultValueCreator: GetInternalAccessibilityHighlightableProperty); - - AccessibilityHiddenProperty = BindableProperty.Create(nameof(AccessibilityHidden), typeof(bool), typeof(View), false, - propertyChanged: SetInternalAccessibilityHiddenProperty, defaultValueCreator: GetInternalAccessibilityHiddenProperty); - - ExcludeLayoutingProperty = BindableProperty.Create(nameof(ExcludeLayouting), typeof(bool), typeof(View), false, - propertyChanged: SetInternalExcludeLayoutingProperty, defaultValueCreator: GetInternalExcludeLayoutingProperty); - - TooltipTextProperty = BindableProperty.Create(nameof(TooltipText), typeof(string), typeof(View), string.Empty, - propertyChanged: SetInternalTooltipTextProperty, defaultValueCreator: GetInternalTooltipTextProperty); - - PositionUsesAnchorPointProperty = BindableProperty.Create(nameof(PositionUsesAnchorPoint), typeof(bool), typeof(View), false, - propertyChanged: SetInternalPositionUsesAnchorPointProperty, defaultValueCreator: GetInternalPositionUsesAnchorPointProperty); - - AnchorPointProperty = BindableProperty.Create(nameof(AnchorPoint), typeof(Tizen.NUI.Position), typeof(View), null, - propertyChanged: SetInternalAnchorPointProperty, defaultValueCreator: GetInternalAnchorPointProperty); - - WidthSpecificationProperty = BindableProperty.Create(nameof(WidthSpecification), typeof(int), typeof(View), 0, - propertyChanged: SetInternalWidthSpecificationProperty, defaultValueCreator: GetInternalWidthSpecificationProperty); - - HeightSpecificationProperty = BindableProperty.Create(nameof(HeightSpecification), typeof(int), typeof(View), 0, - propertyChanged: SetInternalHeightSpecificationProperty, defaultValueCreator: GetInternalHeightSpecificationProperty); - - LayoutTransitionProperty = BindableProperty.Create(nameof(LayoutTransition), typeof(Tizen.NUI.LayoutTransition), typeof(View), null, - propertyChanged: SetInternalLayoutTransitionProperty, defaultValueCreator: GetInternalLayoutTransitionProperty); - - PaddingEXProperty = BindableProperty.Create(nameof(PaddingEX), typeof(Tizen.NUI.Extents), typeof(View), null, - propertyChanged: SetInternalPaddingEXProperty, defaultValueCreator: GetInternalPaddingEXProperty); - - LayoutProperty = BindableProperty.Create(nameof(Layout), typeof(Tizen.NUI.LayoutItem), typeof(View), null, - propertyChanged: SetInternalLayoutProperty, defaultValueCreator: GetInternalLayoutProperty); - - BackgroundImageSynchronosLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronosLoading), typeof(bool), typeof(View), false, - propertyChanged: SetInternalBackgroundImageSynchronosLoadingProperty, defaultValueCreator: GetInternalBackgroundImageSynchronosLoadingProperty); - - BackgroundImageSynchronousLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronousLoading), typeof(bool), typeof(View), false, - propertyChanged: SetInternalBackgroundImageSynchronousLoadingProperty, defaultValueCreator: GetInternalBackgroundImageSynchronousLoadingProperty); - - EnableControlStatePropagationProperty = BindableProperty.Create(nameof(EnableControlStatePropagation), typeof(bool), typeof(View), false, - propertyChanged: SetInternalEnableControlStatePropagationProperty, defaultValueCreator: GetInternalEnableControlStatePropagationProperty); - - PropagatableControlStatesProperty = BindableProperty.Create(nameof(PropagatableControlStates), typeof(ControlState), typeof(View), ControlState.All, - propertyChanged: SetInternalPropagatableControlStatesProperty, defaultValueCreator: GetInternalPropagatableControlStatesProperty); - - GrabTouchAfterLeaveProperty = BindableProperty.Create(nameof(GrabTouchAfterLeave), typeof(bool), typeof(View), false, - propertyChanged: SetInternalGrabTouchAfterLeaveProperty, defaultValueCreator: GetInternalGrabTouchAfterLeaveProperty); - - AllowOnlyOwnTouchProperty = BindableProperty.Create(nameof(AllowOnlyOwnTouch), typeof(bool), typeof(View), false, - propertyChanged: SetInternalAllowOnlyOwnTouchProperty, defaultValueCreator: GetInternalAllowOnlyOwnTouchProperty); - - BlendEquationProperty = BindableProperty.Create(nameof(BlendEquation), typeof(BlendEquationType), typeof(View), default(BlendEquationType), - propertyChanged: SetInternalBlendEquationProperty, defaultValueCreator: GetInternalBlendEquationProperty); - - TransitionOptionsProperty = BindableProperty.Create(nameof(TransitionOptions), typeof(TransitionOptions), typeof(View), default(TransitionOptions), - propertyChanged: SetInternalTransitionOptionsProperty, defaultValueCreator: GetInternalTransitionOptionsProperty); - - AutomationIdProperty = BindableProperty.Create(nameof(AutomationId), typeof(string), typeof(View), string.Empty, - propertyChanged: SetInternalAutomationIdProperty, defaultValueCreator: GetInternalAutomationIdProperty); - - TouchAreaOffsetProperty = BindableProperty.Create(nameof(TouchAreaOffset), typeof(Offset), typeof(View), default(Offset), - propertyChanged: SetInternalTouchAreaOffsetProperty, defaultValueCreator: GetInternalTouchAreaOffsetProperty); - - DispatchTouchMotionProperty = BindableProperty.Create(nameof(DispatchTouchMotion), typeof(bool), typeof(View), false, - propertyChanged: SetInternalDispatchTouchMotionProperty, defaultValueCreator: GetInternalDispatchTouchMotionProperty); - - DispatchHoverMotionProperty = BindableProperty.Create(nameof(DispatchHoverMotion), typeof(bool), typeof(View), false, - propertyChanged: SetInternalDispatchHoverMotionProperty, defaultValueCreator: GetInternalDispatchHoverMotionProperty); - - - RegisterPropertyGroup(PositionProperty, positionPropertyGroup); - RegisterPropertyGroup(Position2DProperty, positionPropertyGroup); - RegisterPropertyGroup(PositionXProperty, positionPropertyGroup); - RegisterPropertyGroup(PositionYProperty, positionPropertyGroup); - - RegisterPropertyGroup(SizeProperty, sizePropertyGroup); - RegisterPropertyGroup(Size2DProperty, sizePropertyGroup); - RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup); - RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup); - - RegisterPropertyGroup(ScaleProperty, scalePropertyGroup); - RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup); - RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup); - RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup); - } - } -#else - // keep readonly for BindableProperty -#endif - - /// /// Gets View's Size2D set by user. /// diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PropertyTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PropertyTest.cs new file mode 100755 index 000000000..d1c8921c8 --- /dev/null +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PropertyTest.cs @@ -0,0 +1,158 @@ +using System; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Components; +using System.Reflection; +using System.Collections.Generic; +using System.ComponentModel; + +namespace Tizen.NUI.Samples +{ + + public class PropertyTest : IExample + { + private View target; + private View root; + private Dictionary> testing = new Dictionary> + { + {typeof(bool), new List() { true, false }}, + {typeof(int), new List() { -99999, -1234, 12345678, -987654321, 987654321}}, + {typeof(float), new List() { -99999.99999f, -1234.1234f, 0f, 123456.123456f, -987654321.123456789f}}, + {typeof(double), new List() { -99999999.99999999f, -1234567890.1234567890f, 0f, 12345699999.12345699999f, -98765432111.123456789f}}, + {typeof(string), new List() { "test", "!@#$%", "][]=-"}}, + {typeof(Tizen.NUI.BaseComponents.ControlState), new List() {ControlState.All, ControlState.Normal, ControlState.Pressed, ControlState.Disabled, ControlState.DisabledFocused}}, + {typeof(Tizen.NUI.Color), new List() {Color.White, Color.AquaMarine, Color.Red, Color.Cyan, Color.Chocolate}}, + {typeof(Tizen.NUI.Rectangle), new List() {new Tizen.NUI.Rectangle(1, 2, 3, 4), new Tizen.NUI.Rectangle(100, -100, -900, 1000), new Tizen.NUI.Rectangle(1234, -94321, 9999, 54321)}} + + }; + + public void Activate() + { + Window window = NUIApplication.GetDefaultWindow(); + + target = new View() + { + Size2D = new Size2D(100, 100), + }; + + var proInfos = target.GetType().GetProperties(); + foreach (var prop in proInfos) + { + + var hasEditorBrowsableNever = Attribute.GetCustomAttribute(prop, typeof(EditorBrowsableAttribute)) is EditorBrowsableAttribute attr && attr.State == EditorBrowsableState.Never; + + var hiddenOrPublic = hasEditorBrowsableNever ? "[Hidden]" : "[Public]"; + Tizen.Log.Debug("NUI", $"{hiddenOrPublic} Property Name: {prop.Name}, Type: {prop.PropertyType}, CanRead: {prop.CanRead}, CanWrite: {prop.CanWrite}, get: {prop.GetValue(target)}"); + + if (!prop.CanRead || !prop.CanWrite) continue; + + if (testing.TryGetValue(prop.PropertyType, out var testVals)) + { + bool res = true; + foreach (var val in testVals) + { + prop.SetValue(target, val); + var got = prop.GetValue(target); + bool resSub = IsSame(val, got, prop.PropertyType); + res &= resSub; + } + string result = res ? "OK" : "BAD"; + Tizen.Log.Debug("NUI", $"Testing {prop.Name} result={result}"); + Tizen.Log.Debug("NUI", $"=================="); + } + else + { + Tizen.Log.Debug("NUI", $"No Testing {prop.Name} {prop.PropertyType} just skip!\n"); + Tizen.Log.Debug("NUI", $"=================="); + continue; + } + } + Tizen.Log.Debug("NUI", $"proInfos len:{proInfos.Length}"); + + root = new View(); + + root.Add(target); + window.Add(root); + + var tl1 = new TextLabel + { + Position = new Position(400, 400), + Size = new Size(600, 100), + Text = "property test" + }; + + root.Add(target); + + var tl2 = new TextLabel + { + Position = new Position(400, 400), + Size = new Size(600, 100), + Text = "please check the log" + }; + root.Add(tl2); + } + + private static object CreateRandomValueForProp(Type propType) + { + if (propType == typeof(string)) return RandomString(); + else if (propType.IsValueType) + { + var underlying = propType.UnderlyingSystemType; + Tizen.Log.Debug("NUI", $"system type: {underlying}"); + return Activator.CreateInstance(propType); + } + else + { + //Todo: for class type properties, need to be added. + return null; + } + } + + private static string RandomString() => Guid.NewGuid().ToString(); + + private static bool IsSame(object a, object b, Type t) + { + if (a.GetType() != b.GetType()) { return false; } + + if (a is IEquatable equatableA && b is IEquatable equatableB) + { + return equatableA.Equals(equatableB); + } + else + { + if (a.GetType().IsValueType) + { + //Tizen.Log.Debug("NUI", $"a:{a}, b:{b}"); + return a.Equals(b); + } + else + { + if (a is Tizen.NUI.Color a1 && b is Tizen.NUI.Color b1) + { + // var aa = a as Tizen.NUI.Color; + // var bb = b as Tizen.NUI.Color; + // var aa = global::System.Convert.ChangeType(a, t); + // var bb = global::System.Convert.ChangeType(b, t); + if (Object.ReferenceEquals(a1, b1)) { return true; } + if (a1 == b1) { return true; } + } + else if (a is Tizen.NUI.Rectangle a2 && b is Tizen.NUI.Rectangle b2) + { + if (Object.ReferenceEquals(a2, b2)) { return true; } + if (a2 == b2) { return true; } + } + else + { + //Tizen.Log.Debug("NUI", $"a:{a}, b:{b}"); + if (Object.ReferenceEquals(a, b)) { return true; } + if (a == b) { return true; } + } + } + } + return false; + } + + public void Deactivate() + { + } + } +}