From: dongsug.song Date: Mon, 18 Mar 2024 09:21:39 +0000 (+0900) Subject: [NUI] Add IsUsingXaml X-Git-Tag: accepted/tizen/8.0/unified/20240613.065534~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bddbe74f84ebbb1aa1f2a6e824f9b1d0474c81e5;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add IsUsingXaml --- diff --git a/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs b/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs index c43b64b..4cba510 100755 --- a/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs +++ b/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs @@ -390,13 +390,7 @@ namespace Tizen.NUI { Tizen.Tracer.Begin("[NUI] OnInitialized()"); - Log.Info("NUI", "NUICorebackend OnPreCreated Called"); - - if (NUIApplication.IsUsingXaml) - { - Tizen.Log.Fatal("NT", $"NUICoreBackend.OnInitialized() XAML ON, IsUsingXaml={NUIApplication.IsUsingXaml}"); - } - + Log.Info("NUI", $"NUICorebackend OnPreCreated Called IsUsingXaml={NUIApplication.IsUsingXaml}"); Tizen.Tracer.Begin("[NUI] OnInitialized(): OnPreCreated event handler"); var preCreateHandler = Handlers[EventType.PreCreated] as Action; diff --git a/src/Tizen.NUI/src/public/Application/NUIApplication.cs b/src/Tizen.NUI/src/public/Application/NUIApplication.cs index 21dd34d..162af45 100755 --- a/src/Tizen.NUI/src/public/Application/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/Application/NUIApplication.cs @@ -64,7 +64,6 @@ namespace Tizen.NUI [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication() : base(new NUICoreBackend()) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #1"); } /// @@ -78,7 +77,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #2"); } /// @@ -89,7 +87,6 @@ namespace Tizen.NUI [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication(string styleSheet) : base(new NUICoreBackend(styleSheet)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #3 IsUsingXaml={IsUsingXaml}"); } /// @@ -104,7 +101,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, WindowMode.Opaque, windowSize, windowPosition)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #4"); } /// @@ -116,8 +112,6 @@ namespace Tizen.NUI [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication(string styleSheet, WindowMode windowMode) : base(new NUICoreBackend(styleSheet, windowMode)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #5"); - Tizen.Log.Fatal("NT", $"IsUsingXaml={IsUsingXaml}"); } /// @@ -133,7 +127,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #6"); } /// @@ -149,8 +142,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(Graphics.BackendType backend, WindowMode windowMode = WindowMode.Opaque, Size2D windowSize = null, Position2D windowPosition = null, string styleSheet = "") : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #7"); - //windowMode and styleSheet will be added later. currently it's not working as expected. Graphics.Backend = backend; Tizen.Log.Error("NUI", "Plaese DO NOT set graphical backend type with this constructor! This will give no effect!"); @@ -164,8 +155,6 @@ namespace Tizen.NUI [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication(ThemeOptions option) : base(new NUICoreBackend()) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #8"); - ApplyThemeOption(option); } @@ -179,8 +168,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(Size2D windowSize, Position2D windowPosition, ThemeOptions option) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #9"); - ApplyThemeOption(option); } @@ -195,8 +182,6 @@ namespace Tizen.NUI [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication(string styleSheet, WindowMode windowMode, WindowType type) : base(new NUICoreBackend(styleSheet, windowMode, type)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #10"); - ExternalThemeManager.Initialize(); } @@ -212,8 +197,6 @@ namespace Tizen.NUI [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition, IBorderInterface borderInterface, WindowMode windowMode = WindowMode.Opaque) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #11"); - EnableBorder(borderInterface); } @@ -226,8 +209,6 @@ namespace Tizen.NUI [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication(ThemeOptions option, IBorderInterface borderInterface) : base(new NUICoreBackend()) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #12"); - EnableBorder(borderInterface); ApplyThemeOption(option); } @@ -243,8 +224,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(Size2D windowSize, Position2D windowPosition, ThemeOptions option, IBorderInterface borderInterface) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #13"); - EnableBorder(borderInterface); ApplyThemeOption(option); } @@ -269,8 +248,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(string styleSheet, WindowMode windowMode, CoreTask task) : base(new NUICoreBackend(styleSheet, windowMode), task) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #14"); - } /// @@ -285,8 +262,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition, CoreTask task) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition), task) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #15"); - } /// @@ -298,8 +273,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(ThemeOptions option, WindowData windowData) : base(new NUICoreBackend(windowData)) { - Tizen.Log.Fatal("NT", $"NUIApplication constructor #16"); - if (windowData.BorderInterface != null) { EnableBorder(windowData.BorderInterface); @@ -673,9 +646,6 @@ namespace Tizen.NUI var disposalbeQueue = DisposeQueue.Instance; var registry = Registry.Instance; - // no need to be enable XAML when preload - NUIApplication.IsUsingXaml = false; - // Initialize some BaseComponent static variables now BaseComponents.View.Preload(); BaseComponents.ImageView.Preload(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 15278bf..940dee3 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -89,10 +89,95 @@ namespace Tizen.NUI.BaseComponents static View() { - Tizen.Log.Fatal("NT", $"static View construct IsUsingXaml={NUIApplication.IsUsingXaml}"); if (NUIApplication.IsUsingXaml) { +#if REMOVE_READONLY CreateBindableProperties(); +#else + BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(View), null, + propertyChanged: SetInternalBackgroundColorProperty, defaultValueCreator: GetInternalBackgroundColorProperty); + + ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(View), null, + propertyChanged: SetInternalColorProperty, defaultValueCreator: GetInternalColorProperty); + + ColorRedProperty = BindableProperty.Create(nameof(ColorRed), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalColorRedProperty, defaultValueCreator: GetInternalColorRedProperty); + + ColorGreenProperty = BindableProperty.Create(nameof(ColorGreen), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalColorGreenProperty, defaultValueCreator: GetInternalColorGreenProperty); + + ColorBlueProperty = BindableProperty.Create(nameof(ColorBlue), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalColorBlueProperty, defaultValueCreator: GetInternalColorBlueProperty); + + CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(View), null, + propertyChanged: SetInternalCellIndexProperty, defaultValueCreator: GetInternalCellIndexProperty); + + Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(View), null, + propertyChanged: SetInternalSize2DProperty, defaultValueCreator: GetInternalSize2DProperty); + + Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(View), null, + propertyChanged: SetInternalPosition2DProperty, defaultValueCreator: GetInternalPosition2DProperty); + + ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(View), null, + propertyChanged: SetInternalParentOriginProperty, defaultValueCreator: GetInternalParentOriginProperty); + + PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(View), null, + propertyChanged: SetInternalPivotPointProperty, defaultValueCreator: GetInternalPivotPointProperty); + + SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalSizeWidthProperty, defaultValueCreator: GetInternalSizeWidthProperty); + + SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalSizeHeightProperty, defaultValueCreator: GetInternalSizeHeightProperty); + + PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(View), null, + propertyChanged: SetInternalPositionProperty, defaultValueCreator: GetInternalPositionProperty); + + PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalPositionXProperty, defaultValueCreator: GetInternalPositionXProperty); + + PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalPositionYProperty, defaultValueCreator: GetInternalPositionYProperty); + + PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalPositionZProperty, defaultValueCreator: GetInternalPositionZProperty); + + ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(View), null, + propertyChanged: SetInternalScaleProperty, defaultValueCreator: GetInternalScaleProperty); + + ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalScaleXProperty, defaultValueCreator: GetInternalScaleXProperty); + + ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalScaleYProperty, defaultValueCreator: GetInternalScaleYProperty); + + ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float), typeof(View), default(float), + propertyChanged: SetInternalScaleZProperty, defaultValueCreator: GetInternalScaleZProperty); + + NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(View), string.Empty, + propertyChanged: SetInternalNameProperty, defaultValueCreator: GetInternalNameProperty); + + SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(View), null, + propertyChanged: SetInternalSizeModeFactorProperty, defaultValueCreator: GetInternalSizeModeFactorProperty); + + PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(View), null, + propertyChanged: SetInternalPaddingProperty, defaultValueCreator: GetInternalPaddingProperty); + + SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(View), null, + propertyChanged: SetInternalSizeProperty, defaultValueCreator: GetInternalSizeProperty); + + MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(View), null, + propertyChanged: SetInternalMinimumSizeProperty, defaultValueCreator: GetInternalMinimumSizeProperty); + + MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(View), null, + propertyChanged: SetInternalMaximumSizeProperty, defaultValueCreator: GetInternalMaximumSizeProperty); + + MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(View), null, + propertyChanged: SetInternalMarginProperty, defaultValueCreator: GetInternalMarginProperty); + + AnchorPointProperty = BindableProperty.Create(nameof(AnchorPoint), typeof(Tizen.NUI.Position), typeof(View), null, + propertyChanged: SetInternalAnchorPointProperty, defaultValueCreator: GetInternalAnchorPointProperty); +#endif RegisterPropertyGroup(PositionProperty, positionPropertyGroup); RegisterPropertyGroup(Position2DProperty, positionPropertyGroup); diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index 5111e2b..41aa0a4 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -82,15 +82,12 @@ namespace Tizen.NUI.BaseComponents return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.KeyInputFocus); })); + // BackgroundColorProperty internal static void SetInternalBackgroundColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; - if (!NUIApplication.IsUsingXaml) - { - view.SetBackgroundColor((Color)newValue); - } - else + if (NUIApplication.IsUsingXaml) { view.themeData?.selectorData?.ClearBackground(view); @@ -103,6 +100,11 @@ namespace Tizen.NUI.BaseComponents { view.SetBackgroundColor((Color)newValue); } + + } + else + { + view.SetBackgroundColor((Color)newValue); } } @@ -128,6 +130,7 @@ namespace Tizen.NUI.BaseComponents /// BackgroundColorProperty /// [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY public static BindableProperty BackgroundColorProperty = null; internal static BindableProperty GetBackgroundColorProperty() @@ -139,8 +142,11 @@ namespace Tizen.NUI.BaseComponents } return BackgroundColorProperty; } +#else + public static readonly BindableProperty BackgroundColorProperty = null; +#endif - + // ColorProperty internal static void SetInternalColorProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -156,7 +162,6 @@ namespace Tizen.NUI.BaseComponents { view.SetColor((Color)newValue); } - } internal static object GetInternalColorProperty(BindableObject bindable) @@ -169,9 +174,15 @@ namespace Tizen.NUI.BaseComponents } Object.InternalRetrievingPropertyVector4(view.SwigCPtr, View.Property.COLOR, view.internalColor.SwigCPtr); return view.internalColor; - } + /// + /// ColorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY + public static BindableProperty ColorProperty = null; + internal static BindableProperty GetColorProperty() { if (ColorProperty == null) @@ -181,27 +192,30 @@ namespace Tizen.NUI.BaseComponents } return ColorProperty; } +#else + public static readonly BindableProperty ColorProperty = null; +#endif - /// - /// ColorProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static BindableProperty ColorProperty = null; - + // ColorRedProperty internal static void SetInternalColorRedProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; view.SetColorRed((float?)newValue); - } internal static object GetInternalColorRedProperty(BindableObject bindable) { var view = (View)bindable; return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorRed); - } + /// + /// ColorRedProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY + public static BindableProperty ColorRedProperty = null; + internal static BindableProperty GetColorRedProperty() { if (ColorRedProperty == null) @@ -211,14 +225,11 @@ namespace Tizen.NUI.BaseComponents } return ColorRedProperty; } +#else + public static readonly BindableProperty ColorRedProperty = null; +#endif - /// - /// ColorRedProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static BindableProperty ColorRedProperty = null; - - + // ColorGreenProperty internal static void SetInternalColorGreenProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -233,6 +244,13 @@ namespace Tizen.NUI.BaseComponents } + /// + /// ColorGreenProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY + public static BindableProperty ColorGreenProperty = null; + internal static BindableProperty GetColorGreenProperty() { if (ColorGreenProperty == null) @@ -242,17 +260,11 @@ namespace Tizen.NUI.BaseComponents } return ColorGreenProperty; } +#else + public static readonly BindableProperty ColorGreenProperty = null; +#endif - - /// - /// ColorGreenProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static BindableProperty ColorGreenProperty = null; - - - - + // ColorBlueProperty internal static void SetInternalColorBlueProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -267,6 +279,13 @@ namespace Tizen.NUI.BaseComponents } + /// + /// ColorBlueProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY + public static BindableProperty ColorBlueProperty = null; + internal static BindableProperty GetColorBlueProperty() { if (ColorBlueProperty == null) @@ -276,13 +295,9 @@ namespace Tizen.NUI.BaseComponents } return ColorBlueProperty; } - - - /// - /// ColorBlueProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static BindableProperty ColorBlueProperty = null; +#else + public static readonly BindableProperty ColorBlueProperty = null; +#endif /// BackgroundImageProperty [EditorBrowsable(EditorBrowsableState.Never)] @@ -517,7 +532,7 @@ namespace Tizen.NUI.BaseComponents return temp; })); - + // CellIndexProperty internal static void SetInternalCellIndexProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -540,6 +555,11 @@ namespace Tizen.NUI.BaseComponents } + /// + /// CellIndexProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetCellIndexProperty() { if (CellIndexProperty == null) @@ -550,11 +570,10 @@ namespace Tizen.NUI.BaseComponents return CellIndexProperty; } - /// - /// CellIndexProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty CellIndexProperty = null; +#else + public static readonly BindableProperty CellIndexProperty = null; +#endif /// /// RowSpanProperty @@ -805,6 +824,7 @@ namespace Tizen.NUI.BaseComponents return view.IsFocusableInTouch(); }); + //Size2DProperty internal static void SetInternalSize2DProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -856,8 +876,7 @@ namespace Tizen.NUI.BaseComponents /// Size2DProperty /// [EditorBrowsable(EditorBrowsableState.Never)] - public static BindableProperty Size2DProperty = null; - +#if REMOVE_READONLY internal static BindableProperty GetSize2DProperty() { if (Size2DProperty == null) @@ -868,6 +887,11 @@ namespace Tizen.NUI.BaseComponents return Size2DProperty; } + public static BindableProperty Size2DProperty = null; +#else + public static readonly BindableProperty Size2DProperty = null; +#endif + /// /// OpacityProperty /// @@ -894,6 +918,7 @@ namespace Tizen.NUI.BaseComponents return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.OPACITY); })); + // Position2DProperty internal static void SetInternalPosition2DProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -918,8 +943,7 @@ namespace Tizen.NUI.BaseComponents /// Position2DProperty /// [EditorBrowsable(EditorBrowsableState.Never)] - public static BindableProperty Position2DProperty = null; - +#if REMOVE_READONLY internal static BindableProperty GetPosition2DProperty() { if (Position2DProperty == null) @@ -930,6 +954,11 @@ namespace Tizen.NUI.BaseComponents return Position2DProperty; } + public static BindableProperty Position2DProperty = null; +#else + public static readonly BindableProperty Position2DProperty = null; +#endif + /// /// PositionUsesPivotPointProperty /// @@ -997,7 +1026,7 @@ namespace Tizen.NUI.BaseComponents return 0; }); - + // ParentOriginProperty internal static void SetInternalParentOriginProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1005,7 +1034,6 @@ namespace Tizen.NUI.BaseComponents { Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, ((Position)newValue).SwigCPtr); } - } internal static object GetInternalParentOriginProperty(BindableObject bindable) @@ -1014,9 +1042,13 @@ namespace Tizen.NUI.BaseComponents Position temp = new Position(0.0f, 0.0f, 0.0f); Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, temp.SwigCPtr); return temp; - } + /// + /// ParentOriginProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetParentOriginProperty() { if (ParentOriginProperty == null) @@ -1027,12 +1059,12 @@ namespace Tizen.NUI.BaseComponents return ParentOriginProperty; } - /// - /// ParentOriginProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty ParentOriginProperty = null; +#else + public static readonly BindableProperty ParentOriginProperty = null; +#endif + // PivotPointProperty internal static void SetInternalPivotPointProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1040,7 +1072,6 @@ namespace Tizen.NUI.BaseComponents { view.SetAnchorPoint((Position)newValue); } - } internal static object GetInternalPivotPointProperty(BindableObject bindable) @@ -1052,9 +1083,13 @@ namespace Tizen.NUI.BaseComponents } Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.AnchorPoint, view.internalPivotPoint.SwigCPtr); return view.internalPivotPoint; - } + /// + /// PivotPointProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetPivotPointProperty() { if (PivotPointProperty == null) @@ -1065,12 +1100,12 @@ namespace Tizen.NUI.BaseComponents return PivotPointProperty; } - /// - /// PivotPointProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty PivotPointProperty = null; - +#else + public static readonly BindableProperty PivotPointProperty = null; +#endif + + // SizeWidthProperty internal static void SetInternalSizeWidthProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1101,6 +1136,11 @@ namespace Tizen.NUI.BaseComponents return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeWidth); } + /// + /// SizeWidthProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetSizeWidthProperty() { if (SizeWidthProperty == null) @@ -1111,12 +1151,12 @@ namespace Tizen.NUI.BaseComponents return SizeWidthProperty; } - /// - /// SizeWidthProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty SizeWidthProperty = null; +#else + public static readonly BindableProperty SizeWidthProperty = null; +#endif + // SizeHeightProperty internal static void SetInternalSizeHeightProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1139,16 +1179,19 @@ namespace Tizen.NUI.BaseComponents Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight, height); } - } internal static object GetInternalSizeHeightProperty(BindableObject bindable) { var view = (View)bindable; return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight); - } + /// + /// SizeHeightProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetSizeHeightProperty() { if (SizeHeightProperty == null) @@ -1159,13 +1202,12 @@ namespace Tizen.NUI.BaseComponents return SizeHeightProperty; } - /// - /// SizeHeightProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty SizeHeightProperty = null; +#else + public static readonly BindableProperty SizeHeightProperty = null; +#endif - + // PositionProperty internal static void SetInternalPositionProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1186,6 +1228,11 @@ namespace Tizen.NUI.BaseComponents return view.internalPosition; } + /// + /// PositionProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetPositionProperty() { if (PositionProperty == null) @@ -1196,12 +1243,12 @@ namespace Tizen.NUI.BaseComponents return PositionProperty; } - /// - /// PositionProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty PositionProperty = null; - +#else + public static readonly BindableProperty PositionProperty = null; +#endif + + // PositionXProperty internal static void SetInternalPositionXProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1209,7 +1256,6 @@ namespace Tizen.NUI.BaseComponents { Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionX, (float)newValue); } - } internal static object GetInternalPositionXProperty(BindableObject bindable) @@ -1218,6 +1264,11 @@ namespace Tizen.NUI.BaseComponents return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionX); } + /// + /// PositionXProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetPositionXProperty() { if (PositionXProperty == null) @@ -1228,12 +1279,12 @@ namespace Tizen.NUI.BaseComponents return PositionXProperty; } - /// - /// PositionXProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty PositionXProperty = null; +#else + public static readonly BindableProperty PositionXProperty = null; +#endif + // PositionYProperty internal static void SetInternalPositionYProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1249,6 +1300,11 @@ namespace Tizen.NUI.BaseComponents return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionY); } + /// + /// PositionYProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetPositionYProperty() { if (PositionYProperty == null) @@ -1259,12 +1315,10 @@ namespace Tizen.NUI.BaseComponents return PositionYProperty; } - /// - /// PositionYProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty PositionYProperty = null; - +#else + public static readonly BindableProperty PositionYProperty = null; +#endif internal static void SetInternalPositionZProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1275,13 +1329,18 @@ namespace Tizen.NUI.BaseComponents } + // PositionZProperty internal static object GetInternalPositionZProperty(BindableObject bindable) { var view = (View)bindable; return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionZ); - } + /// + /// PositionZProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetPositionZProperty() { if (PositionZProperty == null) @@ -1292,12 +1351,10 @@ namespace Tizen.NUI.BaseComponents return PositionZProperty; } - /// - /// PositionZProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty PositionZProperty = null; - +#else + public static readonly BindableProperty PositionZProperty = null; +#endif /// /// OrientationProperty /// @@ -1328,6 +1385,7 @@ namespace Tizen.NUI.BaseComponents } + // ScaleProperty internal static object GetInternalScaleProperty(BindableObject bindable) { var view = (View)bindable; @@ -1337,9 +1395,13 @@ namespace Tizen.NUI.BaseComponents } Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SCALE, view.internalScale.SwigCPtr); return view.internalScale; - } + /// + /// ScaleProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetScaleProperty() { if (ScaleProperty == null) @@ -1350,14 +1412,12 @@ namespace Tizen.NUI.BaseComponents return ScaleProperty; } - - /// - /// ScaleProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty ScaleProperty = null; +#else + public static readonly BindableProperty ScaleProperty = null; +#endif - + // ScaleXProperty internal static void SetInternalScaleXProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1365,16 +1425,19 @@ namespace Tizen.NUI.BaseComponents { Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleX, (float)newValue); } - } internal static object GetInternalScaleXProperty(BindableObject bindable) { var view = (View)bindable; return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleX); - } + /// + /// ScaleXProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetScaleXProperty() { if (ScaleXProperty == null) @@ -1385,12 +1448,12 @@ namespace Tizen.NUI.BaseComponents return ScaleXProperty; } - /// - /// ScaleXProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty ScaleXProperty = null; +#else + public static readonly BindableProperty ScaleXProperty = null; +#endif + // ScaleYProperty internal static void SetInternalScaleYProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1398,16 +1461,19 @@ namespace Tizen.NUI.BaseComponents { Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleY, (float)newValue); } - } internal static object GetInternalScaleYProperty(BindableObject bindable) { var view = (View)bindable; return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleY); - } + /// + /// ScaleYProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetScaleYProperty() { if (ScaleYProperty == null) @@ -1418,13 +1484,12 @@ namespace Tizen.NUI.BaseComponents return ScaleYProperty; } - /// - /// ScaleYProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty ScaleYProperty = null; +#else + public static readonly BindableProperty ScaleYProperty = null; +#endif - + // ScaleZProperty internal static void SetInternalScaleZProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1432,16 +1497,19 @@ namespace Tizen.NUI.BaseComponents { Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ, (float)newValue); } - } internal static object GetInternalScaleZProperty(BindableObject bindable) { var view = (View)bindable; return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ); - } + /// + /// ScaleZProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetScaleZProperty() { if (ScaleZProperty == null) @@ -1452,12 +1520,12 @@ namespace Tizen.NUI.BaseComponents return ScaleZProperty; } - /// - /// ScaleZProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty ScaleZProperty = null; - +#else + public static readonly BindableProperty ScaleZProperty = null; +#endif + + // NameProperty internal static void SetInternalNameProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1466,16 +1534,19 @@ namespace Tizen.NUI.BaseComponents view.internalName = (string)newValue; Object.InternalSetPropertyString(view.SwigCPtr, View.Property.NAME, (string)newValue); } - } internal static object GetInternalNameProperty(BindableObject bindable) { var view = (View)bindable; return view.internalName; - } + /// + /// NameProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetNameProperty() { if (NameProperty == null) @@ -1486,12 +1557,10 @@ namespace Tizen.NUI.BaseComponents return NameProperty; } - /// - /// NameProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty NameProperty = null; - +#else + public static readonly BindableProperty NameProperty = null; +#endif /// /// SensitiveProperty /// @@ -1629,6 +1698,7 @@ namespace Tizen.NUI.BaseComponents } + // SizeModeFactorProperty internal static object GetInternalSizeModeFactorProperty(BindableObject bindable) { var view = (View)bindable; @@ -1638,9 +1708,13 @@ namespace Tizen.NUI.BaseComponents } Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SizeModeFactor, view.internalSizeModeFactor.SwigCPtr); return view.internalSizeModeFactor; - } + /// + /// SizeModeFactorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetSizeModeFactorProperty() { if (SizeModeFactorProperty == null) @@ -1651,12 +1725,10 @@ namespace Tizen.NUI.BaseComponents return SizeModeFactorProperty; } - /// - /// SizeModeFactorProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty SizeModeFactorProperty = null; - +#else + public static readonly BindableProperty SizeModeFactorProperty = null; +#endif /// /// WidthResizePolicyProperty /// @@ -1837,6 +1909,7 @@ namespace Tizen.NUI.BaseComponents return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.HeightForWidth); })); + // PaddingProperty internal static void SetInternalPaddingProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1860,7 +1933,6 @@ namespace Tizen.NUI.BaseComponents tmp?.Dispose(); } } - } internal static object GetInternalPaddingProperty(BindableObject bindable) @@ -1890,9 +1962,13 @@ namespace Tizen.NUI.BaseComponents } return view.internalPadding; - } + /// + /// PaddingProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetPaddingProperty() { if (PaddingProperty == null) @@ -1903,12 +1979,12 @@ namespace Tizen.NUI.BaseComponents return PaddingProperty; } - /// - /// PaddingProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty PaddingProperty = null; +#else + public static readonly BindableProperty PaddingProperty = null; +#endif + // SizeProperty internal static void SetInternalSizeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1964,6 +2040,11 @@ namespace Tizen.NUI.BaseComponents return view.internalSize; } + /// + /// SizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetSizeProperty() { if (SizeProperty == null) @@ -1974,13 +2055,12 @@ namespace Tizen.NUI.BaseComponents return SizeProperty; } - /// - /// SizeProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty SizeProperty = null; +#else + public static readonly BindableProperty SizeProperty = null; +#endif - + // MinimumSizeProperty internal static void SetInternalMinimumSizeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -1989,7 +2069,6 @@ namespace Tizen.NUI.BaseComponents Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, ((Size2D)newValue).SwigCPtr); } - } internal static object GetInternalMinimumSizeProperty(BindableObject bindable) @@ -2002,9 +2081,13 @@ namespace Tizen.NUI.BaseComponents } Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, view.internalMinimumSize.SwigCPtr); return view.internalMinimumSize; - } + /// + /// MinimumSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetMinimumSizeProperty() { if (MinimumSizeProperty == null) @@ -2015,12 +2098,12 @@ namespace Tizen.NUI.BaseComponents return MinimumSizeProperty; } - /// - /// MinimumSizeProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty MinimumSizeProperty = null; +#else + public static readonly BindableProperty MinimumSizeProperty = null; +#endif + // MaximumSizeProperty internal static void SetInternalMaximumSizeProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2029,7 +2112,6 @@ namespace Tizen.NUI.BaseComponents Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, ((Size2D)newValue).SwigCPtr); } - } internal static object GetInternalMaximumSizeProperty(BindableObject bindable) @@ -2042,9 +2124,13 @@ namespace Tizen.NUI.BaseComponents } Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, view.internalMaximumSize.SwigCPtr); return view.internalMaximumSize; - } + /// + /// MaximumSizeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetMaximumSizeProperty() { if (MaximumSizeProperty == null) @@ -2055,11 +2141,10 @@ namespace Tizen.NUI.BaseComponents return MaximumSizeProperty; } - /// - /// MaximumSizeProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty MaximumSizeProperty = null; +#else + public static readonly BindableProperty MaximumSizeProperty = null; +#endif /// /// InheritPositionProperty @@ -2140,6 +2225,7 @@ namespace Tizen.NUI.BaseComponents return (ViewLayoutDirectionType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.LayoutDirection); })); + // MarginProperty internal static void SetInternalMarginProperty(BindableObject bindable, object oldValue, object newValue) { var view = (View)bindable; @@ -2163,7 +2249,6 @@ namespace Tizen.NUI.BaseComponents tmp?.Dispose(); } } - } internal static object GetInternalMarginProperty(BindableObject bindable) @@ -2194,9 +2279,13 @@ namespace Tizen.NUI.BaseComponents } return view.internalMargin; - } + /// + /// MarginProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetMarginProperty() { if (MarginProperty == null) @@ -2207,11 +2296,10 @@ namespace Tizen.NUI.BaseComponents return MarginProperty; } - /// - /// MarginProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty MarginProperty = null; +#else + public static readonly BindableProperty MarginProperty = null; +#endif /// /// UpdateAreaHintProperty @@ -2660,6 +2748,7 @@ namespace Tizen.NUI.BaseComponents return instance.InternalPositionUsesAnchorPoint; }); + // AnchorPointProperty internal static void SetInternalAnchorPointProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Tizen.NUI.BaseComponents.View)bindable; @@ -2667,16 +2756,19 @@ namespace Tizen.NUI.BaseComponents { instance.InternalAnchorPoint = (Tizen.NUI.Position)newValue; } - } internal static object GetInternalAnchorPointProperty(BindableObject bindable) { var instance = (Tizen.NUI.BaseComponents.View)bindable; return instance.InternalAnchorPoint; - } + /// + /// AnchorPointProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] +#if REMOVE_READONLY internal static BindableProperty GetAnchorPointProperty() { if (AnchorPointProperty == null) @@ -2687,11 +2779,10 @@ namespace Tizen.NUI.BaseComponents return AnchorPointProperty; } - /// - /// AnchorPointProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty AnchorPointProperty = null; +#else + public static readonly BindableProperty AnchorPointProperty = null; +#endif /// /// WidthSpecificationProperty @@ -3010,11 +3101,9 @@ namespace Tizen.NUI.BaseComponents return new Size2D((int)userSizeWidth, (int)userSizeHeight); } - +#if REMOVE_READONLY internal static void CreateBindableProperties() { - Tizen.Log.Fatal("NT", $"CreateBindableProperties() START IsUsingXaml={NUIApplication.IsUsingXaml}"); - _ = GetBackgroundColorProperty(); _ = GetColorProperty(); _ = GetColorRedProperty(); @@ -3043,8 +3132,8 @@ namespace Tizen.NUI.BaseComponents _ = GetMaximumSizeProperty(); _ = GetMarginProperty(); _ = GetAnchorPointProperty(); - Tizen.Log.Fatal("NT", $"CreateBindableProperties() END"); } +#endif private void SetBackgroundImage(string value) { diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/DaliDemo/DaliDemo.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/DaliDemo/DaliDemo.cs index c9570f9..0e530c5 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/DaliDemo/DaliDemo.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/DaliDemo/DaliDemo.cs @@ -12,7 +12,6 @@ namespace Tizen.NUI.Samples { public DaliDemo(string styleSheet) : base(styleSheet) { - //DisableBindableProperty = true; } private IExample curExample = null; diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/DisableBindablePropertyTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/IsUsingXamlTest.cs similarity index 98% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/DisableBindablePropertyTest.cs rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/IsUsingXamlTest.cs index a85087c..21985cc 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/DisableBindablePropertyTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/IsUsingXamlTest.cs @@ -5,7 +5,7 @@ using Tizen.NUI.BaseComponents; namespace Tizen.NUI.Samples { using tlog = Tizen.Log; - public class DisableBindablePropertyTest : IExample + public class IsUsingXamlTest : IExample { private const int NUMBER_OF_VIEW = 300; private const int MIN_SIZE = 100;