[NUI] Change API for Window Creation (#957)
[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         /// Keep rendering for at least the given amount of time.
1001         /// </summary>
1002         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
1003         /// <since_tizen> 3 </since_tizen>
1004         public void KeepRendering(float durationSeconds)
1005         {
1006             Interop.Stage.Stage_KeepRendering(stageCPtr, durationSeconds);
1007             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1008         }
1009
1010         /// <summary>
1011         /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
1012         /// This function can be used for following example scenarios: <br />
1013         /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
1014         /// </summary>
1015         /// <param name="DaliKey">The key code to grab.</param>
1016         /// <returns>True if the grab succeeds.</returns>
1017         /// <since_tizen> 3 </since_tizen>
1018         public bool GrabKeyTopmost(int DaliKey)
1019         {
1020             bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1021             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1022             return ret;
1023         }
1024
1025         /// <summary>
1026         /// Ungrabs the key specified by a key for the window.<br />
1027         /// 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 />
1028         /// </summary>
1029         /// <param name="DaliKey">The key code to ungrab.</param>
1030         /// <returns>True if the ungrab succeeds.</returns>
1031         /// <since_tizen> 3 </since_tizen>
1032         public bool UngrabKeyTopmost(int DaliKey)
1033         {
1034             bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1035             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1036             return ret;
1037         }
1038
1039         /// <summary>
1040         ///  Grabs the key specified by a key for a window in a GrabMode. <br />
1041         ///  Details: This function can be used for following example scenarios: <br />
1042         ///  - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
1043         ///  - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
1044         ///  - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
1045         /// </summary>
1046         /// <param name="DaliKey">The key code to grab.</param>
1047         /// <param name="GrabMode">The grab mode for the key.</param>
1048         /// <returns>True if the grab succeeds.</returns>
1049         /// <since_tizen> 3 </since_tizen>
1050         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
1051         {
1052             bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
1053             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1054             return ret;
1055         }
1056
1057         /// <summary>
1058         /// Ungrabs the key specified by a key for a window.<br />
1059         /// 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 />
1060         /// </summary>
1061         /// <param name="DaliKey">The key code to ungrab.</param>
1062         /// <returns>True if the ungrab succeeds.</returns>
1063         /// <since_tizen> 3 </since_tizen>
1064         public bool UngrabKey(int DaliKey)
1065         {
1066             bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
1067             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1068             return ret;
1069         }
1070
1071         /// <summary>
1072         /// Sets the keyboard repeat information.
1073         /// </summary>
1074         /// <param name="rate">The key repeat rate value in seconds.</param>
1075         /// <param name="delay">The key repeat delay value in seconds.</param>
1076         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1077         /// <since_tizen> 5 </since_tizen>
1078         public bool SetKeyboardRepeatInfo(float rate, float delay)
1079         {
1080             bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
1081             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1082             return ret;
1083         }
1084
1085         /// <summary>
1086         /// Gets the keyboard repeat information.
1087         /// </summary>
1088         /// <param name="rate">The key repeat rate value in seconds.</param>
1089         /// <param name="delay">The key repeat delay value in seconds.</param>
1090         /// <returns>True if setting the keyboard repeat succeeds.</returns>
1091         /// <since_tizen> 5 </since_tizen>
1092         public bool GetKeyboardRepeatInfo(out float rate, out float delay)
1093         {
1094             bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
1095             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1096             return ret;
1097         }
1098
1099         /// <summary>
1100         /// Adds a layer to the stage.
1101         /// </summary>
1102         /// <param name="layer">Layer to add.</param>
1103         /// <since_tizen> 3 </since_tizen>
1104         public void AddLayer(Layer layer)
1105         {
1106             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
1107             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1108
1109             LayersChildren?.Add(layer);
1110             layer.SetWindow(this);
1111         }
1112
1113         /// <summary>
1114         /// Removes a layer from the stage.
1115         /// </summary>
1116         /// <param name="layer">Layer to remove.</param>
1117         /// <since_tizen> 3 </since_tizen>
1118         public void RemoveLayer(Layer layer)
1119         {
1120             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
1121             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1122
1123             LayersChildren?.Remove(layer);
1124             layer.SetWindow(null);
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             Interop.Window.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             Interop.Window.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(Interop.Stage.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 = Interop.Stage.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(Interop.Window.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             Interop.WindowInternal.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             Interop.WindowInternal.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             Interop.WindowInternal.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             Interop.WindowInternal.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             Interop.WindowInternal.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             Interop.WindowInternal.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)Interop.WindowInternal.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(Interop.WindowInternal.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(Interop.WindowInternal.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(Interop.Window.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             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
1242             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1243
1244             LayersChildren?.Add(layer);
1245             layer.SetWindow(this);
1246         }
1247
1248         internal void Remove(Layer layer)
1249         {
1250             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
1251             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1252
1253             LayersChildren?.Remove(layer);
1254             layer.SetWindow(null);
1255         }
1256
1257         internal Vector2 GetSize()
1258         {
1259             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1260             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1261             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1262             return ret;
1263         }
1264
1265         internal RenderTaskList GetRenderTaskList()
1266         {
1267             RenderTaskList ret = new RenderTaskList(Interop.Stage.Stage_GetRenderTaskList(stageCPtr), true);
1268             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1269             return ret;
1270         }
1271
1272         /// <summary>
1273         /// Queries the number of on-window layers.
1274         /// </summary>
1275         /// <returns>The number of layers.</returns>
1276         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1277         internal uint GetLayerCount()
1278         {
1279             if (LayersChildren == null || LayersChildren.Count < 0)
1280                 return 0;
1281
1282             return (uint) LayersChildren.Count;
1283         }
1284
1285         internal Layer GetRootLayer()
1286         {
1287             // Window.IsInstalled() is actually true only when called from event thread and
1288             // Core has been initialized, not when Stage is ready.
1289             if (_rootLayer == null && Window.IsInstalled())
1290             {
1291                 _rootLayer = new Layer(Interop.Window.GetRootLayer(swigCPtr), true);
1292                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1293                 LayersChildren?.Add(_rootLayer);
1294                 _rootLayer.SetWindow(this);
1295             }
1296             return _rootLayer;
1297         }
1298
1299         internal void SetBackgroundColor(Vector4 color)
1300         {
1301             Interop.Window.SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1302             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1303         }
1304
1305         internal Vector4 GetBackgroundColor()
1306         {
1307             Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(swigCPtr), true);
1308             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1309             return ret;
1310         }
1311
1312         internal Vector2 GetDpi()
1313         {
1314             Vector2 ret = new Vector2(Interop.Stage.Stage_GetDpi(stageCPtr), true);
1315             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1316             return ret;
1317         }
1318
1319         internal ObjectRegistry GetObjectRegistry()
1320         {
1321             ObjectRegistry ret = new ObjectRegistry(Interop.Stage.Stage_GetObjectRegistry(stageCPtr), true);
1322             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1323             return ret;
1324         }
1325
1326         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1327         {
1328             Interop.Stage.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1329             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1330         }
1331
1332         internal RenderingBehaviorType GetRenderingBehavior()
1333         {
1334             RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.Stage_GetRenderingBehavior(stageCPtr);
1335             if (NDalicPINVOKE.SWIGPendingException.Pending)
1336                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1337             return ret;
1338         }
1339
1340         internal KeyEventSignal KeyEventSignal()
1341         {
1342             KeyEventSignal ret = new KeyEventSignal(Interop.Window.KeyEventSignal(swigCPtr), false);
1343             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1344             return ret;
1345         }
1346
1347         internal VoidSignal EventProcessingFinishedSignal()
1348         {
1349             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_EventProcessingFinishedSignal(stageCPtr), false);
1350             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1351             return ret;
1352         }
1353
1354         internal TouchSignal TouchSignal()
1355         {
1356             TouchSignal ret = new TouchSignal(Interop.Window.TouchSignal(swigCPtr), false);
1357             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358             return ret;
1359         }
1360
1361         internal TouchDataSignal TouchDataSignal()
1362         {
1363             TouchDataSignal ret = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false);
1364             if (NDalicPINVOKE.SWIGPendingException.Pending)
1365                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1366             return ret;
1367         }
1368
1369         internal VoidSignal ContextLostSignal()
1370         {
1371             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_ContextLostSignal(stageCPtr), false);
1372             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1373             return ret;
1374         }
1375
1376         internal VoidSignal ContextRegainedSignal()
1377         {
1378             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_ContextRegainedSignal(stageCPtr), false);
1379             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1380             return ret;
1381         }
1382
1383         internal VoidSignal SceneCreatedSignal()
1384         {
1385             VoidSignal ret = new VoidSignal(Interop.StageSignal.Stage_SceneCreatedSignal(stageCPtr), false);
1386             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1387             return ret;
1388         }
1389
1390         internal ResizedSignal ResizedSignal()
1391         {
1392             ResizedSignal ret = new ResizedSignal(Interop.Window.Window_ResizedSignal(swigCPtr), false);
1393             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1394             return ret;
1395         }
1396
1397         internal void SetWindowSize(Size2D size)
1398         {
1399             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1400             Interop.Window.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1401
1402             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1403
1404             // Resetting Window size should request a relayout of the tree.
1405         }
1406
1407         internal Size2D GetWindowSize()
1408         {
1409             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1410             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1411
1412             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1413             return ret;
1414         }
1415
1416         internal void SetPosition(Position2D position)
1417         {
1418             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1419             Interop.Window.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1420
1421             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1422
1423             // Setting Position of the window should request a relayout of the tree.
1424
1425         }
1426
1427         internal Position2D GetPosition()
1428         {
1429             var val = new Uint16Pair(Interop.Window.GetPosition(swigCPtr), true);
1430             Position2D ret = new Position2D(val.GetX(), val.GetY());
1431
1432             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1433             return ret;
1434         }
1435
1436         internal void SetPositionSize(Rectangle positionSize)
1437         {
1438             Interop.Window.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
1439
1440             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1441
1442             // Setting Position of the window should request a relayout of the tree.
1443
1444         }
1445
1446         /// <summary>
1447         /// Sets whether the window is transparent or not.
1448         /// </summary>
1449         /// <param name="transparent">Whether the window is transparent or not.</param>
1450         /// <since_tizen> 5 </since_tizen>
1451         public void SetTransparency(bool transparent) {
1452             Interop.Window.SetTransparency(swigCPtr, transparent);
1453             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1454
1455             // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1456
1457         }
1458
1459         /// <summary>
1460         /// Dispose for Window
1461         /// </summary>
1462         [EditorBrowsable(EditorBrowsableState.Never)]
1463         protected override void Dispose(DisposeTypes type)
1464         {
1465             if (disposed)
1466             {
1467                 return;
1468             }
1469
1470             if (type == DisposeTypes.Explicit)
1471             {
1472                 //Called by User
1473                 //Release your own managed resources here.
1474                 //You should release all of your own disposable objects here.
1475
1476             }
1477
1478             this.DisconnectNativeSignals();
1479
1480             //Release your own unmanaged resources here.
1481             //You should not access any managed member here except static instance.
1482             //because the execution order of Finalizes is non-deterministic.
1483
1484             if (swigCPtr.Handle != global::System.IntPtr.Zero)
1485             {
1486                 if (swigCMemOwn)
1487                 {
1488                     swigCMemOwn = false;
1489                     Interop.Window.delete_Window(swigCPtr);
1490                 }
1491                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1492             }
1493
1494             base.Dispose(type);
1495         }
1496
1497         internal System.IntPtr GetNativeWindowHandler()
1498         {
1499             System.IntPtr ret = Interop.Window.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
1500             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1501             return ret;
1502         }
1503
1504         private void OnWindowFocusedChanged(bool focusGained)
1505         {
1506             FocusChangedEventArgs e = new FocusChangedEventArgs();
1507
1508             e.FocusGained = focusGained;
1509
1510             if (_windowFocusChangedEventHandler != null)
1511             {
1512                 _windowFocusChangedEventHandler(this, e);
1513             }
1514         }
1515
1516         private StageWheelSignal WheelEventSignal()
1517         {
1518             StageWheelSignal ret = new StageWheelSignal(Interop.StageSignal.Stage_WheelEventSignal(stageCPtr), false);
1519             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1520             return ret;
1521         }
1522
1523         private WheelSignal StageWheelEventSignal()
1524         {
1525             WheelSignal ret = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false);
1526             if (NDalicPINVOKE.SWIGPendingException.Pending)
1527                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1528             return ret;
1529         }
1530
1531         private bool OnWindowTouch(IntPtr view, IntPtr touchData)
1532         {
1533             if (touchData == global::System.IntPtr.Zero)
1534             {
1535                 NUILog.Error("touchData should not be null!");
1536                 return false;
1537             }
1538
1539             TouchEventArgs e = new TouchEventArgs();
1540
1541             e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
1542
1543             if (_rootLayerTouchDataEventHandler != null)
1544             {
1545                 _rootLayerTouchDataEventHandler(this, e);
1546             }
1547             return false;
1548         }
1549
1550         private bool OnStageWheel(IntPtr rootLayer, IntPtr wheelEvent)
1551         {
1552             if (wheelEvent == global::System.IntPtr.Zero)
1553             {
1554                 NUILog.Error("wheelEvent should not be null!");
1555                 return true;
1556             }
1557
1558             WheelEventArgs e = new WheelEventArgs();
1559
1560             e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
1561
1562             if (_stageWheelHandler != null)
1563             {
1564                 _stageWheelHandler(this, e);
1565             }
1566             return true;
1567         }
1568
1569         // Callback for Stage KeyEventsignal
1570         private void OnStageKey(IntPtr data)
1571         {
1572             KeyEventArgs e = new KeyEventArgs();
1573             e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1574
1575
1576             if (_stageKeyHandler != null)
1577             {
1578                 //here we send all data to user event handlers
1579                 _stageKeyHandler(this, e);
1580             }
1581         }
1582
1583         // Callback for Stage EventProcessingFinishedSignal
1584         private void OnEventProcessingFinished()
1585         {
1586             if (_stageEventProcessingFinishedEventHandler != null)
1587             {
1588                 _stageEventProcessingFinishedEventHandler(this, null);
1589             }
1590         }
1591
1592         // Callback for Stage ContextLostSignal
1593         private void OnContextLost()
1594         {
1595             if (_stageContextLostEventHandler != null)
1596             {
1597                 _stageContextLostEventHandler(this, null);
1598             }
1599         }
1600
1601         // Callback for Stage ContextRegainedSignal
1602         private void OnContextRegained()
1603         {
1604             if (_stageContextRegainedEventHandler != null)
1605             {
1606                 _stageContextRegainedEventHandler(this, null);
1607             }
1608         }
1609
1610         // Callback for Stage SceneCreatedSignal
1611         private void OnSceneCreated()
1612         {
1613             if (_stageSceneCreatedEventHandler != null)
1614             {
1615                 _stageSceneCreatedEventHandler(this, null);
1616             }
1617         }
1618
1619         private void OnResized(IntPtr windowSize)
1620         {
1621             ResizedEventArgs e = new ResizedEventArgs();
1622             var val = new Uint16Pair(windowSize, false);
1623             e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1624             val.Dispose();
1625
1626             if (_windowResizedEventHandler != null)
1627             {
1628                 _windowResizedEventHandler(this, e);
1629             }
1630         }
1631
1632         private void OnWindowFocusedChanged2(bool focusGained)
1633         {
1634             FocusChangedEventArgs e = new FocusChangedEventArgs();
1635
1636             e.FocusGained = focusGained;
1637
1638             if (_windowFocusChangedEventHandler2 != null)
1639             {
1640                 _windowFocusChangedEventHandler2(this, e);
1641             }
1642         }
1643
1644         /// <summary>
1645         /// The focus changed event argument.
1646         /// </summary>
1647         /// <since_tizen> 3 </since_tizen>
1648         public class FocusChangedEventArgs : EventArgs
1649         {
1650             /// <summary>
1651             /// FocusGained flag.
1652             /// </summary>
1653             /// <since_tizen> 3 </since_tizen>
1654             public bool FocusGained
1655             {
1656                 get;
1657                 set;
1658             }
1659         }
1660
1661         /// <summary>
1662         /// The touch event argument.
1663         /// </summary>
1664         /// <since_tizen> 3 </since_tizen>
1665         public class TouchEventArgs : EventArgs
1666         {
1667             private Touch _touch;
1668
1669             /// <summary>
1670             /// Touch.
1671             /// </summary>
1672             /// <since_tizen> 3 </since_tizen>
1673             public Touch Touch
1674             {
1675                 get
1676                 {
1677                     return _touch;
1678                 }
1679                 set
1680                 {
1681                     _touch = value;
1682                 }
1683             }
1684         }
1685
1686         /// <summary>
1687         /// Wheel event arguments.
1688         /// </summary>
1689         /// <since_tizen> 3 </since_tizen>
1690         public class WheelEventArgs : EventArgs
1691         {
1692             private Wheel _wheel;
1693
1694             /// <summary>
1695             /// Wheel.
1696             /// </summary>
1697             /// <since_tizen> 3 </since_tizen>
1698             public Wheel Wheel
1699             {
1700                 get
1701                 {
1702                     return _wheel;
1703                 }
1704                 set
1705                 {
1706                     _wheel = value;
1707                 }
1708             }
1709         }
1710
1711         /// <summary>
1712         /// Key event arguments.
1713         /// </summary>
1714         /// <since_tizen> 3 </since_tizen>
1715         public class KeyEventArgs : EventArgs
1716         {
1717             private Key _key;
1718
1719             /// <summary>
1720             /// Key.
1721             /// </summary>
1722             /// <since_tizen> 3 </since_tizen>
1723             public Key Key
1724             {
1725                 get
1726                 {
1727                     return _key;
1728                 }
1729                 set
1730                 {
1731                     _key = value;
1732                 }
1733             }
1734         }
1735
1736         /// <summary>
1737         /// Sets position and size of the window. This API guarantees that
1738         /// both moving and resizing of window will appear on the screen at once.
1739         /// </summary>
1740         [EditorBrowsable(EditorBrowsableState.Never)]
1741         public Rectangle WindowPositionSize
1742         {
1743             get
1744             {
1745                 Position2D position = GetPosition();
1746                 Size2D size = GetSize();
1747                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
1748                 return ret;
1749             }
1750             set
1751             {
1752                 SetPositionSize(value);
1753             }
1754         }
1755
1756         /// <summary>
1757         /// Feeds a key event into the window.
1758         /// This resized event arguments.
1759         /// </summary>
1760         /// <since_tizen> 3 </since_tizen>
1761         public class ResizedEventArgs : EventArgs
1762         {
1763             Size2D _windowSize;
1764
1765             /// <summary>
1766             /// This window size.
1767             /// </summary>
1768             /// <since_tizen> 4 </since_tizen>
1769             public Size2D WindowSize
1770             {
1771                 get
1772                 {
1773                     return _windowSize;
1774                 }
1775                 set
1776                 {
1777                     _windowSize = value;
1778                 }
1779             }
1780         }
1781
1782         /// <summary>
1783         /// Please do not use! this will be deprecated
1784         /// </summary>
1785         /// <since_tizen> 3 </since_tizen>
1786         [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
1787             "Like: " +
1788             "Window.Instance.FocusChanged = OnFocusChanged; " +
1789             "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
1790         [EditorBrowsable(EditorBrowsableState.Never)]
1791         public class WindowFocusChangedEventArgs : EventArgs
1792         {
1793             /// <summary>
1794             /// Please do not use! this will be deprecated
1795             /// </summary>
1796             /// <since_tizen> 3 </since_tizen>
1797             public bool FocusGained
1798             {
1799                 get;
1800                 set;
1801             }
1802         }
1803
1804         /// <summary>
1805         /// Contains and encapsulates Native Window handle.
1806         /// </summary>
1807         /// <since_tizen> 4 </since_tizen>
1808         public class SafeNativeWindowHandle : SafeHandle
1809         {
1810             /// <summary>
1811             /// Contructor, Native window handle is set to handle.
1812             /// </summary>
1813             /// <since_tizen> 4 </since_tizen>
1814             public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
1815             {
1816                 SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
1817             }
1818             /// <summary>
1819             /// Null check if the handle is valid or not.
1820             /// </summary>
1821             /// <since_tizen> 4 </since_tizen>
1822             public override bool IsInvalid
1823             {
1824                 get
1825                 {
1826                     return this.handle == IntPtr.Zero;
1827                 }
1828             }
1829             /// <summary>
1830             /// Release handle itself.
1831             /// </summary>
1832             /// <returns>true when released successfully.</returns>
1833             /// <since_tizen> 4 </since_tizen>
1834             protected override bool ReleaseHandle()
1835             {
1836                 return true;
1837             }
1838         }
1839
1840         /// <summary>
1841         /// Disconnect all native signals
1842         /// </summary>
1843         /// <since_tizen> 5 </since_tizen>
1844         internal void DisconnectNativeSignals()
1845         {
1846             if( _windowFocusChangedEventCallback != null )
1847             {
1848                 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
1849             }
1850
1851             if( _rootLayerTouchDataCallback != null )
1852             {
1853                 TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
1854             }
1855
1856             if( _wheelEventCallback != null )
1857             {
1858                 StageWheelEventSignal().Disconnect(_wheelEventCallback);
1859             }
1860
1861             if( _stageKeyCallbackDelegate != null )
1862             {
1863                 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1864             }
1865
1866             if( _stageEventProcessingFinishedEventCallbackDelegate != null )
1867             {
1868                 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1869             }
1870
1871             if( _stageContextLostEventCallbackDelegate != null )
1872             {
1873                 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1874             }
1875
1876             if( _stageContextRegainedEventCallbackDelegate != null )
1877             {
1878                 ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1879             }
1880
1881             if( _stageSceneCreatedEventCallbackDelegate != null )
1882             {
1883                 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1884             }
1885
1886             if( _windowResizedEventCallback != null )
1887             {
1888                 ResizedSignal().Disconnect(_windowResizedEventCallback);
1889             }
1890
1891             if( _windowFocusChangedEventCallback2 != null )
1892             {
1893                 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1894             }
1895
1896         }
1897
1898     }
1899 }