class ComponentApplication : Application
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- private List<NUIFrameComponent> _frameComponentList;
internal ComponentApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- _frameComponentList = new List<NUIFrameComponent>();
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ComponentApplication obj)
return ret;
}
-
+
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate IntPtr NUIComponentApplicationCreatenativeEventCallbackDelegate(IntPtr data);
+ private delegate IntPtr NUIComponentApplicationCreatenativeEventCallbackDelegate();
- public delegate IntPtr CreateNativeEventHandler(IntPtr data);
- private CreateNativeEventHandler _applicationCreateNativeEventHandler;
+ public delegate IntPtr CreateNativeEventHandler();
+ private CreateNativeEventHandler _applicationCreateNativeEventHandler;
private NUIComponentApplicationCreatenativeEventCallbackDelegate _applicationCreateNativeEventCallbackDelegate;
-
+
/**
* @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
-
-
- // Callback for Application InitSignal
- private IntPtr OnApplicationCreateNative(IntPtr data)
- {
- IntPtr ptr = IntPtr.Zero;
-
- if (_applicationCreateNativeEventHandler != null)
- {
- ptr = _applicationCreateNativeEventHandler.Invoke(data);
- }
- return ptr;
- }
-
- internal void RegisterFrameComponent(NUIFrameComponent nuiFrameComponent)
+ // Callback for Application InitSignal
+ private IntPtr OnApplicationCreateNative()
{
- _frameComponentList.Add(nuiFrameComponent);
- }
+ IntPtr handle = IntPtr.Zero;
- internal int GetFrameComponentCount()
- {
- return _frameComponentList.Count;
- }
+ if (_applicationCreateNativeEventHandler != null)
+ {
+ handle = _applicationCreateNativeEventHandler.Invoke();
+ }
+ return handle;
+ }
}
/// <summary>
/// Callback for Component Application CreateSignal
/// </summary>
- /// <param name="data">user data</param>
- private IntPtr OnCreateNative(IntPtr data)
+ private IntPtr OnCreateNative()
{
IntPtr nativeComponentFactoryMap = IntPtr.Zero;
int n = 0;
nativeComponentFactoryMap = entry.Value.Bind(nativeComponentFactoryMap);
n++;
}
-
return nativeComponentFactoryMap;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class NUIFrameComponent : FrameComponent
{
+ private bool defaultWindowSet = false;
internal NUIWindowInfo NUIWindowInfo
{
get;
public override IWindowInfo CreateWindowInfo()
{
ComponentApplication instance = ComponentApplication.Instance as ComponentApplication;
- if(instance)
+ if (instance)
{
- instance.RegisterFrameComponent(this);
- if(instance.GetFrameComponentCount() == 1)
+ if (!defaultWindowSet)
{
- Window = instance.GetWindow();
- }
- else
- {
- Window = new Window();
+ instance.GetWindow().WindowPositionSize = new Rectangle(0, 0, 1, 1);
+ instance.GetWindow().BackgroundColor = new Color(0, 0, 0, 0);
+ instance.GetWindow().Hide();
+ defaultWindowSet = true;
}
+
+ Window = new Window();
+ Window.Show();
}
NUIWindowInfo = new NUIWindowInfo(Window);
return NUIWindowInfo;