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