[NUI] Sync with dalihub & API5 branch (#631)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
1 /*
2  * Copyright(c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.Runtime.InteropServices;
19 using Tizen.NUI.BaseComponents;
20 using System.ComponentModel;
21 using System.Collections.Generic;
22
23 namespace Tizen.NUI
24 {
25     /// <summary>
26     /// The window class is used internally for drawing.<br />
27     /// The window has an orientation and indicator properties.<br />
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public class Window : BaseHandle
31     {
32         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33         private global::System.Runtime.InteropServices.HandleRef stageCPtr;
34         private readonly global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr;
35         private Layer _rootLayer;
36         private string _windowTitle;
37         private readonly LayoutItem rootLayoutItem;
38
39         private List<Layer> _childLayers = new List<Layer>();
40         private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
41         private RootLayerTouchDataCallbackType _rootLayerTouchDataCallback;
42         private WheelEventCallbackType _wheelEventCallback;
43         private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
44         private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
45         private EventHandler _stageContextLostEventHandler;
46         private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
47         private EventHandler _stageContextRegainedEventHandler;
48         private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
49         private EventHandler _stageSceneCreatedEventHandler;
50         private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
51         private WindowResizedEventCallbackType _windowResizedEventCallback;
52         private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
53
54         private static readonly Window instance = Application.Instance.GetWindow();
55
56         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
57         {
58             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
59             if (NDalicPINVOKE.Stage_IsInstalled())
60             {
61                 global::System.IntPtr rootLayoutIntPtr;
62                 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
63                 // Create a root layout (AbsoluteLayout) that is invisible to the user but enables layouts added to the Window
64                 // Enables layouts added to the Window to have a parent layout.  As parent layout is needed to store measure spec properties.
65                 // Currently without these measure specs the new layout added will always be the size of the window.
66                 rootLayoutIntPtr = NDalicManualPINVOKE.Window_NewRootLayout();
67                 // Store HandleRef used by Add()
68                 rootLayoutCPtr = new global::System.Runtime.InteropServices.HandleRef(this, rootLayoutIntPtr);
69                 Layer rootLayer = GetRootLayer();
70                 // Add the root layout created above to the root layer.
71                 NDalicPINVOKE.Actor_Add(  Layer.getCPtr(rootLayer), rootLayoutCPtr );
72                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73
74                 global::System.IntPtr rootControlLayoutIntPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(rootLayoutCPtr);
75                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76
77                 rootLayoutItem = new LayoutItem(rootControlLayoutIntPtr, true);
78             }
79         }
80
81         internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
82         {
83             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84         }
85
86         internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
87         {
88             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89         }
90
91         internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
92         {
93             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94         }
95
96         internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
97         {
98             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99         }
100
101         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
102         private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
103         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
104         private delegate bool RootLayerTouchDataCallbackType(IntPtr view, IntPtr touchData);
105         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
106         private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
107         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
108         private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
109         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
110         private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
111
112         /// <summary>
113         /// FocusChanged event.
114         /// </summary>
115         /// <since_tizen> 3 </since_tizen>
116         public event EventHandler<FocusChangedEventArgs> FocusChanged
117         {
118             add
119             {
120                 if (_windowFocusChangedEventHandler == null)
121                 {
122                     _windowFocusChangedEventCallback = OnWindowFocusedChanged;
123                     WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
124                 }
125
126                 _windowFocusChangedEventHandler += value;
127             }
128             remove
129             {
130                 _windowFocusChangedEventHandler -= value;
131
132                 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
133                 {
134                     WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
135                 }
136             }
137         }
138
139         /// <summary>
140         /// This event is emitted when the screen is touched and when the touch ends.<br />
141         /// If there are multiple touch points, then this will be emitted when the first touch occurs and
142         /// then when the last finger is lifted.<br />
143         /// An interrupted event will also be emitted (if it occurs).<br />
144         /// </summary>
145         /// <since_tizen> 3 </since_tizen>
146         public event EventHandler<TouchEventArgs> TouchEvent
147         {
148             add
149             {
150                 if (_rootLayerTouchDataEventHandler == null)
151                 {
152                     _rootLayerTouchDataCallback = OnWindowTouch;
153                     this.TouchDataSignal().Connect(_rootLayerTouchDataCallback);
154                 }
155                 _rootLayerTouchDataEventHandler += value;
156             }
157             remove
158             {
159                 _rootLayerTouchDataEventHandler -= value;
160                 if (_rootLayerTouchDataEventHandler == null && TouchSignal().Empty() == false)
161                 {
162                     this.TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
163                 }
164             }
165         }
166
167         /// <summary>
168         /// This event is emitted when the wheel event is received.
169         /// </summary>
170         /// <since_tizen> 3 </since_tizen>
171         public event EventHandler<WheelEventArgs> WheelEvent
172         {
173             add
174             {
175                 if (_stageWheelHandler == null)
176                 {
177                     _wheelEventCallback = OnStageWheel;
178                     this.StageWheelEventSignal().Connect(_wheelEventCallback);
179                 }
180                 _stageWheelHandler += value;
181             }
182             remove
183             {
184                 _stageWheelHandler -= value;
185                 if (_stageWheelHandler == null && StageWheelEventSignal().Empty() == false)
186                 {
187                     this.StageWheelEventSignal().Disconnect(_wheelEventCallback);
188                 }
189             }
190         }
191
192         /// <summary>
193         /// This event is emitted when the key event is received.
194         /// </summary>
195         /// <since_tizen> 3 </since_tizen>
196         public event EventHandler<KeyEventArgs> KeyEvent
197         {
198             add
199             {
200                 if (_stageKeyHandler == null)
201                 {
202                     _stageKeyCallbackDelegate = OnStageKey;
203                     KeyEventSignal().Connect(_stageKeyCallbackDelegate);
204                 }
205                 _stageKeyHandler += value;
206             }
207             remove
208             {
209                 _stageKeyHandler -= value;
210                 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
211                 {
212                     KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
213                 }
214             }
215         }
216
217         /// <summary>
218         /// This event is emitted when the window resized.
219         /// </summary>
220         /// <since_tizen> 3 </since_tizen>
221         public event EventHandler<ResizedEventArgs> Resized
222         {
223             add
224             {
225                 if (_windowResizedEventHandler == null)
226                 {
227                     _windowResizedEventCallback = OnResized;
228                     ResizedSignal().Connect(_windowResizedEventCallback);
229                 }
230
231                 _windowResizedEventHandler += value;
232             }
233             remove
234             {
235                 _windowResizedEventHandler -= value;
236
237                 if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
238                 {
239                     ResizedSignal().Disconnect(_windowResizedEventCallback);
240                 }
241             }
242         }
243
244         /// <summary>
245         /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
246         /// </summary>
247         /// <since_tizen> 3 </since_tizen>
248         /// Please do not use! this will be deprecated!
249         /// Instead please use FocusChanged.
250         [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " +
251             "Like: " +
252             "Window.Instance.FocusChanged = OnFocusChanged; " +
253             "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
254         [EditorBrowsable(EditorBrowsableState.Never)]
255         public event EventHandler<FocusChangedEventArgs> WindowFocusChanged
256         {
257             add
258             {
259                 if (_windowFocusChangedEventHandler2 == null)
260                 {
261                     _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
262                     WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
263                 }
264
265                 _windowFocusChangedEventHandler2 += value;
266             }
267             remove
268             {
269                 _windowFocusChangedEventHandler2 -= value;
270
271                 if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
272                 {
273                     WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
274                 }
275             }
276         }
277
278         internal event EventHandler EventProcessingFinished
279         {
280             add
281             {
282                 if (_stageEventProcessingFinishedEventHandler == null)
283                 {
284                     _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
285                     EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
286                 }
287                 _stageEventProcessingFinishedEventHandler += value;
288
289             }
290             remove
291             {
292                 _stageEventProcessingFinishedEventHandler -= value;
293                 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
294                 {
295                     EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
296                 }
297             }
298         }
299
300         internal event EventHandler ContextLost
301         {
302             add
303             {
304                 if (_stageContextLostEventHandler == null)
305                 {
306                     _stageContextLostEventCallbackDelegate = OnContextLost;
307                     ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
308                 }
309                 _stageContextLostEventHandler += value;
310             }
311             remove
312             {
313                 _stageContextLostEventHandler -= value;
314                 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
315                 {
316                     ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
317                 }
318             }
319         }
320
321         internal event EventHandler ContextRegained
322         {
323             add
324             {
325                 if (_stageContextRegainedEventHandler == null)
326                 {
327                     _stageContextRegainedEventCallbackDelegate = OnContextRegained;
328                     ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
329                 }
330                 _stageContextRegainedEventHandler += value;
331             }
332             remove
333             {
334                 _stageContextRegainedEventHandler -= value;
335                 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
336                 {
337                     this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
338                 }
339             }
340         }
341
342         internal event EventHandler SceneCreated
343         {
344             add
345             {
346                 if (_stageSceneCreatedEventHandler == null)
347                 {
348                     _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
349                     SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
350                 }
351                 _stageSceneCreatedEventHandler += value;
352             }
353             remove
354             {
355                 _stageSceneCreatedEventHandler -= value;
356                 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
357                 {
358                     SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
359                 }
360             }
361         }
362
363         private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
364         private event EventHandler<TouchEventArgs> _rootLayerTouchDataEventHandler;
365         private event EventHandler<WheelEventArgs> _stageWheelHandler;
366         private event EventHandler<KeyEventArgs> _stageKeyHandler;
367         private event EventHandler _stageEventProcessingFinishedEventHandler;
368         private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
369         private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler2;
370
371         /// <summary>
372         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
373         /// </summary>
374         /// <since_tizen> 3 </since_tizen>
375         public enum WindowOrientation
376         {
377             /// <summary>
378             /// Portrait orientation. The height of the display area is greater than the width.
379             /// </summary>
380             /// <since_tizen> 3 </since_tizen>
381             Portrait = 0,
382             /// <summary>
383             /// Landscape orientation. A wide view area is needed.
384             /// </summary>
385             /// <since_tizen> 3 </since_tizen>
386             Landscape = 90,
387             /// <summary>
388             /// Portrait inverse orientation.
389             /// </summary>
390             /// <since_tizen> 3 </since_tizen>
391             PortraitInverse = 180,
392             /// <summary>
393             /// Landscape inverse orientation.
394             /// </summary>
395             /// <since_tizen> 3 </since_tizen>
396             LandscapeInverse = 270
397         }
398
399         /// <summary>
400         /// Enumeration for the key grab mode for platform-level APIs.
401         /// </summary>
402         /// <since_tizen> 3 </since_tizen>
403         public enum KeyGrabMode
404         {
405             /// <summary>
406             /// Grabs a key only when on the top of the grabbing-window stack mode.
407             /// </summary>
408             Topmost = 0,
409             /// <summary>
410             /// Grabs a key together with the other client window(s) mode.
411             /// </summary>
412             Shared,
413             /// <summary>
414             /// Grabs 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.
415             /// </summary>
416             OverrideExclusive,
417             /// <summary>
418             /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
419             /// </summary>
420             Exclusive
421         };
422
423         /// <summary>
424         /// Enumeration for opacity of the indicator.
425         /// </summary>
426         internal enum IndicatorBackgroundOpacity
427         {
428             Opaque = 100,
429             Translucent = 50,
430             Transparent = 0
431         }
432
433         /// <summary>
434         /// Enumeration for visible mode of the indicator.
435         /// </summary>
436         internal enum IndicatorVisibleMode
437         {
438             Invisible = 0,
439             Visible = 1,
440             Auto = 2
441         }
442
443         /// <summary>
444         /// The stage instance property (read-only).<br />
445         /// Gets the current window.<br />
446         /// </summary>
447         /// <since_tizen> 3 </since_tizen>
448         public static Window Instance
449         {
450             get
451             {
452                 return instance;
453             }
454         }
455
456         /// <summary>
457         /// Gets or sets a window type.
458         /// </summary>
459         /// <since_tizen> 3 </since_tizen>
460         public WindowType Type
461         {
462             get
463             {
464                 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
465                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466                 return ret;
467             }
468             set
469             {
470                 NDalicPINVOKE.SetType(swigCPtr, (int)value);
471                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
472             }
473         }
474
475         /// <summary>
476         /// Gets/Sets a window title.
477         /// </summary>
478         /// <since_tizen> 4 </since_tizen>
479         public string Title
480         {
481             get
482             {
483                 return _windowTitle;
484             }
485             set
486             {
487                 _windowTitle = value;
488                 SetClass(_windowTitle, "");
489             }
490         }
491
492         /// <summary>
493         /// The rendering behavior of a Window.
494         /// </summary>
495         /// <since_tizen> 5 </since_tizen>
496         public RenderingBehaviorType RenderingBehavior
497         {
498             get
499             {
500                 return GetRenderingBehavior();
501             }
502             set
503             {
504                 SetRenderingBehavior(value);
505             }
506         }
507
508         /// <summary>
509         /// The window size property (read-only).
510         /// </summary>
511         /// <since_tizen> 3 </since_tizen>
512         public Size2D Size
513         {
514             get
515             {
516                 Size2D ret = GetSize();
517                 return ret;
518             }
519         }
520
521         /// <summary>
522         /// The background color property.
523         /// </summary>
524         /// <since_tizen> 3 </since_tizen>
525         public Color BackgroundColor
526         {
527             set
528             {
529                 SetBackgroundColor(value);
530             }
531             get
532             {
533                 Color ret = GetBackgroundColor();
534                 return ret;
535             }
536         }
537
538         /// <summary>
539         /// The DPI property (read-only).<br />
540         /// Retrieves the DPI of the display device to which the Window is connected.<br />
541         /// </summary>
542         /// <since_tizen> 3 </since_tizen>
543         public Vector2 Dpi
544         {
545             get
546             {
547                 return GetDpi();
548             }
549         }
550
551         /// <summary>
552         /// The layer count property (read-only).<br />
553         /// Queries the number of on-Window layers.<br />
554         /// </summary>
555         /// <since_tizen> 3 </since_tizen>
556         public uint LayerCount
557         {
558             get
559             {
560                 return GetLayerCount();
561             }
562         }
563
564         /// <summary>
565         /// Gets or sets a size of the window.
566         /// </summary>
567         /// <since_tizen> 4 </since_tizen>
568         public Size2D WindowSize
569         {
570             get
571             {
572                 return GetWindowSize();
573             }
574             set
575             {
576                 SetWindowSize(value);
577             }
578         }
579
580         /// <summary>
581         /// Gets or sets a position of the window.
582         /// </summary>
583         /// <since_tizen> 4 </since_tizen>
584         public Position2D WindowPosition
585         {
586             get
587             {
588                 return GetPosition();
589             }
590             set
591             {
592                 SetPosition(value);
593             }
594         }
595         internal static Vector4 DEFAULT_BACKGROUND_COLOR
596         {
597             get
598             {
599                 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
600                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
601                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602                 return ret;
603             }
604         }
605
606         internal static Vector4 DEBUG_BACKGROUND_COLOR
607         {
608             get
609             {
610                 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
611                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
612                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613                 return ret;
614             }
615         }
616
617         internal List<Layer> LayersChildren
618         {
619             get
620             {
621                 return _childLayers;
622             }
623         }
624
625         /// <summary>
626         /// Feed a key-event into the window.
627         /// </summary>
628         /// <param name="keyEvent">The key event to feed.</param>
629         /// <since_tizen> 4 </since_tizen>
630         [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
631         public static void FeedKeyEvent(Key keyEvent)
632         {
633             NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
634             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
635         }
636
637         /// <summary>
638         /// Sets whether the window accepts a focus or not.
639         /// </summary>
640         /// <param name="accept">If a focus is accepted or not. The default is true.</param>
641         /// <since_tizen> 3 </since_tizen>
642         public void SetAcceptFocus(bool accept)
643         {
644             NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
645             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646         }
647
648         /// <summary>
649         /// Returns whether the window accepts a focus or not.
650         /// </summary>
651         /// <returns>True if the window accepts a focus, false otherwise.</returns>
652         /// <since_tizen> 3 </since_tizen>
653         public bool IsFocusAcceptable()
654         {
655             bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
656             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
657
658             return ret;
659         }
660
661         /// <summary>
662         /// Shows the window if it is hidden.
663         /// </summary>
664         /// <since_tizen> 3 </since_tizen>
665         public void Show()
666         {
667             NDalicPINVOKE.Show(swigCPtr);
668             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
669         }
670
671         /// <summary>
672         /// Hides the window if it is showing.
673         /// </summary>
674         /// <since_tizen> 3 </since_tizen>
675         public void Hide()
676         {
677             NDalicPINVOKE.Hide(swigCPtr);
678             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679         }
680
681         /// <summary>
682         /// Retrieves whether the window is visible or not.
683         /// </summary>
684         /// <returns>True if the window is visible.</returns>
685         /// <since_tizen> 3 </since_tizen>
686         public bool IsVisible()
687         {
688             bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
689             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690             return temp;
691         }
692
693         /// <summary>
694         /// Gets the count of supported auxiliary hints of the window.
695         /// </summary>
696         /// <returns>The number of supported auxiliary hints.</returns>
697         /// <since_tizen> 3 </since_tizen>
698         public uint GetSupportedAuxiliaryHintCount()
699         {
700             uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
701             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702             return ret;
703         }
704
705         /// <summary>
706         /// Gets the supported auxiliary hint string of the window.
707         /// </summary>
708         /// <param name="index">The index of the supported auxiliary hint lists.</param>
709         /// <returns>The auxiliary hint string of the index.</returns>
710         /// <since_tizen> 3 </since_tizen>
711         public string GetSupportedAuxiliaryHint(uint index)
712         {
713             string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
714             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715             return ret;
716         }
717
718         /// <summary>
719         /// Creates an auxiliary hint of the window.
720         /// </summary>
721         /// <param name="hint">The auxiliary hint string.</param>
722         /// <param name="value">The value string.</param>
723         /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
724         /// <since_tizen> 3 </since_tizen>
725         public uint AddAuxiliaryHint(string hint, string value)
726         {
727             uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
728             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
729             return ret;
730         }
731
732         /// <summary>
733         /// Removes an auxiliary hint of the window.
734         /// </summary>
735         /// <param name="id">The ID of the auxiliary hint.</param>
736         /// <returns>True if no error occurred, false otherwise.</returns>
737         /// <since_tizen> 3 </since_tizen>
738         public bool RemoveAuxiliaryHint(uint id)
739         {
740             bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
741             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
742             return ret;
743         }
744
745         /// <summary>
746         /// Changes a value of the auxiliary hint.
747         /// </summary>
748         /// <param name="id">The auxiliary hint ID.</param>
749         /// <param name="value">The value string to be set.</param>
750         /// <returns>True if no error occurred, false otherwise.</returns>
751         /// <since_tizen> 3 </since_tizen>
752         public bool SetAuxiliaryHintValue(uint id, string value)
753         {
754             bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
755             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756             return ret;
757         }
758
759         /// <summary>
760         /// Gets a value of the auxiliary hint.
761         /// </summary>
762         /// <param name="id">The auxiliary hint ID.</param>
763         /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
764         /// <since_tizen> 3 </since_tizen>
765         public string GetAuxiliaryHintValue(uint id)
766         {
767             string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
768             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
769             return ret;
770         }
771
772         /// <summary>
773         /// Gets an ID of the auxiliary hint string.
774         /// </summary>
775         /// <param name="hint">The auxiliary hint string.</param>
776         /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
777         /// <since_tizen> 3 </since_tizen>
778         public uint GetAuxiliaryHintId(string hint)
779         {
780             uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
781             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
782             return ret;
783         }
784
785         /// <summary>
786         /// Sets a region to accept input events.
787         /// </summary>
788         /// <param name="inputRegion">The region to accept input events.</param>
789         /// <since_tizen> 3 </since_tizen>
790         public void SetInputRegion(Rectangle inputRegion)
791         {
792             NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
793             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
794         }
795
796         /// <summary>
797         /// Sets a priority level for the specified notification window.
798         /// </summary>
799         /// <param name="level">The notification window level.</param>
800         /// <returns>True if no error occurred, false otherwise.</returns>
801         /// <since_tizen> 3 </since_tizen>
802         public bool SetNotificationLevel(NotificationLevel level)
803         {
804             bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
805             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806             return ret;
807         }
808
809         /// <summary>
810         /// Gets a priority level for the specified notification window.
811         /// </summary>
812         /// <returns>The notification window level.</returns>
813         /// <since_tizen> 3 </since_tizen>
814         public NotificationLevel GetNotificationLevel()
815         {
816             NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
817             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
818             return ret;
819         }
820
821         /// <summary>
822         /// Sets a transparent window's visual state to opaque. <br />
823         /// If a visual state of a transparent window is opaque, <br />
824         /// then the window manager could handle it as an opaque window when calculating visibility.
825         /// </summary>
826         /// <param name="opaque">Whether the window's visual state is opaque.</param>
827         /// <remarks>This will have no effect on an opaque window. <br />
828         /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
829         /// </remarks>
830         /// <since_tizen> 3 </since_tizen>
831         public void SetOpaqueState(bool opaque)
832         {
833             NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
834             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835         }
836
837         /// <summary>
838         /// Returns whether a transparent window's visual state is opaque or not.
839         /// </summary>
840         /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
841         /// <remarks> The return value has no meaning on an opaque window. </remarks>
842         /// <since_tizen> 3 </since_tizen>
843         public bool IsOpaqueState()
844         {
845             bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
846             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847             return ret;
848         }
849
850         /// <summary>
851         /// Sets a window's screen off mode.
852         /// </summary>
853         /// <param name="screenOffMode">The screen mode.</param>
854         /// <returns>True if no error occurred, false otherwise.</returns>
855         /// <since_tizen> 4 </since_tizen>
856         public bool SetScreenOffMode(ScreenOffMode screenOffMode)
857         {
858             bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode);
859             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
860             return ret;
861         }
862
863         /// <summary>
864         /// Gets the screen mode of the window.
865         /// </summary>
866         /// <returns>The screen off mode.</returns>
867         /// <since_tizen> 4 </since_tizen>
868         public ScreenOffMode GetScreenOffMode()
869         {
870             ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr);
871             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
872             return ret;
873         }
874
875         /// <summary>
876         /// Sets preferred brightness of the window.
877         /// </summary>
878         /// <param name="brightness">The preferred brightness (0 to 100).</param>
879         /// <returns>True if no error occurred, false otherwise.</returns>
880         /// <since_tizen> 3 </since_tizen>
881         public bool SetBrightness(int brightness)
882         {
883             bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
884             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
885             return ret;
886         }
887
888         /// <summary>
889         /// Gets the preferred brightness of the window.
890         /// </summary>
891         /// <returns>The preferred brightness.</returns>
892         /// <since_tizen> 3 </since_tizen>
893         public int GetBrightness()
894         {
895             int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
896             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
897             return ret;
898         }
899
900         /// <summary>
901         /// Sets the window name and the class string.
902         /// </summary>
903         /// <param name="name">The name of the window.</param>
904         /// <param name="klass">The class of the window.</param>
905         /// <since_tizen> 4 </since_tizen>
906         public void SetClass(string name, string klass)
907         {
908             NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
909             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
910         }
911
912         /// <summary>
913         /// Raises the window to the top of the window stack.
914         /// </summary>
915         /// <since_tizen> 3 </since_tizen>
916         public void Raise()
917         {
918             NDalicPINVOKE.Window_Raise(swigCPtr);
919             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
920         }
921
922         /// <summary>
923         /// Lowers the window to the bottom of the window stack.
924         /// </summary>
925         /// <since_tizen> 3 </since_tizen>
926         public void Lower()
927         {
928             NDalicPINVOKE.Window_Lower(swigCPtr);
929             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
930         }
931
932         /// <summary>
933         /// Activates the window to the top of the window stack even it is iconified.
934         /// </summary>
935         /// <since_tizen> 3 </since_tizen>
936         public void Activate()
937         {
938             NDalicPINVOKE.Window_Activate(swigCPtr);
939             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
940         }
941
942         /// <summary>
943         /// Gets the default ( root ) layer.
944         /// </summary>
945         /// <returns>The root layer.</returns>
946         /// <since_tizen> 3 </since_tizen>
947         public Layer GetDefaultLayer()
948         {
949             return this.GetRootLayer();
950         }
951
952         /// <summary>
953         /// Add a child view to window.
954         /// </summary>
955         /// <param name="view">the child should be added to the window.</param>
956         /// <since_tizen> 3 </since_tizen>
957         public void Add(View view)
958         {
959             NDalicPINVOKE.Actor_Add(rootLayoutCPtr, View.getCPtr(view));
960             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
961             this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
962             view.InternalParent = this.GetRootLayer();
963         }
964
965         /// <summary>
966         /// Remove a child view from window.
967         /// </summary>
968         /// <param name="view">the child to be removed.</param>
969         /// <since_tizen> 3 </since_tizen>
970         public void Remove(View view)
971         {
972             NDalicPINVOKE.Actor_Remove(rootLayoutCPtr, View.getCPtr(view));
973             this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
974             view.InternalParent = null;
975         }
976
977         /// <summary>
978         /// Retrieves the layer at a specified depth.
979         /// </summary>
980         /// <param name="depth">The layer's depth index.</param>
981         /// <returns>The layer found at the given depth.</returns>
982         /// <since_tizen> 3 </since_tizen>
983         public Layer GetLayer(uint depth)
984         {
985             if (depth < LayersChildren.Count)
986             {
987                 Layer ret = LayersChildren[Convert.ToInt32(depth)];
988                 return ret;
989             }
990             else
991             {
992                 return null;
993             }
994         }
995
996         /// <summary>
997         /// Keep rendering for at least the given amount of time.
998         /// </summary>
999         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
1000         /// <since_tizen> 3 </since_tizen>
1001         public void KeepRendering(float durationSeconds)
1002         {
1003             NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
1004             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1005         }
1006
1007         /// <summary>
1008         /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
1009         /// This function can be used for following example scenarios: <br />
1010         /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
1011         /// </summary>
1012         /// <param name="DaliKey">The key code to grab.</param>
1013         /// <returns>True if the grab succeeds.</returns>
1014         /// <since_tizen> 3 </since_tizen>
1015         public bool GrabKeyTopmost(int DaliKey)
1016         {
1017             bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1018             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1019             return ret;
1020         }
1021
1022         /// <summary>
1023         /// Ungrabs the key specified by a key for the window.<br />
1024         /// 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 />
1025         /// </summary>
1026         /// <param name="DaliKey">The key code to ungrab.</param>
1027         /// <returns>True if the ungrab succeeds.</returns>
1028         /// <since_tizen> 3 </since_tizen>
1029         public bool UngrabKeyTopmost(int DaliKey)
1030         {
1031             bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1032             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1033             return ret;
1034         }
1035
1036         /// <summary>
1037         ///  Grabs the key specified by a key for a window in a GrabMode. <br />
1038         ///  Details: This function can be used for following example scenarios: <br />
1039         ///  - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
1040         ///  - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
1041         ///  - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
1042         /// </summary>
1043         /// <param name="DaliKey">The key code to grab.</param>
1044         /// <param name="GrabMode">The grab mode for the key.</param>
1045         /// <returns>True if the grab succeeds.</returns>
1046         /// <since_tizen> 3 </since_tizen>
1047         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
1048         {
1049             bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
1050             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1051             return ret;
1052         }
1053
1054         /// <summary>
1055         /// Ungrabs the key specified by a key for a window.<br />
1056         /// 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 />
1057         /// </summary>
1058         /// <param name="DaliKey">The key code to ungrab.</param>
1059         /// <returns>True if the ungrab succeeds.</returns>
1060         /// <since_tizen> 3 </since_tizen>
1061         public bool UngrabKey(int DaliKey)
1062         {
1063             bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1064             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1065             return ret;
1066         }
1067
1068         /// <summary>
1069         /// Sets the keyboard repeat information.
1070         /// </summary>
1071         /// <param name="rate">The key repeat rate value in seconds.</param>
1072         /// <param name="delay">The key repeat delay value in seconds.</param>
1073         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1074         /// <since_tizen> 5 </since_tizen>
1075         public bool SetKeyboardRepeatInfo(float rate, float delay)
1076         {
1077             bool ret = NDalicManualPINVOKE.SetKeyboardRepeatInfo(rate, delay);
1078             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1079             return ret;
1080         }
1081
1082         /// <summary>
1083         /// Gets the keyboard repeat information.
1084         /// </summary>
1085         /// <param name="rate">The key repeat rate value in seconds.</param>
1086         /// <param name="delay">The key repeat delay value in seconds.</param>
1087         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1088         /// <since_tizen> 5 </since_tizen>
1089         public bool GetKeyboardRepeatInfo(out float rate, out float delay)
1090         {
1091             bool ret = NDalicManualPINVOKE.GetKeyboardRepeatInfo(out rate, out delay);
1092             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1093             return ret;
1094         }
1095
1096         /// <summary>
1097         /// Adds a layer to the stage.
1098         /// </summary>
1099         /// <param name="layer">Layer to add.</param>
1100         /// <since_tizen> 3 </since_tizen>
1101         public void AddLayer(Layer layer)
1102         {
1103             NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
1104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105
1106             LayersChildren.Add(layer);
1107         }
1108
1109         /// <summary>
1110         /// Removes a layer from the stage.
1111         /// </summary>
1112         /// <param name="layer">Layer to remove.</param>
1113         /// <since_tizen> 3 </since_tizen>
1114         public void RemoveLayer(Layer layer)
1115         {
1116             NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
1117             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118
1119             LayersChildren.Remove(layer);
1120         }
1121
1122         /// <summary>
1123         /// Feeds a key event into the window.
1124         /// </summary>
1125         /// <param name="keyEvent">The key event to feed.</param>
1126         /// <since_tizen> 5 </since_tizen>
1127         public void FeedKey(Key keyEvent)
1128         {
1129             NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
1130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1131         }
1132
1133         /// <summary>
1134         /// Allows at least one more render, even when paused.
1135         /// The window should be shown, not minimised.
1136         /// </summary>
1137         /// <since_tizen> 4 </since_tizen>
1138         public void RenderOnce()
1139         {
1140             NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
1141             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1142         }
1143
1144         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
1145         {
1146             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1147         }
1148
1149         internal static Window GetCurrent()
1150         {
1151             Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
1152             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1153             return ret;
1154         }
1155
1156         internal static bool IsInstalled()
1157         {
1158             bool ret = NDalicPINVOKE.Stage_IsInstalled();
1159             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1160             return ret;
1161         }
1162
1163         internal WindowFocusSignalType WindowFocusChangedSignal()
1164         {
1165             WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
1166             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1167             return ret;
1168         }
1169
1170         internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
1171         {
1172             NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
1173             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1174         }
1175
1176         internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
1177         {
1178             NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
1179             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1180         }
1181
1182         internal void RotateIndicator(Window.WindowOrientation orientation)
1183         {
1184             NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
1185             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1186         }
1187
1188         internal void AddAvailableOrientation(Window.WindowOrientation orientation)
1189         {
1190             NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
1191             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1192         }
1193
1194         internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1195         {
1196             NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
1197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1198         }
1199
1200         internal void SetPreferredOrientation(Window.WindowOrientation orientation)
1201         {
1202             NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
1203             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1204         }
1205
1206         internal Window.WindowOrientation GetPreferredOrientation()
1207         {
1208             Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
1209             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1210             return ret;
1211         }
1212
1213         internal DragAndDropDetector GetDragAndDropDetector()
1214         {
1215             DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
1216             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1217             return ret;
1218         }
1219
1220         internal Any GetNativeHandle()
1221         {
1222             Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
1223             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224             return ret;
1225         }
1226
1227         internal WindowFocusSignalType FocusChangedSignal()
1228         {
1229             WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
1230             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1231             return ret;
1232         }
1233
1234         internal void Add(Layer layer)
1235         {
1236             NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
1237             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1238
1239             LayersChildren.Add(layer);
1240         }
1241
1242         internal void Remove(Layer layer)
1243         {
1244             NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
1245             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1246
1247             LayersChildren.Remove(layer);
1248         }
1249
1250         internal Vector2 GetSize()
1251         {
1252             Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
1253             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1254             return ret;
1255         }
1256
1257         internal RenderTaskList GetRenderTaskList()
1258         {
1259             RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
1260             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1261             return ret;
1262         }
1263
1264         /// <summary>
1265         /// Queries the number of on-window layers.
1266         /// </summary>
1267         /// <returns>The number of layers.</returns>
1268         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1269         internal uint GetLayerCount()
1270         {
1271             if (LayersChildren == null || LayersChildren.Count < 0)
1272                 return 0;
1273
1274             return (uint) LayersChildren.Count;
1275         }
1276
1277         internal Layer GetRootLayer()
1278         {
1279             // Window.IsInstalled() is actually true only when called from event thread and
1280             // Core has been initialized, not when Stage is ready.
1281             if (_rootLayer == null && Window.IsInstalled())
1282             {
1283                 _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
1284                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1285                 LayersChildren.Add(_rootLayer);
1286             }
1287             return _rootLayer;
1288         }
1289
1290         internal void SetBackgroundColor(Vector4 color)
1291         {
1292             NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
1293             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1294         }
1295
1296         internal Vector4 GetBackgroundColor()
1297         {
1298             Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
1299             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1300             return ret;
1301         }
1302
1303         internal Vector2 GetDpi()
1304         {
1305             Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
1306             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1307             return ret;
1308         }
1309
1310         internal ObjectRegistry GetObjectRegistry()
1311         {
1312             ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
1313             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1314             return ret;
1315         }
1316
1317         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1318         {
1319             NDalicPINVOKE.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1320             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1321         }
1322
1323         internal RenderingBehaviorType GetRenderingBehavior()
1324         {
1325             RenderingBehaviorType ret = (RenderingBehaviorType)NDalicPINVOKE.Stage_GetRenderingBehavior(stageCPtr);
1326             if (NDalicPINVOKE.SWIGPendingException.Pending)
1327                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1328             return ret;
1329         }
1330
1331         internal KeyEventSignal KeyEventSignal()
1332         {
1333             KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
1334             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1335             return ret;
1336         }
1337
1338         internal VoidSignal EventProcessingFinishedSignal()
1339         {
1340             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
1341             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1342             return ret;
1343         }
1344
1345         internal TouchSignal TouchSignal()
1346         {
1347             TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
1348             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1349             return ret;
1350         }
1351
1352         internal TouchDataSignal TouchDataSignal()
1353         {
1354             TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false);
1355             if (NDalicPINVOKE.SWIGPendingException.Pending)
1356                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1357             return ret;
1358         }
1359
1360         internal VoidSignal ContextLostSignal()
1361         {
1362             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
1363             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1364             return ret;
1365         }
1366
1367         internal VoidSignal ContextRegainedSignal()
1368         {
1369             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
1370             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1371             return ret;
1372         }
1373
1374         internal VoidSignal SceneCreatedSignal()
1375         {
1376             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
1377             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1378             return ret;
1379         }
1380
1381         internal ResizedSignal ResizedSignal()
1382         {
1383             ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
1384             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1385             return ret;
1386         }
1387
1388         internal void SetWindowSize(Size2D size)
1389         {
1390             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1391             NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1392
1393             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1394
1395             if(rootLayoutItem != null)
1396             {
1397                 rootLayoutItem.RequestLayout();
1398             }
1399         }
1400
1401         internal Size2D GetWindowSize()
1402         {
1403             var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
1404             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1405
1406             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1407             return ret;
1408         }
1409
1410         internal void SetPosition(Position2D position)
1411         {
1412             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1413             NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1414
1415             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1416
1417             if(rootLayoutItem != null)
1418             {
1419                 rootLayoutItem.RequestLayout();
1420             }
1421         }
1422
1423         internal Position2D GetPosition()
1424         {
1425             var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
1426             Position2D ret = new Position2D(val.GetX(), val.GetY());
1427
1428             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1429             return ret;
1430         }
1431
1432         internal void SetPositionSize(Rectangle positionSize)
1433         {
1434             NDalicPINVOKE.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
1435
1436             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1437
1438             if(rootLayoutItem != null)
1439             {
1440                 rootLayoutItem.RequestLayout();
1441             }
1442         }
1443
1444         /// <summary>
1445         /// Sets whether the window is transparent or not.
1446         /// </summary>
1447         /// <param name="transparent">Whether the window is transparent or not.</param>
1448         /// <since_tizen> 5 </since_tizen>
1449         public void SetTransparency(bool transparent) {
1450             NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
1451             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1452
1453             if(rootLayoutItem != null)
1454             {
1455                 rootLayoutItem.RequestLayout();
1456             }
1457         }
1458
1459         internal System.IntPtr GetNativeWindowHandler()
1460         {
1461             System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
1462             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1463             return ret;
1464         }
1465
1466         private void OnWindowFocusedChanged(bool focusGained)
1467         {
1468             FocusChangedEventArgs e = new FocusChangedEventArgs();
1469
1470             e.FocusGained = focusGained;
1471
1472             if (_windowFocusChangedEventHandler != null)
1473             {
1474                 _windowFocusChangedEventHandler(this, e);
1475             }
1476         }
1477
1478         private StageWheelSignal WheelEventSignal()
1479         {
1480             StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
1481             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1482             return ret;
1483         }
1484
1485         private WheelSignal StageWheelEventSignal()
1486         {
1487             WheelSignal ret = new WheelSignal(NDalicPINVOKE.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false);
1488             if (NDalicPINVOKE.SWIGPendingException.Pending)
1489                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1490             return ret;
1491         }
1492
1493         private bool OnWindowTouch(IntPtr view, IntPtr touchData)
1494         {
1495             if (touchData == global::System.IntPtr.Zero)
1496             {
1497                 NUILog.Error("touchData should not be null!");
1498                 return false;
1499             }
1500
1501             TouchEventArgs e = new TouchEventArgs();
1502
1503             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
1504
1505             if (_rootLayerTouchDataEventHandler != null)
1506             {
1507                 _rootLayerTouchDataEventHandler(this, e);
1508             }
1509             return false;
1510         }
1511
1512         private bool OnStageWheel(IntPtr rootLayer, IntPtr wheelEvent)
1513         {
1514             if (wheelEvent == global::System.IntPtr.Zero)
1515         {
1516                 NUILog.Error("wheelEvent should not be null!");
1517                 return true;
1518             }
1519
1520             WheelEventArgs e = new WheelEventArgs();
1521
1522             e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
1523
1524             if (_stageWheelHandler != null)
1525             {
1526                 _stageWheelHandler(this, e);
1527             }
1528             return true;
1529         }
1530
1531         // Callback for Stage KeyEventsignal
1532         private void OnStageKey(IntPtr data)
1533         {
1534             KeyEventArgs e = new KeyEventArgs();
1535
1536             if (data != null)
1537             {
1538                 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1539             }
1540
1541             if (_stageKeyHandler != null)
1542             {
1543                 //here we send all data to user event handlers
1544                 _stageKeyHandler(this, e);
1545             }
1546         }
1547
1548         // Callback for Stage EventProcessingFinishedSignal
1549         private void OnEventProcessingFinished()
1550         {
1551             if (_stageEventProcessingFinishedEventHandler != null)
1552             {
1553                 _stageEventProcessingFinishedEventHandler(this, null);
1554             }
1555         }
1556
1557         // Callback for Stage ContextLostSignal
1558         private void OnContextLost()
1559         {
1560             if (_stageContextLostEventHandler != null)
1561             {
1562                 _stageContextLostEventHandler(this, null);
1563             }
1564         }
1565
1566         // Callback for Stage ContextRegainedSignal
1567         private void OnContextRegained()
1568         {
1569             if (_stageContextRegainedEventHandler != null)
1570             {
1571                 _stageContextRegainedEventHandler(this, null);
1572             }
1573         }
1574
1575         // Callback for Stage SceneCreatedSignal
1576         private void OnSceneCreated()
1577         {
1578             if (_stageSceneCreatedEventHandler != null)
1579             {
1580                 _stageSceneCreatedEventHandler(this, null);
1581             }
1582         }
1583
1584         private void OnResized(IntPtr windowSize)
1585         {
1586             ResizedEventArgs e = new ResizedEventArgs();
1587             var val = new Uint16Pair(windowSize, false);
1588             e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1589             val.Dispose();
1590
1591             if (_windowResizedEventHandler != null)
1592             {
1593                 _windowResizedEventHandler(this, e);
1594             }
1595         }
1596
1597         private void OnWindowFocusedChanged2(bool focusGained)
1598         {
1599             FocusChangedEventArgs e = new FocusChangedEventArgs();
1600
1601             e.FocusGained = focusGained;
1602
1603             if (_windowFocusChangedEventHandler2 != null)
1604             {
1605                 _windowFocusChangedEventHandler2(this, e);
1606             }
1607         }
1608
1609         /// <summary>
1610         /// The focus changed event argument.
1611         /// </summary>
1612         /// <since_tizen> 3 </since_tizen>
1613         public class FocusChangedEventArgs : EventArgs
1614         {
1615             /// <summary>
1616             /// FocusGained flag.
1617             /// </summary>
1618             /// <since_tizen> 3 </since_tizen>
1619             public bool FocusGained
1620             {
1621                 get;
1622                 set;
1623             }
1624         }
1625
1626         /// <summary>
1627         /// The touch event argument.
1628         /// </summary>
1629         /// <since_tizen> 3 </since_tizen>
1630         public class TouchEventArgs : EventArgs
1631         {
1632             private Touch _touch;
1633
1634             /// <summary>
1635             /// Touch.
1636             /// </summary>
1637             /// <since_tizen> 3 </since_tizen>
1638             public Touch Touch
1639             {
1640                 get
1641                 {
1642                     return _touch;
1643                 }
1644                 set
1645                 {
1646                     _touch = value;
1647                 }
1648             }
1649         }
1650
1651         /// <summary>
1652         /// Wheel event arguments.
1653         /// </summary>
1654         /// <since_tizen> 3 </since_tizen>
1655         public class WheelEventArgs : EventArgs
1656         {
1657             private Wheel _wheel;
1658
1659             /// <summary>
1660             /// Wheel.
1661             /// </summary>
1662             /// <since_tizen> 3 </since_tizen>
1663             public Wheel Wheel
1664             {
1665                 get
1666                 {
1667                     return _wheel;
1668                 }
1669                 set
1670                 {
1671                     _wheel = value;
1672                 }
1673             }
1674         }
1675
1676         /// <summary>
1677         /// Key event arguments.
1678         /// </summary>
1679         /// <since_tizen> 3 </since_tizen>
1680         public class KeyEventArgs : EventArgs
1681         {
1682             private Key _key;
1683
1684             /// <summary>
1685             /// Key.
1686             /// </summary>
1687             /// <since_tizen> 3 </since_tizen>
1688             public Key Key
1689             {
1690                 get
1691                 {
1692                     return _key;
1693                 }
1694                 set
1695                 {
1696                     _key = value;
1697                 }
1698             }
1699         }
1700
1701         /// <summary>
1702         /// Sets position and size of the window. This API guarantees that
1703         /// both moving and resizing of window will appear on the screen at once.
1704         /// </summary>
1705         [EditorBrowsable(EditorBrowsableState.Never)]
1706         public Rectangle WindowPositionSize
1707         {
1708             get
1709             {
1710                 Position2D position = GetPosition();
1711                 Size2D size = GetSize();
1712                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
1713                 return ret;
1714             }
1715             set
1716             {
1717                 SetPositionSize(value);
1718             }
1719         }
1720
1721         /// <summary>
1722         /// Feeds a key event into the window.
1723         /// This resized event arguments.
1724         /// </summary>
1725         /// <since_tizen> 3 </since_tizen>
1726         public class ResizedEventArgs : EventArgs
1727         {
1728             Size2D _windowSize;
1729
1730             /// <summary>
1731             /// This window size.
1732             /// </summary>
1733             /// <since_tizen> 4 </since_tizen>
1734             public Size2D WindowSize
1735             {
1736                 get
1737                 {
1738                     return _windowSize;
1739                 }
1740                 set
1741                 {
1742                     _windowSize = value;
1743                 }
1744             }
1745         }
1746
1747         /// <summary>
1748         /// Please do not use! this will be deprecated
1749         /// </summary>
1750         /// <since_tizen> 3 </since_tizen>
1751         [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
1752             "Like: " +
1753             "Window.Instance.FocusChanged = OnFocusChanged; " +
1754             "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
1755         [EditorBrowsable(EditorBrowsableState.Never)]
1756         public class WindowFocusChangedEventArgs : EventArgs
1757         {
1758             /// <summary>
1759             /// Please do not use! this will be deprecated
1760             /// </summary>
1761             /// <since_tizen> 3 </since_tizen>
1762             public bool FocusGained
1763             {
1764                 get;
1765                 set;
1766             }
1767         }
1768
1769         /// <summary>
1770         /// Contains and encapsulates Native Window handle.
1771         /// </summary>
1772         /// <since_tizen> 4 </since_tizen>
1773         public class SafeNativeWindowHandle : SafeHandle
1774         {
1775             /// <summary>
1776             /// Contructor, Native window handle is set to handle.
1777             /// </summary>
1778             /// <since_tizen> 4 </since_tizen>
1779             public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
1780             {
1781                 SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
1782             }
1783             /// <summary>
1784             /// Null check if the handle is valid or not.
1785             /// </summary>
1786             /// <since_tizen> 4 </since_tizen>
1787             public override bool IsInvalid
1788             {
1789                 get
1790                 {
1791                     return this.handle == IntPtr.Zero;
1792                 }
1793             }
1794             /// <summary>
1795             /// Release handle itself.
1796             /// </summary>
1797             /// <returns>true when released successfully.</returns>
1798             /// <since_tizen> 4 </since_tizen>
1799             protected override bool ReleaseHandle()
1800             {
1801                 return true;
1802             }
1803         }
1804
1805         /// <summary>
1806         /// Disconnect all native signals
1807         /// </summary>
1808         /// <since_tizen> 5 </since_tizen>
1809         internal void DisconnectNativeSignals() 
1810         {
1811             if( _windowFocusChangedEventCallback != null )
1812             {
1813                 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
1814             }
1815
1816             if( _rootLayerTouchDataCallback != null )
1817             {
1818                 TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
1819             }
1820
1821             if( _wheelEventCallback != null )
1822             {
1823                 StageWheelEventSignal().Disconnect(_wheelEventCallback);
1824             }
1825
1826             if( _stageKeyCallbackDelegate != null )
1827             {
1828                 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1829             }
1830
1831             if( _stageEventProcessingFinishedEventCallbackDelegate != null )
1832             {
1833                 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1834             }
1835
1836             if( _stageContextLostEventCallbackDelegate != null )
1837             {
1838                 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1839             }
1840
1841             if( _stageContextRegainedEventCallbackDelegate != null )
1842             {
1843                 ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1844             }
1845
1846             if( _stageSceneCreatedEventCallbackDelegate != null )
1847             {
1848                 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1849             }
1850
1851             if( _windowResizedEventCallback != null )
1852             {
1853                 ResizedSignal().Disconnect(_windowResizedEventCallback);
1854             }
1855
1856             if( _windowFocusChangedEventCallback2 != null )
1857             {
1858                 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1859             }
1860
1861         }
1862
1863     }
1864 }