Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUI] Preload static values #6574

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading