2 using System.Collections.Generic;
4 using System.Runtime.InteropServices;
8 class ComponentApplication : Application
10 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
12 internal ComponentApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
14 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
17 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ComponentApplication obj)
19 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
22 protected override void Dispose(DisposeTypes type)
29 //Release your own unmanaged resources here.
30 //You should not access any managed member here except static instance.
31 //because the execution order of Finalizes is non-deterministic.
32 if (swigCPtr.Handle != global::System.IntPtr.Zero)
37 Interop.ComponentApplication.delete_ComponentApplication(swigCPtr);
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
44 public static ComponentApplication NewComponentApplication(string[] args, string stylesheet)
46 ComponentApplication ret = New(args, stylesheet);
47 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 public static ComponentApplication New(string[] args, string stylesheet)
54 int argc = args.Length;
55 string argvStr = string.Join(" ", args);
57 IntPtr widgetIntPtr = Interop.ComponentApplication.ComponentApplication_New(argc, argvStr, stylesheet);
59 ComponentApplication ret = new ComponentApplication(widgetIntPtr, false);
61 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 internal ComponentApplication(ComponentApplication componentApplication) : this(Interop.ComponentApplication.new_ComponentApplication__SWIG_1(ComponentApplication.getCPtr(componentApplication)), true)
68 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
71 internal ComponentApplication Assign(ComponentApplication componentApplication)
73 ComponentApplication ret = new ComponentApplication(Interop.ComponentApplication.ComponentApplication_Assign(swigCPtr, ComponentApplication.getCPtr(componentApplication)), false);
74 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
80 private delegate IntPtr NUIComponentApplicationCreatenativeEventCallbackDelegate();
82 public delegate IntPtr CreateNativeEventHandler();
83 private CreateNativeEventHandler _applicationCreateNativeEventHandler;
84 private NUIComponentApplicationCreatenativeEventCallbackDelegate _applicationCreateNativeEventCallbackDelegate;
88 * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
89 * provided by the user. Initialized signal is emitted when application is initialised
91 public event CreateNativeEventHandler CreateNative
97 // Restricted to only one listener
98 if (_applicationCreateNativeEventHandler == null)
100 _applicationCreateNativeEventHandler += value;
102 _applicationCreateNativeEventCallbackDelegate = new NUIComponentApplicationCreatenativeEventCallbackDelegate(OnApplicationCreateNative);
103 Connect(_applicationCreateNativeEventCallbackDelegate);
112 if (_applicationCreateNativeEventHandler != null)
114 Disconnect(_applicationCreateNativeEventCallbackDelegate);
117 _applicationCreateNativeEventHandler -= value;
123 public void Connect(System.Delegate func)
125 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
127 Interop.ComponentApplication.ComponentApplication_CreateNativeSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
128 if (NDalicPINVOKE.SWIGPendingException.Pending)
130 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 public void Disconnect(System.Delegate func)
137 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
139 Interop.ComponentApplication.ComponentApplication_CreateNativeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
140 if (NDalicPINVOKE.SWIGPendingException.Pending)
142 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 internal ApplicationSignal CreateNativeSignal()
149 ApplicationSignal ret = new ApplicationSignal(Interop.ComponentApplication.ComponentApplication_CreateNativeSignal(swigCPtr), false);
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 // Callback for Application InitSignal
155 private IntPtr OnApplicationCreateNative()
157 IntPtr handle = IntPtr.Zero;
159 if (_applicationCreateNativeEventHandler != null)
161 handle = _applicationCreateNativeEventHandler.Invoke();