Skip to content

Commit

Permalink
Revert "[NUI] Rebase from DevelNUI to main (#6597)"
Browse files Browse the repository at this point in the history
This reverts commit ae55a7e.
  • Loading branch information
bshsqa authored and hinohie committed Jan 21, 2025
1 parent ae55a7e commit 3064a9b
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 214 deletions.
2 changes: 1 addition & 1 deletion packaging/csapi-tizenfx.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Auto-generated from csapi-tizenfx.spec.in by makespec.sh

%define TIZEN_NET_API_VERSION 13
%define TIZEN_NET_RPM_VERSION 13.0.0.999+nui22402
%define TIZEN_NET_RPM_VERSION 13.0.0.999+nui22401
%define TIZEN_NET_NUGET_VERSION 13.0.0.99999

%define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
Expand Down
2 changes: 1 addition & 1 deletion packaging/version.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RPM_VERSION=13.0.0.999
NUGET_VERSION=13.0.0.99999

# RPM Version Suffix
RPM_VERSION_SUFFIX=nui22402
RPM_VERSION_SUFFIX=nui22401
Original file line number Diff line number Diff line change
Expand Up @@ -26,81 +26,81 @@ namespace Tizen.NUI
/// Defines a value type of view state.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public readonly struct UIState
public readonly struct ViewState
{
/// <summary>
/// The All state is used in a selector class. It represents all states, so if this state is defined in a selector, the other states are ignored.
/// </summary>
public static readonly UIState All = new (ControlStateUtility.FullMask);
public static readonly ViewState All = new (ControlStateUtility.FullMask);

/// <summary>
/// Normal State.
/// </summary>
public static readonly UIState Normal = new (0UL);
public static readonly ViewState Normal = new (0UL);

/// <summary>
/// Focused State.
/// </summary>
public static readonly UIState Focused = new (nameof(Focused));
public static readonly ViewState Focused = new (nameof(Focused));

/// <summary>
/// Pressed State.
/// </summary>
public static readonly UIState Pressed = new (nameof(Pressed));
public static readonly ViewState Pressed = new (nameof(Pressed));

/// <summary>
/// Disabled State.
/// </summary>
public static readonly UIState Disabled = new (nameof(Disabled));
public static readonly ViewState Disabled = new (nameof(Disabled));

/// <summary>
/// Selected State.
/// </summary>
public static readonly UIState Selected = new (nameof(Selected));
public static readonly ViewState Selected = new (nameof(Selected));

/// <summary>
/// Pressed caused by key state.
/// </summary>
public static readonly UIState PressedByKey = Pressed + new UIState(nameof(PressedByKey));
public static readonly ViewState PressedByKey = Pressed + new ViewState(nameof(PressedByKey));

/// <summary>
/// Pressed caused by touch state.
/// </summary>
public static readonly UIState PressedByTouch = Pressed + new UIState(nameof(PressedByTouch));
public static readonly ViewState PressedByTouch = Pressed + new ViewState(nameof(PressedByTouch));

/// <summary>
/// SelectedPressed State.
/// </summary>
public static readonly UIState SelectedPressed = Selected + Pressed;
public static readonly ViewState SelectedPressed = Selected + Pressed;

/// <summary>
/// DisabledSelected State.
/// </summary>
public static readonly UIState DisabledSelected = Disabled + Selected;
public static readonly ViewState DisabledSelected = Disabled + Selected;

/// <summary>
/// DisabledFocused State.
/// </summary>
public static readonly UIState DisabledFocused = Disabled + Focused;
public static readonly ViewState DisabledFocused = Disabled + Focused;

/// <summary>
/// SelectedFocused State.
/// </summary>
public static readonly UIState SelectedFocused = Selected + Focused;
public static readonly ViewState SelectedFocused = Selected + Focused;

/// <summary>
/// This is used in a selector class. It represents all other states except for states that are already defined in a selector.
/// </summary>
public static readonly UIState Other = new UIState(nameof(Other));
public static readonly ViewState Other = new ViewState(nameof(Other));

private readonly ulong bitFlags;

private UIState(ulong bitMask)
private ViewState(ulong bitMask)
{
bitFlags = bitMask;
}

private UIState(string name) : this(ControlStateUtility.Register(name))
private ViewState(string name) : this(ControlStateUtility.Register(name))
{
}

Expand All @@ -110,30 +110,30 @@ private UIState(string name) : this(ControlStateUtility.Register(name))
internal bool IsCombined => (bitFlags != 0UL) && ((bitFlags & (bitFlags - 1UL)) != 0UL);

/// <summary>
/// Create an instance of the <see cref="UIState"/> with state name.
/// Create an instance of the <see cref="ViewState"/> with state name.
/// </summary>
/// <param name="name">The state name.</param>
/// <returns>The <see cref="UIState"/> instance which has single state.</returns>
/// <returns>The <see cref="ViewState"/> instance which has single state.</returns>
/// <exception cref="ArgumentNullException">Thrown when the given name is null.</exception>
/// <exception cref="ArgumentException">Thrown when the given name is invalid.</exception>
public static UIState Create(string name)
public static ViewState Create(string name)
{
return new UIState(name);
return new ViewState(name);
}

/// <summary>
/// Determines whether a state contains a specified state.
/// </summary>
/// <param name="state">The state to search for</param>
/// <returns>true if the state contain a specified state, otherwise, false.</returns>
public bool Contains(UIState state) => (bitFlags & state.bitFlags) == state.bitFlags;
public bool Contains(ViewState state) => (bitFlags & state.bitFlags) == state.bitFlags;

/// <summary>
/// Checks if there is a intersection part between this and the other.
/// </summary>
/// <param name="other">The other state to check.</param>
/// <returns>True if an intersection exists, otherwise false.</returns>
public bool HasIntersectionWith(UIState other) => (bitFlags & other.bitFlags) != 0L;
public bool HasIntersectionWith(ViewState other) => (bitFlags & other.bitFlags) != 0L;

/// <inheritdoc/>
public override string ToString()
Expand Down Expand Up @@ -165,41 +165,41 @@ public override string ToString()
/// <summary>
/// Compares whether the two ControlStates are same or not.
/// </summary>
/// <param name="lhs">A <see cref="UIState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="UIState"/> on the right hand side.</param>
/// <param name="lhs">A <see cref="ViewState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="ViewState"/> on the right hand side.</param>
/// <returns>true if the ControlStates are equal; otherwise, false.</returns>
public static bool operator ==(UIState lhs, UIState rhs) => lhs.Equals(rhs);
public static bool operator ==(ViewState lhs, ViewState rhs) => lhs.Equals(rhs);

/// <summary>
/// Compares whether the two ControlStates are different or not.
/// </summary>
/// <param name="lhs">A <see cref="UIState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="UIState"/> on the right hand side.</param>
/// <param name="lhs">A <see cref="ViewState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="ViewState"/> on the right hand side.</param>
/// <returns>true if the ControlStates are not equal; otherwise, false.</returns>
public static bool operator !=(UIState lhs, UIState rhs) => !lhs.Equals(rhs);
public static bool operator !=(ViewState lhs, ViewState rhs) => !lhs.Equals(rhs);

/// <summary>
/// The addition operator.
/// </summary>
/// <param name="lhs">A <see cref="UIState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="UIState"/> on the right hand side.</param>
/// <returns>The <see cref="UIState"/> containing the result of the addition.</returns>
public static UIState operator +(UIState lhs, UIState rhs) => new (lhs.bitFlags | rhs.bitFlags);
/// <param name="lhs">A <see cref="ViewState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="ViewState"/> on the right hand side.</param>
/// <returns>The <see cref="ViewState"/> containing the result of the addition.</returns>
public static ViewState operator +(ViewState lhs, ViewState rhs) => new ViewState(lhs.bitFlags | rhs.bitFlags);

/// <summary>
/// The substraction operator.
/// </summary>
/// <param name="lhs">A <see cref="UIState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="UIState"/> on the right hand side.</param>
/// <returns>The <see cref="UIState"/> containing the result of the substraction.</returns>
public static UIState operator -(UIState lhs, UIState rhs) => new (lhs.bitFlags & ~(rhs.bitFlags));
/// <param name="lhs">A <see cref="ViewState"/> on the left hand side.</param>
/// <param name="rhs">A <see cref="ViewState"/> on the right hand side.</param>
/// <returns>The <see cref="ViewState"/> containing the result of the substraction.</returns>
public static ViewState operator -(ViewState lhs, ViewState rhs) => new ViewState(lhs.bitFlags & ~(rhs.bitFlags));

public bool Equals(UIState other) => bitFlags == other.bitFlags;
public bool Equals(ViewState other) => bitFlags == other.bitFlags;

/// <inheritdoc/>
public override bool Equals(object obj)
{
if (obj is UIState otherState)
if (obj is ViewState otherState)
{
return Equals(otherState);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,57 @@
*/
using System.ComponentModel;

namespace Tizen.NUI
namespace Tizen.NUI.L
{
/// <summary>
/// Defines a value type of color.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public struct UIColor
public struct Color
{
/// <summary>
/// The default color. (This is to distinguish from zero corners)
/// </summary>
public static readonly UIColor Default = new (-1, -1, -1, -1);
public static readonly Color Default = new (-1, -1, -1, -1);

/// <summary>
/// The transparent color.
/// </summary>
public static readonly UIColor Transparent = new (0, 0, 0, 0);
public static readonly Color Transparent = new (0, 0, 0, 0);

/// <summary>
/// The transparent color.
/// </summary>
public static readonly UIColor Black = new (0, 0, 0, 1);
public static readonly Color Black = new (0, 0, 0, 1);

/// <summary>
/// The white color.
/// </summary>
public static readonly UIColor White = new (1, 1, 1, 1);
public static readonly Color White = new (1, 1, 1, 1);

/// <summary>
/// The red color.
/// </summary>
public static readonly UIColor Red = new (1, 0, 0, 1);
public static readonly Color Red = new (1, 0, 0, 1);

/// <summary>
/// The green color.
/// </summary>
public static readonly UIColor Green = new (0, 1, 0, 1);
public static readonly Color Green = new (0, 1, 0, 1);

/// <summary>
/// The blue color.
/// </summary>
public static readonly UIColor Blue = new (0, 0, 1, 1);
public static readonly Color Blue = new (0, 0, 1, 1);

/// <summary>
/// Initializes a new instance of the <see cref="UIColor"/> struct.
/// Initializes a new instance of the <see cref="Color"/> struct.
/// </summary>
/// <param name="r">The red component.</param>
/// <param name="g">The green component.</param>
/// <param name="b">The blue component.</param>
/// <param name="a">The alpha component.</param>
public UIColor(float r, float g, float b, float a)
public Color(float r, float g, float b, float a)
{
R = r;
G = g;
Expand All @@ -75,25 +75,25 @@ public UIColor(float r, float g, float b, float a)
}

/// <summary>
/// Initializes a new instance of the <see cref="UIColor"/> struct.
/// Initializes a new instance of the <see cref="Color"/> struct.
/// </summary>
/// <param name="value">The value of 0xRRGGBB format.</param>
/// <param name="alpha">The alpha value between 0.0 and 1.0.</param>
/// <example>
/// <code>
/// new UIColor(0xFF0000, 1f); // Solid red
/// new UIColor(0x00FF00, 0.5f) // Half transparent green
/// new L.Color(0xFF0000, 1f); // Solid red
/// new L.Color(0x00FF00, 0.5f) // Half transparent green
/// </code>
/// </example>
public UIColor(uint value, float alpha)
public Color(uint value, float alpha)
{
R = ((value >> 16) & 0xff) / 255.0f;
G = ((value >> 8) & 0xff) / 255.0f;
B = (value & 0xff) / 255.0f;
A = alpha;
}

internal UIColor(NUI.Vector4 vector4) : this(vector4.X, vector4.Y, vector4.Z, vector4.W)
internal Color(NUI.Vector4 vector4) : this(vector4.X, vector4.Y, vector4.Z, vector4.W)
{
}

Expand Down Expand Up @@ -144,7 +144,7 @@ public float A
/// </summary>
/// <param name="alpha">The value to multiply the alpha component by.</param>
/// <returns>The new color.</returns>
public readonly UIColor MultiplyAlpha(float alpha) => new UIColor(R, G, B, A * alpha);
public readonly Color MultiplyAlpha(float alpha) => new Color(R, G, B, A * alpha);

/// <inheritdoc/>
public override string ToString() => $"R:{R}, G:{G}, B:{B}, A:{A}";
Expand All @@ -154,7 +154,7 @@ public float A
/// </summary>
/// <param name="alpha">The new alpha value.</param>
/// <returns>A new color object with the specified alpha value.</returns>
public readonly UIColor WithAlpha(float alpha) => new (R, G, B, alpha);
public readonly Color WithAlpha(float alpha) => new (R, G, B, alpha);

internal readonly NUI.Color ToReferenceType() => new NUI.Color(R, G, B, A);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,40 @@
*/
using System.ComponentModel;

namespace Tizen.NUI
namespace Tizen.NUI.L
{
/// <summary>
/// Defines a value type of corner radius.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public struct UICorner
public struct Corner
{
/// <summary>
/// The default corner. (This is to distinguish from zero corners)
/// </summary>
public static readonly UICorner Default = new (-1, -1, -1, -1);
public static readonly Corner Default = new (-1, -1, -1, -1);

/// <summary>
/// The zero corner.
/// </summary>
public static readonly UICorner Zero = new (0.0f, 0.0f, 0.0f, 0.0f);
public static readonly Corner Zero = new (0.0f, 0.0f, 0.0f, 0.0f);

/// <summary>
/// Initializes a new instance of the <see cref="UICorner"/> struct.
/// Initializes a new instance of the <see cref="Corner"/> struct.
/// </summary>
/// <param name="uniform">The uniform corner value.</param>
public UICorner(float uniform) : this(uniform, uniform, uniform, uniform)
public Corner(float uniform) : this(uniform, uniform, uniform, uniform)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="UICorner"/> struct.
/// Initializes a new instance of the <see cref="Corner"/> struct.
/// </summary>
/// <param name="topLeft">The top-left value.</param>
/// <param name="topRight">The top-right value.</param>
/// <param name="bottomRight">The bottom-right value.</param>
/// <param name="bottomLeft">The bottom-left value.</param>
public UICorner(float topLeft, float topRight, float bottomRight, float bottomLeft)
public Corner(float topLeft, float topRight, float bottomRight, float bottomLeft)
{
TopLeft = topLeft;
TopRight = topRight;
Expand Down
Loading

0 comments on commit 3064a9b

Please sign in to comment.