/*
- * Copyright(c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
-using System.Threading;
-using System.Threading.Tasks;
using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
namespace Tizen.NUI
{
- /**
- * @brief Event arguments that passed via NUIApplicationInit signal
- *
- */
+ // Event arguments that passed via NUIApplicationInit signal
internal class NUIApplicationInitEventArgs : EventArgs
{
- private Application _application;
+ private Application application;
- /**
- * @brief Application - is the application that is being initialized
- *
- */
+ // Application - is the application that is being initialized
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationTerminate signal
- *
- */
+ // Event arguments that passed via NUIApplicationTerminate signal
internal class NUIApplicationTerminatingEventArgs : EventArgs
{
- private Application _application;
- /**
- * @brief Application - is the application that is being Terminated
- *
- */
+ private Application application;
+
+ // Application - is the application that is being Terminated
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationPause signal
- *
- */
+ // Event arguments that passed via NUIApplicationPause signal
internal class NUIApplicationPausedEventArgs : EventArgs
{
- private Application _application;
- /**
- * @brief Application - is the application that is being Paused
- *
- */
+ private Application application;
+
+ // Application - is the application that is being Paused
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationResume signal
- *
- */
+ // Event arguments that passed via NUIApplicationResume signal
internal class NUIApplicationResumedEventArgs : EventArgs
{
- private Application _application;
- /**
- * @brief Application - is the application that is being Resumed
- *
- */
+ private Application application;
+ // Application - is the application that is being Resumed
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationReset signal
- *
- */
+ // Event arguments that passed via NUIApplicationReset signal
internal class NUIApplicationResetEventArgs : EventArgs
{
- private Application _application;
- /**
- * @brief Application - is the application that is being Reset
- *
- */
+ private Application application;
+
+ // Application - is the application that is being Reset
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
- *
- */
+ // Event arguments that passed via NUIApplicationLanguageChanged signal
internal class NUIApplicationLanguageChangedEventArgs : EventArgs
{
- private Application _application;
- /**
- * @brief Application - is the application that is being affected with Device's language change
- *
- */
+ private Application application;
+
+ // Application - is the application that is being affected with Device's language change
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationRegionChanged signal
- *
- */
+ // Event arguments that passed via NUIApplicationRegionChanged signal
internal class NUIApplicationRegionChangedEventArgs : EventArgs
{
- private Application _application;
- /**
- * @brief Application - is the application that is being affected with Device's region change
- *
- */
+ private Application application;
+
+ // Application - is the application that is being affected with Device's region change
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationBatteryLow signal
- *
- */
+ // Event arguments that passed via NUIApplicationBatteryLow signal
internal class NUIApplicationBatteryLowEventArgs : EventArgs
{
- private Application.BatteryStatus _status;
- /**
- * @brief Application - is the application that is being affected when the battery level of the device is low
- *
- */
+ private Application.BatteryStatus status;
+
+ // Application - is the application that is being affected when the battery level of the device is low
public Application.BatteryStatus BatteryStatus
{
get
{
- return _status;
+ return status;
}
set
{
- _status = value;
+ status = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationMemoryLow signal
- *
- */
+ // Event arguments that passed via NUIApplicationMemoryLow signal
internal class NUIApplicationMemoryLowEventArgs : EventArgs
{
- private Application.MemoryStatus _status;
- /**
- * @brief Application - is the application that is being affected when the memory level of the device is low
- *
- */
+ private Application.MemoryStatus status;
+
+ // Application - is the application that is being affected when the memory level of the device is low
public Application.MemoryStatus MemoryStatus
{
get
{
- return _status;
+ return status;
}
set
{
- _status = value;
+ status = value;
}
}
}
- /**
- * @brief Event arguments that passed via NUIApplicationAppControl signal
- *
- */
+ // Event arguments that passed via NUIApplicationDeviceOrientationChanged signal
+ internal class NUIApplicationDeviceOrientationChangedEventArgs : EventArgs
+ {
+ private Application.DeviceOrientationStatus status;
+
+ // Application - is the application that is being affected when the device orientation is changed.
+ public Application.DeviceOrientationStatus DeviceOrientationStatus
+ {
+ get
+ {
+ return status;
+ }
+ set
+ {
+ status = value;
+ }
+ }
+ }
+
+ // Event arguments that passed via NUIApplicationAppControl signal
internal class NUIApplicationAppControlEventArgs : EventArgs
{
- private Application _application;
- private IntPtr _voidp;
- /**
- * @brief Application - is the application that is receiving the launch request from another application
- *
- */
+ private Application application;
+ private IntPtr voidp;
+
+ // Application - is the application that is receiving the launch request from another application
public Application Application
{
get
{
- return _application;
+ return application;
}
set
{
- _application = value;
+ application = value;
}
}
- /**
- * @brief VoidP - contains the information about why the application is launched
- *
- */
+
+ // VoidP - contains the information about why the application is launched
public IntPtr VoidP
{
get
{
- return _voidp;
+ return voidp;
}
set
{
- _voidp = value;
+ voidp = value;
}
}
}
internal class Application : BaseHandle, IResourcesProvider, IElementConfiguration<Application>
{
-
static Application s_current;
- ReadOnlyCollection<Element> _logicalChildren;
+ ReadOnlyCollection<Element> logicalChildren;
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetCurrentApplication(Application value) => Current = value;
{
if (s_current == value)
return;
- if (value == null)
- s_current = null; //Allow to reset current for unittesting
s_current = value;
}
}
internal override ReadOnlyCollection<Element> LogicalChildrenInternal
{
- get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
+ get { return logicalChildren ?? (logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
}
internal IResourceDictionary SystemResources { get; }
ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
- ResourceDictionary _resources;
- public bool IsResourcesCreated => _resources != null;
+ ResourceDictionary resources;
+ public bool IsResourcesCreated => resources != null;
public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e);
- static private Dictionary<object, Dictionary<resChangeCb, int>> resourceChangeCallbackDict = new Dictionary<object, Dictionary<resChangeCb, int>>();
- static public void AddResourceChangedCallback(object handle, resChangeCb cb)
- {
- Dictionary<resChangeCb, int> cbDict;
- resourceChangeCallbackDict.TryGetValue(handle, out cbDict);
-
- if (null == cbDict)
- {
- cbDict = new Dictionary<resChangeCb, int>();
- resourceChangeCallbackDict.Add(handle, cbDict);
- }
-
- if (false == cbDict.ContainsKey(cb))
- {
- cbDict.Add(cb, 0);
- }
- }
-
internal override void OnResourcesChanged(object sender, ResourcesChangedEventArgs e)
{
base.OnResourcesChanged(sender, e);
-
- foreach (KeyValuePair<object, Dictionary<resChangeCb, int>> resourcePair in resourceChangeCallbackDict)
- {
- foreach (KeyValuePair<resChangeCb, int> cbPair in resourcePair.Value)
- {
- cbPair.Key(sender, e);
- }
- }
}
public ResourceDictionary XamlResources
{
get
{
- if (_resources != null)
- return _resources;
-
- _resources = new ResourceDictionary();
- int hashCode = _resources.GetHashCode();
- ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
- return _resources;
+ if (resources == null)
+ {
+ resources = new ResourceDictionary();
+ int hashCode = resources.GetHashCode();
+ ((IResourceDictionary)resources).ValuesChanged += OnResourcesChanged;
+ }
+ return resources;
}
set
{
- if (_resources == value)
+ if (resources == value)
return;
OnPropertyChanging();
- if (_resources != null)
- ((IResourceDictionary)_resources).ValuesChanged -= OnResourcesChanged;
- _resources = value;
+ if (resources != null)
+ ((IResourceDictionary)resources).ValuesChanged -= OnResourcesChanged;
+ resources = value;
OnResourcesChanged(value);
- if (_resources != null)
- ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
+ if (resources != null)
+ ((IResourceDictionary)resources).ValuesChanged += OnResourcesChanged;
OnPropertyChanged();
}
internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
{
+ if (values == null)
+ return;
+
if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
{
base.OnParentResourcesChanged(values);
if (innerKeys.Add(value.Key))
changedResources.Add(value);
}
- OnResourcesChanged(changedResources);
+ if (changedResources.Count != 0)
+ OnResourcesChanged(changedResources);
}
-
internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
SetCurrentApplication(this);
-
-
s_current = this;
}
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
- }
-
protected override void Dispose(DisposeTypes type)
{
if (disposed)
//Release your own unmanaged resources here.
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
-
- if (_applicationInitEventCallbackDelegate != null)
+ if (applicationInitEventCallbackDelegate != null)
{
- initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
+ initSignal?.Disconnect(applicationInitEventCallbackDelegate);
initSignal?.Dispose();
initSignal = null;
}
- if (_applicationTerminateEventCallbackDelegate != null)
+ if (applicationTerminateEventCallbackDelegate != null)
{
- terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
+ terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
terminateSignal?.Dispose();
terminateSignal = null;
}
- if (_applicationPauseEventCallbackDelegate != null)
+ if (applicationPauseEventCallbackDelegate != null)
{
- pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
+ pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
pauseSignal?.Dispose();
pauseSignal = null;
}
- if (_applicationResumeEventCallbackDelegate != null)
+ if (applicationResumeEventCallbackDelegate != null)
{
- resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
+ resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
resumeSignal?.Dispose();
resumeSignal = null;
}
- if (_applicationResetEventCallbackDelegate != null)
+ if (applicationResetEventCallbackDelegate != null)
{
- resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
+ resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
resetSignal?.Dispose();
resetSignal = null;
}
- if (_applicationLanguageChangedEventCallbackDelegate != null)
+ if (applicationLanguageChangedEventCallbackDelegate != null)
{
- languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
+ languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
languageChangedSignal?.Dispose();
languageChangedSignal = null;
}
- if (_applicationRegionChangedEventCallbackDelegate != null)
+ if (applicationRegionChangedEventCallbackDelegate != null)
{
- regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
+ regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
regionChangedSignal?.Dispose();
regionChangedSignal = null;
}
- if (_applicationBatteryLowEventCallbackDelegate != null)
+ if (applicationBatteryLowEventCallbackDelegate != null)
{
- batteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
+ batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
batteryLowSignal?.Dispose();
batteryLowSignal = null;
}
- if (_applicationMemoryLowEventCallbackDelegate != null)
+ if (applicationMemoryLowEventCallbackDelegate != null)
{
- memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
+ memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
memoryLowSignal?.Dispose();
memoryLowSignal = null;
}
- if (_applicationAppControlEventCallbackDelegate != null)
+ if (applicationDeviceOrientationChangedEventCallback != null)
+ {
+ deviceOrientationChangedSignal?.Disconnect(applicationDeviceOrientationChangedEventCallback);
+ deviceOrientationChangedSignal?.Dispose();
+ deviceOrientationChangedSignal = null;
+ }
+
+ if (applicationAppControlEventCallbackDelegate != null)
{
- appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
+ appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
appControlSignal?.Dispose();
appControlSignal = null;
}
- win?.Dispose();
- win = null;
+ //Task
+ if (applicationTaskInitEventCallbackDelegate != null)
+ {
+ taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
+ taskInitSignal?.Dispose();
+ taskInitSignal = null;
+ }
+
+ if (applicationTaskTerminateEventCallbackDelegate != null)
+ {
+ taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
+ taskTerminateSignal?.Dispose();
+ taskTerminateSignal = null;
+ }
+
+ if (applicationTaskLanguageChangedEventCallbackDelegate != null)
+ {
+ taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
+ taskLanguageChangedSignal?.Dispose();
+ taskLanguageChangedSignal = null;
+ }
+
+ if (applicationTaskRegionChangedEventCallbackDelegate != null)
+ {
+ taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
+ taskRegionChangedSignal?.Dispose();
+ taskRegionChangedSignal = null;
+ }
+
+ if (applicationTaskBatteryLowEventCallbackDelegate != null)
+ {
+ taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
+ taskBatteryLowSignal?.Dispose();
+ taskBatteryLowSignal = null;
+ }
+
+ if (applicationTaskMemoryLowEventCallbackDelegate != null)
+ {
+ taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
+ taskMemoryLowSignal?.Dispose();
+ taskMemoryLowSignal = null;
+ }
+
+ if (applicationTaskDeviceOrientationChangedEventCallback != null)
+ {
+ taskDeviceOrientationChangedSignal?.Disconnect(applicationTaskDeviceOrientationChangedEventCallback);
+ taskDeviceOrientationChangedSignal?.Dispose();
+ taskDeviceOrientationChangedSignal = null;
+ }
+
+ if (applicationTaskAppControlEventCallbackDelegate != null)
+ {
+ taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
+ taskAppControlSignal?.Dispose();
+ taskAppControlSignal = null;
+ }
+
+ window?.Dispose();
+ window = null;
base.Dispose(type);
}
CriticallyLow
};
+ public enum DeviceOrientationStatus
+ {
+ Orientation_0 = 0,
+ Orientation_90 = 90,
+ Orientation_180 = 180,
+ Orientation_270 = 270
+ };
+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object, NUIApplicationInitEventArgs> _applicationInitEventHandler;
- private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationInitEventArgs> applicationInitEventHandler;
+ private NUIApplicationInitEventCallbackDelegate applicationInitEventCallbackDelegate;
private ApplicationSignal initSignal;
-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> _applicationTerminateEventHandler;
- private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> applicationTerminateEventHandler;
+ private NUIApplicationTerminateEventCallbackDelegate applicationTerminateEventCallbackDelegate;
private ApplicationSignal terminateSignal;
-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object, NUIApplicationPausedEventArgs> _applicationPauseEventHandler;
- private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationPausedEventArgs> applicationPauseEventHandler;
+ private NUIApplicationPauseEventCallbackDelegate applicationPauseEventCallbackDelegate;
private ApplicationSignal pauseSignal;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object, NUIApplicationResumedEventArgs> _applicationResumeEventHandler;
- private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationResumedEventArgs> applicationResumeEventHandler;
+ private NUIApplicationResumeEventCallbackDelegate applicationResumeEventCallbackDelegate;
private ApplicationSignal resumeSignal;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object, NUIApplicationResetEventArgs> _applicationResetEventHandler;
- private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationResetEventArgs> applicationResetEventHandler;
+ private NUIApplicationResetEventCallbackDelegate applicationResetEventCallbackDelegate;
private ApplicationSignal resetSignal;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
- private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> applicationLanguageChangedEventHandler;
+ private NUIApplicationLanguageChangedEventCallbackDelegate applicationLanguageChangedEventCallbackDelegate;
private ApplicationSignal languageChangedSignal;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
- private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> applicationRegionChangedEventHandler;
+ private NUIApplicationRegionChangedEventCallbackDelegate applicationRegionChangedEventCallbackDelegate;
private ApplicationSignal regionChangedSignal;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status);
- private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
- private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> applicationBatteryLowEventHandler;
+ private NUIApplicationBatteryLowEventCallbackDelegate applicationBatteryLowEventCallbackDelegate;
private LowBatterySignalType batteryLowSignal;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status);
- private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
- private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> applicationMemoryLowEventHandler;
+ private NUIApplicationMemoryLowEventCallbackDelegate applicationMemoryLowEventCallbackDelegate;
private LowMemorySignalType memoryLowSignal;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void NUIApplicationDeviceOrientationChangedEventCallback(DeviceOrientationStatus status);
+ private DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> applicationDeviceOrientationChangedEventHandler;
+ private NUIApplicationDeviceOrientationChangedEventCallback applicationDeviceOrientationChangedEventCallback;
+ private DeviceOrientationChangedSignalType deviceOrientationChangedSignal;
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
- private DaliEventHandler<object, NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
- private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
+ private DaliEventHandler<object, NUIApplicationAppControlEventArgs> applicationAppControlEventHandler;
+ private NUIApplicationAppControlEventCallbackDelegate applicationAppControlEventCallbackDelegate;
private ApplicationControlSignal appControlSignal;
- private Window win;
+ private DaliEventHandler<object, NUIApplicationInitEventArgs> applicationTaskInitEventHandler;
+ private NUIApplicationInitEventCallbackDelegate applicationTaskInitEventCallbackDelegate;
+ private ApplicationSignal taskInitSignal;
- /**
- * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. Initialized signal is emitted when application is initialised
- */
+ private DaliEventHandler<object, NUIApplicationTerminatingEventArgs> applicationTaskTerminateEventHandler;
+ private NUIApplicationTerminateEventCallbackDelegate applicationTaskTerminateEventCallbackDelegate;
+ private ApplicationSignal taskTerminateSignal;
+
+ private DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> applicationTaskLanguageChangedEventHandler;
+ private NUIApplicationLanguageChangedEventCallbackDelegate applicationTaskLanguageChangedEventCallbackDelegate;
+ private ApplicationSignal taskLanguageChangedSignal;
+
+ private DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> applicationTaskRegionChangedEventHandler;
+ private NUIApplicationRegionChangedEventCallbackDelegate applicationTaskRegionChangedEventCallbackDelegate;
+ private ApplicationSignal taskRegionChangedSignal;
+
+ private DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> applicationTaskBatteryLowEventHandler;
+ private NUIApplicationBatteryLowEventCallbackDelegate applicationTaskBatteryLowEventCallbackDelegate;
+ private LowBatterySignalType taskBatteryLowSignal;
+
+ private DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> applicationTaskMemoryLowEventHandler;
+ private NUIApplicationMemoryLowEventCallbackDelegate applicationTaskMemoryLowEventCallbackDelegate;
+ private LowMemorySignalType taskMemoryLowSignal;
+
+ private DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> applicationTaskDeviceOrientationChangedEventHandler;
+ private NUIApplicationDeviceOrientationChangedEventCallback applicationTaskDeviceOrientationChangedEventCallback;
+ private DeviceOrientationChangedSignalType taskDeviceOrientationChangedSignal;
+
+ private DaliEventHandler<object, NUIApplicationAppControlEventArgs> applicationTaskAppControlEventHandler;
+ private NUIApplicationAppControlEventCallbackDelegate applicationTaskAppControlEventCallbackDelegate;
+ private ApplicationControlSignal taskAppControlSignal;
+
+ private Window window;
+
+ // Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. Initialized signal is emitted when application is initialized
public event DaliEventHandler<object, NUIApplicationInitEventArgs> Initialized
{
add
{
// Restricted to only one listener
- if (_applicationInitEventHandler == null)
+ if (applicationInitEventHandler == null)
{
- _applicationInitEventHandler += value;
- _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
+ applicationInitEventHandler += value;
+ applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
initSignal = this.InitSignal();
- initSignal?.Connect(_applicationInitEventCallbackDelegate);
+ initSignal?.Connect(applicationInitEventCallbackDelegate);
}
}
remove
{
- if (_applicationInitEventHandler != null)
+ if (applicationInitEventHandler != null)
{
- initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
+ initSignal?.Disconnect(applicationInitEventCallbackDelegate);
initSignal?.Dispose();
initSignal = null;
}
- _applicationInitEventHandler -= value;
+ applicationInitEventHandler -= value;
}
}
// Callback for Application InitSignal
private void OnApplicationInit(IntPtr data)
{
+ Log.Info("NUI", "[NUI] OnApplicationInit: DisposeQueue Initialize");
+ Tizen.Tracer.Begin("[NUI] OnApplicationInit: DisposeQueue Initialize");
// Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
DisposeQueue.Instance.Initialize();
-
+ Tizen.Tracer.End();
+
+ Log.Info("NUI", "[NUI] OnApplicationInit: GetWindow");
+ Tizen.Tracer.Begin("[NUI] OnApplicationInit: GetWindow");
+ Window.Instance = GetWindow();
+#if !PROFILE_TV
+ //tv profile never use default focus indicator, so this is not needed!
+ _ = FocusManager.Instance;
+#endif
+ Tizen.Tracer.End();
+
+ Log.Info("NUI", "[NUI] OnApplicationInit: Window Show");
+ Tizen.Tracer.Begin("[NUI] OnApplicationInit: Window Show");
// Notify that the window is displayed to the app core.
if (NUIApplication.IsPreload)
{
Window.Instance.Show();
}
+ Tizen.Tracer.End();
- if (_applicationInitEventHandler != null)
+ Log.Info("NUI", "[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
+ Tizen.Tracer.Begin("[NUI] OnApplicationInit: applicationInitEventHandler Invoke");
+ if (applicationInitEventHandler != null)
{
NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
e.Application = this;
- _applicationInitEventHandler.Invoke(this, e);
+ applicationInitEventHandler.Invoke(this, e);
}
-
+ Tizen.Tracer.End();
}
- /**
- * @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. Terminated signal is emitted when application is terminating
- */
+ // Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. Terminated signal is emitted when application is terminating
public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> Terminating
{
add
{
// Restricted to only one listener
- if (_applicationTerminateEventHandler == null)
+ if (applicationTerminateEventHandler == null)
{
- _applicationTerminateEventHandler += value;
+ applicationTerminateEventHandler += value;
- _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
+ applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
terminateSignal = this.TerminateSignal();
- terminateSignal?.Connect(_applicationTerminateEventCallbackDelegate);
+ terminateSignal?.Connect(applicationTerminateEventCallbackDelegate);
}
}
remove
{
- if (_applicationTerminateEventHandler != null)
+ if (applicationTerminateEventHandler != null)
{
- terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
+ terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate);
terminateSignal?.Dispose();
terminateSignal = null;
}
- _applicationTerminateEventHandler -= value;
+ applicationTerminateEventHandler -= value;
}
}
// Callback for Application TerminateSignal
private void OnNUIApplicationTerminate(IntPtr data)
{
- if (_applicationTerminateEventHandler != null)
+ if (applicationTerminateEventHandler != null)
{
NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
e.Application = this;
- _applicationTerminateEventHandler.Invoke(this, e);
+ applicationTerminateEventHandler.Invoke(this, e);
}
List<Window> windows = GetWindowList();
- foreach (Window window in windows)
+ if (windows != null)
{
- window?.DisconnectNativeSignals();
+ foreach (Window window in windows)
+ {
+ window?.DisconnectNativeSignals();
+ }
}
}
- /**
- * @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. Paused signal is emitted when application is paused
- */
+ // Event for Paused signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. Paused signal is emitted when application is paused
public event DaliEventHandler<object, NUIApplicationPausedEventArgs> Paused
{
add
{
// Restricted to only one listener
- if (_applicationPauseEventHandler == null)
+ if (applicationPauseEventHandler == null)
{
- _applicationPauseEventHandler += value;
+ applicationPauseEventHandler += value;
- _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
+ applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
pauseSignal = this.PauseSignal();
- pauseSignal?.Connect(_applicationPauseEventCallbackDelegate);
+ pauseSignal?.Connect(applicationPauseEventCallbackDelegate);
}
}
remove
{
- if (_applicationPauseEventHandler != null)
+ if (applicationPauseEventHandler != null)
{
- pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
+ pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate);
pauseSignal?.Dispose();
pauseSignal = null;
}
- _applicationPauseEventHandler -= value;
+ applicationPauseEventHandler -= value;
}
}
// Callback for Application PauseSignal
private void OnNUIApplicationPause(IntPtr data)
{
- if (_applicationPauseEventHandler != null)
+ if (applicationPauseEventHandler != null)
{
NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
e.Application = this;
- _applicationPauseEventHandler.Invoke(this, e);
+ applicationPauseEventHandler.Invoke(this, e);
}
}
- /**
- * @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. Resumed signal is emitted when application is resumed
- */
+ // Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. Resumed signal is emitted when application is resumed
public event DaliEventHandler<object, NUIApplicationResumedEventArgs> Resumed
{
add
{
// Restricted to only one listener
- if (_applicationResumeEventHandler == null)
+ if (applicationResumeEventHandler == null)
{
- _applicationResumeEventHandler += value;
+ applicationResumeEventHandler += value;
- _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
+ applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
resumeSignal = this.ResumeSignal();
- resumeSignal?.Connect(_applicationResumeEventCallbackDelegate);
+ resumeSignal?.Connect(applicationResumeEventCallbackDelegate);
}
}
remove
{
- if (_applicationResumeEventHandler != null)
+ if (applicationResumeEventHandler != null)
{
- resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
+ resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate);
resumeSignal?.Dispose();
resumeSignal = null;
}
- _applicationResumeEventHandler -= value;
+ applicationResumeEventHandler -= value;
}
}
// Callback for Application ResumeSignal
private void OnNUIApplicationResume(IntPtr data)
{
- if (_applicationResumeEventHandler != null)
+ if (applicationResumeEventHandler != null)
{
NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
e.Application = this;
- _applicationResumeEventHandler.Invoke(this, e);
+ applicationResumeEventHandler.Invoke(this, e);
}
}
- /**
- * @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. Reset signal is emitted when application is reset
- */
+ // Event for Reset signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. Reset signal is emitted when application is reset
public new event DaliEventHandler<object, NUIApplicationResetEventArgs> Reset
{
add
{
// Restricted to only one listener
- if (_applicationResetEventHandler == null)
+ if (applicationResetEventHandler == null)
{
- _applicationResetEventHandler += value;
+ applicationResetEventHandler += value;
- _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
+ applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
resetSignal = this.ResetSignal();
- resetSignal?.Connect(_applicationResetEventCallbackDelegate);
+ resetSignal?.Connect(applicationResetEventCallbackDelegate);
}
}
remove
{
- if (_applicationResetEventHandler != null)
+ if (applicationResetEventHandler != null)
{
- resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
+ resetSignal?.Disconnect(applicationResetEventCallbackDelegate);
resetSignal?.Dispose();
resetSignal = null;
}
- _applicationResetEventHandler -= value;
+ applicationResetEventHandler -= value;
}
}
// Callback for Application ResetSignal
private void OnNUIApplicationReset(IntPtr data)
{
- if (_applicationResetEventHandler != null)
+ if (applicationResetEventHandler != null)
{
NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
e.Application = this;
- _applicationResetEventHandler.Invoke(this, e);
+ applicationResetEventHandler.Invoke(this, e);
}
}
- /**
- * @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
- */
+ // Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> LanguageChanged
{
add
{
// Restricted to only one listener
- if (_applicationLanguageChangedEventHandler == null)
+ if (applicationLanguageChangedEventHandler == null)
{
- _applicationLanguageChangedEventHandler += value;
+ applicationLanguageChangedEventHandler += value;
- _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
+ applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
languageChangedSignal = this.LanguageChangedSignal();
- languageChangedSignal?.Connect(_applicationLanguageChangedEventCallbackDelegate);
+ languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate);
}
}
remove
{
- if (_applicationLanguageChangedEventHandler != null)
+ if (applicationLanguageChangedEventHandler != null)
{
- languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
+ languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate);
languageChangedSignal?.Dispose();
languageChangedSignal = null;
}
- _applicationLanguageChangedEventHandler -= value;
+ applicationLanguageChangedEventHandler -= value;
}
}
// Callback for Application LanguageChangedSignal
private void OnNUIApplicationLanguageChanged(IntPtr data)
{
- if (_applicationLanguageChangedEventHandler != null)
+ if (applicationLanguageChangedEventHandler != null)
{
NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
e.Application = this;
- _applicationLanguageChangedEventHandler.Invoke(this, e);
+ applicationLanguageChangedEventHandler.Invoke(this, e);
}
}
- /**
- * @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. RegionChanged signal is emitted when the region of the device is changed.
- */
+ // Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. RegionChanged signal is emitted when the region of the device is changed.
public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> RegionChanged
{
add
{
// Restricted to only one listener
- if (_applicationRegionChangedEventHandler == null)
+ if (applicationRegionChangedEventHandler == null)
{
- _applicationRegionChangedEventHandler += value;
+ applicationRegionChangedEventHandler += value;
- _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
+ applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
regionChangedSignal = this.RegionChangedSignal();
- regionChangedSignal?.Connect(_applicationRegionChangedEventCallbackDelegate);
+ regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate);
}
}
remove
{
- if (_applicationRegionChangedEventHandler != null)
+ if (applicationRegionChangedEventHandler != null)
{
- regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
+ regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate);
regionChangedSignal?.Dispose();
regionChangedSignal = null;
}
- _applicationRegionChangedEventHandler -= value;
+ applicationRegionChangedEventHandler -= value;
}
}
// Callback for Application RegionChangedSignal
private void OnNUIApplicationRegionChanged(IntPtr data)
{
- if (_applicationRegionChangedEventHandler != null)
+ if (applicationRegionChangedEventHandler != null)
{
NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
e.Application = this;
- _applicationRegionChangedEventHandler.Invoke(this, e);
+ applicationRegionChangedEventHandler.Invoke(this, e);
}
}
- /**
- * @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
- */
+ // Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> BatteryLow
{
add
{
// Restricted to only one listener
- if (_applicationBatteryLowEventHandler == null)
+ if (applicationBatteryLowEventHandler == null)
{
- _applicationBatteryLowEventHandler += value;
+ applicationBatteryLowEventHandler += value;
- _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
+ applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
batteryLowSignal = this.BatteryLowSignal();
- batteryLowSignal?.Connect(_applicationBatteryLowEventCallbackDelegate);
+ batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate);
}
}
remove
{
- if (_applicationBatteryLowEventHandler != null)
+ if (applicationBatteryLowEventHandler != null)
{
- batteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
+ batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate);
batteryLowSignal?.Dispose();
batteryLowSignal = null;
}
- _applicationBatteryLowEventHandler -= value;
+ applicationBatteryLowEventHandler -= value;
}
}
// Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
e.BatteryStatus = status;
- _applicationBatteryLowEventHandler?.Invoke(this, e);
+ applicationBatteryLowEventHandler?.Invoke(this, e);
}
- /**
- * @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
- */
+ // Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> MemoryLow
{
add
{
// Restricted to only one listener
- if (_applicationMemoryLowEventHandler == null)
+ if (applicationMemoryLowEventHandler == null)
{
- _applicationMemoryLowEventHandler += value;
+ applicationMemoryLowEventHandler += value;
- _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
+ applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
memoryLowSignal = this.MemoryLowSignal();
- memoryLowSignal?.Connect(_applicationMemoryLowEventCallbackDelegate);
+ memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate);
}
}
remove
{
- if (_applicationMemoryLowEventHandler != null)
+ if (applicationMemoryLowEventHandler != null)
{
- memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
+ memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate);
memoryLowSignal?.Dispose();
memoryLowSignal = null;
}
- _applicationMemoryLowEventHandler -= value;
+ applicationMemoryLowEventHandler -= value;
}
}
// Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
e.MemoryStatus = status;
- _applicationMemoryLowEventHandler?.Invoke(this, e);
+ applicationMemoryLowEventHandler?.Invoke(this, e);
}
- /**
- * @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
- * provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
- */
+ // Event for changing Device orientation signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. DeviceOrientationChanged signal is emitted when the device orientation is changed.
+ public event DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> DeviceOrientationChanged
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationDeviceOrientationChangedEventHandler == null)
+ {
+ applicationDeviceOrientationChangedEventHandler += value;
+
+ applicationDeviceOrientationChangedEventCallback = new NUIApplicationDeviceOrientationChangedEventCallback(OnNUIApplicationDeviceOrientationChanged);
+ deviceOrientationChangedSignal = this.DeviceOrientationChangedSignal();
+ deviceOrientationChangedSignal?.Connect(applicationDeviceOrientationChangedEventCallback);
+ }
+ }
+
+ remove
+ {
+ if (applicationDeviceOrientationChangedEventHandler != null)
+ {
+ deviceOrientationChangedSignal?.Disconnect(applicationDeviceOrientationChangedEventCallback);
+ deviceOrientationChangedSignal?.Dispose();
+ deviceOrientationChangedSignal = null;
+ }
+
+ applicationDeviceOrientationChangedEventHandler -= value;
+ }
+ }
+
+ // Callback for Application DeviceOrientationChangedSignal
+ private void OnNUIApplicationDeviceOrientationChanged(DeviceOrientationStatus status)
+ {
+ NUIApplicationDeviceOrientationChangedEventArgs e = new NUIApplicationDeviceOrientationChangedEventArgs();
+
+ e.DeviceOrientationStatus = status;
+ applicationDeviceOrientationChangedEventHandler?.Invoke(this, e);
+ }
+
+ // Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
+ // provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> AppControl
{
add
{
// Restricted to only one listener
- if (_applicationAppControlEventHandler == null)
+ if (applicationAppControlEventHandler == null)
{
- _applicationAppControlEventHandler += value;
+ applicationAppControlEventHandler += value;
- _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
+ applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
appControlSignal = this.AppControlSignal();
- appControlSignal?.Connect(_applicationAppControlEventCallbackDelegate);
+ appControlSignal?.Connect(applicationAppControlEventCallbackDelegate);
}
}
remove
{
- if (_applicationAppControlEventHandler != null)
+ if (applicationAppControlEventHandler != null)
{
- appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
+ appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate);
appControlSignal?.Dispose();
appControlSignal = null;
}
- _applicationAppControlEventHandler -= value;
+ applicationAppControlEventHandler -= value;
}
}
// Callback for Application AppControlSignal
private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
{
- if (_applicationAppControlEventHandler != null)
+ if (applicationAppControlEventHandler != null)
{
NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
e.VoidP = voidp;
e.Application = this;
- _applicationAppControlEventHandler.Invoke(this, e);
+ applicationAppControlEventHandler.Invoke(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. Initialized signal is emitted when application is initialized
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationInitEventArgs> TaskInitialized
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationTaskInitEventHandler == null)
+ {
+ Tizen.Log.Fatal("NUI", "TaskInitialized Property adding");
+ applicationTaskInitEventHandler += value;
+ applicationTaskInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationTaskInit);
+ taskInitSignal = this.TaskInitSignal();
+ taskInitSignal?.Connect(applicationTaskInitEventCallbackDelegate);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskInitEventHandler != null)
+ {
+ taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate);
+ taskInitSignal?.Dispose();
+ taskInitSignal = null;
+ }
+
+ applicationTaskInitEventHandler -= value;
+ }
+ }
+
+ private void OnApplicationTaskInit(IntPtr data)
+ {
+ if (applicationTaskInitEventHandler != null)
+ {
+ NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
+ e.Application = this;
+ applicationTaskInitEventHandler.Invoke(this, e);
+ }
+
+ }
+
+ /// <summary>
+ /// Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. Terminated signal is emitted when application is terminating
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationTerminatingEventArgs> TaskTerminating
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationTaskTerminateEventHandler == null)
+ {
+ applicationTaskTerminateEventHandler += value;
+
+ applicationTaskTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTaskTerminate);
+ taskTerminateSignal = this.TaskTerminateSignal();
+ taskTerminateSignal?.Connect(applicationTaskTerminateEventCallbackDelegate);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskTerminateEventHandler != null)
+ {
+ taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate);
+ taskTerminateSignal?.Dispose();
+ taskTerminateSignal = null;
+ }
+
+ applicationTaskTerminateEventHandler -= value;
+ }
+ }
+
+ private void OnNUIApplicationTaskTerminate(IntPtr data)
+ {
+ if (applicationTaskTerminateEventHandler != null)
+ {
+ NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
+ e.Application = this;
+ applicationTaskTerminateEventHandler.Invoke(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Event for TaskLanguageChanged signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. TaskLanguageChanged signal is emitted when the region of the device is changed.
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationLanguageChangedEventArgs> TaskLanguageChanged
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationTaskLanguageChangedEventHandler == null)
+ {
+ applicationTaskLanguageChangedEventHandler += value;
+
+ applicationTaskLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationTaskLanguageChanged);
+ taskLanguageChangedSignal = this.TaskLanguageChangedSignal();
+ taskLanguageChangedSignal?.Connect(applicationTaskLanguageChangedEventCallbackDelegate);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskLanguageChangedEventHandler != null)
+ {
+ taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate);
+ taskLanguageChangedSignal?.Dispose();
+ taskLanguageChangedSignal = null;
+ }
+
+ applicationTaskLanguageChangedEventHandler -= value;
+ }
+ }
+
+ private void OnNUIApplicationTaskLanguageChanged(IntPtr data)
+ {
+ if (applicationTaskLanguageChangedEventHandler != null)
+ {
+ NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
+ e.Application = this;
+ applicationTaskLanguageChangedEventHandler.Invoke(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Event for TaskRegionChanged signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. TaskRegionChanged signal is emitted when the region of the device is changed.
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationRegionChangedEventArgs> TaskRegionChanged
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationTaskRegionChangedEventHandler == null)
+ {
+ applicationTaskRegionChangedEventHandler += value;
+
+ applicationTaskRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationTaskRegionChanged);
+ taskRegionChangedSignal = this.TaskRegionChangedSignal();
+ taskRegionChangedSignal?.Connect(applicationTaskRegionChangedEventCallbackDelegate);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskRegionChangedEventHandler != null)
+ {
+ taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate);
+ taskRegionChangedSignal?.Dispose();
+ taskRegionChangedSignal = null;
+ }
+
+ applicationTaskRegionChangedEventHandler -= value;
}
}
- protected static Application _instance; // singleton
+ private void OnNUIApplicationTaskRegionChanged(IntPtr data)
+ {
+ if (applicationTaskRegionChangedEventHandler != null)
+ {
+ NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
+ e.Application = this;
+ applicationTaskRegionChangedEventHandler.Invoke(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Event for TaskBatteryLow signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. TaskBatteryLow signal is emitted when the battery level of the device is low.
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationBatteryLowEventArgs> TaskBatteryLow
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationTaskBatteryLowEventHandler == null)
+ {
+ applicationTaskBatteryLowEventHandler += value;
+
+ applicationTaskBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationTaskBatteryLow);
+ taskBatteryLowSignal = this.TaskBatteryLowSignal();
+ taskBatteryLowSignal?.Connect(applicationTaskBatteryLowEventCallbackDelegate);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskBatteryLowEventHandler != null)
+ {
+ taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate);
+ taskBatteryLowSignal?.Dispose();
+ taskBatteryLowSignal = null;
+ }
+
+ applicationTaskBatteryLowEventHandler -= value;
+ }
+ }
+
+ private void OnNUIApplicationTaskBatteryLow(BatteryStatus status)
+ {
+ NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
+
+ // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
+ e.BatteryStatus = status;
+ applicationTaskBatteryLowEventHandler?.Invoke(this, e);
+ }
+
+ /// <summary>
+ /// Event for TaskMemoryLow signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. TaskMemoryLow signal is emitted when the memory level of the device is low.
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationMemoryLowEventArgs> TaskMemoryLow
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationTaskMemoryLowEventHandler == null)
+ {
+ applicationTaskMemoryLowEventHandler += value;
+
+ applicationTaskMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationTaskMemoryLow);
+ taskMemoryLowSignal = this.TaskMemoryLowSignal();
+ taskMemoryLowSignal?.Connect(applicationTaskMemoryLowEventCallbackDelegate);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskMemoryLowEventHandler != null)
+ {
+ taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate);
+ taskMemoryLowSignal?.Dispose();
+ taskMemoryLowSignal = null;
+ }
+
+ applicationTaskMemoryLowEventHandler -= value;
+ }
+ }
+
+ private void OnNUIApplicationTaskMemoryLow(MemoryStatus status)
+ {
+ NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
+
+ // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
+ e.MemoryStatus = status;
+ applicationTaskMemoryLowEventHandler?.Invoke(this, e);
+ }
+
+ /// <summary>
+ /// Event for TaskDeviceOrientationChanged signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. TaskDeviceOrientationChanged signal is emitted when the device orientation is changed.
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationDeviceOrientationChangedEventArgs> TaskDeviceOrientationChanged
+ {
+ add
+ {
+ if (applicationTaskDeviceOrientationChangedEventHandler == null)
+ {
+ applicationTaskDeviceOrientationChangedEventHandler += value;
+
+ applicationTaskDeviceOrientationChangedEventCallback = new NUIApplicationDeviceOrientationChangedEventCallback(OnNUIApplicationTaskDeviceOrientationChanged);
+ taskDeviceOrientationChangedSignal = this.TaskDeviceOrientationChangedSignal();
+ taskDeviceOrientationChangedSignal?.Connect(applicationTaskDeviceOrientationChangedEventCallback);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskDeviceOrientationChangedEventHandler != null)
+ {
+ taskDeviceOrientationChangedSignal?.Disconnect(applicationTaskDeviceOrientationChangedEventCallback);
+ taskDeviceOrientationChangedSignal?.Dispose();
+ taskDeviceOrientationChangedSignal = null;
+ }
+
+ applicationTaskDeviceOrientationChangedEventHandler -= value;
+ }
+ }
+
+ private void OnNUIApplicationTaskDeviceOrientationChanged(DeviceOrientationStatus status)
+ {
+ NUIApplicationDeviceOrientationChangedEventArgs e = new NUIApplicationDeviceOrientationChangedEventArgs();
+
+ e.DeviceOrientationStatus = status;
+ applicationTaskDeviceOrientationChangedEventHandler?.Invoke(this, e);
+ }
+
+ /// <summary>
+ /// Event for TaskAppControl signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. TaskAppControl signal is emitted when another application sends a launch request to the application.
+ /// </summary>
+ public event DaliEventHandler<object, NUIApplicationAppControlEventArgs> TaskAppControl
+ {
+ add
+ {
+ // Restricted to only one listener
+ if (applicationTaskAppControlEventHandler == null)
+ {
+ applicationTaskAppControlEventHandler += value;
+
+ applicationTaskAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationTaskAppControl);
+ taskAppControlSignal = this.TaskAppControlSignal();
+ taskAppControlSignal?.Connect(applicationTaskAppControlEventCallbackDelegate);
+ }
+ }
+
+ remove
+ {
+ if (applicationTaskAppControlEventHandler != null)
+ {
+ taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate);
+ taskAppControlSignal?.Dispose();
+ taskAppControlSignal = null;
+ }
+
+ applicationTaskAppControlEventHandler -= value;
+ }
+ }
+
+ private void OnNUIApplicationTaskAppControl(IntPtr application, IntPtr voidp)
+ {
+ if (applicationTaskAppControlEventHandler != null)
+ {
+ NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
+ e.VoidP = voidp;
+ e.Application = this;
+ applicationTaskAppControlEventHandler.Invoke(this, e);
+ }
+ }
+
+ protected static Application instance; // singleton
public static Application Instance
{
get
{
- return _instance;
+ return instance;
}
}
public static Application NewApplication()
{
- return NewApplication("", Application.WindowMode.Opaque);
+ return NewApplication("", NUIApplication.WindowMode.Opaque);
}
public static Application NewApplication(string stylesheet)
{
- return NewApplication(stylesheet, Application.WindowMode.Opaque);
+ return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
}
- public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
+ public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
{
// register all Views with the type registry, so that can be created / styled via JSON
//ViewRegistryHelper.Initialize(); //moved to Application side.
- if (_instance)
+ if (instance != null)
{
- return _instance;
+ return instance;
}
Application ret = New(1, stylesheet, windowMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
// set the singleton
- _instance = ret;
+ instance = ret;
return ret;
}
- public static Application NewApplication(string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
- if (_instance)
+ if (instance != null)
{
- return _instance;
+ return instance;
}
Application ret = New(1, stylesheet, windowMode, positionSize);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
// set the singleton
- _instance = ret;
+ instance = ret;
return ret;
}
- public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
+ public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
{
- if (_instance)
+ if (instance != null)
{
- return _instance;
+ return instance;
}
- Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
+ Application ret = New(args, stylesheet, windowMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
// set the singleton
- _instance = ret;
- return _instance;
+ instance = ret;
+ return instance;
}
- public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
- if (_instance)
+ if (instance != null)
{
- return _instance;
+ return instance;
}
- Application ret = New(args, stylesheet, (Application.WindowMode)windowMode, positionSize);
+ Application ret = New(args, stylesheet, windowMode, positionSize);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
// set the singleton
- _instance = ret;
- return _instance;
+ instance = ret;
+ return instance;
+ }
+
+ public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
+ {
+ if (instance != null)
+ {
+ return instance;
+ }
+ Application ret = New(args, stylesheet, windowMode, type);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ instance = ret;
+ return instance;
+ }
+
+ public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
+ {
+ if (instance != null)
+ {
+ return instance;
+ }
+ Application ret = New(args, stylesheet, windowMode, positionSize, useUIThread);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ instance = ret;
+ return instance;
+ }
+
+ public static Application NewApplication(string[] args, string stylesheet, bool useUIThread, WindowData windowData)
+ {
+ if (instance != null)
+ {
+ return instance;
+ }
+ Application ret = New(args, stylesheet, useUIThread, windowData);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ instance = ret;
+ return instance;
}
/// <summary>
/// </summary>
/// <param name="func">The function to call</param>
/// <returns>true if added successfully, false otherwise</returns>
+ /// <remarks>
+ /// It will return false when one of the following conditions is met.
+ /// 1) the <see cref="Window"/> is hidden.
+ /// 2) the <see cref="Window"/> is iconified.
+ /// </remarks>
public bool AddIdle(System.Delegate func)
{
System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
return ret;
}
- public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
+ public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
{
Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
+ public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
{
Application ret = null;
int argc = 0;
}
catch (Exception exception)
{
- Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
+ Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
throw;
return ret;
}
- public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
Application ret = null;
int argc = 0;
}
catch (Exception exception)
{
- Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, msg : " + exception.Message);
+ Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
throw;
return ret;
}
+ public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
+ {
+ int argc = 0;
+ string argvStr = "";
+ try
+ {
+ argc = args.Length;
+ argvStr = string.Join(" ", args);
+ }
+ catch (Exception exception)
+ {
+ Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
+ Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
+ Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
+ throw;
+ }
+
+ // It will be removed until dali APIs are prepared.
+ Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
+
+ Application ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize, bool useUIThread)
+ {
+ Application ret = null;
+ int argc = 0;
+ string argvStr = "";
+ try
+ {
+ argc = args.Length;
+ argvStr = string.Join(" ", args);
+
+ ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize), useUIThread), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ catch (Exception exception)
+ {
+ Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
+ Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
+ Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
+ throw;
+ }
+
+ return ret;
+ }
+
+ public static Application New(string[] args, string stylesheet, bool useUIThread, WindowData windowData)
+ {
+ Application ret = null;
+ int argc = 0;
+ string argvStr = "";
+ try
+ {
+ argc = args.Length;
+ argvStr = string.Join(" ", args);
+
+ ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, useUIThread, WindowData.getCPtr(windowData)), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ catch (Exception exception)
+ {
+ Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
+ Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
+ Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
+ throw;
+ }
+
+ return ret;
+ }
+
public Application() : this(Interop.Application.NewApplication(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
public Window GetWindow()
{
- win = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindow(SwigCPtr)) as Window;
- if (win == null)
+ if (window != null)
{
- win = new Window(Interop.Application.GetWindow(SwigCPtr), true);
+ return window;
+ }
+
+ var nativeWindow = Interop.Application.GetWindow(SwigCPtr);
+ window = Registry.GetManagedBaseHandleFromNativePtr(nativeWindow) as Window;
+ if (window != null)
+ {
+ HandleRef CPtr = new HandleRef(this, nativeWindow);
+ Interop.BaseHandle.DeleteBaseHandle(CPtr);
+ CPtr = new HandleRef(null, IntPtr.Zero);
+ }
+ else
+ {
+ window = new Window(nativeWindow, true);
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return win;
+ return window;
}
public static string GetResourcePath()
return ret;
}
+ public void FlushUpdateMessages()
+ {
+ Interop.Application.FlushUpdateMessages(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
[EditorBrowsable(EditorBrowsableState.Never)]
public static List<Window> GetWindowList()
{
+ if (Interop.Stage.IsInstalled() == false)
+ {
+ NUILog.ErrorBacktrace($"[ERROR] dali adaptor and dali window is not ready. just return NULL here");
+ return null;
+ }
+
uint ListSize = Interop.Application.GetWindowsListSize();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
List<Window> WindowList = new List<Window>();
for (uint i = 0; i < ListSize; ++i)
{
- Window currWin = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindowsFromList(i)) as Window;
+ Window currWin = WindowList.GetInstanceSafely<Window>(Interop.Application.GetWindowsFromList(i));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if (currWin)
+ if (currWin != null)
{
WindowList.Add(currWin);
}
return ret;
}
- public enum WindowMode
+ internal DeviceOrientationChangedSignalType DeviceOrientationChangedSignal()
+ {
+ DeviceOrientationChangedSignalType ret = new DeviceOrientationChangedSignalType(NDalicPINVOKE.ApplicationDeviceOrientationChangedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ //Task
+ internal ApplicationSignal TaskInitSignal()
{
- Opaque = 0,
- Transparent = 1
+ ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskInitSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal ApplicationSignal TaskTerminateSignal()
+ {
+ ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskTerminateSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal ApplicationControlSignal TaskAppControlSignal()
+ {
+ ApplicationControlSignal ret = new ApplicationControlSignal(NDalicPINVOKE.ApplicationTaskAppControlSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal ApplicationSignal TaskLanguageChangedSignal()
+ {
+ ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskLanguageChangedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal ApplicationSignal TaskRegionChangedSignal()
+ {
+ ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.ApplicationTaskRegionChangedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal LowBatterySignalType TaskBatteryLowSignal()
+ {
+ LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.ApplicationTaskLowBatterySignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal LowMemorySignalType TaskMemoryLowSignal()
+ {
+ LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.ApplicationTaskLowMemorySignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal DeviceOrientationChangedSignalType TaskDeviceOrientationChangedSignal()
+ {
+ DeviceOrientationChangedSignalType ret = new DeviceOrientationChangedSignalType(NDalicPINVOKE.ApplicationTaskDeviceOrientationChangedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
}
}