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