diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs index 1488aa9af9a..d761a20ce6d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs @@ -29,11 +29,11 @@ namespace Tizen.NUI.BaseComponents /// 9 public partial class ViewStyle : BindableObject, IDisposable { - static readonly IStyleProperty BackgroundImageProperty = new StyleProperty>((v, o) => View.SetInternalBackgroundImageProperty(v, null, o)); + static readonly IStyleProperty BackgroundImageProperty = new StyleProperty>((v, o) => v.SetInternalBackgroundImage(o)); static readonly IStyleProperty FocusableProperty = new StyleProperty((v, o) => v.Focusable = o); static readonly IStyleProperty FocusableChildrenProperty = new StyleProperty((v, o) => v.FocusableChildren = o); static readonly IStyleProperty FocusableInTouchProperty = new StyleProperty((v, o) => v.FocusableInTouch = o); - static readonly IStyleProperty OpacityProperty = new StyleProperty>((v, o) => View.SetInternalOpacityProperty(v, null, o)); + static readonly IStyleProperty OpacityProperty = new StyleProperty>((v, o) => v.SetInternalOpacity(o)); static readonly IStyleProperty PositionUsesPivotPointProperty = new StyleProperty((v, o) => v.PositionUsesPivotPoint = o); static readonly IStyleProperty ParentOriginProperty = new StyleProperty((v, o) => v.ParentOrigin = o); static readonly IStyleProperty PivotPointProperty = new StyleProperty((v, o) => v.PivotPoint = o); @@ -54,16 +54,16 @@ public partial class ViewStyle : BindableObject, IDisposable static readonly IStyleProperty MaximumSizeProperty = new StyleProperty((v, o) => v.MaximumSize = o); static readonly IStyleProperty ClippingModeProperty = new StyleProperty((v, o) => v.ClippingMode = o); static readonly IStyleProperty MarginProperty = new StyleProperty((v, o) => v.Margin = o); - static readonly IStyleProperty BackgroundColorProperty = new StyleProperty>((v, o) => View.SetInternalBackgroundColorProperty(v, null, o)); - static readonly IStyleProperty ColorProperty = new StyleProperty>((v, o) => View.SetInternalColorProperty(v, null, o)); - static readonly IStyleProperty BackgroundImageBorderProperty = new StyleProperty>((v, o) => View.SetInternalBackgroundImageBorderProperty(v, null, o)); - static readonly IStyleProperty ImageShadowProperty = new StyleProperty>((v, o) => View.SetInternalImageShadowProperty(v, null, o)); - static readonly IStyleProperty BoxShadowProperty = new StyleProperty>((v, o) => View.SetInternalBoxShadowProperty(v, null, o)); + static readonly IStyleProperty BackgroundColorProperty = new StyleProperty>((v, o) => v.SetInternalBackgroundColor(o)); + static readonly IStyleProperty ColorProperty = new StyleProperty>((v, o) => v.SetInternalColor(o)); + static readonly IStyleProperty BackgroundImageBorderProperty = new StyleProperty>((v, o) => v.SetInternalBackgroundImageBorder(o)); + static readonly IStyleProperty ImageShadowProperty = new StyleProperty>((v, o) => v.SetInternalImageShadow(o)); + static readonly IStyleProperty BoxShadowProperty = new StyleProperty>((v, o) => v.SetInternalBoxShadow(o)); static readonly IStyleProperty CornerRadiusProperty = new StyleProperty((v, o) => v.CornerRadius = o); static readonly IStyleProperty CornerRadiusPolicyProperty = new StyleProperty((v, o) => v.CornerRadiusPolicy = o); static readonly IStyleProperty BorderlineWidthProperty = new StyleProperty((v, o) => v.BorderlineWidth = o); static readonly IStyleProperty BorderlineColorProperty = new StyleProperty((v, o) => v.BorderlineColor = o); - static readonly IStyleProperty BorderlineColorSelectorProperty = new StyleProperty>((v, o) => View.SetInternalBorderlineColorSelectorProperty(v, null, o)); + static readonly IStyleProperty BorderlineColorSelectorProperty = new StyleProperty>((v, o) => v.SetInternalBorderlineColor(o)); static readonly IStyleProperty BorderlineOffsetProperty = new StyleProperty((v, o) => v.BorderlineOffset = o); static readonly IStyleProperty ThemeChangeSensitiveProperty = new StyleProperty((v, o) => v.ThemeChangeSensitive = o); static readonly IStyleProperty IsEnabledProperty = new StyleProperty((v, o) => v.IsEnabled = o); diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 7f61276c38d..2a5a89358c9 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -842,11 +842,12 @@ public bool ExcludeLayouting } } - internal bool GetInternalExcludeLayouting() + private bool GetInternalExcludeLayouting() { return InternalExcludeLayouting; } - internal void SetInternalExcludeLayouting(bool excludeLayouting) + + private void SetInternalExcludeLayouting(bool excludeLayouting) { InternalExcludeLayouting = excludeLayouting; } @@ -880,7 +881,7 @@ public string StyleName } else { - return (string)GetInternalStyleNameProperty(this); + return GetInternalStyleName(); } } set @@ -891,12 +892,36 @@ public string StyleName } else { - SetInternalStyleNameProperty(this, null, value); + SetInternalStyleName(value); } NotifyPropertyChanged(); } } + private string GetInternalStyleName() + { + if (!string.IsNullOrEmpty(styleName)) + return styleName; + + return Object.InternalGetPropertyString(SwigCPtr, Property.StyleName); + } + + private void SetInternalStyleName(string name) + { + string styleName = (string)name; + Object.InternalSetPropertyString(SwigCPtr, Property.StyleName, styleName); + this.styleName = styleName; + if (string.IsNullOrEmpty(styleName)) + return; + + var style = ThemeManager.GetUpdateStyleWithoutClone(styleName); + if (style == null) + return; + + ApplyStyle(style); + SetThemeApplied(); + } + /// /// The KeyInputFocus, type bool. /// @@ -928,11 +953,12 @@ public bool KeyInputFocus } } - internal void SetInternalKeyInputFocus(bool keyInputFocus) + private void SetInternalKeyInputFocus(bool keyInputFocus) { Object.InternalSetPropertyBool(SwigCPtr, Property.KeyInputFocus, keyInputFocus); } - internal bool GetInternalKeyInputFocus() + + private bool GetInternalKeyInputFocus() { return Object.InternalGetPropertyBool(SwigCPtr, Property.KeyInputFocus); } @@ -973,7 +999,7 @@ public Color BackgroundColor } else { - return (Color)GetInternalBackgroundColorProperty(this); + return GetInternalBackgroundColor(); } } set @@ -984,13 +1010,49 @@ public Color BackgroundColor } else { - SetInternalBackgroundColorProperty(this, null, value); + SetInternalBackgroundColor(value); } NotifyPropertyChanged(); NotifyBackgroundChanged(); } } + internal void SetInternalBackgroundColor(Selector selector) + { + themeData?.selectorData?.ClearBackground(this); + if (selector.HasAll()) + { + SetBackgroundColor(selector.All); + } + else + { + EnsureSelectorData().BackgroundColor = new TriggerableSelector(this, selector, SetBackgroundColor, true); + } + } + + private void SetInternalBackgroundColor(Color color) + { + themeData?.selectorData?.ClearBackground(this); + SetBackgroundColor(color); + } + + private Color GetInternalBackgroundColor() + { + if (internalBackgroundColor == null) + { + internalBackgroundColor = new Color(OnBackgroundColorChanged, 0, 0, 0, 0); + } + + int visualType = (int)Visual.Type.Invalid; + Object.InternalRetrievingVisualPropertyInt(SwigCPtr, Property.BACKGROUND, Visual.Property.Type, out visualType); + + if (visualType == (int)Visual.Type.Color) + { + Object.InternalRetrievingVisualPropertyVector4(SwigCPtr, Property.BACKGROUND, ColorVisualProperty.MixColor, Color.getCPtr(internalBackgroundColor)); + } + return internalBackgroundColor; + } + /// /// The mutually exclusive with "backgroundColor" and "background" type Map. /// @@ -1005,7 +1067,7 @@ public string BackgroundImage } else { - return (string)GetInternalBackgroundImageProperty(this); + return GetInternalBackgroundImage(); } } set @@ -1016,13 +1078,46 @@ public string BackgroundImage } else { - SetInternalBackgroundImageProperty(this, null, value); + SetInternalBackgroundImage(value); } NotifyPropertyChanged(); NotifyBackgroundChanged(); } } + internal void SetInternalBackgroundImage(Selector selector) + { + if (themeData?.selectorData != null) + { + themeData.selectorData.BackgroundColor?.Reset(this); + themeData.selectorData.BackgroundImage?.Reset(this); + } + + if (selector.HasAll()) + { + SetBackgroundImage(selector.All); + } + else + { + EnsureSelectorData().BackgroundImage = new TriggerableSelector(this, selector, SetBackgroundImage, true); + } + } + + private void SetInternalBackgroundImage(string imageUrl) + { + if (themeData?.selectorData != null) + { + themeData.selectorData.BackgroundColor?.Reset(this); + themeData.selectorData.BackgroundImage?.Reset(this); + } + SetBackgroundImage(imageUrl); + } + + private string GetInternalBackgroundImage() + { + return backgroundImageUrl; + } + /// /// Get or set the border of background image. /// @@ -1038,7 +1133,7 @@ public Rectangle BackgroundImageBorder } else { - return (Rectangle)GetInternalBackgroundImageBorderProperty(this); + return GetInternalBackgroundImageBorder(); } } set @@ -1049,12 +1144,37 @@ public Rectangle BackgroundImageBorder } else { - SetInternalBackgroundImageBorderProperty(this, null, value); + SetInternalBackgroundImageBorder(value); } NotifyPropertyChanged(); } } + internal void SetInternalBackgroundImageBorder(Selector selector) + { + themeData?.selectorData?.BackgroundImageBorder?.Reset(this); + + if (selector.HasAll()) + { + SetBackgroundImageBorder(selector.All); + } + else + { + EnsureSelectorData().BackgroundImageBorder = new TriggerableSelector(this, selector, SetBackgroundImageBorder, true); + } + } + + private void SetInternalBackgroundImageBorder(Rectangle border) + { + themeData?.selectorData?.BackgroundImageBorder?.Reset(this); + SetBackgroundImageBorder(border); + } + + private Rectangle GetInternalBackgroundImageBorder() + { + return backgroundExtraData?.BackgroundImageBorder; + } + /// /// Gets or sets the background of the view. /// This property value is the PropertyMap representing the background. @@ -1070,7 +1190,7 @@ public Tizen.NUI.PropertyMap Background } else { - return (PropertyMap)GetInternalBackgroundProperty(this); + return GetInternalBackground(); } } set @@ -1081,13 +1201,56 @@ public Tizen.NUI.PropertyMap Background } else { - SetInternalBackgroundProperty(this, null, value); + SetInternalBackground(value); } NotifyPropertyChanged(); NotifyBackgroundChanged(); } } + private void SetInternalBackground(PropertyMap map) + { + if (map == null) + return; + + // Background extra data is not valid anymore. We should ignore lazy UpdateBackgroundExtraData + backgroundExtraData = null; + backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None; + + // Update backgroundImageUrl and backgroundImageSynchronousLoading from Map + foreach (int key in cachedNUIViewBackgroundImagePropertyKeyList) + { + using PropertyValue propertyValue = map.Find(key); + if (propertyValue != null) + { + if (key == ImageVisualProperty.URL) + { + propertyValue.Get(out backgroundImageUrl); + } + else if (key == ImageVisualProperty.SynchronousLoading) + { + propertyValue.Get(out backgroundImageSynchronousLoading); + } + } + } + + using var mapValue = new PropertyValue(map); + Object.SetProperty(SwigCPtr, Property.BACKGROUND, mapValue); + } + + private PropertyMap GetInternalBackground() + { + // Sync as current properties + UpdateBackgroundExtraData(); + + PropertyMap tmp = new PropertyMap(); + var propertyValue = Object.GetProperty(SwigCPtr, Property.BACKGROUND); + propertyValue.Get(tmp); + propertyValue.Dispose(); + propertyValue = null; + return tmp; + } + /// /// Describes a shadow as an image for a View. /// It is null by default. @@ -1119,7 +1282,7 @@ public ImageShadow ImageShadow } else { - return (ImageShadow)GetInternalImageShadowProperty(this); + return GetInternalImageShadow(); } } set @@ -1130,12 +1293,44 @@ public ImageShadow ImageShadow } else { - SetInternalImageShadowProperty(this, null, value); + SetInternalImageShadow(value); } NotifyPropertyChanged(); } } + internal void SetInternalImageShadow(Selector shadow) + { + themeData?.selectorData?.ClearShadow(this); + if (shadow.HasAll()) + { + SetShadow(shadow.All); + } + else + { + EnsureSelectorData().ImageShadow = new TriggerableSelector(this, shadow, SetShadow, true); + } + } + + private void SetInternalImageShadow(ImageShadow shadow) + { + themeData?.selectorData?.ClearShadow(this); + SetShadow(shadow); + } + + private ImageShadow GetInternalImageShadow() + { + // Sync as current properties + UpdateBackgroundExtraData(); + + using PropertyMap map = new PropertyMap(); + using var shadowProperty = Object.GetProperty(SwigCPtr, Property.SHADOW); + shadowProperty.Get(map); + + var shadow = new ImageShadow(map); + return shadow.IsEmpty() ? null : shadow; + } + /// /// Describes a box shaped shadow drawing for a View. /// It is null by default. @@ -1164,7 +1359,7 @@ public Shadow BoxShadow } else { - return (Shadow)GetInternalBoxShadowProperty(this); + return GetInternalBoxShadow(); } } set @@ -1175,12 +1370,43 @@ public Shadow BoxShadow } else { - SetInternalBoxShadowProperty(this, null, value); + SetInternalBoxShadow(value); } NotifyPropertyChanged(); } } + internal void SetInternalBoxShadow(Selector shadow) + { + themeData?.selectorData?.ClearShadow(this); + if (shadow.HasAll()) + { + SetShadow(shadow.All); + } + else + { + EnsureSelectorData().BoxShadow = new TriggerableSelector(this, shadow, SetShadow, true); + } + } + + private void SetInternalBoxShadow(Shadow shadow) + { + themeData?.selectorData?.ClearShadow(this); + SetShadow(shadow); + } + + private Shadow GetInternalBoxShadow() + { + // Sync as current properties + UpdateBackgroundExtraData(); + + using PropertyMap map = new PropertyMap(); + using var shadowProperty = Object.GetProperty(SwigCPtr, Property.SHADOW); + shadowProperty.Get(map); + var shadow = new Shadow(map); + return shadow.IsEmpty() ? null : shadow; + } + /// /// The radius for the rounded corners of the View. /// This will rounds background and shadow edges. @@ -1207,7 +1433,7 @@ public Vector4 CornerRadius } else { - return (Vector4)GetInternalCornerRadiusProperty(this); + return GetInternalCornerRadius(); } } set @@ -1218,12 +1444,23 @@ public Vector4 CornerRadius } else { - SetInternalCornerRadiusProperty(this, null, value); + SetInternalCornerRadius(value); } NotifyPropertyChanged(); } } + private void SetInternalCornerRadius(Vector4 newValue) + { + (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerRadius = newValue; + UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius); + } + + private Vector4 GetInternalCornerRadius() + { + return backgroundExtraData == null ? Vector4.Zero : backgroundExtraData.CornerRadius; + } + /// /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units). /// It is absolute by default. @@ -1234,7 +1471,6 @@ public VisualTransformPolicyType CornerRadiusPolicy { get { - if (NUIApplication.IsUsingXaml) { return (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty); @@ -1256,7 +1492,8 @@ public VisualTransformPolicyType CornerRadiusPolicy } } } - internal void SetInternalCornerRadiusPolicy(VisualTransformPolicyType value) + + private void SetInternalCornerRadiusPolicy(VisualTransformPolicyType value) { (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerRadiusPolicy = value; @@ -1265,7 +1502,8 @@ internal void SetInternalCornerRadiusPolicy(VisualTransformPolicyType value) UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius); } } - internal VisualTransformPolicyType GetInternalCornerRadiusPolicy() + + private VisualTransformPolicyType GetInternalCornerRadiusPolicy() { return backgroundExtraData == null ? VisualTransformPolicyType.Absolute : backgroundExtraData.CornerRadiusPolicy; } @@ -1352,12 +1590,14 @@ public float BorderlineWidth NotifyPropertyChanged(); } } - internal void SetInternalBorderlineWidth(float borderlineWidth) + + private void SetInternalBorderlineWidth(float borderlineWidth) { (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BorderlineWidth = borderlineWidth; UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline); } - internal float GetInternalBorderlineWidth() + + private float GetInternalBorderlineWidth() { return backgroundExtraData == null ? 0.0f : backgroundExtraData.BorderlineWidth; } @@ -1385,7 +1625,7 @@ public Color BorderlineColor } else { - return (Color)GetInternalBorderlineColorProperty(this); + return GetInternalBorderlineColor(); } } set @@ -1396,12 +1636,36 @@ public Color BorderlineColor } else { - SetInternalBorderlineColorProperty(this, null, value); + SetInternalBorderlineColor(value); } NotifyPropertyChanged(); } } + internal void SetInternalBorderlineColor(Selector selector) + { + themeData?.selectorData?.BorderlineColor?.Reset(this); + if (selector.HasAll()) + { + SetBorderlineColor(selector.All); + } + else + { + EnsureSelectorData().BorderlineColor = new TriggerableSelector(this, selector, SetBorderlineColor, true); + } + } + + private void SetInternalBorderlineColor(Color color) + { + themeData?.selectorData?.BorderlineColor?.Reset(this); + SetBorderlineColor(color); + } + + private Color GetInternalBorderlineColor() + { + return backgroundExtraData == null ? Color.Black : backgroundExtraData.BorderlineColor; + } + /// /// The color selector for the borderline of the View. /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only. @@ -1417,7 +1681,7 @@ internal Selector BorderlineColorSelector } else { - return (Selector)GetInternalBorderlineColorSelectorProperty(this); + return GetInternalBorderlineColorSelector(); } } set @@ -1428,12 +1692,18 @@ internal Selector BorderlineColorSelector } else { - SetInternalBorderlineColorSelectorProperty(this, null, value); + SetInternalBorderlineColor(value); } NotifyPropertyChanged(); } } + private Selector GetInternalBorderlineColorSelector() + { + var selector = themeData?.selectorData?.BorderlineColor?.Get(); + return (null != selector) ? selector : new Selector(); + } + /// /// The Relative offset for the borderline of the View. /// Recommended range : [-1.0f to 1.0f]. @@ -1478,12 +1748,13 @@ public float BorderlineOffset } } - internal void SetInternalBorderlineOffset(float borderlineOffset) + private void SetInternalBorderlineOffset(float borderlineOffset) { (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BorderlineOffset = borderlineOffset; UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline); } - internal float GetInternalBorderlineOffset() + + private float GetInternalBorderlineOffset() { return backgroundExtraData == null ? 0.0f : backgroundExtraData.BorderlineOffset; } @@ -1519,11 +1790,12 @@ public States State } } - internal void SetInternalState(States value) + private void SetInternalState(States value) { Object.InternalSetPropertyInt(SwigCPtr, Property.STATE, (int)value); } - internal States GetInternalState() + + private States GetInternalState() { int temp = Object.InternalGetPropertyInt(SwigCPtr, Property.STATE); switch (temp) @@ -1566,12 +1838,13 @@ public States SubState } } - internal void SetInternalSubState(States value) + private void SetInternalSubState(States value) { string valueToString = value.GetDescription(); Object.InternalSetPropertyString(SwigCPtr, Property.SubState, valueToString); } - internal States GetInternalSubState() + + private States GetInternalSubState() { string temp = Object.InternalGetPropertyString(SwigCPtr, Property.SubState); return temp.GetValueByDescription(); @@ -1592,7 +1865,7 @@ public Tizen.NUI.PropertyMap Tooltip } else { - return (PropertyMap)GetInternalTooltipProperty(this); + return GetInternalTooltip(); } } set @@ -1603,12 +1876,29 @@ public Tizen.NUI.PropertyMap Tooltip } else { - SetInternalTooltipProperty(this, null, value); + SetInternalTooltip(value); } NotifyPropertyChanged(); } } + private void SetInternalTooltip(PropertyMap map) + { + if (map != null) + { + using var pv = new PropertyValue(map); + Object.SetProperty(SwigCPtr, Property.TOOLTIP, pv); + } + } + + private PropertyMap GetInternalTooltip() + { + using PropertyMap temp = new PropertyMap(); + using var pv = Object.GetProperty(SwigCPtr, Property.TOOLTIP); + pv.Get(temp); + return temp; + } + /// /// Displays a tooltip as a text. /// @@ -1623,7 +1913,7 @@ public string TooltipText } else { - return GetInternalTooltipTextProperty(this) as string; + return GetInternalTooltipText(); } } set @@ -1634,11 +1924,24 @@ public string TooltipText } else { - SetInternalTooltipTextProperty(this, null, value); + SetInternalTooltipText(value); } } } + private void SetInternalTooltipText(string text) + { + if (text != null) + { + InternalTooltipText = text; + } + } + + private string GetInternalTooltipText() + { + return InternalTooltipText; + } + private string InternalTooltipText { get @@ -1709,11 +2012,12 @@ public float Flex } } - internal void SetInternalFlex(float flex) + private void SetInternalFlex(float flex) { Object.InternalSetPropertyFloat(SwigCPtr, FlexContainer.ChildProperty.FLEX, flex); } - internal float GetInternalFlex() + + private float GetInternalFlex() { return Object.InternalGetPropertyFloat(SwigCPtr, FlexContainer.ChildProperty.FLEX); } @@ -1751,11 +2055,12 @@ public int AlignSelf } } - internal void SetInternalAlignSelf(int alignSelf) + private void SetInternalAlignSelf(int alignSelf) { Object.InternalSetPropertyInt(SwigCPtr, FlexContainer.ChildProperty.AlignSelf, alignSelf); } - internal int GetInternalAlignSelf() + + private int GetInternalAlignSelf() { return Object.InternalGetPropertyInt(SwigCPtr, FlexContainer.ChildProperty.AlignSelf); } @@ -1780,7 +2085,7 @@ public Vector4 FlexMargin } else { - Vector4 temp = (Vector4)GetInternalFlexMarginProperty(this); + using Vector4 temp = GetInternalFlexMargin(); return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W); } } @@ -1792,12 +2097,27 @@ public Vector4 FlexMargin } else { - SetInternalFlexMarginProperty(this, null, value); + SetInternalFlexMargin(value); } NotifyPropertyChanged(); } } + private void SetInternalFlexMargin(Vector4 margin) + { + if (margin != null) + { + Object.InternalSetPropertyVector4(SwigCPtr, FlexContainer.ChildProperty.FlexMargin, margin.SwigCPtr); + } + } + + private Vector4 GetInternalFlexMargin() + { + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Object.InternalRetrievingPropertyVector4(SwigCPtr, FlexContainer.ChildProperty.FlexMargin, temp.SwigCPtr); + return temp; + } + /// /// The top-left cell this child occupies, if not set, the first available cell is used. /// @@ -1827,7 +2147,7 @@ public Vector2 CellIndex } else { - return (Vector2)GetInternalCellIndexProperty(this); + return GetInternalCellIndex(); } } set @@ -1838,12 +2158,30 @@ public Vector2 CellIndex } else { - SetInternalCellIndexProperty(this, null, value); + SetInternalCellIndex(value); } NotifyPropertyChanged(); } } + private void SetInternalCellIndex(Vector2 newValue) + { + if (newValue != null) + { + Object.InternalSetPropertyVector2(SwigCPtr, TableView.ChildProperty.CellIndex, newValue.SwigCPtr); + } + } + + private Vector2 GetInternalCellIndex() + { + if (internalCellIndex == null) + { + internalCellIndex = new Vector2(OnCellIndexChanged, 0, 0); + } + Object.InternalRetrievingPropertyVector2(SwigCPtr, TableView.ChildProperty.CellIndex, internalCellIndex.SwigCPtr); + return internalCellIndex; + } + /// /// The number of rows this child occupies, if not set, the default value is 1. /// @@ -1878,11 +2216,12 @@ public float RowSpan } } - internal void SetInternalRowSpan(float rowSpan) + private void SetInternalRowSpan(float rowSpan) { Object.InternalSetPropertyFloat(SwigCPtr, TableView.ChildProperty.RowSpan, rowSpan); } - internal float GetInternalRowSpan() + + private float GetInternalRowSpan() { return Object.InternalGetPropertyFloat(SwigCPtr, TableView.ChildProperty.RowSpan); } @@ -1921,11 +2260,12 @@ public float ColumnSpan } } - internal void SetInternalColumnSpan(float columnSpan) + private void SetInternalColumnSpan(float columnSpan) { Object.InternalSetPropertyFloat(SwigCPtr, TableView.ChildProperty.ColumnSpan, columnSpan); } - internal float GetInternalColumnSpan() + + private float GetInternalColumnSpan() { return Object.InternalGetPropertyFloat(SwigCPtr, TableView.ChildProperty.ColumnSpan); } @@ -1964,12 +2304,13 @@ public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment } } - internal void SetInternalCellHorizontalAlignment(HorizontalAlignmentType value) + private void SetInternalCellHorizontalAlignment(HorizontalAlignmentType value) { string valueToString = value.GetDescription(); Object.InternalSetPropertyString(SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment, valueToString); } - internal HorizontalAlignmentType GetInternalCellHorizontalAlignment() + + private HorizontalAlignmentType GetInternalCellHorizontalAlignment() { string temp = Object.InternalGetPropertyString(SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment); return temp.GetValueByDescription(); @@ -2009,12 +2350,13 @@ public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment } } - internal void SetInternalCellVerticalAlignment(VerticalAlignmentType value) + private void SetInternalCellVerticalAlignment(VerticalAlignmentType value) { string valueToString = value.GetDescription(); Object.InternalSetPropertyString(SwigCPtr, TableView.ChildProperty.CellVerticalAlignment, valueToString); } - internal VerticalAlignmentType GetInternalCellVerticalAlignment() + + private VerticalAlignmentType GetInternalCellVerticalAlignment() { string temp = Object.InternalGetPropertyString(SwigCPtr, TableView.ChildProperty.CellVerticalAlignment); return temp.GetValueByDescription(); @@ -2037,7 +2379,7 @@ public View LeftFocusableView } else { - return (View)GetInternalLeftFocusableViewProperty(this); + return GetInternalLeftFocusableView(); } } set @@ -2048,12 +2390,33 @@ public View LeftFocusableView } else { - SetInternalLeftFocusableViewProperty(this, null, value); + SetInternalLeftFocusableView(value); } NotifyPropertyChanged(); } } + private void SetInternalLeftFocusableView(View view) + { + if (view != null) + { + LeftFocusableViewId = (int)view?.GetId(); + } + else + { + LeftFocusableViewId = -1; + } + } + + private View GetInternalLeftFocusableView() + { + if (LeftFocusableViewId >= 0) + { + return ConvertIdToView((uint)LeftFocusableViewId); + } + return null; + } + /// /// The right focusable view.
/// This will return null if not set.
@@ -2071,7 +2434,7 @@ public View RightFocusableView } else { - return (View)GetInternalRightFocusableViewProperty(this); + return GetInternalRightFocusableView(); } } set @@ -2082,12 +2445,33 @@ public View RightFocusableView } else { - SetInternalRightFocusableViewProperty(this, null, value); + SetInternalRightFocusableView(value); } NotifyPropertyChanged(); } } + private void SetInternalRightFocusableView(View view) + { + if (view != null) + { + RightFocusableViewId = (int)view.GetId(); + } + else + { + RightFocusableViewId = -1; + } + } + + private View GetInternalRightFocusableView() + { + if (RightFocusableViewId >= 0) + { + return ConvertIdToView((uint)RightFocusableViewId); + } + return null; + } + /// /// The up focusable view.
/// This will return null if not set.
@@ -2105,7 +2489,7 @@ public View UpFocusableView } else { - return (View)GetInternalUpFocusableViewProperty(this); + return GetInternalUpFocusableView(); } } set @@ -2116,12 +2500,33 @@ public View UpFocusableView } else { - SetInternalUpFocusableViewProperty(this, null, value); + SetInternalUpFocusableView(value); } NotifyPropertyChanged(); } } + private void SetInternalUpFocusableView(View view) + { + if (view != null) + { + UpFocusableViewId = (int)view?.GetId(); + } + else + { + UpFocusableViewId = -1; + } + } + + private View GetInternalUpFocusableView() + { + if (UpFocusableViewId >= 0) + { + return ConvertIdToView((uint)UpFocusableViewId); + } + return null; + } + /// /// The down focusable view.
/// This will return null if not set.
@@ -2139,7 +2544,7 @@ public View DownFocusableView } else { - return (View)GetInternalDownFocusableViewProperty(this); + return GetInternalDownFocusableView(); } } set @@ -2150,12 +2555,33 @@ public View DownFocusableView } else { - SetInternalDownFocusableViewProperty(this, null, value); + SetInternalDownFocusableView(value); } NotifyPropertyChanged(); } } + private void SetInternalDownFocusableView(View view) + { + if (view != null) + { + DownFocusableViewId = (int)view?.GetId(); + } + else + { + DownFocusableViewId = -1; + } + } + + private View GetInternalDownFocusableView() + { + if (DownFocusableViewId >= 0) + { + return ConvertIdToView((uint)DownFocusableViewId); + } + return null; + } + /// /// The clockwise focusable view by rotary wheel.
/// This will return null if not set.
@@ -2173,7 +2599,7 @@ public View ClockwiseFocusableView } else { - return (View)GetInternalClockwiseFocusableViewProperty(this); + return GetInternalClockwiseFocusableView(); } } set @@ -2184,12 +2610,33 @@ public View ClockwiseFocusableView } else { - SetInternalClockwiseFocusableViewProperty(this, null, value); + SetInternalClockwiseFocusableView(value); } NotifyPropertyChanged(); } } + private void SetInternalClockwiseFocusableView(View view) + { + if (view != null) + { + ClockwiseFocusableViewId = (int)view?.GetId(); + } + else + { + ClockwiseFocusableViewId = -1; + } + } + + private View GetInternalClockwiseFocusableView() + { + if (ClockwiseFocusableViewId >= 0) + { + return ConvertIdToView((uint)ClockwiseFocusableViewId); + } + return null; + } + /// /// The counter clockwise focusable view by rotary wheel.
/// This will return null if not set.
@@ -2207,7 +2654,7 @@ public View CounterClockwiseFocusableView } else { - return (View)GetInternalCounterClockwiseFocusableViewProperty(this); + return GetInternalCounterClockwiseFocusableView(); } } set @@ -2218,12 +2665,33 @@ public View CounterClockwiseFocusableView } else { - SetInternalCounterClockwiseFocusableViewProperty(this, null, value); + SetInternalCounterClockwiseFocusableView(value); } NotifyPropertyChanged(); } } + private void SetInternalCounterClockwiseFocusableView(View view) + { + if (view != null) + { + CounterClockwiseFocusableViewId = (int)view?.GetId(); + } + else + { + CounterClockwiseFocusableViewId = -1; + } + } + + private View GetInternalCounterClockwiseFocusableView() + { + if (CounterClockwiseFocusableViewId >= 0) + { + return ConvertIdToView((uint)CounterClockwiseFocusableViewId); + } + return null; + } + /// /// Whether the view should be focusable by keyboard navigation. /// @@ -2255,11 +2723,12 @@ public bool Focusable } } - internal void SetInternalFocusable(bool focusable) + private void SetInternalFocusable(bool focusable) { SetKeyboardFocusable(focusable); } - internal bool GetInternalFocusable() + + private bool GetInternalFocusable() { return IsKeyboardFocusable(); } @@ -2296,11 +2765,12 @@ public bool FocusableChildren } } - internal void SetInternalFocusableChildren(bool focusableChildren) + private void SetInternalFocusableChildren(bool focusableChildren) { SetKeyboardFocusableChildren(focusableChildren); } - internal bool GetInternalFocusableChildren() + + private bool GetInternalFocusableChildren() { return AreChildrenKeyBoardFocusable(); } @@ -2339,11 +2809,12 @@ public bool FocusableInTouch } } - internal void SetInternalFocusableInTouch(bool focusableInTouch) + private void SetInternalFocusableInTouch(bool focusableInTouch) { SetFocusableInTouch(focusableInTouch); } - internal bool GetInternalFocusableInTouch() + + private bool GetInternalFocusableInTouch() { return IsFocusableInTouch(); } @@ -2392,26 +2863,21 @@ public Size2D Size2D { get { + Size2D temp = null; if (NUIApplication.IsUsingXaml) { - var temp = (Size2D)GetValue(Size2DProperty); - if (this.Layout == null) - { - if (temp.Width < 0) { temp.Width = 0; } - if (temp.Height < 0) { temp.Height = 0; } - } - return temp; + temp = (Size2D)GetValue(Size2DProperty); } else { - var temp = (Size2D)GetInternalSize2DProperty(this); - if (this.Layout == null) - { - if (temp.Width < 0) { temp.Width = 0; } - if (temp.Height < 0) { temp.Height = 0; } - } - return temp; + temp = GetInternalSize2D(); + } + if (this.Layout == null) + { + if (temp.Width < 0) { temp.Width = 0; } + if (temp.Height < 0) { temp.Height = 0; } } + return temp; } set { @@ -2421,12 +2887,59 @@ public Size2D Size2D } else { - SetInternalSize2DProperty(this, null, value); + SetInternalSize2D(value); } NotifyPropertyChanged(); } } + private void SetInternalSize2D(Size2D size) + { + // 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. + int width = size.Width; + int height = size.Height; + userSizeWidth = (float)width; + userSizeHeight = (float)height; + + if (HasLayoutWidth()) + SetLayoutWidth(width); + if (HasLayoutHeight()) + SetLayoutHeight(height); + + bool relayoutRequired = false; + // To avoid duplicated size setup, change internal policy directly. + if (widthPolicy != width) + { + widthPolicy = width; + relayoutRequired = true; + } + if (heightPolicy != height) + { + heightPolicy = height; + relayoutRequired = true; + } + if (relayoutRequired) + { + RequestLayout(); + } + + Object.InternalSetPropertyVector2ActualVector3(SwigCPtr, Property.SIZE, size.SwigCPtr); + } + + private Size2D GetInternalSize2D() + { + if (internalSize2D == null) + { + internalSize2D = new Size2D(OnSize2DChanged, 0, 0); + } + Object.InternalRetrievingPropertyVector2ActualVector3(SwigCPtr, Property.SIZE, internalSize2D.SwigCPtr); + + return internalSize2D; + } + /// /// Retrieves the size of the view. /// The coordinates are relative to the view's parent. @@ -2485,12 +2998,28 @@ public float Opacity } } - internal void SetInternalOpacity(float opacity) + internal void SetInternalOpacity(Selector selector) { + themeData?.selectorData?.Opacity?.Reset(this); + if (selector.HasAll()) + { + SetOpacity(selector.All); + } + else + { + EnsureSelectorData().Opacity = new TriggerableSelector(this, selector, SetOpacity, true); + } + } + + private void SetInternalOpacity(float opacity) + { + themeData?.selectorData?.Opacity?.Reset(this); + //Selector using code has been removed because the Selector is not used when IsUsingXaml is false SetOpacity(opacity); } - internal float GetInternalOpacity() + + private float GetInternalOpacity() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.OPACITY); } @@ -2525,8 +3054,7 @@ public Position2D Position2D } else { - return (Position2D)GetInternalPosition2DProperty(this); - + return GetInternalPosition2D(); } } set @@ -2537,12 +3065,30 @@ public Position2D Position2D } else { - SetInternalPosition2DProperty(this, null, value); + SetInternalPosition2D(value); } NotifyPropertyChanged(); } } + private void SetInternalPosition2D(Position2D newValue) + { + if (newValue != null) + { + Object.InternalSetPropertyVector2ActualVector3(SwigCPtr, Property.POSITION, newValue.SwigCPtr); + } + } + + private Position2D GetInternalPosition2D() + { + if (internalPosition2D == null) + { + internalPosition2D = new Position2D(OnPosition2DChanged, 0, 0); + } + Object.InternalRetrievingPropertyVector2ActualVector3(SwigCPtr, Property.POSITION, internalPosition2D.SwigCPtr); + return internalPosition2D; + } + /// /// Retrieves the screen position of the view.
///
@@ -2607,11 +3153,12 @@ public bool PositionUsesPivotPoint } } - internal void SetInternalPositionUsesPivotPoint(bool positionUsesPivotPoint) + private void SetInternalPositionUsesPivotPoint(bool positionUsesPivotPoint) { Object.InternalSetPropertyBool(SwigCPtr, Property.PositionUsesAnchorPoint, positionUsesPivotPoint); } - internal bool GetInternalPositionUsesPivotPoint() + + private bool GetInternalPositionUsesPivotPoint() { return Object.InternalGetPropertyBool(SwigCPtr, Property.PositionUsesAnchorPoint); } @@ -2653,11 +3200,12 @@ public bool PositionUsesAnchorPoint } } - internal void SetInternalPositionUsesAnchorPoint(bool positionUsesAnchorPoint) + private void SetInternalPositionUsesAnchorPoint(bool positionUsesAnchorPoint) { InternalPositionUsesAnchorPoint = positionUsesAnchorPoint; } - internal bool GetInternalPositionUsesAnchorPoint() + + private bool GetInternalPositionUsesAnchorPoint() { return InternalPositionUsesAnchorPoint; } @@ -2737,7 +3285,7 @@ public int SiblingOrder } } - internal void SetInternalSiblingOrder(int siblingOrder) + private void SetInternalSiblingOrder(int siblingOrder) { if (siblingOrder < 0) { @@ -2760,7 +3308,8 @@ internal void SetInternalSiblingOrder(int siblingOrder) } } } - internal int GetInternalSiblingOrder() + + private int GetInternalSiblingOrder() { var parentChildren = GetParent()?.Children; if (parentChildren != null) @@ -2832,7 +3381,7 @@ public Position ParentOrigin } else { - var tmp = (Position)GetInternalParentOriginProperty(this); + using var tmp = GetInternalParentOrigin(); return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z); } } @@ -2844,12 +3393,27 @@ public Position ParentOrigin } else { - SetInternalParentOriginProperty(this, null, value); + SetInternalParentOrigin(value); } NotifyPropertyChanged(); } } + private void SetInternalParentOrigin(Position origin) + { + if (origin != null) + { + Object.InternalSetPropertyVector3(SwigCPtr, Property.ParentOrigin, origin.SwigCPtr); + } + } + + private Position GetInternalParentOrigin() + { + Position temp = new Position(0.0f, 0.0f, 0.0f); + Object.InternalRetrievingPropertyVector3(SwigCPtr, Property.ParentOrigin, temp.SwigCPtr); + return temp; + } + /// /// Gets or sets the anchor-point of a view.
/// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.
@@ -2883,7 +3447,7 @@ public Position PivotPoint } else { - return (Position)GetInternalPivotPointProperty(this); + return GetInternalPivotPoint(); } } set @@ -2894,12 +3458,30 @@ public Position PivotPoint } else { - SetInternalPivotPointProperty(this, null, value); + SetInternalPivotPoint(value); } NotifyPropertyChanged(); } } + private void SetInternalPivotPoint(Position position) + { + if (position != null) + { + SetAnchorPoint(position); + } + } + + private Position GetInternalPivotPoint() + { + if (internalPivotPoint == null) + { + internalPivotPoint = new Position(OnPivotPointChanged, 0, 0, 0); + } + Object.InternalRetrievingPropertyVector3(SwigCPtr, Property.AnchorPoint, internalPivotPoint.SwigCPtr); + return internalPivotPoint; + } + /// /// Gets or sets the size width of the view. /// @@ -2939,7 +3521,7 @@ public float SizeWidth } } - internal void SetInternalSizeWidth(float sizeWidth) + private void SetInternalSizeWidth(float sizeWidth) { // Size property setter is only used by user. // Framework code uses SetSize() instead of Size property setter. @@ -2962,7 +3544,8 @@ internal void SetInternalSizeWidth(float sizeWidth) Object.InternalSetPropertyFloat(SwigCPtr, Property.SizeWidth, width); } - internal float GetInternalSizeWidth() + + private float GetInternalSizeWidth() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.SizeWidth); } @@ -3006,7 +3589,7 @@ public float SizeHeight } } - internal void SetInternalSizeHeight(float sizeHeight) + private void SetInternalSizeHeight(float sizeHeight) { // Size property setter is only used by user. // Framework code uses SetSize() instead of Size property setter. @@ -3029,7 +3612,8 @@ internal void SetInternalSizeHeight(float sizeHeight) Object.InternalSetPropertyFloat(SwigCPtr, Property.SizeHeight, height); } - internal float GetInternalSizeHeight() + + private float GetInternalSizeHeight() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.SizeHeight); } @@ -3071,7 +3655,7 @@ public Position Position } else { - return (Position)GetInternalPositionProperty(this); + return GetInternalPosition(); } } set @@ -3082,12 +3666,30 @@ public Position Position } else { - SetInternalPositionProperty(this, null, value); + SetInternalPosition(value); } NotifyPropertyChanged(); } } + private void SetInternalPosition(Position position) + { + if (position != null) + { + Object.InternalSetPropertyVector3(SwigCPtr, Property.POSITION, position.SwigCPtr); + } + } + + private Position GetInternalPosition() + { + if (internalPosition == null) + { + internalPosition = new Position(OnPositionChanged, 0, 0, 0); + } + Object.InternalRetrievingPropertyVector3(SwigCPtr, Property.POSITION, internalPosition.SwigCPtr); + return internalPosition; + } + /// /// Gets or sets the position X of the view. /// @@ -3127,11 +3729,12 @@ public float PositionX } } - internal void SetInternalPositionX(float positionX) + private void SetInternalPositionX(float positionX) { Object.InternalSetPropertyFloat(SwigCPtr, Property.PositionX, positionX); } - internal float GetInternalPositionX() + + private float GetInternalPositionX() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.PositionX); } @@ -3175,11 +3778,12 @@ public float PositionY } } - internal void SetInternalPositionY(float positionY) + private void SetInternalPositionY(float positionY) { Object.InternalSetPropertyFloat(SwigCPtr, Property.PositionY, positionY); } - internal float GetInternalPositionY() + + private float GetInternalPositionY() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.PositionY); } @@ -3223,11 +3827,12 @@ public float PositionZ } } - internal void SetInternalPositionZ(float positionZ) + private void SetInternalPositionZ(float positionZ) { Object.InternalSetPropertyFloat(SwigCPtr, Property.PositionZ, positionZ); } - internal float GetInternalPositionZ() + + private float GetInternalPositionZ() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.PositionZ); } @@ -3270,7 +3875,7 @@ public Rotation Orientation } else { - return (Rotation)GetInternalOrientationProperty(this); + return GetInternalOrientation(); } } set @@ -3281,12 +3886,26 @@ public Rotation Orientation } else { - SetInternalOrientationProperty(this, null, value); + SetInternalOrientation(value); } NotifyPropertyChanged(); } } + private void SetInternalOrientation(Rotation rotation) + { + using var tmp = new PropertyValue(rotation); + Object.SetProperty(SwigCPtr, Property.ORIENTATION, tmp); + } + + private Rotation GetInternalOrientation() + { + using Rotation temp = new Rotation(); + using var pv = Object.GetProperty(SwigCPtr, Property.ORIENTATION); + pv.Get(temp); + return temp; + } + /// /// Gets or sets the world orientation of the view.
///
@@ -3337,7 +3956,7 @@ public Vector3 Scale } else { - return (Vector3)GetInternalScaleProperty(this); + return GetInternalScale(); } } set @@ -3348,12 +3967,30 @@ public Vector3 Scale } else { - SetInternalScaleProperty(this, null, value); + SetInternalScale(value); } NotifyPropertyChanged(); } } + private void SetInternalScale(Vector3 scale) + { + if (scale != null) + { + SetScale(scale); + } + } + + private Vector3 GetInternalScale() + { + if (internalScale == null) + { + internalScale = new Vector3(OnScaleChanged, 0, 0, 0); + } + Object.InternalRetrievingPropertyVector3(SwigCPtr, Property.SCALE, internalScale.SwigCPtr); + return internalScale; + } + /// /// Gets or sets the scale X factor applied to the view. /// @@ -3393,11 +4030,12 @@ public float ScaleX } } - internal void SetInternalScaleX(float scaleX) + private void SetInternalScaleX(float scaleX) { Object.InternalSetPropertyFloat(SwigCPtr, Property.ScaleX, scaleX); } - internal float GetInternalScaleX() + + private float GetInternalScaleX() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.ScaleX); } @@ -3441,11 +4079,12 @@ public float ScaleY } } - internal void SetInternalScaleY(float scaleY) + private void SetInternalScaleY(float scaleY) { Object.InternalSetPropertyFloat(SwigCPtr, Property.ScaleY, scaleY); } - internal float GetInternalScaleY() + + private float GetInternalScaleY() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.ScaleY); } @@ -3489,11 +4128,12 @@ public float ScaleZ } } - internal void SetInternalScaleZ(float scaleZ) + private void SetInternalScaleZ(float scaleZ) { Object.InternalSetPropertyFloat(SwigCPtr, Property.ScaleZ, scaleZ); } - internal float GetInternalScaleZ() + + private float GetInternalScaleZ() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.ScaleZ); } @@ -3560,7 +4200,7 @@ public string Name } else { - return (string)GetInternalNameProperty(this); + return GetInternalName(); } } set @@ -3571,12 +4211,26 @@ public string Name } else { - SetInternalNameProperty(this, null, value); + SetInternalName(value); } NotifyPropertyChanged(); } } + private void SetInternalName(string name) + { + if (name != null) + { + internalName = name; + Object.InternalSetPropertyString(SwigCPtr, Property.NAME, name); + } + } + + private string GetInternalName() + { + return internalName; + } + /// /// Get the number of children held by the view. /// @@ -3633,11 +4287,12 @@ public bool Sensitive } } - internal void SetInternalSensitive(bool sensitive) + private void SetInternalSensitive(bool sensitive) { Object.InternalSetPropertyBool(SwigCPtr, Property.SENSITIVE, sensitive); } - internal bool GetInternalSensitive() + + private bool GetInternalSensitive() { return Object.InternalGetPropertyBool(SwigCPtr, Property.SENSITIVE); } @@ -3675,12 +4330,13 @@ public bool IsEnabled } } - internal void SetInternalIsEnabled(bool isEnabled) + private void SetInternalIsEnabled(bool isEnabled) { Object.InternalSetPropertyBool(SwigCPtr, Property.UserInteractionEnabled, isEnabled); OnEnabled(isEnabled); } - internal bool GetInternalIsEnabled() + + private bool GetInternalIsEnabled() { return Object.InternalGetPropertyBool(SwigCPtr, Property.UserInteractionEnabled); } @@ -3716,11 +4372,12 @@ public bool LeaveRequired } } - internal void SetInternalLeaveRequired(bool leaveRequired) + private void SetInternalLeaveRequired(bool leaveRequired) { Object.InternalSetPropertyBool(SwigCPtr, Property.LeaveRequired, leaveRequired); } - internal bool GetInternalLeaveRequired() + + private bool GetInternalLeaveRequired() { return Object.InternalGetPropertyBool(SwigCPtr, Property.LeaveRequired); } @@ -3756,11 +4413,12 @@ public bool InheritOrientation } } - internal void SetInternalInheritOrientation(bool inheritOrientation) + private void SetInternalInheritOrientation(bool inheritOrientation) { Object.InternalSetPropertyBool(SwigCPtr, Property.InheritOrientation, inheritOrientation); } - internal bool GetInternalInheritOrientation() + + private bool GetInternalInheritOrientation() { return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritOrientation); } @@ -3796,11 +4454,12 @@ public bool InheritScale } } - internal void SetInternalInheritScale(bool inheritScale) + private void SetInternalInheritScale(bool inheritScale) { Object.InternalSetPropertyBool(SwigCPtr, Property.InheritScale, inheritScale); } - internal bool GetInternalInheritScale() + + private bool GetInternalInheritScale() { return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritScale); } @@ -3841,11 +4500,12 @@ public DrawModeType DrawMode } } - internal void SetInternalDrawMode(DrawModeType value) + private void SetInternalDrawMode(DrawModeType value) { Object.InternalSetPropertyInt(SwigCPtr, Property.DrawMode, (int)value); } - internal DrawModeType GetInternalDrawMode() + + private DrawModeType GetInternalDrawMode() { return (DrawModeType)Object.InternalGetPropertyInt(SwigCPtr, Property.DrawMode); } @@ -3880,7 +4540,7 @@ public Vector3 SizeModeFactor } else { - return (Vector3)GetInternalSizeModeFactorProperty(this); + return GetInternalSizeModeFactor(); } } set @@ -3891,12 +4551,30 @@ public Vector3 SizeModeFactor } else { - SetInternalSizeModeFactorProperty(this, null, value); + SetInternalSizeModeFactor(value); } NotifyPropertyChanged(); } } + private void SetInternalSizeModeFactor(Vector3 factor) + { + if (factor != null) + { + Object.InternalSetPropertyVector3(SwigCPtr, Property.SizeModeFactor, factor.SwigCPtr); + } + } + + private Vector3 GetInternalSizeModeFactor() + { + if (internalSizeModeFactor == null) + { + internalSizeModeFactor = new Vector3(OnSizeModeFactorChanged, 0, 0, 0); + } + Object.InternalRetrievingPropertyVector3(SwigCPtr, Property.SizeModeFactor, internalSizeModeFactor.SwigCPtr); + return internalSizeModeFactor; + } + /// /// Gets or sets the width resize policy to be used. /// @@ -3927,7 +4605,8 @@ public ResizePolicyType WidthResizePolicy NotifyPropertyChanged(); } } - internal void SetInternalWidthResizePolicy(ResizePolicyType value) + + private void SetInternalWidthResizePolicy(ResizePolicyType value) { if (value == ResizePolicyType.KeepSizeFollowingParent) { @@ -3969,7 +4648,8 @@ internal void SetInternalWidthResizePolicy(ResizePolicyType value) break; } } - internal ResizePolicyType GetInternalWidthResizePolicy() + + private ResizePolicyType GetInternalWidthResizePolicy() { string temp = Object.InternalGetPropertyString(SwigCPtr, Property.WidthResizePolicy); return temp.GetValueByDescription(); @@ -4005,7 +4685,8 @@ public ResizePolicyType HeightResizePolicy NotifyPropertyChanged(); } } - internal void SetInternalHeightResizePolicy(ResizePolicyType value) + + private void SetInternalHeightResizePolicy(ResizePolicyType value) { if (value == ResizePolicyType.KeepSizeFollowingParent) { @@ -4048,7 +4729,8 @@ internal void SetInternalHeightResizePolicy(ResizePolicyType value) break; } } - internal ResizePolicyType GetInternalHeightResizePolicy() + + private ResizePolicyType GetInternalHeightResizePolicy() { string temp = Object.InternalGetPropertyString(SwigCPtr, Property.HeightResizePolicy); return temp.GetValueByDescription(); @@ -4085,12 +4767,14 @@ public SizeScalePolicyType SizeScalePolicy NotifyPropertyChanged(); } } - internal void SetInternalSizeScalePolicy(SizeScalePolicyType value) + + private void SetInternalSizeScalePolicy(SizeScalePolicyType value) { string valueToString = value.GetDescription(); Object.InternalSetPropertyString(SwigCPtr, Property.SizeScalePolicy, valueToString); } - internal SizeScalePolicyType GetInternalSizeScalePolicy() + + private SizeScalePolicyType GetInternalSizeScalePolicy() { return (SizeScalePolicyType)Object.InternalGetPropertyInt(SwigCPtr, Property.SizeScalePolicy); } @@ -4126,11 +4810,12 @@ public bool WidthForHeight } } - internal void SetInternalWidthForHeight(bool widthForHeight) + private void SetInternalWidthForHeight(bool widthForHeight) { Object.InternalSetPropertyBool(SwigCPtr, Property.WidthForHeight, widthForHeight); } - internal bool GetInternalWidthForHeight() + + private bool GetInternalWidthForHeight() { return Object.InternalGetPropertyBool(SwigCPtr, Property.WidthForHeight); } @@ -4165,11 +4850,13 @@ public bool HeightForWidth NotifyPropertyChanged(); } } - internal void SetInternalHeightForWidth(bool heightForWidth) + + private void SetInternalHeightForWidth(bool heightForWidth) { Object.InternalSetPropertyBool(SwigCPtr, Property.HeightForWidth, heightForWidth); } - internal bool GetInternalHeightForWidth() + + private bool GetInternalHeightForWidth() { return Object.InternalGetPropertyBool(SwigCPtr, Property.HeightForWidth); } @@ -4202,7 +4889,7 @@ public Extents Padding } else { - return (Extents)GetInternalPaddingProperty(this); + return GetInternalPadding(); } } set @@ -4213,12 +4900,66 @@ public Extents Padding } else { - SetInternalPaddingProperty(this, null, value); + SetInternalPadding(value); } NotifyPropertyChanged(); } } + private void SetInternalPadding(Extents extents) + { + if (extents != null) + { + if (HasPadding() && extents is Extents newPadding) + SetPadding(new UIExtents(newPadding.Start, newPadding.End, newPadding.Top, newPadding.Bottom), false); + + if (Layout != null) + { + Layout.Padding = new Extents((Extents)extents); + if ((Padding.Start != 0) || (Padding.End != 0) || (Padding.Top != 0) || (Padding.Bottom != 0)) + { + using var ex = new Extents(0, 0, 0, 0); + using var tmp = new PropertyValue(ex); + Object.SetProperty(SwigCPtr, Property.PADDING, tmp); + } + Layout.RequestLayout(); + } + else + { + using var tmp = new PropertyValue(extents); + Object.SetProperty(SwigCPtr, Property.PADDING, tmp); + } + } + } + + private Extents GetInternalPadding() + { + if ((internalPadding == null) || (Layout != null)) + { + ushort start = 0, end = 0, top = 0, bottom = 0; + if (Layout != null) + { + if (Layout.Padding != null) + { + start = Layout.Padding.Start; + end = Layout.Padding.End; + top = Layout.Padding.Top; + bottom = Layout.Padding.Bottom; + } + } + internalPadding = new Extents(OnPaddingChanged, start, end, top, bottom); + } + + if (Layout == null) + { + var tmp = Object.GetProperty(SwigCPtr, Property.PADDING); + tmp?.Get(internalPadding); + tmp?.Dispose(); + } + + return internalPadding; + } + /// /// Gets or sets the minimum size the view can be assigned in size negotiation. /// @@ -4248,7 +4989,7 @@ public Size2D MinimumSize } else { - return (Size2D)GetInternalMinimumSizeProperty(this); + return GetInternalMinimumSize(); } } set @@ -4277,12 +5018,30 @@ public Size2D MinimumSize } else { - SetInternalMinimumSizeProperty(this, null, value); + SetInternalMinimumSize(value); } NotifyPropertyChanged(); } } + private void SetInternalMinimumSize(Size2D size) + { + if (size != null) + { + Object.InternalSetPropertyVector2(SwigCPtr, Property.MinimumSize, size.SwigCPtr); + } + } + + private Size2D GetInternalMinimumSize() + { + if (internalMinimumSize == null) + { + internalMinimumSize = new Size2D(OnMinimumSizeChanged, 0, 0); + } + Object.InternalRetrievingPropertyVector2(SwigCPtr, Property.MinimumSize, internalMinimumSize.SwigCPtr); + return internalMinimumSize; + } + /// /// Gets or sets the maximum size the view can be assigned in size negotiation. /// @@ -4308,7 +5067,7 @@ public Size2D MaximumSize } else { - return (Size2D)GetInternalMaximumSizeProperty(this); + return GetInternalMaximumSize(); } } set @@ -4328,12 +5087,30 @@ public Size2D MaximumSize } else { - SetInternalMaximumSizeProperty(this, null, value); + SetInternalMaximumSize(value); } NotifyPropertyChanged(); } } + private void SetInternalMaximumSize(Size2D size) + { + if (size != null) + { + Object.InternalSetPropertyVector2(SwigCPtr, Property.MaximumSize, size.SwigCPtr); + } + } + + private Size2D GetInternalMaximumSize() + { + if (internalMaximumSize == null) + { + internalMaximumSize = new Size2D(OnMaximumSizeChanged, 0, 0); + } + Object.InternalRetrievingPropertyVector2(SwigCPtr, Property.MaximumSize, internalMaximumSize.SwigCPtr); + return internalMaximumSize; + } + /// /// Gets or sets whether a child view inherits it's parent's position.
/// Default is to inherit.
@@ -4366,11 +5143,13 @@ public bool InheritPosition NotifyPropertyChanged(); } } - internal void SetInternalInheritPosition(bool inheritPosition) + + private void SetInternalInheritPosition(bool inheritPosition) { Object.InternalSetPropertyBool(SwigCPtr, Property.InheritPosition, inheritPosition); } - internal bool GetInternalInheritPosition() + + private bool GetInternalInheritPosition() { return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritPosition); } @@ -4405,11 +5184,13 @@ public ClippingModeType ClippingMode NotifyPropertyChanged(); } } - internal void SetInternalClippingMode(ClippingModeType value) + + private void SetInternalClippingMode(ClippingModeType value) { Object.InternalSetPropertyInt(SwigCPtr, Property.ClippingMode, (int)value); } - internal ClippingModeType GetInternalClippingMode() + + private ClippingModeType GetInternalClippingMode() { return (ClippingModeType)Object.InternalGetPropertyInt(SwigCPtr, Property.ClippingMode); } @@ -4449,7 +5230,7 @@ public Position AnchorPoint } else { - return (Position)GetInternalAnchorPointProperty(this); + return GetInternalAnchorPoint(); } } set @@ -4460,11 +5241,24 @@ public Position AnchorPoint } else { - SetInternalAnchorPointProperty(this, null, value); + SetInternalAnchorPoint(value); } } } + private void SetInternalAnchorPoint(Position position) + { + if (position != null) + { + InternalAnchorPoint = position; + } + } + + private Position GetInternalAnchorPoint() + { + return InternalAnchorPoint; + } + private Position InternalAnchorPoint { get @@ -4515,7 +5309,7 @@ public Size Size } else { - return (Size)GetInternalSizeProperty(this); + return GetInternalSize(); } } set @@ -4526,12 +5320,68 @@ public Size Size } else { - SetInternalSizeProperty(this, null, value); + SetInternalSize(value); } NotifyPropertyChanged(); } } + private void SetInternalSize(Size size) + { + if (size != 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 = size.Width; + float height = size.Height; + float depth = size.Depth; + + userSizeWidth = width; + userSizeHeight = height; + + if (HasLayoutWidth()) + SetLayoutWidth(width); + if (HasLayoutHeight()) + SetLayoutHeight(height); + + // Set Specification so when layouts measure this View it matches the value set here. + // All Views are currently Layouts. + int widthPolicy = (int)Math.Ceiling(width); + int heightPolicy = (int)Math.Ceiling(height); + + bool relayoutRequired = false; + // To avoid duplicated size setup, change internal policy directly. + if (this.widthPolicy != widthPolicy) + { + this.widthPolicy = widthPolicy; + relayoutRequired = true; + } + if (this.heightPolicy != heightPolicy) + { + this.heightPolicy = heightPolicy; + relayoutRequired = true; + } + if (relayoutRequired) + { + RequestLayout(); + } + + SetSize(width, height, depth); + } + } + + private Size GetInternalSize() + { + if (internalSize == null) + { + internalSize = new Size(OnSizeChanged, 0, 0, 0); + } + Object.InternalRetrievingPropertyVector3(SwigCPtr, Property.SIZE, internalSize.SwigCPtr); + return internalSize; + } + /// /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. /// @@ -4598,11 +5448,13 @@ public bool InheritLayoutDirection NotifyPropertyChanged(); } } - internal void SetInternalInheritLayoutDirection(bool inheritLayoutDirection) + + private void SetInternalInheritLayoutDirection(bool inheritLayoutDirection) { Object.InternalSetPropertyBool(SwigCPtr, Property.InheritLayoutDirection, inheritLayoutDirection); } - internal bool GetInternalInheritLayoutDirection() + + private bool GetInternalInheritLayoutDirection() { return Object.InternalGetPropertyBool(SwigCPtr, Property.InheritLayoutDirection); } @@ -4639,11 +5491,12 @@ public ViewLayoutDirectionType LayoutDirection } } - internal void SetInternalLayoutDirection(ViewLayoutDirectionType value) + private void SetInternalLayoutDirection(ViewLayoutDirectionType value) { Object.InternalSetPropertyInt(SwigCPtr, Property.LayoutDirection, (int)value); } - internal ViewLayoutDirectionType GetInternalLayoutDirection() + + private ViewLayoutDirectionType GetInternalLayoutDirection() { return (ViewLayoutDirectionType)Object.InternalGetPropertyInt(SwigCPtr, Property.LayoutDirection); } @@ -4678,7 +5531,7 @@ public Extents Margin } else { - return (Extents)GetInternalMarginProperty(this); + return GetInternalMargin(); } } @@ -4690,13 +5543,66 @@ public Extents Margin } else { - SetInternalMarginProperty(this, null, value); + SetInternalMargin(value); } NotifyPropertyChanged(); } } + private void SetInternalMargin(Extents extents) + { + if (extents != null) + { + if (HasMargin() && extents is Extents newMargin) + SetMargin(new UIExtents(newMargin.Start, newMargin.End, newMargin.Top, newMargin.Bottom), false); + + if (Layout != null) + { + Layout.Margin = new Extents((Extents)extents); + if ((Margin.Start != 0) || (Margin.End != 0) || (Margin.Top != 0) || (Margin.Bottom != 0)) + { + using var ex = new Extents(0, 0, 0, 0); + using var tmp = new PropertyValue(ex); + Object.SetProperty(SwigCPtr, Property.MARGIN, tmp); + } + Layout.RequestLayout(); + } + else + { + using var tmp = new PropertyValue(extents); + Object.SetProperty(SwigCPtr, Property.MARGIN, tmp); + } + } + } + + private Extents GetInternalMargin() + { + if ((internalMargin == null) || (Layout != null)) + { + ushort start = 0, end = 0, top = 0, bottom = 0; + if (Layout != null) + { + if (Layout.Margin != null) + { + start = Layout.Margin.Start; + end = Layout.Margin.End; + top = Layout.Margin.Top; + bottom = Layout.Margin.Bottom; + } + } + internalMargin = new Extents(OnMarginChanged, start, end, top, bottom); + } + + if (Layout == null) + { + using var tmp = Object.GetProperty(SwigCPtr, Property.MARGIN); + tmp?.Get(internalMargin); + } + + return internalMargin; + } + /// /// The required policy for this dimension, values or exact value. /// @@ -4743,11 +5649,13 @@ public int WidthSpecification NotifyPropertyChanged(); } } - internal void SetInternalWidthSpecification(int widthSpecification) + + private void SetInternalWidthSpecification(int widthSpecification) { InternalWidthSpecification = widthSpecification; } - internal int GetInternalWidthSpecification() + + private int GetInternalWidthSpecification() { return InternalWidthSpecification; } @@ -4822,11 +5730,13 @@ public int HeightSpecification NotifyPropertyChanged(); } } - internal void SetInternalHeightSpecification(int heightSpecification) + + private void SetInternalHeightSpecification(int heightSpecification) { InternalHeightSpecification = heightSpecification; } - internal int GetInternalHeightSpecification() + + private int GetInternalHeightSpecification() { return InternalHeightSpecification; } @@ -4891,7 +5801,7 @@ public LayoutTransition LayoutTransition } else { - return GetInternalLayoutTransitionProperty(this) as LayoutTransition; + return GetInternalLayoutTransition(); } } set @@ -4902,12 +5812,25 @@ public LayoutTransition LayoutTransition } else { - SetInternalLayoutTransitionProperty(this, null, value); + SetInternalLayoutTransition(value); } NotifyPropertyChanged(); } } + private void SetInternalLayoutTransition(LayoutTransition transition) + { + if (transition != null) + { + InternalLayoutTransition = transition; + } + } + + private LayoutTransition GetInternalLayoutTransition() + { + return InternalLayoutTransition; + } + private LayoutTransition InternalLayoutTransition { get => EnsureLayoutExtraData().LayoutTransition; @@ -4952,7 +5875,7 @@ public Extents PaddingEX } else { - return GetInternalPaddingEXProperty(this) as Extents; + return GetInternalPaddingEX(); } } set @@ -4963,11 +5886,24 @@ public Extents PaddingEX } else { - SetInternalPaddingEXProperty(this, null, value); + SetInternalPaddingEX(value); } } } + private void SetInternalPaddingEX(Extents padding) + { + if (padding != null) + { + InternalPaddingEX = padding; + } + } + + private Extents GetInternalPaddingEX() + { + return InternalPaddingEX; + } + private Extents InternalPaddingEX { get @@ -5025,10 +5961,8 @@ public Color Color } else { - return (Color)GetInternalColorProperty(this); + return GetInternalColor(); } - - } set { @@ -5038,12 +5972,39 @@ public Color Color } else { - SetInternalColorProperty(this, null, value); + SetInternalColor(value); } + NotifyPropertyChanged(); + } + } + + internal void SetInternalColor(Selector selector) + { + themeData?.selectorData?.Color?.Reset(this); + if (selector.HasAll()) + { + SetColor(selector.All); + } + else + { + EnsureSelectorData().Color = new TriggerableSelector(this, selector, SetColor, true); + } + } + private void SetInternalColor(Color color) + { + themeData?.selectorData?.Color?.Reset(this); + SetColor(color); + } - NotifyPropertyChanged(); + private Color GetInternalColor() + { + if (internalColor == null) + { + internalColor = new Color(OnColorChanged, 0, 0, 0, 0); } + Object.InternalRetrievingPropertyVector4(SwigCPtr, View.Property.COLOR, internalColor.SwigCPtr); + return internalColor; } /// @@ -5081,11 +6042,12 @@ public float ColorRed NotifyPropertyChanged(); } } - internal void SetInternalColorRed(float colorRed) + + private void SetInternalColorRed(float colorRed) { SetColorRed(colorRed); } - internal float GetInternalColorRed() + private float GetInternalColorRed() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.ColorRed); } @@ -5125,11 +6087,13 @@ public float ColorGreen NotifyPropertyChanged(); } } - internal void SetInternalColorGreen(float colorGreen) + + private void SetInternalColorGreen(float colorGreen) { SetColorGreen(colorGreen); } - internal float GetInternalColorGreen() + + private float GetInternalColorGreen() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.ColorGreen); } @@ -5169,11 +6133,12 @@ public float ColorBlue NotifyPropertyChanged(); } } - internal void SetInternalColorBlue(float colorBlue) + private void SetInternalColorBlue(float colorBlue) { SetColorBlue(colorBlue); } - internal float GetInternalColorBlue() + + private float GetInternalColorBlue() { return Object.InternalGetPropertyFloat(SwigCPtr, Property.ColorBlue); } @@ -5195,7 +6160,7 @@ public LayoutItem Layout } else { - return GetInternalLayoutProperty(this) as LayoutItem; + return GetInternalLayout(); } } set @@ -5206,11 +6171,24 @@ public LayoutItem Layout } else { - SetInternalLayoutProperty(this, null, value); + SetInternalLayout(value); } } } + private void SetInternalLayout(LayoutItem item) + { + if (item != null) + { + InternalLayout = item; + } + } + + private LayoutItem GetInternalLayout() + { + return InternalLayout; + } + private LayoutItem InternalLayout { get => layoutExtraData?.Layout; @@ -5384,11 +6362,12 @@ public bool BackgroundImageSynchronosLoading } } - internal void SetInternalBackgroundImageSynchronosLoading(bool backgroundImageSynchronousLoading) + private void SetInternalBackgroundImageSynchronosLoading(bool backgroundImageSynchronousLoading) { InternalBackgroundImageSynchronosLoading = backgroundImageSynchronousLoading; } - internal bool GetInternalBackgroundImageSynchronosLoading() + + private bool GetInternalBackgroundImageSynchronosLoading() { return InternalBackgroundImageSynchronosLoading; } @@ -5439,11 +6418,12 @@ public bool BackgroundImageSynchronousLoading } } - internal void SetInternalBackgroundImageSynchronousLoading(bool backgroundImageSynchronousLoading) + private void SetInternalBackgroundImageSynchronousLoading(bool backgroundImageSynchronousLoading) { InternalBackgroundImageSynchronousLoading = backgroundImageSynchronousLoading; } - internal bool GetInternalBackgroundImageSynchronousLoading() + + private bool GetInternalBackgroundImageSynchronousLoading() { return InternalBackgroundImageSynchronousLoading; } @@ -5482,7 +6462,7 @@ public Vector4 UpdateAreaHint } else { - return (Vector4)GetInternalUpdateAreaHintProperty(this); + return GetInternalUpdateAreaHint(); } } set @@ -5493,12 +6473,27 @@ public Vector4 UpdateAreaHint } else { - SetInternalUpdateAreaHintProperty(this, null, value); + SetInternalUpdateAreaHint(value); } NotifyPropertyChanged(); } } + private void SetInternalUpdateAreaHint(Vector4 area) + { + if (area != null) + { + Object.InternalSetPropertyVector4(SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), area.SwigCPtr); + } + } + + private Vector4 GetInternalUpdateAreaHint() + { + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Object.InternalRetrievingPropertyVector4(SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), temp.SwigCPtr); + return temp; + } + /// /// Enable/Disable ControlState propagation for children. /// It is false by default. @@ -5533,11 +6528,12 @@ public bool EnableControlStatePropagation } } - internal void SetInternalEnableControlStatePropagation(bool enableControlStatePropagation) + private void SetInternalEnableControlStatePropagation(bool enableControlStatePropagation) { InternalEnableControlStatePropagation = enableControlStatePropagation; } - internal bool GetInternalEnableControlStatePropagation() + + private bool GetInternalEnableControlStatePropagation() { return InternalEnableControlStatePropagation; } @@ -5578,7 +6574,7 @@ public ControlState PropagatableControlStates } else { - return (ControlState)GetInternalPropagatableControlStatesProperty(this); + return GetInternalPropagatableControlStates(); } } set @@ -5589,12 +6585,25 @@ public ControlState PropagatableControlStates } else { - SetInternalPropagatableControlStatesProperty(this, null, value); + SetInternalPropagatableControlStates(value); } NotifyPropertyChanged(); } } + private void SetInternalPropagatableControlStates(ControlState state) + { + if (state != null) + { + InternalPropagatableControlStates = state; + } + } + + private ControlState GetInternalPropagatableControlStates() + { + return InternalPropagatableControlStates; + } + private ControlState InternalPropagatableControlStates { get => propagatableControlStates; @@ -5631,7 +6640,8 @@ public bool EnableControlState } } } - internal void SetInternalEnableControlState(bool enableControlStateArg) + + private void SetInternalEnableControlState(bool enableControlStateArg) { bool prev = enableControlState; enableControlState = enableControlStateArg; @@ -5648,7 +6658,8 @@ internal void SetInternalEnableControlState(bool enableControlStateArg) } } } - internal bool GetInternalEnableControlState() + + private bool GetInternalEnableControlState() { return enableControlState; } @@ -5683,11 +6694,13 @@ public bool GrabTouchAfterLeave } } } - internal void SetInternalGrabTouchAfterLeave(bool grabTouchAfterLeave) + + private void SetInternalGrabTouchAfterLeave(bool grabTouchAfterLeave) { InternalGrabTouchAfterLeave = grabTouchAfterLeave; } - internal bool GetInternalGrabTouchAfterLeave() + + private bool GetInternalGrabTouchAfterLeave() { return InternalGrabTouchAfterLeave; } @@ -5746,11 +6759,13 @@ public bool AllowOnlyOwnTouch } } } - internal void SetInternalAllowOnlyOwnTouch(bool allowOnlyOwnTouch) + + private void SetInternalAllowOnlyOwnTouch(bool allowOnlyOwnTouch) { InternalAllowOnlyOwnTouch = allowOnlyOwnTouch; } - internal bool GetInternalAllowOnlyOwnTouch() + + private bool GetInternalAllowOnlyOwnTouch() { return InternalAllowOnlyOwnTouch; } @@ -5799,11 +6814,13 @@ public BlendEquationType BlendEquation } } } - internal void SetInternalBlendEquation(BlendEquationType value) + + private void SetInternalBlendEquation(BlendEquationType value) { InternalBlendEquation = value; } - internal BlendEquationType GetInternalBlendEquation() + + private BlendEquationType GetInternalBlendEquation() { return InternalBlendEquation; } @@ -5852,7 +6869,7 @@ public bool ThemeChangeSensitive } } - internal void SetInternalThemeChangeSensitive(bool themeChangeSensitive) + private void SetInternalThemeChangeSensitive(bool themeChangeSensitive) { if (ThemeChangeSensitive == themeChangeSensitive) return; @@ -5871,7 +6888,8 @@ internal void SetInternalThemeChangeSensitive(bool themeChangeSensitive) ThemeManager.ThemeChangedInternal.Remove(OnThemeChanged); } } - internal bool GetInternalThemeChangeSensitive() + + private bool GetInternalThemeChangeSensitive() { return themeData?.ThemeChangeSensitive ?? ThemeManager.ApplicationThemeChangeSensitive; } @@ -5961,7 +6979,7 @@ public TransitionOptions TransitionOptions } else { - return GetInternalTransitionOptionsProperty(this) as TransitionOptions; + return GetInternalTransitionOptions(); } } set @@ -5972,12 +6990,25 @@ public TransitionOptions TransitionOptions } else { - SetInternalTransitionOptionsProperty(this, null, value); + SetInternalTransitionOptions(value); } NotifyPropertyChanged(); } } + private void SetInternalTransitionOptions(TransitionOptions options) + { + if (options != null) + { + InternalTransitionOptions = options; + } + } + + private TransitionOptions GetInternalTransitionOptions() + { + return InternalTransitionOptions; + } + private TransitionOptions InternalTransitionOptions { get => layoutExtraData?.TransitionOptions; diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityProperties.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityProperties.cs index 76d4caf71da..617be961e75 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityProperties.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityProperties.cs @@ -19,6 +19,7 @@ using System.ComponentModel; using System.Runtime.InteropServices; using Tizen.NUI; +using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { @@ -42,7 +43,7 @@ public string AccessibilityName } else { - return (string)GetInternalAccessibilityNameProperty(this); + return GetInternalAccessibilityName(); } } set @@ -53,12 +54,25 @@ public string AccessibilityName } else { - SetInternalAccessibilityNameProperty(this, null, value); + SetInternalAccessibilityName(value); } NotifyPropertyChanged(); } } + private void SetInternalAccessibilityName(string name) + { + if (name != null) + { + Object.InternalSetPropertyString(SwigCPtr, Property.AccessibilityName, name); + } + } + + private string GetInternalAccessibilityName() + { + return Object.InternalGetPropertyString(SwigCPtr, Property.AccessibilityName); + } + /// /// Gets or sets accessibility description. /// @@ -73,7 +87,7 @@ public string AccessibilityDescription } else { - return (string)GetInternalAccessibilityDescriptionProperty(this); + return GetInternalAccessibilityDescription(); } } set @@ -84,12 +98,25 @@ public string AccessibilityDescription } else { - SetInternalAccessibilityDescriptionProperty(this, null, value); + SetInternalAccessibilityDescription(value); } NotifyPropertyChanged(); } } + private void SetInternalAccessibilityDescription(string description) + { + if (description != null) + { + Object.InternalSetPropertyString(SwigCPtr, Property.AccessibilityDescription, description); + } + } + + private string GetInternalAccessibilityDescription() + { + return Object.InternalGetPropertyString(SwigCPtr, Property.AccessibilityDescription); + } + /// /// Gets or sets accessibility translation domain. /// @@ -104,7 +131,7 @@ public string AccessibilityTranslationDomain } else { - return (string)GetInternalAccessibilityTranslationDomainProperty(this); + return GetInternalAccessibilityTranslationDomain(); } } set @@ -115,12 +142,25 @@ public string AccessibilityTranslationDomain } else { - SetInternalAccessibilityTranslationDomainProperty(this, null, value); + SetInternalAccessibilityTranslationDomain(value); } NotifyPropertyChanged(); } } + private void SetInternalAccessibilityTranslationDomain(string domain) + { + if (domain != null) + { + Object.InternalSetPropertyString(SwigCPtr, Property.AccessibilityTranslationDomain, domain); + } + } + + private string GetInternalAccessibilityTranslationDomain() + { + return Object.InternalGetPropertyString(SwigCPtr, Property.AccessibilityTranslationDomain); + } + /// /// Gets or sets accessibility role. /// @@ -135,7 +175,7 @@ public Role AccessibilityRole } else { - return (Role)GetInternalAccessibilityRoleProperty(this); + return GetInternalAccessibilityRole(); } } set @@ -146,12 +186,22 @@ public Role AccessibilityRole } else { - SetInternalAccessibilityRoleProperty(this, null, value); + SetInternalAccessibilityRole(value); } NotifyPropertyChanged(); } } + private void SetInternalAccessibilityRole(Role role) + { + Object.InternalSetPropertyInt(SwigCPtr, Property.AccessibilityRole, (int)role); + } + + private Role GetInternalAccessibilityRole() + { + return (Role)Object.InternalGetPropertyInt(SwigCPtr, Property.AccessibilityRole); + } + /// /// Gets or sets whether the view is highlightable for accessibility or not. /// @@ -170,7 +220,7 @@ public bool AccessibilityHighlightable } else { - return (bool)GetInternalAccessibilityHighlightableProperty(this); + return GetInternalAccessibilityHighlightable(); } } set @@ -181,12 +231,22 @@ public bool AccessibilityHighlightable } else { - SetInternalAccessibilityHighlightableProperty(this, null, value); + SetInternalAccessibilityHighlightable(value); } NotifyPropertyChanged(); } } + private void SetInternalAccessibilityHighlightable(bool highlightable) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.AccessibilityHighlightable, highlightable); + } + + private bool GetInternalAccessibilityHighlightable() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.AccessibilityHighlightable); + } + /// /// Controls whether the view is hidden from the AT-SPI tree. /// @@ -204,7 +264,7 @@ public bool AccessibilityHidden } else { - return (bool)GetInternalAccessibilityHiddenProperty(this); + return GetInternalAccessibilityHidden(); } } set @@ -215,12 +275,22 @@ public bool AccessibilityHidden } else { - SetInternalAccessibilityHiddenProperty(this, null, value); + SetInternalAccessibilityHidden(value); } NotifyPropertyChanged(); } } + private void SetInternalAccessibilityHidden(bool hidden) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.AccessibilityHidden, hidden); + } + + private bool GetInternalAccessibilityHidden() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.AccessibilityHidden); + } + /// /// Gets or sets a value that allows the automation framework to find and interact with this element. /// @@ -235,7 +305,7 @@ public bool AccessibilityHidden } else { - return GetInternalAutomationIdProperty(this) as string; + return GetInternalAutomationId(); } } set @@ -246,10 +316,23 @@ public bool AccessibilityHidden } else { - SetInternalAutomationIdProperty(this, null, value); + SetInternalAutomationId(value); } NotifyPropertyChanged(); } } + + private void SetInternalAutomationId(string newValue) + { + if (newValue != null) + { + Object.InternalSetPropertyString(SwigCPtr, Property.AutomationId, newValue); + } + } + + private string GetInternalAutomationId() + { + return Object.InternalGetPropertyString(SwigCPtr, Property.AutomationId); + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index da0cd4b3d26..b6f287b6cc1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -35,35 +35,18 @@ public partial class View /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty StyleNameProperty = null; - internal static void SetInternalStyleNameProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - string styleName = (string)newValue; - - Object.InternalSetPropertyString(view.SwigCPtr, View.Property.StyleName, styleName); - - view.styleName = styleName; - - if (string.IsNullOrEmpty(styleName)) return; - - var style = ThemeManager.GetUpdateStyleWithoutClone(styleName); - - if (style == null) return; - - view.ApplyStyle(style); - view.SetThemeApplied(); + var view = (View)bindable; + view.SetInternalStyleName((string)newValue); } } internal static object GetInternalStyleNameProperty(BindableObject bindable) { var view = (View)bindable; - - if (!string.IsNullOrEmpty(view.styleName)) return view.styleName; - - return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.StyleName); + return view.GetInternalStyleName(); } /// @@ -71,12 +54,11 @@ internal static object GetInternalStyleNameProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty KeyInputFocusProperty = null; - internal static void SetInternalKeyInputFocusProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalKeyInputFocus((bool)newValue); } } @@ -91,38 +73,22 @@ internal static object GetInternalKeyInputFocusProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BackgroundColorProperty = null; - internal static void SetInternalBackgroundColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - view.themeData?.selectorData?.ClearBackground(view); if (newValue is Selector selector) { - if (selector.HasAll()) view.SetBackgroundColor(selector.All); - else view.EnsureSelectorData().BackgroundColor = new TriggerableSelector(view, selector, view.SetBackgroundColor, true); + view.SetInternalBackgroundColor(selector); } else { - view.SetBackgroundColor((Color)newValue); + view.SetInternalBackgroundColor((Color)newValue); } } internal static object GetInternalBackgroundColorProperty(BindableObject bindable) { var view = (View)bindable; - - if (view.internalBackgroundColor == null) - { - view.internalBackgroundColor = new Color(view.OnBackgroundColorChanged, 0, 0, 0, 0); - } - - int visualType = (int)Visual.Type.Invalid; - Object.InternalRetrievingVisualPropertyInt(view.SwigCPtr, Property.BACKGROUND, Visual.Property.Type, out visualType); - - if (visualType == (int)Visual.Type.Color) - { - Object.InternalRetrievingVisualPropertyVector4(view.SwigCPtr, Property.BACKGROUND, ColorVisualProperty.MixColor, Color.getCPtr(view.internalBackgroundColor)); - } - return view.internalBackgroundColor; + return view.GetInternalBackgroundColor(); } /// @@ -130,33 +96,22 @@ internal static object GetInternalBackgroundColorProperty(BindableObject bindabl /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ColorProperty = null; - internal static void SetInternalColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - view.themeData?.selectorData?.Color?.Reset(view); - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetColor(selector.All); - else view.EnsureSelectorData().Color = new TriggerableSelector(view, selector, view.SetColor, true); + view.SetInternalColor(selector); } else { - view.SetColor((Color)newValue); + view.SetInternalColor((Color)newValue); } } internal static object GetInternalColorProperty(BindableObject bindable) { var view = (View)bindable; - - if (view.internalColor == null) - { - view.internalColor = new Color(view.OnColorChanged, 0, 0, 0, 0); - } - Object.InternalRetrievingPropertyVector4(view.SwigCPtr, View.Property.COLOR, view.internalColor.SwigCPtr); - return view.internalColor; + return view.GetInternalColor(); } /// @@ -164,7 +119,6 @@ internal static object GetInternalColorProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ColorRedProperty = null; - internal static void SetInternalColorRedProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -181,12 +135,10 @@ internal static object GetInternalColorRedProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ColorGreenProperty = null; - internal static void SetInternalColorGreenProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; view.SetInternalColorGreen((float)newValue); - } internal static object GetInternalColorGreenProperty(BindableObject bindable) { @@ -199,12 +151,10 @@ internal static object GetInternalColorGreenProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ColorBlueProperty = null; - internal static void SetInternalColorBlueProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; view.SetInternalColorBlue((float)newValue); - } internal static object GetInternalColorBlueProperty(BindableObject bindable) { @@ -217,7 +167,6 @@ internal static object GetInternalColorBlueProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BackgroundImageProperty = null; - internal static void SetInternalBackgroundImageProperty(BindableObject bindable, object oldValue, object newValue) { if (NUIApplication.IsUsingXaml) @@ -228,60 +177,43 @@ internal static void SetInternalBackgroundImageProperty(BindableObject bindable, return; } } - var view = (View)bindable; - - if (view.themeData?.selectorData != null) - { - view.themeData.selectorData.BackgroundColor?.Reset(view); - view.themeData.selectorData.BackgroundImage?.Reset(view); - } - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetBackgroundImage(selector.All); - else view.EnsureSelectorData().BackgroundImage = new TriggerableSelector(view, selector, view.SetBackgroundImage, true); + view.SetInternalBackgroundImage(selector); } else { - view.SetBackgroundImage((string)newValue); + view.SetInternalBackgroundImage((string)newValue); } } internal static object GetInternalBackgroundImageProperty(BindableObject bindable) { var view = (View)bindable; - - return (string)view.backgroundImageUrl; + return view.GetInternalBackgroundImage(); } - /// /// BackgroundImageBorderProperty /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BackgroundImageBorderProperty = null; - internal static void SetInternalBackgroundImageBorderProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - view.themeData?.selectorData?.BackgroundImageBorder?.Reset(view); - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetBackgroundImageBorder(selector.All); - else view.EnsureSelectorData().BackgroundImageBorder = new TriggerableSelector(view, selector, view.SetBackgroundImageBorder, true); + view.SetInternalBackgroundImageBorder(selector); } else { - view.SetBackgroundImageBorder((Rectangle)newValue); + view.SetInternalBackgroundImageBorder((Rectangle)newValue); } } internal static object GetInternalBackgroundImageBorderProperty(BindableObject bindable) { var view = (View)bindable; - - return view.backgroundExtraData?.BackgroundImageBorder; + return view.GetInternalBackgroundImageBorder(); } /// @@ -289,52 +221,18 @@ internal static object GetInternalBackgroundImageBorderProperty(BindableObject b /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BackgroundProperty = null; - internal static void SetInternalBackgroundProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - PropertyMap map = (PropertyMap)newValue; - - // Background extra data is not valid anymore. We should ignore lazy UpdateBackgroundExtraData - view.backgroundExtraData = null; - view.backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None; - - // Update backgroundImageUrl and backgroundImageSynchronousLoading from Map - foreach (int key in cachedNUIViewBackgroundImagePropertyKeyList) - { - using PropertyValue propertyValue = map.Find(key); - if (propertyValue != null) - { - if (key == ImageVisualProperty.URL) - { - propertyValue.Get(out view.backgroundImageUrl); - } - else if (key == ImageVisualProperty.SynchronousLoading) - { - propertyValue.Get(out view.backgroundImageSynchronousLoading); - } - } - } - - using var mapValue = new PropertyValue(map); - Object.SetProperty(view.SwigCPtr, Property.BACKGROUND, mapValue); + var view = (View)bindable; + view.SetInternalBackground((PropertyMap)newValue); } } internal static object GetInternalBackgroundProperty(BindableObject bindable) { var view = (View)bindable; - - // Sync as current properties - view.UpdateBackgroundExtraData(); - - PropertyMap tmp = new PropertyMap(); - var propertyValue = Object.GetProperty(view.SwigCPtr, Property.BACKGROUND); - propertyValue.Get(tmp); - propertyValue.Dispose(); - propertyValue = null; - return tmp; + return view.GetInternalBackground(); } /// @@ -342,12 +240,11 @@ internal static object GetInternalBackgroundProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty StateProperty = null; - internal static void SetInternalStateProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalState((States)newValue); } } @@ -362,12 +259,11 @@ internal static object GetInternalStateProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SubStateProperty = null; - internal static void SetInternalSubStateProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalSubState((States)newValue); } } @@ -382,21 +278,18 @@ internal static object GetInternalSubStateProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TooltipProperty = null; - internal static void SetInternalTooltipProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + var view = (View)bindable; + view.SetInternalTooltip((PropertyMap)newValue); } } internal static object GetInternalTooltipProperty(BindableObject bindable) { var view = (View)bindable; - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.TOOLTIP).Get(temp); - return temp; + return view.GetInternalTooltip(); } /// @@ -404,12 +297,11 @@ internal static object GetInternalTooltipProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FlexProperty = null; - internal static void SetInternalFlexProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalFlex((float)newValue); } } @@ -424,7 +316,6 @@ internal static object GetInternalFlexProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty AlignSelfProperty = null; - internal static void SetInternalAlignSelfProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -444,21 +335,18 @@ internal static object GetInternalAlignSelfProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FlexMarginProperty = null; - internal static void SetInternalFlexMarginProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyVector4(view.SwigCPtr, FlexContainer.ChildProperty.FlexMargin, ((Vector4)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalFlexMargin((Vector4)newValue); } } internal static object GetInternalFlexMarginProperty(BindableObject bindable) { var view = (View)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Object.InternalRetrievingPropertyVector4(view.SwigCPtr, FlexContainer.ChildProperty.FlexMargin, temp.SwigCPtr); - return temp; + return view.GetInternalFlexMargin(); } /// @@ -466,26 +354,18 @@ internal static object GetInternalFlexMarginProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CellIndexProperty = null; - internal static void SetInternalCellIndexProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyVector2(view.SwigCPtr, TableView.ChildProperty.CellIndex, ((Vector2)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalCellIndex((Vector2)newValue); } - } internal static object GetInternalCellIndexProperty(BindableObject bindable) { var view = (View)bindable; - if (view.internalCellIndex == null) - { - view.internalCellIndex = new Vector2(view.OnCellIndexChanged, 0, 0); - } - Object.InternalRetrievingPropertyVector2(view.SwigCPtr, TableView.ChildProperty.CellIndex, view.internalCellIndex.SwigCPtr); - return view.internalCellIndex; - + return view.GetInternalCellIndex(); } /// @@ -493,12 +373,11 @@ internal static object GetInternalCellIndexProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty RowSpanProperty = null; - internal static void SetInternalRowSpanProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalRowSpan((float)newValue); } } @@ -513,7 +392,6 @@ internal static object GetInternalRowSpanProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ColumnSpanProperty = null; - internal static void SetInternalColumnSpanProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -533,7 +411,6 @@ internal static object GetInternalColumnSpanProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CellHorizontalAlignmentProperty = null; - internal static void SetInternalCellHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -553,7 +430,6 @@ internal static object GetInternalCellHorizontalAlignmentProperty(BindableObject ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CellVerticalAlignmentProperty = null; - internal static void SetInternalCellVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -574,12 +450,11 @@ internal static object GetInternalCellVerticalAlignmentProperty(BindableObject b ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty WeightProperty = null; - internal static void SetInternalWeightProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.Weight = (float)newValue; } } @@ -594,18 +469,15 @@ internal static object GetInternalWeightProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty LeftFocusableViewProperty = null; - internal static void SetInternalLeftFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View)?.GetId(); } - else { view.LeftFocusableViewId = -1; } + view.SetInternalLeftFocusableView((View)newValue); } internal static object GetInternalLeftFocusableViewProperty(BindableObject bindable) { var view = (View)bindable; - if (view.LeftFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.LeftFocusableViewId); } - return null; + return view.GetInternalLeftFocusableView(); } /// @@ -613,18 +485,15 @@ internal static object GetInternalLeftFocusableViewProperty(BindableObject binda /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty RightFocusableViewProperty = null; - internal static void SetInternalRightFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View)?.GetId(); } - else { view.RightFocusableViewId = -1; } + view.SetInternalRightFocusableView((View)newValue); } internal static object GetInternalRightFocusableViewProperty(BindableObject bindable) { var view = (View)bindable; - if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); } - return null; + return view.GetInternalRightFocusableView(); } /// @@ -632,18 +501,15 @@ internal static object GetInternalRightFocusableViewProperty(BindableObject bind /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty UpFocusableViewProperty = null; - internal static void SetInternalUpFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null) { view.UpFocusableViewId = (int)(newValue as View)?.GetId(); } - else { view.UpFocusableViewId = -1; } + view.SetInternalUpFocusableView((View)newValue); } internal static object GetInternalUpFocusableViewProperty(BindableObject bindable) { var view = (View)bindable; - if (view.UpFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.UpFocusableViewId); } - return null; + return view.GetInternalUpFocusableView(); } /// @@ -651,18 +517,15 @@ internal static object GetInternalUpFocusableViewProperty(BindableObject bindabl /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty DownFocusableViewProperty = null; - internal static void SetInternalDownFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View)?.GetId(); } - else { view.DownFocusableViewId = -1; } + view.SetInternalDownFocusableView((View)newValue); } internal static object GetInternalDownFocusableViewProperty(BindableObject bindable) { var view = (View)bindable; - if (view.DownFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.DownFocusableViewId); } - return null; + return view.GetInternalDownFocusableView(); } /// @@ -670,18 +533,15 @@ internal static object GetInternalDownFocusableViewProperty(BindableObject binda /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ClockwiseFocusableViewProperty = null; - internal static void SetInternalClockwiseFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null && (newValue is View)) { view.ClockwiseFocusableViewId = (int)(newValue as View)?.GetId(); } - else { view.ClockwiseFocusableViewId = -1; } + view.SetInternalClockwiseFocusableView((View)newValue); } internal static object GetInternalClockwiseFocusableViewProperty(BindableObject bindable) { var view = (View)bindable; - if (view.ClockwiseFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.ClockwiseFocusableViewId); } - return null; + return view.GetInternalClockwiseFocusableView(); } /// @@ -689,18 +549,15 @@ internal static object GetInternalClockwiseFocusableViewProperty(BindableObject /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CounterClockwiseFocusableViewProperty = null; - internal static void SetInternalCounterClockwiseFocusableViewProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (newValue != null && (newValue is View)) { view.CounterClockwiseFocusableViewId = (int)(newValue as View)?.GetId(); } - else { view.CounterClockwiseFocusableViewId = -1; } + view.SetInternalCounterClockwiseFocusableView((View)newValue); } internal static object GetInternalCounterClockwiseFocusableViewProperty(BindableObject bindable) { var view = (View)bindable; - if (view.CounterClockwiseFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.CounterClockwiseFocusableViewId); } - return null; + return view.GetInternalCounterClockwiseFocusableView(); } /// @@ -708,11 +565,13 @@ internal static object GetInternalCounterClockwiseFocusableViewProperty(Bindable /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FocusableProperty = null; - internal static void SetInternalFocusableProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; - if (newValue != null) { view.SetInternalFocusable((bool)newValue); } + if (newValue != null) + { + var view = (View)bindable; + view.SetInternalFocusable((bool)newValue); + } } internal static object GetInternalFocusableProperty(BindableObject bindable) { @@ -725,11 +584,13 @@ internal static object GetInternalFocusableProperty(BindableObject bindable) ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FocusableChildrenProperty = null; - internal static void SetInternalFocusableChildrenProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; - if (newValue != null) { view.SetInternalFocusableChildren((bool)newValue); } + if (newValue != null) + { + var view = (View)bindable; + view.SetInternalFocusableChildren((bool)newValue); + } } internal static object GetInternalFocusableChildrenProperty(BindableObject bindable) { @@ -742,11 +603,13 @@ internal static object GetInternalFocusableChildrenProperty(BindableObject binda ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FocusableInTouchProperty = null; - internal static void SetInternalFocusableInTouchProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; - if (newValue != null) { view.SetInternalFocusableInTouch((bool)newValue); } + if (newValue != null) + { + var view = (View)bindable; + view.SetInternalFocusableInTouch((bool)newValue); + } } internal static object GetInternalFocusableInTouchProperty(BindableObject bindable) { @@ -759,57 +622,18 @@ internal static object GetInternalFocusableInTouchProperty(BindableObject bindab ///
[EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty Size2DProperty = null; - internal static void SetInternalSize2DProperty(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. - int width = ((Size2D)newValue).Width; - int height = ((Size2D)newValue).Height; - view.userSizeWidth = (float)width; - view.userSizeHeight = (float)height; - - if (view.HasLayoutWidth()) - view.SetLayoutWidth(width); - if (view.HasLayoutHeight()) - view.SetLayoutHeight(height); - - bool relayoutRequired = false; - // To avoid duplicated size setup, change internal policy directly. - if (view.widthPolicy != width) - { - view.widthPolicy = width; - relayoutRequired = true; - } - if (view.heightPolicy != height) - { - view.heightPolicy = height; - relayoutRequired = true; - } - if (relayoutRequired) - { - view.RequestLayout(); - } - - Object.InternalSetPropertyVector2ActualVector3(view.SwigCPtr, View.Property.SIZE, ((Size2D)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalSize2D((Size2D)newValue); } } - internal static object GetInternalSize2DProperty(BindableObject bindable) { var view = (View)bindable; - if (view.internalSize2D == null) - { - view.internalSize2D = new Size2D(view.OnSize2DChanged, 0, 0); - } - Object.InternalRetrievingPropertyVector2ActualVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize2D.SwigCPtr); - - return view.internalSize2D; + return view.GetInternalSize2D(); } /// @@ -817,17 +641,12 @@ internal static object GetInternalSize2DProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty OpacityProperty = null; - internal static void SetInternalOpacityProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - view.themeData?.selectorData?.Opacity?.Reset(view); - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetOpacity(selector.All); - else view.EnsureSelectorData().Opacity = new TriggerableSelector(view, selector, view.SetOpacity, true); + view.SetInternalOpacity(selector); } else { @@ -845,24 +664,18 @@ internal static object GetInternalOpacityProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty Position2DProperty = null; - internal static void SetInternalPosition2DProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyVector2ActualVector3(view.SwigCPtr, View.Property.POSITION, ((Position2D)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalPosition2D((Position2D)newValue); } } internal static object GetInternalPosition2DProperty(BindableObject bindable) { var view = (View)bindable; - if (view.internalPosition2D == null) - { - view.internalPosition2D = new Position2D(view.OnPosition2DChanged, 0, 0); - } - Object.InternalRetrievingPropertyVector2ActualVector3(view.SwigCPtr, View.Property.POSITION, view.internalPosition2D.SwigCPtr); - return view.internalPosition2D; + return view.GetInternalPosition2D(); } /// @@ -870,12 +683,11 @@ internal static object GetInternalPosition2DProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionUsesPivotPointProperty = null; - internal static void SetInternalPositionUsesPivotPointProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalPositionUsesPivotPoint((bool)newValue); } } @@ -890,12 +702,11 @@ internal static object GetInternalPositionUsesPivotPointProperty(BindableObject /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SiblingOrderProperty = null; - internal static void SetInternalSiblingOrderProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalSiblingOrder((int)newValue); } } @@ -910,47 +721,37 @@ internal static object GetInternalSiblingOrderProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ParentOriginProperty = null; - internal static void SetInternalParentOriginProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, ((Position)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalParentOrigin((Position)newValue); } } internal static object GetInternalParentOriginProperty(BindableObject bindable) { var view = (View)bindable; - Position temp = new Position(0.0f, 0.0f, 0.0f); - Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, temp.SwigCPtr); - return temp; + return view.GetInternalParentOrigin(); } - /// /// PivotPointProperty /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PivotPointProperty = null; - internal static void SetInternalPivotPointProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - view.SetAnchorPoint((Position)newValue); + var view = (View)bindable; + view.SetInternalPivotPoint((Position)newValue); } } internal static object GetInternalPivotPointProperty(BindableObject bindable) { var view = (View)bindable; - if (view.internalPivotPoint == null) - { - view.internalPivotPoint = new Position(view.OnPivotPointChanged, 0, 0, 0); - } - Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.AnchorPoint, view.internalPivotPoint.SwigCPtr); - return view.internalPivotPoint; + return view.GetInternalPivotPoint(); } /// @@ -958,12 +759,11 @@ internal static object GetInternalPivotPointProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeWidthProperty = null; - internal static void SetInternalSizeWidthProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalSizeWidth((float)newValue); } } @@ -978,12 +778,11 @@ internal static object GetInternalSizeWidthProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeHeightProperty = null; - internal static void SetInternalSizeHeightProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalSizeHeight((float)newValue); } } @@ -998,24 +797,18 @@ internal static object GetInternalSizeHeightProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionProperty = null; - internal static void SetInternalPositionProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.POSITION, ((Position)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalPosition((Position)newValue); } } internal static object GetInternalPositionProperty(BindableObject bindable) { var view = (View)bindable; - if (view.internalPosition == null) - { - view.internalPosition = new Position(view.OnPositionChanged, 0, 0, 0); - } - Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.POSITION, view.internalPosition.SwigCPtr); - return view.internalPosition; + return view.GetInternalPosition(); } /// @@ -1023,7 +816,6 @@ internal static object GetInternalPositionProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionXProperty = null; - internal static void SetInternalPositionXProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1043,7 +835,6 @@ internal static object GetInternalPositionXProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionYProperty = null; - internal static void SetInternalPositionYProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1063,7 +854,6 @@ internal static object GetInternalPositionYProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionZProperty = null; - internal static void SetInternalPositionZProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1083,21 +873,18 @@ internal static object GetInternalPositionZProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty OrientationProperty = null; - internal static void SetInternalOrientationProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue)); + var view = (View)bindable; + view.SetInternalOrientation((Rotation)newValue); } } internal static object GetInternalOrientationProperty(BindableObject bindable) { var view = (View)bindable; - Rotation temp = new Rotation(); - Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.ORIENTATION).Get(temp); - return temp; + return view.GetInternalOrientation(); } /// @@ -1105,25 +892,18 @@ internal static object GetInternalOrientationProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScaleProperty = null; - internal static void SetInternalScaleProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - view.SetScale((Vector3)newValue); + var view = (View)bindable; + view.SetInternalScale((Vector3)newValue); } - } internal static object GetInternalScaleProperty(BindableObject bindable) { var view = (View)bindable; - if (view.internalScale == null) - { - view.internalScale = new Vector3(view.OnScaleChanged, 0, 0, 0); - } - Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SCALE, view.internalScale.SwigCPtr); - return view.internalScale; + return view.GetInternalScale(); } /// @@ -1131,7 +911,6 @@ internal static object GetInternalScaleProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScaleXProperty = null; - internal static void SetInternalScaleXProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1151,7 +930,6 @@ internal static object GetInternalScaleXProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScaleYProperty = null; - internal static void SetInternalScaleYProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1171,7 +949,6 @@ internal static object GetInternalScaleYProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScaleZProperty = null; - internal static void SetInternalScaleZProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1191,20 +968,18 @@ internal static object GetInternalScaleZProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty NameProperty = null; - internal static void SetInternalNameProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - view.internalName = (string)newValue; - Object.InternalSetPropertyString(view.SwigCPtr, View.Property.NAME, (string)newValue); + var view = (View)bindable; + view.SetInternalName((string)newValue); } } internal static object GetInternalNameProperty(BindableObject bindable) { var view = (View)bindable; - return view.internalName; + return view.GetInternalName(); } /// @@ -1212,7 +987,6 @@ internal static object GetInternalNameProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SensitiveProperty = null; - internal static void SetInternalSensitiveProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1232,7 +1006,6 @@ internal static object GetInternalSensitiveProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty IsEnabledProperty = null; - internal static void SetInternalIsEnabledProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1252,19 +1025,18 @@ internal static object GetInternalIsEnabledProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty DispatchKeyEventsProperty = null; - internal static void SetInternalDispatchKeyEventsProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.DispatchKeyEvents, (bool)newValue); + var view = (View)bindable; + view.SetInternalDispatchKeyEvents((bool)newValue); } } internal static object GetInternalDispatchKeyEventsProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.DispatchKeyEvents); + return view.GetInternalDispatchKeyEvents(); } /// @@ -1272,7 +1044,6 @@ internal static object GetInternalDispatchKeyEventsProperty(BindableObject binda /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty LeaveRequiredProperty = null; - internal static void SetInternalLeaveRequiredProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1292,7 +1063,6 @@ internal static object GetInternalLeaveRequiredProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InheritOrientationProperty = null; - internal static void SetInternalInheritOrientationProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1312,7 +1082,6 @@ internal static object GetInternalInheritOrientationProperty(BindableObject bind /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InheritScaleProperty = null; - internal static void SetInternalInheritScaleProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1332,7 +1101,6 @@ internal static object GetInternalInheritScaleProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty DrawModeProperty = null; - internal static void SetInternalDrawModeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1352,25 +1120,18 @@ internal static object GetInternalDrawModeProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeModeFactorProperty = null; - internal static void SetInternalSizeModeFactorProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.SizeModeFactor, ((Vector3)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalSizeModeFactor((Vector3)newValue); } - } internal static object GetInternalSizeModeFactorProperty(BindableObject bindable) { var view = (View)bindable; - if (view.internalSizeModeFactor == null) - { - view.internalSizeModeFactor = new Vector3(view.OnSizeModeFactorChanged, 0, 0, 0); - } - Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SizeModeFactor, view.internalSizeModeFactor.SwigCPtr); - return view.internalSizeModeFactor; + return view.GetInternalSizeModeFactor(); } /// @@ -1378,7 +1139,6 @@ internal static object GetInternalSizeModeFactorProperty(BindableObject bindable /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty WidthResizePolicyProperty = null; - internal static void SetInternalWidthResizePolicyProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1398,7 +1158,6 @@ internal static object GetInternalWidthResizePolicyProperty(BindableObject binda /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty HeightResizePolicyProperty = null; - internal static void SetInternalHeightResizePolicyProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1418,7 +1177,6 @@ internal static object GetInternalHeightResizePolicyProperty(BindableObject bind /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeScalePolicyProperty = null; - internal static void SetInternalSizeScalePolicyProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1438,7 +1196,6 @@ internal static object GetInternalSizeScalePolicyProperty(BindableObject bindabl /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty WidthForHeightProperty = null; - internal static void SetInternalWidthForHeightProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1458,7 +1215,6 @@ internal static object GetInternalWidthForHeightProperty(BindableObject bindable /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty HeightForWidthProperty = null; - internal static void SetInternalHeightForWidthProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1478,61 +1234,18 @@ internal static object GetInternalHeightForWidthProperty(BindableObject bindable /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PaddingProperty = null; - internal static void SetInternalPaddingProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - if (view.HasPadding() && newValue is Extents newPadding) - view.SetPadding(new UIExtents(newPadding.Start, newPadding.End, newPadding.Top, newPadding.Bottom), false); - - if (view.Layout != null) - { - view.Layout.Padding = new Extents((Extents)newValue); - if ((view.Padding.Start != 0) || (view.Padding.End != 0) || (view.Padding.Top != 0) || (view.Padding.Bottom != 0)) - { - var tmp = new PropertyValue(new Extents(0, 0, 0, 0)); - Object.SetProperty(view.SwigCPtr, Property.PADDING, tmp); - tmp?.Dispose(); - } - view.Layout.RequestLayout(); - } - else - { - var tmp = new PropertyValue((Extents)newValue); - Object.SetProperty(view.SwigCPtr, Property.PADDING, tmp); - tmp?.Dispose(); - } + var view = (View)bindable; + view.SetInternalPadding((Extents)newValue); } } internal static object GetInternalPaddingProperty(BindableObject bindable) { var view = (View)bindable; - if ((view.internalPadding == null) || (view.Layout != null)) - { - ushort start = 0, end = 0, top = 0, bottom = 0; - if (view.Layout != null) - { - if (view.Layout.Padding != null) - { - start = view.Layout.Padding.Start; - end = view.Layout.Padding.End; - top = view.Layout.Padding.Top; - bottom = view.Layout.Padding.Bottom; - } - } - view.internalPadding = new Extents(view.OnPaddingChanged, start, end, top, bottom); - } - - if (view.Layout == null) - { - var tmp = Object.GetProperty(view.SwigCPtr, Property.PADDING); - tmp?.Get(view.internalPadding); - tmp?.Dispose(); - } - - return view.internalPadding; + return view.GetInternalPadding(); } /// @@ -1540,64 +1253,18 @@ internal static object GetInternalPaddingProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeProperty = null; - internal static void SetInternalSizeProperty(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 = ((Size)newValue).Width; - float height = ((Size)newValue).Height; - float depth = ((Size)newValue).Depth; - - view.userSizeWidth = width; - view.userSizeHeight = height; - - if (view.HasLayoutWidth()) - view.SetLayoutWidth(width); - if (view.HasLayoutHeight()) - view.SetLayoutHeight(height); - - // Set Specification so when layouts measure this View it matches the value set here. - // All Views are currently Layouts. - int widthPolicy = (int)System.Math.Ceiling(width); - int heightPolicy = (int)System.Math.Ceiling(height); - - bool relayoutRequired = false; - // To avoid duplicated size setup, change internal policy directly. - if (view.widthPolicy != widthPolicy) - { - view.widthPolicy = widthPolicy; - relayoutRequired = true; - } - if (view.heightPolicy != heightPolicy) - { - view.heightPolicy = heightPolicy; - relayoutRequired = true; - } - if (relayoutRequired) - { - view.RequestLayout(); - } - - view.SetSize(width, height, depth); + var view = (View)bindable; + view.SetInternalSize((Size)newValue); } } internal static object GetInternalSizeProperty(BindableObject bindable) { var view = (View)bindable; - - if (view.internalSize == null) - { - view.internalSize = new Size(view.OnSizeChanged, 0, 0, 0); - } - Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize.SwigCPtr); - - return view.internalSize; + return view.GetInternalSize(); } /// @@ -1605,26 +1272,18 @@ internal static object GetInternalSizeProperty(BindableObject bindable) /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty MinimumSizeProperty = null; - internal static void SetInternalMinimumSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, ((Size2D)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalMinimumSize((Size2D)newValue); } } internal static object GetInternalMinimumSizeProperty(BindableObject bindable) { - var view = (View)bindable; - if (view.internalMinimumSize == null) - { - view.internalMinimumSize = new Size2D(view.OnMinimumSizeChanged, 0, 0); - } - Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, view.internalMinimumSize.SwigCPtr); - return view.internalMinimumSize; + return view.GetInternalMinimumSize(); } /// @@ -1635,23 +1294,16 @@ internal static object GetInternalMinimumSizeProperty(BindableObject bindable) internal static void SetInternalMaximumSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, ((Size2D)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalMaximumSize((Size2D)newValue); } } internal static object GetInternalMaximumSizeProperty(BindableObject bindable) { var view = (View)bindable; - - if (view.internalMaximumSize == null) - { - view.internalMaximumSize = new Size2D(view.OnMaximumSizeChanged, 0, 0); - } - Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, view.internalMaximumSize.SwigCPtr); - return view.internalMaximumSize; + return view.GetInternalMaximumSize(); } /// @@ -1662,9 +1314,9 @@ internal static object GetInternalMaximumSizeProperty(BindableObject bindable) internal static void SetInternalInheritPositionProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalInheritPosition((bool)newValue); } } @@ -1682,9 +1334,9 @@ internal static object GetInternalInheritPositionProperty(BindableObject bindabl internal static void SetInternalClippingModeProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalClippingMode((ClippingModeType)newValue); } } @@ -1702,9 +1354,9 @@ internal static object GetInternalClippingModeProperty(BindableObject bindable) internal static void SetInternalInheritLayoutDirectionProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalInheritLayoutDirection((bool)newValue); } } @@ -1722,9 +1374,9 @@ internal static object GetInternalInheritLayoutDirectionProperty(BindableObject internal static void SetInternalLayoutDirectionProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { + var view = (View)bindable; view.SetInternalLayoutDirection((ViewLayoutDirectionType)newValue); } } @@ -1742,59 +1394,16 @@ internal static object GetInternalLayoutDirectionProperty(BindableObject bindabl internal static void SetInternalMarginProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - if (view.HasMargin() && newValue is Extents newMargin) - view.SetMargin(new UIExtents(newMargin.Start, newMargin.End, newMargin.Top, newMargin.Bottom), false); - - if (view.Layout != null) - { - view.Layout.Margin = new Extents((Extents)newValue); - if ((view.Margin.Start != 0) || (view.Margin.End != 0) || (view.Margin.Top != 0) || (view.Margin.Bottom != 0)) - { - var tmp = new PropertyValue(new Extents(0, 0, 0, 0)); - Object.SetProperty(view.SwigCPtr, Property.MARGIN, tmp); - tmp?.Dispose(); - } - view.Layout.RequestLayout(); - } - else - { - var tmp = new PropertyValue((Extents)newValue); - Object.SetProperty(view.SwigCPtr, Property.MARGIN, tmp); - tmp?.Dispose(); - } + var view = (View)bindable; + view.SetInternalMargin((Extents)newValue); } } internal static object GetInternalMarginProperty(BindableObject bindable) { var view = (View)bindable; - if ((view.internalMargin == null) || (view.Layout != null)) - { - ushort start = 0, end = 0, top = 0, bottom = 0; - if (view.Layout != null) - { - if (view.Layout.Margin != null) - { - start = view.Layout.Margin.Start; - end = view.Layout.Margin.End; - top = view.Layout.Margin.Top; - bottom = view.Layout.Margin.Bottom; - } - } - view.internalMargin = new Extents(view.OnMarginChanged, start, end, top, bottom); - } - - if (view.Layout == null) - { - - var tmp = Object.GetProperty(view.SwigCPtr, Property.MARGIN); - tmp?.Get(view.internalMargin); - tmp?.Dispose(); - } - - return view.internalMargin; + return view.GetInternalMargin(); } /// @@ -1805,20 +1414,16 @@ internal static object GetInternalMarginProperty(BindableObject bindable) internal static void SetInternalUpdateAreaHintProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyVector4(view.SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), ((Vector4)newValue).SwigCPtr); + var view = (View)bindable; + view.SetInternalUpdateAreaHint((Vector4)newValue); } } internal static object GetInternalUpdateAreaHintProperty(BindableObject bindable) { var view = (View)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - - Object.InternalRetrievingPropertyVector4(view.SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), temp.SwigCPtr); - return temp; + return view.GetInternalUpdateAreaHint(); } /// @@ -1830,31 +1435,19 @@ internal static object GetInternalUpdateAreaHintProperty(BindableObject bindable internal static void SetInternalImageShadowProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - view.themeData?.selectorData?.ClearShadow(view); - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetShadow(selector.All); - else view.EnsureSelectorData().ImageShadow = new TriggerableSelector(view, selector, view.SetShadow, true); + view.SetInternalImageShadow(selector); } else { - view.SetShadow((ImageShadow)newValue); + view.SetInternalImageShadow((ImageShadow)newValue); } } internal static object GetInternalImageShadowProperty(BindableObject bindable) { var view = (View)bindable; - - // Sync as current properties - view.UpdateBackgroundExtraData(); - - PropertyMap map = new PropertyMap(); - Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SHADOW).Get(map); - - var shadow = new ImageShadow(map); - return shadow.IsEmpty() ? null : shadow; + return view.GetInternalImageShadow(); } /// @@ -1866,31 +1459,19 @@ internal static object GetInternalImageShadowProperty(BindableObject bindable) internal static void SetInternalBoxShadowProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - view.themeData?.selectorData?.ClearShadow(view); - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetShadow(selector.All); - else view.EnsureSelectorData().BoxShadow = new TriggerableSelector(view, selector, view.SetShadow, true); + view.SetInternalBoxShadow(selector); } else { - view.SetShadow((Shadow)newValue); + view.SetInternalBoxShadow((Shadow)newValue); } } internal static object GetInternalBoxShadowProperty(BindableObject bindable) { var view = (View)bindable; - - // Sync as current properties - view.UpdateBackgroundExtraData(); - - PropertyMap map = new PropertyMap(); - Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SHADOW).Get(map); - - var shadow = new Shadow(map); - return shadow.IsEmpty() ? null : shadow; + return view.GetInternalBoxShadow(); } /// @@ -1902,13 +1483,12 @@ internal static object GetInternalBoxShadowProperty(BindableObject bindable) internal static void SetInternalCornerRadiusProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadius = (Vector4)newValue; - view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius); + view.SetInternalCornerRadius((Vector4)newValue); } internal static object GetInternalCornerRadiusProperty(BindableObject bindable) { var view = (View)bindable; - return view.backgroundExtraData == null ? Vector4.Zero : view.backgroundExtraData.CornerRadius; + return view.GetInternalCornerRadius(); } /// @@ -1954,23 +1534,19 @@ internal static object GetInternalBorderlineWidthProperty(BindableObject bindabl internal static void SetInternalBorderlineColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - view.themeData?.selectorData?.BorderlineColor?.Reset(view); - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetBorderlineColor(selector.All); - else view.EnsureSelectorData().BorderlineColor = new TriggerableSelector(view, selector, view.SetBorderlineColor, true); + view.SetInternalBorderlineColor(selector); } else { - view.SetBorderlineColor((Color)newValue); + view.SetInternalBorderlineColor((Color)newValue); } } internal static object GetInternalBorderlineColorProperty(BindableObject bindable) { var view = (View)bindable; - return view.backgroundExtraData == null ? Color.Black : view.backgroundExtraData.BorderlineColor; + return view.GetInternalBorderlineColor(); } /// @@ -1984,24 +1560,19 @@ internal static object GetInternalBorderlineColorProperty(BindableObject bindabl internal static void SetInternalBorderlineColorSelectorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - - view.themeData?.selectorData?.BorderlineColor?.Reset(view); - if (newValue is Selector selector) { - if (selector.HasAll()) view.SetBorderlineColor(selector.All); - else view.EnsureSelectorData().BorderlineColor = new TriggerableSelector(view, selector, view.SetBorderlineColor, true); + view.SetInternalBorderlineColor(selector); } else { - view.SetBorderlineColor((Color)newValue); + view.SetInternalBorderlineColor((Color)newValue); } } internal static object GetInternalBorderlineColorSelectorProperty(BindableObject bindable) { var view = (View)bindable; - var selector = view.themeData?.selectorData?.BorderlineColor?.Get(); - return (null != selector) ? selector : new Selector(); + return view.GetInternalBorderlineColorSelector(); } /// @@ -2061,16 +1632,16 @@ internal static object GetInternalThemeChangeSensitiveProperty(BindableObject bi internal static void SetInternalAccessibilityNameProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityName, (string)newValue); + var view = (View)bindable; + view.SetInternalAccessibilityName((string)newValue); } } internal static object GetInternalAccessibilityNameProperty(BindableObject bindable) { var view = (View)bindable; - return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityName); + return view.GetInternalAccessibilityName(); } /// @@ -2081,18 +1652,16 @@ internal static object GetInternalAccessibilityNameProperty(BindableObject binda internal static void SetInternalAccessibilityDescriptionProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityDescription, (string)newValue); + var view = (View)bindable; + view.SetInternalAccessibilityDescription((string)newValue); } } internal static object GetInternalAccessibilityDescriptionProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityDescription); + return view.GetInternalAccessibilityDescription(); } /// @@ -2103,18 +1672,16 @@ internal static object GetInternalAccessibilityDescriptionProperty(BindableObjec internal static void SetInternalAccessibilityTranslationDomainProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityTranslationDomain, (string)newValue); + var view = (View)bindable; + view.SetInternalAccessibilityTranslationDomain((string)newValue); } } internal static object GetInternalAccessibilityTranslationDomainProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityTranslationDomain); + return view.GetInternalAccessibilityTranslationDomain(); } /// @@ -2125,18 +1692,16 @@ internal static object GetInternalAccessibilityTranslationDomainProperty(Bindabl internal static void SetInternalAccessibilityRoleProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.AccessibilityRole, (int)newValue); + var view = (View)bindable; + view.SetInternalAccessibilityRole((Role)newValue); } } internal static object GetInternalAccessibilityRoleProperty(BindableObject bindable) { var view = (View)bindable; - - return (Role)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.AccessibilityRole); + return view.GetInternalAccessibilityRole(); } /// @@ -2147,18 +1712,16 @@ internal static object GetInternalAccessibilityRoleProperty(BindableObject binda internal static void SetInternalAccessibilityHighlightableProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHighlightable, (bool)newValue); + var view = (View)bindable; + view.SetInternalAccessibilityHighlightable((bool)newValue); } } internal static object GetInternalAccessibilityHighlightableProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHighlightable); + return view.GetInternalAccessibilityHighlightable(); } /// @@ -2169,18 +1732,16 @@ internal static object GetInternalAccessibilityHighlightableProperty(BindableObj internal static void SetInternalAccessibilityHiddenProperty(BindableObject bindable, object oldValue, object newValue) { - var view = (View)bindable; if (newValue != null) { - - Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHidden, (bool)newValue); + var view = (View)bindable; + view.SetInternalAccessibilityHidden((bool)newValue); } } internal static object GetInternalAccessibilityHiddenProperty(BindableObject bindable) { var view = (View)bindable; - - return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHidden); + return view.GetInternalAccessibilityHidden(); } /// @@ -2191,9 +1752,9 @@ internal static object GetInternalAccessibilityHiddenProperty(BindableObject bin internal static void SetInternalExcludeLayoutingProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalExcludeLayouting((bool)newValue); } } @@ -2211,16 +1772,16 @@ internal static object GetInternalExcludeLayoutingProperty(BindableObject bindab internal static void SetInternalTooltipTextProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalTooltipText = (string)newValue; + var instance = (View)bindable; + instance.SetInternalTooltipText((string)newValue); } } internal static object GetInternalTooltipTextProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalTooltipText; + var instance = (View)bindable; + return instance.GetInternalTooltipText(); } /// @@ -2231,15 +1792,15 @@ internal static object GetInternalTooltipTextProperty(BindableObject bindable) internal static void SetInternalPositionUsesAnchorPointProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalPositionUsesAnchorPoint((bool)newValue); } } internal static object GetInternalPositionUsesAnchorPointProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalPositionUsesAnchorPoint(); } @@ -2251,16 +1812,16 @@ internal static object GetInternalPositionUsesAnchorPointProperty(BindableObject internal static void SetInternalAnchorPointProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalAnchorPoint = (Tizen.NUI.Position)newValue; + var instance = (View)bindable; + instance.SetInternalAnchorPoint((Position)newValue); } } internal static object GetInternalAnchorPointProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalAnchorPoint; + var instance = (View)bindable; + return instance.GetInternalAnchorPoint(); } /// @@ -2271,15 +1832,15 @@ internal static object GetInternalAnchorPointProperty(BindableObject bindable) internal static void SetInternalWidthSpecificationProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalWidthSpecification((int)newValue); } } internal static object GetInternalWidthSpecificationProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalWidthSpecification(); } @@ -2291,15 +1852,15 @@ internal static object GetInternalWidthSpecificationProperty(BindableObject bind internal static void SetInternalHeightSpecificationProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalHeightSpecification((int)newValue); } } internal static object GetInternalHeightSpecificationProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalHeightSpecification(); } @@ -2311,16 +1872,16 @@ internal static object GetInternalHeightSpecificationProperty(BindableObject bin internal static void SetInternalLayoutTransitionProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalLayoutTransition = (Tizen.NUI.LayoutTransition)newValue; + var instance = (View)bindable; + instance.SetInternalLayoutTransition((LayoutTransition)newValue); } } internal static object GetInternalLayoutTransitionProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalLayoutTransition; + var instance = (View)bindable; + return instance.GetInternalLayoutTransition(); } /// @@ -2331,16 +1892,16 @@ internal static object GetInternalLayoutTransitionProperty(BindableObject bindab internal static void SetInternalPaddingEXProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalPaddingEX = (Tizen.NUI.Extents)newValue; + var instance = (View)bindable; + instance.SetInternalPaddingEX((Extents)newValue); } } internal static object GetInternalPaddingEXProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalPaddingEX; + var instance = (View)bindable; + return instance.GetInternalPaddingEX(); } /// @@ -2351,16 +1912,16 @@ internal static object GetInternalPaddingEXProperty(BindableObject bindable) internal static void SetInternalLayoutProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalLayout = (Tizen.NUI.LayoutItem)newValue; + var instance = (View)bindable; + instance.SetInternalLayout((LayoutItem)newValue); } } internal static object GetInternalLayoutProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalLayout; + var instance = (View)bindable; + return instance.GetInternalLayout(); } /// @@ -2371,15 +1932,15 @@ internal static object GetInternalLayoutProperty(BindableObject bindable) internal static void SetInternalBackgroundImageSynchronosLoadingProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalBackgroundImageSynchronosLoading((bool)newValue); } } internal static object GetInternalBackgroundImageSynchronosLoadingProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalBackgroundImageSynchronosLoading(); } @@ -2391,15 +1952,15 @@ internal static object GetInternalBackgroundImageSynchronosLoadingProperty(Binda internal static void SetInternalBackgroundImageSynchronousLoadingProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalBackgroundImageSynchronousLoading((bool)newValue); } } internal static object GetInternalBackgroundImageSynchronousLoadingProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalBackgroundImageSynchronousLoading(); } @@ -2411,15 +1972,15 @@ internal static object GetInternalBackgroundImageSynchronousLoadingProperty(Bind internal static void SetInternalEnableControlStatePropagationProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalEnableControlStatePropagation((bool)newValue); } } internal static object GetInternalEnableControlStatePropagationProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalEnableControlStatePropagation(); } @@ -2431,16 +1992,16 @@ internal static object GetInternalEnableControlStatePropagationProperty(Bindable internal static void SetInternalPropagatableControlStatesProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.InternalPropagatableControlStates = (ControlState)newValue; } } internal static object GetInternalPropagatableControlStatesProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalPropagatableControlStates; + var instance = (View)bindable; + return instance.GetInternalPropagatableControlStates(); } /// @@ -2451,15 +2012,15 @@ internal static object GetInternalPropagatableControlStatesProperty(BindableObje internal static void SetInternalGrabTouchAfterLeaveProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalGrabTouchAfterLeave((bool)newValue); } } internal static object GetInternalGrabTouchAfterLeaveProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalGrabTouchAfterLeave(); } @@ -2471,15 +2032,15 @@ internal static object GetInternalGrabTouchAfterLeaveProperty(BindableObject bin internal static void SetInternalAllowOnlyOwnTouchProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalAllowOnlyOwnTouch((bool)newValue); } } internal static object GetInternalAllowOnlyOwnTouchProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalAllowOnlyOwnTouch(); } @@ -2491,15 +2052,15 @@ internal static object GetInternalAllowOnlyOwnTouchProperty(BindableObject binda internal static void SetInternalBlendEquationProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { + var instance = (View)bindable; instance.SetInternalBlendEquation((BlendEquationType)newValue); } } internal static object GetInternalBlendEquationProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; + var instance = (View)bindable; return instance.GetInternalBlendEquation(); } @@ -2511,16 +2072,16 @@ internal static object GetInternalBlendEquationProperty(BindableObject bindable) internal static void SetInternalTransitionOptionsProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalTransitionOptions = (Tizen.NUI.TransitionOptions)newValue; + var instance = (View)bindable; + instance.SetInternalTransitionOptions((TransitionOptions)newValue); } } internal static object GetInternalTransitionOptionsProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalTransitionOptions; + var instance = (View)bindable; + return instance.GetInternalTransitionOptions(); } /// @@ -2531,18 +2092,16 @@ internal static object GetInternalTransitionOptionsProperty(BindableObject binda internal static void SetInternalAutomationIdProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - - Object.InternalSetPropertyString(instance.SwigCPtr, View.Property.AutomationId, (string)newValue); + var instance = (View)bindable; + instance.SetInternalAutomationId((string)newValue); } } internal static object GetInternalAutomationIdProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - - return Object.InternalGetPropertyString(instance.SwigCPtr, View.Property.AutomationId); + var instance = (View)bindable; + return instance.GetInternalAutomationId(); } /// @@ -2553,16 +2112,16 @@ internal static object GetInternalAutomationIdProperty(BindableObject bindable) internal static void SetInternalTouchAreaOffsetProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalTouchAreaOffset = (Tizen.NUI.Offset)newValue; + var instance = (View)bindable; + instance.SetInternalTouchAreaOffset((Offset)newValue); } } internal static object GetInternalTouchAreaOffsetProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalTouchAreaOffset; + var instance = (View)bindable; + return instance.GetInternalTouchAreaOffset(); } /// @@ -2573,16 +2132,16 @@ internal static object GetInternalTouchAreaOffsetProperty(BindableObject bindabl internal static void SetInternalDispatchTouchMotionProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalDispatchTouchMotion = (bool)newValue; + var instance = (View)bindable; + instance.SetInternalDispatchTouchMotion((bool)newValue); } } internal static object GetInternalDispatchTouchMotionProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalDispatchTouchMotion; + var instance = (View)bindable; + return instance.GetInternalDispatchTouchMotion(); } /// @@ -2593,17 +2152,16 @@ internal static object GetInternalDispatchTouchMotionProperty(BindableObject bin internal static void SetInternalDispatchHoverMotionProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; if (newValue != null) { - instance.InternalDispatchHoverMotion = (bool)newValue; + var instance = (View)bindable; + instance.SetInternalDispatchHoverMotion((bool)newValue); } } - internal static object GetInternalDispatchHoverMotionProperty(BindableObject bindable) { - var instance = (Tizen.NUI.BaseComponents.View)bindable; - return instance.InternalDispatchHoverMotion; + var instance = (View)bindable; + return instance.GetInternalDispatchHoverMotion(); } /// diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs index d635edb9f84..28781f25901 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs @@ -1581,7 +1581,7 @@ public Offset TouchAreaOffset } else { - return (Offset)GetInternalTouchAreaOffsetProperty(this); + return GetInternalTouchAreaOffset(); } } set @@ -1592,12 +1592,22 @@ public Offset TouchAreaOffset } else { - SetInternalTouchAreaOffsetProperty(this, null, value); + SetInternalTouchAreaOffset(value); } NotifyPropertyChanged(); } } + private void SetInternalTouchAreaOffset(Offset offset) + { + InternalTouchAreaOffset = offset; + } + + private Offset GetInternalTouchAreaOffset() + { + return InternalTouchAreaOffset; + } + private Offset InternalTouchAreaOffset { get @@ -1631,7 +1641,7 @@ public bool DispatchKeyEvents } else { - return (bool)GetInternalDispatchKeyEventsProperty(this); + return GetInternalDispatchKeyEvents(); } } set @@ -1642,12 +1652,22 @@ public bool DispatchKeyEvents } else { - SetInternalDispatchKeyEventsProperty(this, null, value); + SetInternalDispatchKeyEvents(value); } NotifyPropertyChanged(); } } + private void SetInternalDispatchKeyEvents(bool dispatch) + { + Object.InternalSetPropertyBool(SwigCPtr, Property.DispatchKeyEvents, dispatch); + } + + private bool GetInternalDispatchKeyEvents() + { + return Object.InternalGetPropertyBool(SwigCPtr, Property.DispatchKeyEvents); + } + /// /// Gets or sets the status of whether touch events can be dispatched. /// If a View's DispatchTouchEvents is set to false, then it's can not will receive touch and parents will not receive a touch event signal either. @@ -1980,7 +2000,7 @@ public bool DispatchTouchMotion } else { - return (bool)GetInternalDispatchTouchMotionProperty(this); + return GetInternalDispatchTouchMotion(); } } set @@ -1991,11 +2011,21 @@ public bool DispatchTouchMotion } else { - SetInternalDispatchTouchMotionProperty(this, null, value); + SetInternalDispatchTouchMotion(value); } } } + private void SetInternalDispatchTouchMotion(bool dispatch) + { + InternalDispatchTouchMotion = dispatch; + } + + private bool GetInternalDispatchTouchMotion() + { + return InternalDispatchTouchMotion; + } + private bool InternalDispatchTouchMotion { get @@ -2024,7 +2054,7 @@ public bool DispatchHoverMotion } else { - return (bool)GetInternalDispatchHoverMotionProperty(this); + return GetInternalDispatchHoverMotion(); } } set @@ -2035,11 +2065,21 @@ public bool DispatchHoverMotion } else { - SetInternalDispatchHoverMotionProperty(this, null, value); + SetInternalDispatchHoverMotion(value); } } } + private void SetInternalDispatchHoverMotion(bool dispatch) + { + InternalDispatchHoverMotion = dispatch; + } + + private bool GetInternalDispatchHoverMotion() + { + return InternalDispatchHoverMotion; + } + private bool InternalDispatchHoverMotion { get diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs index f997c860deb..d58483e20ba 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -355,13 +355,11 @@ private int LeftFocusableViewId { get { - - return Object.InternalGetPropertyInt(SwigCPtr, View.Property.LeftFocusableViewId); + return Object.InternalGetPropertyInt(SwigCPtr, Property.LeftFocusableViewId); } set { - - Object.InternalSetPropertyInt(SwigCPtr, View.Property.LeftFocusableViewId, value); + Object.InternalSetPropertyInt(SwigCPtr, Property.LeftFocusableViewId, value); } } @@ -369,13 +367,11 @@ private int RightFocusableViewId { get { - - return Object.InternalGetPropertyInt(SwigCPtr, View.Property.RightFocusableViewId); + return Object.InternalGetPropertyInt(SwigCPtr, Property.RightFocusableViewId); } set { - - Object.InternalSetPropertyInt(SwigCPtr, View.Property.RightFocusableViewId, value); + Object.InternalSetPropertyInt(SwigCPtr, Property.RightFocusableViewId, value); } } @@ -383,13 +379,11 @@ private int UpFocusableViewId { get { - - return Object.InternalGetPropertyInt(SwigCPtr, View.Property.UpFocusableViewId); + return Object.InternalGetPropertyInt(SwigCPtr, Property.UpFocusableViewId); } set { - - Object.InternalSetPropertyInt(SwigCPtr, View.Property.UpFocusableViewId, value); + Object.InternalSetPropertyInt(SwigCPtr, Property.UpFocusableViewId, value); } } @@ -397,13 +391,11 @@ private int DownFocusableViewId { get { - - return Object.InternalGetPropertyInt(SwigCPtr, View.Property.DownFocusableViewId); + return Object.InternalGetPropertyInt(SwigCPtr, Property.DownFocusableViewId); } set { - - Object.InternalSetPropertyInt(SwigCPtr, View.Property.DownFocusableViewId, value); + Object.InternalSetPropertyInt(SwigCPtr, Property.DownFocusableViewId, value); } } @@ -411,13 +403,11 @@ private int ClockwiseFocusableViewId { get { - - return Object.InternalGetPropertyInt(SwigCPtr, View.Property.ClockwiseFocusableViewId); + return Object.InternalGetPropertyInt(SwigCPtr, Property.ClockwiseFocusableViewId); } set { - - Object.InternalSetPropertyInt(SwigCPtr, View.Property.ClockwiseFocusableViewId, value); + Object.InternalSetPropertyInt(SwigCPtr, Property.ClockwiseFocusableViewId, value); } } @@ -425,13 +415,11 @@ private int CounterClockwiseFocusableViewId { get { - - return Object.InternalGetPropertyInt(SwigCPtr, View.Property.CounterClockwiseFocusableViewId); + return Object.InternalGetPropertyInt(SwigCPtr, Property.CounterClockwiseFocusableViewId); } set { - - Object.InternalSetPropertyInt(SwigCPtr, View.Property.CounterClockwiseFocusableViewId, value); + Object.InternalSetPropertyInt(SwigCPtr, Property.CounterClockwiseFocusableViewId, value); } }