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