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