Skip to content

Commit

Permalink
[NUI] Preload static values
Browse files Browse the repository at this point in the history
  • Loading branch information
Woochan Lee authored and lwc0917 committed Jan 13, 2025
1 parent 3cdf4ea commit f9daacc
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Tizen.NUI/src/public/Application/NUIApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ static public void Preload()
BaseComponents.TextField.Preload();
Disposable.Preload();
Color.Preload();
NUIConstants.Preload();

// Initialize exception tasks. It must be called end of Preload()
NDalicPINVOKE.Preload();
Expand Down
29 changes: 29 additions & 0 deletions src/Tizen.NUI/src/public/Common/NUIConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,11 @@ public struct ParentOrigin
private static readonly Position bottomCenter = new Position(Middle, Bottom, Middle);
private static readonly Position bottomRight = new Position(Right, Bottom, Middle);

internal static void Preload()
{
// Do nothing. Just call for load static values.
}

/// <summary>
/// Top
/// </summary>
Expand Down Expand Up @@ -1522,6 +1527,11 @@ public struct PositionAxis
private static readonly Position negativeYaxis = new Position(0.0f, -1.0f, 0.0f);
private static readonly Position negativeZaxis = new Position(0.0f, 0.0f, -1.0f);

internal static void Preload()
{
// Do nothing. Jsut call for load static values.
}

/// <summary>
/// The X axis
/// </summary>
Expand Down Expand Up @@ -1909,6 +1919,11 @@ public struct SlideTransitionDirection
private static readonly Vector2 left = new Vector2(-1, 0);
private static readonly Vector2 right = new Vector2(1, 0);

internal static void Preload()
{
// Do nothing. Just call for load static values.
}

/// <summary>
/// Top
/// </summary>
Expand Down Expand Up @@ -1958,4 +1973,18 @@ public enum WindowBlurType
[EditorBrowsable(EditorBrowsableState.Never)]
Behind = 2,
}

internal struct NUIConstants
{
internal static void Preload()
{
ParentOrigin.Preload();
SlideTransitionDirection.Preload();
PositionAxis.Preload();
Position.Preload();
Vector2.Preload();
Vector3.Preload();
Vector4.Preload();
}
}
}
5 changes: 5 additions & 0 deletions src/Tizen.NUI/src/public/Common/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public class Position : Disposable, ICloneable
private static readonly Position one = new Position(1.0f, 1.0f, 1.0f);
private static readonly Position zero = new Position(0.0f, 0.0f, 0.0f);

internal static new void Preload()
{
// Do nothing. Just call for load static values.
}

/// <summary>
/// The constructor.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Tizen.NUI/src/public/Common/Vector2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public class Vector2 : Disposable, ICloneable
private static readonly Vector2 negativeXaxis = new Vector2(-1.0f, 0.0f);
private static readonly Vector2 negativeYaxis = new Vector2(0.0f, -1.0f);

internal static new void Preload()
{
// Do nothing. Just call for load static values.
}

/// <summary>
/// The default constructor initializes the vector to 0.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Tizen.NUI/src/public/Common/Vector3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public class Vector3 : Disposable, ICloneable
private static readonly Vector3 negativeYaxis = new Vector3(0.0f, -1.0f, 0.0f);
private static readonly Vector3 negativeZaxis = new Vector3(0.0f, 0.0f, -1.0f);

internal static new void Preload()
{
// Do nothing. Just call for load static values.
}

/// <summary>
/// The default constructor of Vector3 class.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Tizen.NUI/src/public/Common/Vector4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class Vector4 : Disposable, ICloneable
private static readonly Vector4 yaxis = new Vector4(0.0f, 1.0f, 0.0f, 0.0f);
private static readonly Vector4 zaxis = new Vector4(0.0f, 0.0f, 1.0f, 0.0f);

internal static new void Preload()
{
// Do nothing. Just call for load static values.
}

/// <summary>
/// The default constructor initializes the vector to 0.
/// </summary>
Expand Down

0 comments on commit f9daacc

Please sign in to comment.