private bool borderEnabled = false;
private IBorderInterface borderInterface = null;
+ private State currentState = State.Invalid;
+
/// <summary>
/// Xaml loaded delegate.
/// </summary>
[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())
{
+ currentState = State.Ready;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition))
{
+ currentState = State.Ready;
}
/// <summary>
[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))
{
+ currentState = State.Ready;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, WindowMode.Opaque, windowSize, windowPosition))
{
+ currentState = State.Ready;
}
/// <summary>
[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))
{
+ currentState = State.Ready;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition))
{
+ currentState = State.Ready;
}
/// <summary>
public NUIApplication(Graphics.BackendType backend, WindowMode windowMode = WindowMode.Opaque, Size2D windowSize = null, Position2D windowPosition = null, string styleSheet = "") : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition))
{
//windowMode and styleSheet will be added later. currently it's not working as expected.
+ currentState = State.Ready;
Graphics.Backend = backend;
Tizen.Log.Error("NUI", "Plaese DO NOT set graphical backend type with this constructor! This will give no effect!");
}
[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())
{
+ currentState = State.Ready;
ApplyThemeOption(option);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(Size2D windowSize, Position2D windowPosition, ThemeOptions option) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition))
{
+ currentState = State.Ready;
ApplyThemeOption(option);
}
[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))
{
+ currentState = State.Ready;
ExternalThemeManager.Initialize();
}
[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))
{
+ currentState = State.Ready;
EnableBorder(borderInterface);
}
[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())
{
+ currentState = State.Ready;
EnableBorder(borderInterface);
ApplyThemeOption(option);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(Size2D windowSize, Position2D windowPosition, ThemeOptions option, IBorderInterface borderInterface) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition))
{
+ currentState = State.Ready;
EnableBorder(borderInterface);
ApplyThemeOption(option);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(string styleSheet, WindowMode windowMode, CoreTask task) : base(new NUICoreBackend(styleSheet, windowMode), task)
{
+ currentState = State.Ready;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition, CoreTask task) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition), task)
{
+ currentState = State.Ready;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(ThemeOptions option, WindowData windowData) : base(new NUICoreBackend(windowData))
{
+ currentState = State.Ready;
if (windowData.BorderInterface != null)
{
EnableBorder(windowData.BorderInterface);
}
}
+
+ /// <summary>
+ /// Gets the state of current application.
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public State State
+ {
+ get
+ {
+ return currentState;
+ }
+ }
+
/// <summary>
/// Gets the default window.
/// </summary>
/// <since_tizen> 3 </since_tizen>
protected override void OnTerminate()
{
+ currentState = State.Terminated;
base.OnTerminate();
}
/// <since_tizen> 3 </since_tizen>
protected virtual void OnPause()
{
+ currentState = State.Paused;
Paused?.Invoke(this, EventArgs.Empty);
}
/// <since_tizen> 3 </since_tizen>
protected virtual void OnResume()
{
+ currentState = State.Resumed;
Resumed?.Invoke(this, EventArgs.Empty);
}
{
Tizen.Tracer.Begin("[NUI] OnPreCreate()");
+ currentState = State.PreCreated;
if (borderEnabled && GetDefaultWindow() != null)
{
GetDefaultWindow().EnableBorder(borderInterface, new Window.BorderCloseDelegate(Exit));
}
-
Tizen.Tracer.End();
}
protected override void OnCreate()
{
Tizen.Tracer.Begin("[NUI] OnCreate()");
+ currentState = State.Created;
base.OnCreate();
internal const string GlesCSharpBinder = NDalicPINVOKE.Lib;
internal const string VulkanCSharpBinder = "libdali-csharp-binder-vk.so";
}
+
+ /// <summary>
+ /// Enum of Application status
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum State
+ {
+ /// <summary>
+ /// Invalid
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Invalid = -1,
+ /// <summary>
+ /// Ready
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Ready,
+ /// <summary>
+ /// PreCreated
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ PreCreated,
+ /// <summary>
+ /// Created
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Created,
+ /// <summary>
+ /// Resumed
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Resumed,
+ /// <summary>
+ /// Paused
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Paused,
+ /// <summary>
+ /// Terminated
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Terminated
+ }
}