sync with devel/master branch
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Tizen.NUI
28 {
29
30     using System;
31     using System.Runtime.InteropServices;
32     using Tizen.NUI.BaseComponents;
33
34     /// <summary>
35     /// The window class is used internally for drawing.<br>
36     /// A Window has an orientation and indicator properties.<br>
37     /// </summary>
38     public class Window : BaseHandle
39     {
40         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41         private global::System.Runtime.InteropServices.HandleRef stageCPtr;
42
43         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
44         {
45             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
46             stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
47         }
48
49         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
50         {
51             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52         }
53
54         /// <summary>
55         /// To make Window instance be disposed.
56         /// </summary>
57         protected override void Dispose(DisposeTypes type)
58         {
59             if(disposed)
60             {
61                 return;
62             }
63
64             if(type == DisposeTypes.Explicit)
65             {
66                 //Called by User
67                 //Release your own managed resources here.
68                 //You should release all of your own disposable objects here.
69             }
70
71             //Release your own unmanaged resources here.
72             //You should not access any managed member here except static instance.
73             //because the execution order of Finalizes is non-deterministic.
74
75             if (swigCPtr.Handle != global::System.IntPtr.Zero)
76             {
77                 if (swigCMemOwn)
78                 {
79                     swigCMemOwn = false;
80                     NDalicPINVOKE.delete_Window(swigCPtr);
81                     NDalicPINVOKE.delete_Stage(stageCPtr);
82                 }
83                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
84             }
85
86             base.Dispose(type);
87         }
88
89         internal static Window GetCurrent()
90         {
91             Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93             return ret;
94         }
95
96        internal static bool IsInstalled()
97        {
98             bool ret = NDalicPINVOKE.Stage_IsInstalled();
99             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100             return ret;
101        }
102
103         /// <summary>
104         /// Sets the focus acceptable flag of an window as true.
105         /// </summary>
106         public void SetAcceptFocus(bool accept)
107         {
108             NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
109             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110         }
111
112         /// <summary>
113         /// Retrieves whether the window is focus acceptable or not.
114         /// </summary>
115         public bool IsFocusAcceptable()
116         {
117             return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
118             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119         }
120
121         /// <summary>
122         /// Shows the window if it is hidden.
123         /// </summary>
124         public void Show()
125         {
126             NDalicPINVOKE.Show(swigCPtr);
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128         }
129
130         /// <summary>
131         /// Hides the window if it is showing.
132         /// </summary>
133         public void Hide()
134         {
135             NDalicPINVOKE.Hide(swigCPtr);
136             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137         }
138
139         /// <summary>
140         /// Retrieves whether the window is visible or not.
141         /// </summary>
142         /// <returns>true, if the windoe is visible</returns>
143         public bool IsVisible()
144         {
145             bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
146             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147             return temp;
148         }
149
150         /// <summary>
151         /// Gets the count of supported auxiliary hints of the window.
152         /// </summary>
153         /// <returns>The number of supported auxiliary hints.</returns>
154         public uint GetSupportedAuxiliaryHintCount() {
155             uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157             return ret;
158         }
159
160         /// <summary>
161         /// Gets the supported auxiliary hint string of the window.
162         /// </summary>
163         /// <param name="index">The index of the supported auxiliary hint lists.</param>
164         /// <returns>The auxiliary hint string of the index.</returns>
165         public string GetSupportedAuxiliaryHint(uint index) {
166             string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168             return ret;
169         }
170
171         /// <summary>
172         /// Creates an auxiliary hint of the window.
173         /// </summary>
174         /// <param name="hint">The auxiliary hint string.</param>
175         /// <param name="value">The value string.</param>
176         /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
177         public uint AddAuxiliaryHint(string hint, string value) {
178             uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
179             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180             return ret;
181         }
182
183         /// <summary>
184         /// Removes an auxiliary hint of the window.
185         /// </summary>
186         /// <param name="id">The ID of the auxiliary hint.</param>
187         /// <returns>True if no error occurred, false otherwise.</returns>
188         public bool RemoveAuxiliaryHint(uint id) {
189             bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
190             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191             return ret;
192         }
193
194         /// <summary>
195         /// Changes a value of the auxiliary hint.
196         /// </summary>
197         /// <param name="id">The auxiliary hint ID.</param>
198         /// <param name="value">The value string to be set.</param>
199         /// <returns>True if no error occurred, false otherwise.</returns>
200         public bool SetAuxiliaryHintValue(uint id, string value) {
201             bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
202             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203             return ret;
204         }
205
206         /// <summary>
207         /// Gets a value of the auxiliary hint.
208         /// </summary>
209         /// <param name="id">The auxiliary hint ID.</param>
210         /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
211         public string GetAuxiliaryHintValue(uint id) {
212             string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
213             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214             return ret;
215         }
216
217         /// <summary>
218         /// Gets an ID of the auxiliary hint string.
219         /// </summary>
220         /// <param name="hint">The auxiliary hint string.</param>
221         /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
222         public uint GetAuxiliaryHintId(string hint) {
223             uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
224             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225             return ret;
226         }
227
228         /// <summary>
229         /// Sets a region to accept input events.
230         /// </summary>
231         /// <param name="inputRegion">The region to accept input events.</param>
232         public void SetInputRegion(Rectangle inputRegion) {
233             NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
234             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235         }
236
237         /// <summary>
238         /// Gets/Sets a window type.
239         /// </summary>
240         public WindowType Type
241         {
242             get
243             {
244                 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
245                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246                 return ret;
247             }
248             set
249             {
250                 NDalicPINVOKE.SetType(swigCPtr, (int)value);
251                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252             }
253         }
254         // public void SetType(WindowType type) {
255             
256         // }
257
258         // public WindowType GetType() {
259         //     WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
260         //     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261         //     return ret;
262         // }
263
264         /// <summary>
265         /// Sets a priority level for the specified notification window.
266         /// </summary>
267         /// <param name="level">The notification window level.</param>
268         /// <returns>True if no error occurred, false otherwise.</returns>
269         public bool SetNotificationLevel(NotificationLevel level) {
270             bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
271             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272             return ret;
273         }
274
275         /// <summary>
276         /// Gets a priority level for the specified notification window.
277         /// </summary>
278         /// <returns>The notification window level.</returns>
279         public NotificationLevel GetNotificationLevel() {
280             NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
281             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282             return ret;
283         }
284
285         /// <summary>
286         /// Sets a transparent window's visual state to opaque.
287         /// </summary>
288         /// <param name="opaque">Whether the window's visual state is opaque.</param>
289         public void SetOpaqueState(bool opaque) {
290             NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
291             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292         }
293
294         /// <summary>
295         /// Returns whether a transparent window's visual state is opaque or not.
296         /// </summary>
297         /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
298         public bool IsOpaqueState() {
299             bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
300             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301             return ret;
302         }
303
304         /// <summary>
305         /// Sets a window's screen mode.
306         /// </summary>
307         /// <param name="screenMode">The screen mode.</param>
308         /// <returns>True if no error occurred, false otherwise.</returns>
309         public bool SetScreenMode(ScreenMode screenMode) {
310             bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode);
311             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312             return ret;
313         }
314
315         /// <summary>
316         /// Gets a screen mode of the window.
317         /// </summary>
318         /// <returns>The screen mode.</returns>
319         public ScreenMode GetScreenMode() {
320             ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr);
321             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
322             return ret;
323         }
324
325         /// <summary>
326         /// Sets preferred brightness of the window.
327         /// </summary>
328         /// <param name="brightness">The preferred brightness (0 to 100).</param>
329         /// <returns>True if no error occurred, false otherwise.</returns>
330         public bool SetBrightness(int brightness) {
331             bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
332             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333             return ret;
334         }
335
336         /// <summary>
337         /// Gets preffered brightness of the window.
338         /// </summary>
339         /// <returns>The preffered brightness.</returns>
340         public int GetBrightness() {
341             int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
342             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343             return ret;
344         }
345
346         public class WindowFocusChangedEventArgs : EventArgs
347         {
348             public bool FocusGained
349             {
350                 get;
351                 set;
352             }
353         }
354
355         private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
356         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
357         private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
358         private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
359
360         public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
361         {
362             add
363             {
364                 if (_windowFocusChangedEventHandler == null)
365                 {
366                     _windowFocusChangedEventCallback = OnWindowFocusedChanged;
367                     WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
368                 }
369
370                 _windowFocusChangedEventHandler += value;
371             }
372             remove
373             {
374                 _windowFocusChangedEventHandler -= value;
375
376                 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
377                 {
378                     WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
379                 }
380             }
381         }
382
383         private void OnWindowFocusedChanged(bool focusGained)
384         {
385             WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
386
387             e.FocusGained = focusGained;
388
389             if (_windowFocusChangedEventHandler != null)
390             {
391                 _windowFocusChangedEventHandler(this, e);
392             }
393         }
394
395         internal WindowFocusSignalType WindowFocusChangedSignal()
396         {
397             WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
398             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399             return ret;
400         }
401
402
403
404         /// <summary>
405         /// Creates an initialized handle to a new Window.
406         /// </summary>
407         /// <param name="windowPosition">The position and size of the Window</param>
408         /// <param name="name">The Window title</param>
409         /// <param name="isTransparent">Whether Window is transparent</param>
410         public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
411         {
412             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413
414         }
415
416         /// <summary>
417         /// Creates an initialized handle to a new Window.
418         /// </summary>
419         /// <param name="windowPosition">The position and size of the Window</param>
420         /// <param name="name">The Window title</param>
421         public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
422         {
423             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424
425         }
426
427         /// <summary>
428         /// Creates an initialized handle to a new Window.
429         /// </summary>
430         /// <param name="windowPosition">The position and size of the Window</param>
431         /// <param name="name">The Window title</param>
432         /// <param name="className">The Window class name</param>
433         /// <param name="isTransparent">Whether Window is transparent</param>
434         public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
435         {
436             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437
438         }
439
440         /// <summary>
441         /// Creates an initialized handle to a new Window.
442         /// </summary>
443         /// <param name="windowPosition">The position and size of the Window</param>
444         /// <param name="name">The Window title</param>
445         /// <param name="className">The Window class name</param>
446         public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
447         {
448             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449
450         }
451         internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true)
452         {
453             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454         }
455
456         internal Window Assign(Window rhs)
457         {
458             Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
459             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
460             return ret;
461         }
462
463         /// <summary>
464         /// This sets whether the indicator bar should be shown or not.
465         /// </summary>
466         /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param>
467         internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
468         {
469             NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
470             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
471         }
472
473         /// <summary>
474         /// This sets the opacity mode of indicator bar.
475         /// </summary>
476         /// <param name="opacity">The opacity mode</param>
477         internal void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity)
478         {
479             NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
480             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
481         }
482
483         /// <summary>
484         /// This sets the orientation of indicator bar.<br>
485         /// It does not implicitly show the indicator if it is currently hidden.<br>
486         /// </summary>
487         /// <param name="orientation">The orientation</param>
488         internal void RotateIndicator(Window.WindowOrientation orientation)
489         {
490             NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
491             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492         }
493
494         internal void SetClass(string name, string klass)
495         {
496             NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
497             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498         }
499
500         /// <summary>
501         /// Raises window to the top of Window stack.
502         /// </summary>
503         public void Raise()
504         {
505             NDalicPINVOKE.Window_Raise(swigCPtr);
506             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507         }
508
509         /// <summary>
510         /// Lowers window to the bottom of Window stack.
511         /// </summary>
512         public void Lower()
513         {
514             NDalicPINVOKE.Window_Lower(swigCPtr);
515             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516         }
517
518         /// <summary>
519         /// Activates window to the top of Window stack even it is iconified.
520         /// </summary>
521         public void Activate()
522         {
523             NDalicPINVOKE.Window_Activate(swigCPtr);
524             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525         }
526
527         internal void AddAvailableOrientation(Window.WindowOrientation orientation)
528         {
529             NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
530             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531         }
532
533         internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
534         {
535             NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
536             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
537         }
538
539         internal void SetPreferredOrientation(Window.WindowOrientation orientation)
540         {
541             NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
542             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543         }
544
545         internal Window.WindowOrientation GetPreferredOrientation()
546         {
547             Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
548             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549             return ret;
550         }
551
552         internal DragAndDropDetector GetDragAndDropDetector()
553         {
554             DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
555             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
556             return ret;
557         }
558
559         internal Any GetNativeHandle()
560         {
561             Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
562             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
563             return ret;
564         }
565
566         internal WindowFocusSignalType FocusChangedSignal()
567         {
568             WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
569             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
570             return ret;
571         }
572
573         /// <summary>
574         /// Get default ( root ) layer.
575         /// </summary>
576         /// <returns>The root layer</returns>
577         public Layer GetDefaultLayer()
578         {
579             return this.GetRootLayer();
580         }
581
582         /// <summary>
583         /// Add layer to the Stage.
584         /// </summary>
585         /// <param name="layer">Layer to add</param>
586         public void AddLayer(Layer layer)
587         {
588             NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
589             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590         }
591
592         /// <summary>
593         /// Remove layer from the Stage.
594         /// </summary>
595         /// <param name="layer">Layer to remove</param>
596         public void RemoveLayer(Layer layer)
597         {
598             NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
599             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600         }
601
602         internal void Add(View view)
603         {
604             NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
605             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606         }
607
608         internal void Remove(View view)
609         {
610             NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
611             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
612         }
613
614         internal Vector2 GetSize()
615         {
616             Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
617             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
618             return ret;
619         }
620
621         internal RenderTaskList GetRenderTaskList()
622         {
623             RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
624             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625             return ret;
626         }
627
628         /// <summary>
629         /// Queries the number of on-window layers.
630         /// </summary>
631         /// <returns>The number of layers.</returns>
632         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
633         public uint GetLayerCount()
634         {
635             uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
636             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
637             return ret;
638         }
639
640         public Layer GetLayer(uint depth)
641         {
642             Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
643             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
644             return ret;
645         }
646
647         internal Layer GetRootLayer()
648         {
649             Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
650             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651             return ret;
652         }
653
654         internal void SetBackgroundColor(Vector4 color)
655         {
656             NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
657             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658         }
659
660         internal Vector4 GetBackgroundColor()
661         {
662             Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
663             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
664             return ret;
665         }
666
667         internal Vector2 GetDpi()
668         {
669             Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
670             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671             return ret;
672         }
673
674         internal ObjectRegistry GetObjectRegistry()
675         {
676             ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
677             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
678             return ret;
679         }
680
681         /// <summary>
682         /// Keep rendering for at least the given amount of time.
683         /// </summary>
684         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame</param>
685         public void KeepRendering(float durationSeconds)
686         {
687             NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
688             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
689         }
690
691         internal KeyEventSignal KeyEventSignal()
692         {
693             KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
694             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
695             return ret;
696         }
697
698         internal VoidSignal EventProcessingFinishedSignal()
699         {
700             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
701             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702             return ret;
703         }
704
705         internal TouchSignal TouchSignal()
706         {
707             TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
708             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
709             return ret;
710         }
711
712         private StageWheelSignal WheelEventSignal()
713         {
714             StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
715             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
716             return ret;
717         }
718
719         internal VoidSignal ContextLostSignal()
720         {
721             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
722             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
723             return ret;
724         }
725
726         internal VoidSignal ContextRegainedSignal()
727         {
728             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
729             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
730             return ret;
731         }
732
733         internal VoidSignal SceneCreatedSignal()
734         {
735             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
736             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
737             return ret;
738         }
739
740         internal static Vector4 DEFAULT_BACKGROUND_COLOR
741         {
742             get
743             {
744                 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
745                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
746                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
747                 return ret;
748             }
749         }
750
751         internal static Vector4 DEBUG_BACKGROUND_COLOR
752         {
753             get
754             {
755                 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
756                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
757                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758                 return ret;
759             }
760         }
761
762         private static readonly Window instance = Application.Instance.GetWindow();
763
764         /// <summary>
765         /// Stage instance property (read-only).<br>
766         /// Gets the current Window.<br>
767         /// </summary>
768         public static Window Instance
769         {
770             get
771             {
772                 return instance;
773             }
774         }
775
776         /// <summary>
777         /// Grabs the key specified by a key for a window only when a window is the topmost window. <br>
778         /// This function can be used for following example scenarios: <br>
779         /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
780         /// </summary>
781         /// <param name="DaliKey">The key code to grab</param>
782         /// <returns>true if the grab succeeds</returns>
783         public bool GrabKeyTopmost(int DaliKey)
784         {
785             bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
786             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787             return ret;
788         }
789
790         /// <summary>
791         /// Ungrabs the key specified by a key for a window. <br>
792         /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.<br>
793         /// </summary>
794         /// <param name="DaliKey">The key code to ungrab</param>
795         /// <returns>true if the ungrab succeeds</returns>
796         public bool UngrabKeyTopmost(int DaliKey)
797         {
798             bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
799             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
800             return ret;
801         }
802         /// <summary>
803         ///  Grabs the key specified by a key for a window in a GrabMode. <br>
804         ///  Details: This function can be used for following example scenarios: <br>
805         ///  - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br>
806         ///  - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app. <br>
807         ///  - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
808         /// </summary>
809         /// <param name="DaliKey">The key code to grab</param>
810         /// <param name="GrabMode">The grab mode for the key</param>
811         /// <returns>true if the grab succeeds</returns>
812         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
813         {
814             bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
815             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
816             return ret;
817         }
818         /// <summary>
819         /// Ungrabs the key specified by a key for a window.  <br>
820         /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br>
821         /// </summary>
822         /// <param name="DaliKey">The key code to ungrab</param>
823         /// <returns>true if the ungrab succeeds</returns>
824         public bool UngrabKey(int DaliKey)
825         {
826             bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
827             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
828             return ret;
829         }
830         internal System.IntPtr GetNativeWindowHandler()
831         {
832             System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
833             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
834             return ret;
835         }
836
837
838
839         /// <summary>
840         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
841         /// </summary>
842         public enum WindowOrientation
843         {
844             Portrait = 0,
845             Landscape = 90,
846             PortraitInverse = 180,
847             LandscapeInverse = 270
848         }
849
850         /// <summary>
851         /// Enumeration for key grab mode for platform-level APIs.
852         /// </summary>
853         public enum KeyGrabMode
854         {
855             /// <summary>
856             /// Grab a key only when on the top of the grabbing-window stack mode.
857             /// </summary>
858             Topmost = 0,
859             /// <summary>
860             /// Grab a key together with the other client window(s) mode.
861             /// </summary>
862             Shared,
863             /// <summary>
864             /// Grab a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode.
865             /// </summary>
866             OverrideExclusive,
867             /// <summary>
868             /// Grab a key exclusively regardless of the grabbing-window's position on the window stack mode.
869             /// </summary>
870             Exclusive
871         };
872
873         /// <summary>
874         /// Enumeration for opacity of the indicator.
875         /// </summary>
876         internal enum IndicatorBgOpacity
877         {
878             Opaque = 100,
879             Translucent = 50,
880             Transparent = 0
881         }
882
883         /// <summary>
884         /// Enumeration for visible mode of the indicator.
885         /// </summary>
886         internal enum IndicatorVisibleMode
887         {
888             Invisible = 0,
889             Visible = 1,
890             Auto = 2
891         }
892
893         /// <summary>
894         /// Touch event argument.
895         /// </summary>
896         public class TouchEventArgs : EventArgs
897         {
898             private Touch _touch;
899
900             /// <summary>
901             /// Touch.
902             /// </summary>
903             public Touch Touch
904             {
905                 get
906                 {
907                     return _touch;
908                 }
909                 set
910                 {
911                     _touch = value;
912                 }
913             }
914         }
915
916         private event EventHandler<TouchEventArgs> _stageTouchHandler;
917         private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
918
919         /// <summary>
920         /// This is emitted when the screen is touched and when the touch ends.<br>
921         /// If there are multiple touch points, then this will be emitted when the first touch occurs and
922         /// then when the last finger is lifted.<br>
923         /// An interrupted event will also be emitted (if it occurs).<br>
924         /// </summary>
925         public event EventHandler<TouchEventArgs> TouchEvent
926         {
927             add
928             {
929                 lock (this)
930                 {
931                     _stageTouchHandler += value;
932                     _stageTouchCallbackDelegate = OnStageTouch;
933                     this.TouchSignal().Connect(_stageTouchCallbackDelegate);
934                 }
935             }
936             remove
937             {
938                 lock (this)
939                 {
940                     if (_stageTouchHandler != null)
941                     {
942                         this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
943                     }
944                     _stageTouchHandler -= value;
945                 }
946             }
947         }
948
949         private void OnStageTouch(IntPtr data)
950         {
951             TouchEventArgs e = new TouchEventArgs();
952
953             if (data != null)
954             {
955                 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
956             }
957
958             if (_stageTouchHandler != null)
959             {
960                 _stageTouchHandler(this, e);
961             }
962         }
963
964         /// <summary>
965         /// Wheel event arguments.
966         /// </summary>
967         public class WheelEventArgs : EventArgs
968         {
969             private Wheel _wheel;
970
971             /// <summary>
972             /// Wheel.
973             /// </summary>
974             public Wheel Wheel
975             {
976                 get
977                 {
978                     return _wheel;
979                 }
980                 set
981                 {
982                     _wheel = value;
983                 }
984             }
985         }
986
987         private event EventHandler<WheelEventArgs> _stageWheelHandler;
988         private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
989
990         /// <summary>
991         /// Event emitted when wheel event is received.
992         /// </summary>
993         public event EventHandler<WheelEventArgs> WheelEvent
994         {
995             add
996             {
997                 if (_stageWheelHandler == null)
998                 {
999                     _stageWheelCallbackDelegate = OnStageWheel;
1000                     WheelEventSignal().Connect(_stageWheelCallbackDelegate);
1001                 }
1002                 _stageWheelHandler += value;
1003             }
1004             remove
1005             {
1006                 _stageWheelHandler -= value;
1007                 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
1008                 {
1009                     WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
1010                 }
1011             }
1012         }
1013
1014         private void OnStageWheel(IntPtr data)
1015         {
1016             WheelEventArgs e = new WheelEventArgs();
1017
1018             if (data != null)
1019             {
1020                 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1021             }
1022
1023             if (_stageWheelHandler != null)
1024             {
1025                 _stageWheelHandler(this, e);
1026             }
1027         }
1028
1029         /// <summary>
1030         /// Key event arguments.
1031         /// </summary>
1032         public class KeyEventArgs : EventArgs
1033         {
1034             private Key _key;
1035
1036             /// <summary>
1037             /// Key
1038             /// </summary>
1039             public Key Key
1040             {
1041                 get
1042                 {
1043                     return _key;
1044                 }
1045                 set
1046                 {
1047                     _key = value;
1048                 }
1049             }
1050         }
1051
1052         private event EventHandler<KeyEventArgs> _stageKeyHandler;
1053         private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1054
1055         /// <summary>
1056         /// Event emitted when key event is received.
1057         /// </summary>
1058         public event EventHandler<KeyEventArgs> KeyEvent
1059         {
1060             add
1061             {
1062                 if (_stageKeyHandler == null)
1063                 {
1064                     _stageKeyCallbackDelegate = OnStageKey;
1065                     KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1066                 }
1067                 _stageKeyHandler += value;
1068             }
1069             remove
1070             {
1071                 _stageKeyHandler -= value;
1072                 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1073                 {
1074                     KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1075                 }
1076             }
1077         }
1078
1079         // Callback for Stage KeyEventsignal
1080         private void OnStageKey(IntPtr data)
1081         {
1082             KeyEventArgs e = new KeyEventArgs();
1083
1084             if (data != null)
1085             {
1086                 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1087             }
1088
1089             if (_stageKeyHandler != null)
1090             {
1091                 //here we send all data to user event handlers
1092                 _stageKeyHandler(this, e);
1093             }
1094         }
1095
1096
1097         private event EventHandler _stageEventProcessingFinishedEventHandler;
1098         private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1099
1100         internal event EventHandler EventProcessingFinished
1101         {
1102             add
1103             {
1104                 if (_stageEventProcessingFinishedEventHandler == null)
1105                 {
1106                     _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1107                     EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1108                 }
1109                 _stageEventProcessingFinishedEventHandler += value;
1110
1111             }
1112             remove
1113             {
1114                 _stageEventProcessingFinishedEventHandler -= value;
1115                 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1116                 {
1117                     EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1118                 }
1119             }
1120         }
1121
1122         // Callback for Stage EventProcessingFinishedSignal
1123         private void OnEventProcessingFinished()
1124         {
1125             if (_stageEventProcessingFinishedEventHandler != null)
1126             {
1127                 _stageEventProcessingFinishedEventHandler(this, null);
1128             }
1129         }
1130
1131
1132         private EventHandler _stageContextLostEventHandler;
1133         private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1134
1135         internal event EventHandler ContextLost
1136         {
1137             add
1138             {
1139                 if (_stageContextLostEventHandler == null)
1140                 {
1141                     _stageContextLostEventCallbackDelegate = OnContextLost;
1142                     ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1143                 }
1144                 _stageContextLostEventHandler += value;
1145             }
1146             remove
1147             {
1148                 _stageContextLostEventHandler -= value;
1149                 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1150                 {
1151                     ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1152                 }
1153             }
1154         }
1155
1156         // Callback for Stage ContextLostSignal
1157         private void OnContextLost()
1158         {
1159             if (_stageContextLostEventHandler != null)
1160             {
1161                 _stageContextLostEventHandler(this, null);
1162             }
1163         }
1164
1165
1166         private EventHandler _stageContextRegainedEventHandler;
1167         private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1168
1169         internal event EventHandler ContextRegained
1170         {
1171             add
1172             {
1173                 if (_stageContextRegainedEventHandler == null)
1174                 {
1175                     _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1176                     ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1177                 }
1178                 _stageContextRegainedEventHandler += value;
1179             }
1180             remove
1181             {
1182                 _stageContextRegainedEventHandler -= value;
1183                 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1184                 {
1185                     this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1186                 }
1187             }
1188         }
1189
1190         // Callback for Stage ContextRegainedSignal
1191         private void OnContextRegained()
1192         {
1193             if (_stageContextRegainedEventHandler != null)
1194             {
1195                 _stageContextRegainedEventHandler(this, null);
1196             }
1197         }
1198
1199
1200         private EventHandler _stageSceneCreatedEventHandler;
1201         private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1202
1203         internal event EventHandler SceneCreated
1204         {
1205             add
1206             {
1207                 if (_stageSceneCreatedEventHandler == null)
1208                 {
1209                     _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1210                     SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1211                 }
1212                 _stageSceneCreatedEventHandler += value;
1213             }
1214             remove
1215             {
1216                 _stageSceneCreatedEventHandler -= value;
1217                 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1218                 {
1219                     SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1220                 }
1221             }
1222         }
1223
1224         // Callback for Stage SceneCreatedSignal
1225         private void OnSceneCreated()
1226         {
1227             if (_stageSceneCreatedEventHandler != null)
1228             {
1229                 _stageSceneCreatedEventHandler(this, null);
1230             }
1231         }
1232
1233         /// <summary>
1234         /// Window size property (read-only).
1235         /// </summary>
1236         public Vector2 Size
1237         {
1238             get
1239             {
1240                 Vector2 ret = GetSize();
1241                 return ret;
1242             }
1243         }
1244
1245         /// <summary>
1246         /// Background color property.
1247         /// </summary>
1248         public Vector4 BackgroundColor
1249         {
1250             set
1251             {
1252                 SetBackgroundColor(value);
1253             }
1254             get
1255             {
1256                 Vector4 ret = GetBackgroundColor();
1257                 return ret;
1258             }
1259         }
1260
1261         /// <summary>
1262         /// Dpi property (read-only).<br>
1263         /// Retrieves the DPI of the display device to which the Window is connected.<br>
1264         /// </summary>
1265         public Vector2 Dpi
1266         {
1267             get
1268             {
1269                 return GetDpi();
1270             }
1271         }
1272
1273         /// <summary>
1274         /// Layer count property (read-only).<br>
1275         /// Queries the number of on-Window layers.<br>
1276         /// </summary>
1277         public uint LayerCount
1278         {
1279             get
1280             {
1281                 return GetLayerCount();
1282             }
1283         }
1284     }
1285 }