[NUI] Integration from dalihub (#1073)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.ComponentModel;
19 using System.Collections.Generic;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.BaseComponents;
22
23 namespace Tizen.NUI
24 {
25     /// <summary>
26     /// The window class is used internally for drawing.<br />
27     /// The window has an orientation and indicator properties.<br />
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public partial class Window : BaseHandle
31     {
32         private static readonly Window instance = Application.Instance?.GetWindow();
33         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
34         private global::System.Runtime.InteropServices.HandleRef stageCPtr;
35         private Layer _rootLayer;
36         private string _windowTitle;
37         private List<Layer> _childLayers = new List<Layer>();
38         private LayoutController localController;
39
40         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Window.Window_SWIGUpcast(cPtr), cMemoryOwn)
41         {
42             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
43             if (Interop.Stage.Stage_IsInstalled())
44             {
45                 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.Stage_GetCurrent());
46
47                 localController = new LayoutController(this);
48                 NUILog.Debug("layoutController id:" + localController.GetId() );
49             }
50         }
51                 
52         /// <summary>
53         /// Creates a new Window.<br />
54         /// This creates an extra window in addition to the default main window<br />
55         /// </summary>
56         /// <param name="windowPosition">The position and size of the Window.</param>
57         /// <param name="isTranslucent">Whether Window is translucent.</param>
58         /// <returns>A new Window.</returns>
59         /// <since_tizen> 6 </since_tizen>
60         public Window(Rectangle windowPosition = null , bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
61         {
62             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
63         }
64
65         /// <summary>
66         /// Creates a new Window.<br />
67         /// This creates an extra window in addition to the default main window<br />
68         /// </summary>
69         /// <param name="name">The name for extra window. </param>
70         /// <param name="windowPosition">The position and size of the Window.</param>
71         /// <param name="isTranslucent">Whether Window is translucent.</param>
72         /// <returns>A new Window.</returns>
73         /// <since_tizen> 6 </since_tizen>
74         public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
75         {
76             this._windowTitle = name;
77             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78         }
79
80         /// <summary>
81         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
82         /// </summary>
83         /// <since_tizen> 3 </since_tizen>
84         public enum WindowOrientation
85         {
86             /// <summary>
87             /// Portrait orientation. The height of the display area is greater than the width.
88             /// </summary>
89             /// <since_tizen> 3 </since_tizen>
90             Portrait = 0,
91             /// <summary>
92             /// Landscape orientation. A wide view area is needed.
93             /// </summary>
94             /// <since_tizen> 3 </since_tizen>
95             Landscape = 90,
96             /// <summary>
97             /// Portrait inverse orientation.
98             /// </summary>
99             /// <since_tizen> 3 </since_tizen>
100             PortraitInverse = 180,
101             /// <summary>
102             /// Landscape inverse orientation.
103             /// </summary>
104             /// <since_tizen> 3 </since_tizen>
105             LandscapeInverse = 270
106         }
107
108         /// <summary>
109         /// Enumeration for the key grab mode for platform-level APIs.
110         /// </summary>
111         /// <since_tizen> 3 </since_tizen>
112         public enum KeyGrabMode
113         {
114             /// <summary>
115             /// Grabs a key only when on the top of the grabbing-window stack mode.
116             /// </summary>
117             Topmost = 0,
118             /// <summary>
119             /// Grabs a key together with the other client window(s) mode.
120             /// </summary>
121             Shared,
122             /// <summary>
123             /// 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.
124             /// </summary>
125             OverrideExclusive,
126             /// <summary>
127             /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
128             /// </summary>
129             Exclusive
130         };
131
132         /// <summary>
133         /// Enumeration for transition effect's state.
134         /// </summary>
135         [EditorBrowsable(EditorBrowsableState.Never)]
136         public enum EffectStates
137         {
138             /// <summary>
139             /// None state.
140             /// </summary>
141             [EditorBrowsable(EditorBrowsableState.Never)]
142             None = 0,
143             /// <summary>
144             /// Transition effect is started.
145             /// </summary>
146             [EditorBrowsable(EditorBrowsableState.Never)]
147             Start,
148             /// <summary>
149             /// Transition effect is ended.
150             /// </summary>
151             [EditorBrowsable(EditorBrowsableState.Never)]
152             End,
153         }
154
155         /// <summary>
156         /// Enumeration for transition effect's type.
157         /// </summary>
158         [EditorBrowsable(EditorBrowsableState.Never)]
159         public enum EffectTypes
160         {
161             /// <summary>
162             /// None type.
163             /// </summary>
164             [EditorBrowsable(EditorBrowsableState.Never)]
165             None = 0,
166             /// <summary>
167             /// Window show effect.
168             /// </summary>
169             [EditorBrowsable(EditorBrowsableState.Never)]
170             Show,
171             /// <summary>
172             /// Window hide effect.
173             /// </summary>
174             [EditorBrowsable(EditorBrowsableState.Never)]
175             Hide,
176         }
177
178         /// <summary>
179         /// Enumeration for opacity of the indicator.
180         /// </summary>
181         internal enum IndicatorBackgroundOpacity
182         {
183             Opaque = 100,
184             Translucent = 50,
185             Transparent = 0
186         }
187
188         /// <summary>
189         /// Enumeration for visible mode of the indicator.
190         /// </summary>
191         internal enum IndicatorVisibleMode
192         {
193             Invisible = 0,
194             Visible = 1,
195             Auto = 2
196         }
197
198         /// <summary>
199         /// The stage instance property (read-only).<br />
200         /// Gets the current window.<br />
201         /// </summary>
202         /// <since_tizen> 3 </since_tizen>
203         public static Window Instance
204         {
205             get
206             {
207                 return instance;
208             }
209         }
210
211         /// <summary>
212         /// Gets or sets a window type.
213         /// </summary>
214         /// <since_tizen> 3 </since_tizen>
215         public WindowType Type
216         {
217             get
218             {
219                 WindowType ret = (WindowType)Interop.Window.GetType(swigCPtr);
220                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221                 return ret;
222             }
223             set
224             {
225                 Interop.Window.SetType(swigCPtr, (int)value);
226                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227             }
228         }
229
230         /// <summary>
231         /// Gets/Sets a window title.
232         /// </summary>
233         /// <since_tizen> 4 </since_tizen>
234         public string Title
235         {
236             get
237             {
238                 return _windowTitle;
239             }
240             set
241             {
242                 _windowTitle = value;
243                 SetClass(_windowTitle, "");
244             }
245         }
246
247         /// <summary>
248         /// The rendering behavior of a Window.
249         /// </summary>
250         /// <since_tizen> 5 </since_tizen>
251         public RenderingBehaviorType RenderingBehavior
252         {
253             get
254             {
255                 return GetRenderingBehavior();
256             }
257             set
258             {
259                 SetRenderingBehavior(value);
260             }
261         }
262
263         /// <summary>
264         /// The window size property (read-only).
265         /// </summary>
266         /// <since_tizen> 3 </since_tizen>
267         public Size2D Size
268         {
269             get
270             {
271                 Size2D ret = GetSize();
272                 return ret;
273             }
274         }
275
276         /// <summary>
277         /// The background color property.
278         /// </summary>
279         /// <since_tizen> 3 </since_tizen>
280         public Color BackgroundColor
281         {
282             set
283             {
284                 SetBackgroundColor(value);
285             }
286             get
287             {
288                 Color ret = GetBackgroundColor();
289                 return ret;
290             }
291         }
292
293         /// <summary>
294         /// The DPI property (read-only).<br />
295         /// Retrieves the DPI of the display device to which the Window is connected.<br />
296         /// </summary>
297         /// <since_tizen> 3 </since_tizen>
298         public Vector2 Dpi
299         {
300             get
301             {
302                 return GetDpi();
303             }
304         }
305
306         /// <summary>
307         /// The layer count property (read-only).<br />
308         /// Queries the number of on-Window layers.<br />
309         /// </summary>
310         /// <since_tizen> 3 </since_tizen>
311         public uint LayerCount
312         {
313             get
314             {
315                 return GetLayerCount();
316             }
317         }
318
319         /// <summary>
320         /// Gets or sets a size of the window.
321         /// </summary>
322         /// <since_tizen> 4 </since_tizen>
323         public Size2D WindowSize
324         {
325             get
326             {
327                 return GetWindowSize();
328             }
329             set
330             {
331                 SetWindowSize(value);
332             }
333         }
334
335         /// <summary>
336         /// Gets or sets a position of the window.
337         /// </summary>
338         /// <since_tizen> 4 </since_tizen>
339         public Position2D WindowPosition
340         {
341             get
342             {
343                 return GetPosition();
344             }
345             set
346             {
347                 SetPosition(value);
348             }
349         }
350
351         /// <summary>
352         /// Sets position and size of the window. This API guarantees that
353         /// both moving and resizing of window will appear on the screen at once.
354         /// </summary>
355         [EditorBrowsable(EditorBrowsableState.Never)]
356         public Rectangle WindowPositionSize
357         {
358             get
359             {
360                 Position2D position = GetPosition();
361                 Size2D size = GetSize();
362                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
363                 return ret;
364             }
365             set
366             {
367                 SetPositionSize(value);
368             }
369         }
370
371         internal static Vector4 DEFAULT_BACKGROUND_COLOR
372         {
373             get
374             {
375                 global::System.IntPtr cPtr = Interop.Stage.Stage_DEFAULT_BACKGROUND_COLOR_get();
376                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
377                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378                 return ret;
379             }
380         }
381
382         internal static Vector4 DEBUG_BACKGROUND_COLOR
383         {
384             get
385             {
386                 global::System.IntPtr cPtr = Interop.Stage.Stage_DEBUG_BACKGROUND_COLOR_get();
387                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
388                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389                 return ret;
390             }
391         }
392
393         internal List<Layer> LayersChildren
394         {
395             get
396             {
397                 return _childLayers;
398             }
399         }
400
401         /// <summary>
402         ///  Get the LayoutController for this Window.
403         /// </summary>
404         internal LayoutController LayoutController
405         {
406             get
407             {
408                 return localController;
409             }
410         }
411
412         /// <summary>
413         /// Feed a key-event into the window.
414         /// </summary>
415         /// <param name="keyEvent">The key event to feed.</param>
416         /// <since_tizen> 4 </since_tizen>
417         [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
418         public static void FeedKeyEvent(Key keyEvent)
419         {
420             Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
421             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422         }
423
424         /// <summary>
425         /// Sets whether the window accepts a focus or not.
426         /// </summary>
427         /// <param name="accept">If a focus is accepted or not. The default is true.</param>
428         /// <since_tizen> 3 </since_tizen>
429         public void SetAcceptFocus(bool accept)
430         {
431             Interop.Window.SetAcceptFocus(swigCPtr, accept);
432             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433         }
434
435         /// <summary>
436         /// Returns whether the window accepts a focus or not.
437         /// </summary>
438         /// <returns>True if the window accepts a focus, false otherwise.</returns>
439         /// <since_tizen> 3 </since_tizen>
440         public bool IsFocusAcceptable()
441         {
442             bool ret = Interop.Window.IsFocusAcceptable(swigCPtr);
443             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444
445             return ret;
446         }
447
448         /// <summary>
449         /// Shows the window if it is hidden.
450         /// </summary>
451         /// <since_tizen> 3 </since_tizen>
452         public void Show()
453         {
454             Interop.Window.Show(swigCPtr);
455             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
456         }
457
458         /// <summary>
459         /// Hides the window if it is showing.
460         /// </summary>
461         /// <since_tizen> 3 </since_tizen>
462         public void Hide()
463         {
464             Interop.Window.Hide(swigCPtr);
465             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466         }
467
468         /// <summary>
469         /// Retrieves whether the window is visible or not.
470         /// </summary>
471         /// <returns>True if the window is visible.</returns>
472         /// <since_tizen> 3 </since_tizen>
473         public bool IsVisible()
474         {
475             bool temp = Interop.Window.IsVisible(swigCPtr);
476             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
477             return temp;
478         }
479
480         /// <summary>
481         /// Gets the count of supported auxiliary hints of the window.
482         /// </summary>
483         /// <returns>The number of supported auxiliary hints.</returns>
484         /// <since_tizen> 3 </since_tizen>
485         public uint GetSupportedAuxiliaryHintCount()
486         {
487             uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(swigCPtr);
488             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
489             return ret;
490         }
491
492         /// <summary>
493         /// Gets the supported auxiliary hint string of the window.
494         /// </summary>
495         /// <param name="index">The index of the supported auxiliary hint lists.</param>
496         /// <returns>The auxiliary hint string of the index.</returns>
497         /// <since_tizen> 3 </since_tizen>
498         public string GetSupportedAuxiliaryHint(uint index)
499         {
500             string ret = Interop.Window.GetSupportedAuxiliaryHint(swigCPtr, index);
501             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
502             return ret;
503         }
504
505         /// <summary>
506         /// Creates an auxiliary hint of the window.
507         /// </summary>
508         /// <param name="hint">The auxiliary hint string.</param>
509         /// <param name="value">The value string.</param>
510         /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
511         /// <since_tizen> 3 </since_tizen>
512         public uint AddAuxiliaryHint(string hint, string value)
513         {
514             uint ret = Interop.Window.AddAuxiliaryHint(swigCPtr, hint, value);
515             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516             return ret;
517         }
518
519         /// <summary>
520         /// Removes an auxiliary hint of the window.
521         /// </summary>
522         /// <param name="id">The ID of the auxiliary hint.</param>
523         /// <returns>True if no error occurred, false otherwise.</returns>
524         /// <since_tizen> 3 </since_tizen>
525         public bool RemoveAuxiliaryHint(uint id)
526         {
527             bool ret = Interop.Window.RemoveAuxiliaryHint(swigCPtr, id);
528             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529             return ret;
530         }
531
532         /// <summary>
533         /// Changes a value of the auxiliary hint.
534         /// </summary>
535         /// <param name="id">The auxiliary hint ID.</param>
536         /// <param name="value">The value string to be set.</param>
537         /// <returns>True if no error occurred, false otherwise.</returns>
538         /// <since_tizen> 3 </since_tizen>
539         public bool SetAuxiliaryHintValue(uint id, string value)
540         {
541             bool ret = Interop.Window.SetAuxiliaryHintValue(swigCPtr, id, value);
542             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543             return ret;
544         }
545
546         /// <summary>
547         /// Gets a value of the auxiliary hint.
548         /// </summary>
549         /// <param name="id">The auxiliary hint ID.</param>
550         /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
551         /// <since_tizen> 3 </since_tizen>
552         public string GetAuxiliaryHintValue(uint id)
553         {
554             string ret = Interop.Window.GetAuxiliaryHintValue(swigCPtr, id);
555             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
556             return ret;
557         }
558
559         /// <summary>
560         /// Gets an ID of the auxiliary hint string.
561         /// </summary>
562         /// <param name="hint">The auxiliary hint string.</param>
563         /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
564         /// <since_tizen> 3 </since_tizen>
565         public uint GetAuxiliaryHintId(string hint)
566         {
567             uint ret = Interop.Window.GetAuxiliaryHintId(swigCPtr, hint);
568             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569             return ret;
570         }
571
572         /// <summary>
573         /// Sets a region to accept input events.
574         /// </summary>
575         /// <param name="inputRegion">The region to accept input events.</param>
576         /// <since_tizen> 3 </since_tizen>
577         public void SetInputRegion(Rectangle inputRegion)
578         {
579             Interop.Window.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
580             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
581         }
582
583         /// <summary>
584         /// Sets a priority level for the specified notification window.
585         /// </summary>
586         /// <param name="level">The notification window level.</param>
587         /// <returns>True if no error occurred, false otherwise.</returns>
588         /// <since_tizen> 3 </since_tizen>
589         public bool SetNotificationLevel(NotificationLevel level)
590         {
591             bool ret = Interop.Window.SetNotificationLevel(swigCPtr, (int)level);
592             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593             return ret;
594         }
595
596         /// <summary>
597         /// Gets a priority level for the specified notification window.
598         /// </summary>
599         /// <returns>The notification window level.</returns>
600         /// <since_tizen> 3 </since_tizen>
601         public NotificationLevel GetNotificationLevel()
602         {
603             NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(swigCPtr);
604             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605             return ret;
606         }
607
608         /// <summary>
609         /// Sets a transparent window's visual state to opaque. <br />
610         /// If a visual state of a transparent window is opaque, <br />
611         /// then the window manager could handle it as an opaque window when calculating visibility.
612         /// </summary>
613         /// <param name="opaque">Whether the window's visual state is opaque.</param>
614         /// <remarks>This will have no effect on an opaque window. <br />
615         /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
616         /// </remarks>
617         /// <since_tizen> 3 </since_tizen>
618         public void SetOpaqueState(bool opaque)
619         {
620             Interop.Window.SetOpaqueState(swigCPtr, opaque);
621             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622         }
623
624         /// <summary>
625         /// Returns whether a transparent window's visual state is opaque or not.
626         /// </summary>
627         /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
628         /// <remarks> The return value has no meaning on an opaque window. </remarks>
629         /// <since_tizen> 3 </since_tizen>
630         public bool IsOpaqueState()
631         {
632             bool ret = Interop.Window.IsOpaqueState(swigCPtr);
633             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634             return ret;
635         }
636
637         /// <summary>
638         /// Sets a window's screen off mode.
639         /// </summary>
640         /// <param name="screenOffMode">The screen mode.</param>
641         /// <returns>True if no error occurred, false otherwise.</returns>
642         /// <since_tizen> 4 </since_tizen>
643         public bool SetScreenOffMode(ScreenOffMode screenOffMode)
644         {
645             bool ret = Interop.Window.SetScreenOffMode(swigCPtr, (int)screenOffMode);
646             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647             return ret;
648         }
649
650         /// <summary>
651         /// Gets the screen mode of the window.
652         /// </summary>
653         /// <returns>The screen off mode.</returns>
654         /// <since_tizen> 4 </since_tizen>
655         public ScreenOffMode GetScreenOffMode()
656         {
657             ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(swigCPtr);
658             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659             return ret;
660         }
661
662         /// <summary>
663         /// Sets preferred brightness of the window.
664         /// </summary>
665         /// <param name="brightness">The preferred brightness (0 to 100).</param>
666         /// <returns>True if no error occurred, false otherwise.</returns>
667         /// <since_tizen> 3 </since_tizen>
668         public bool SetBrightness(int brightness)
669         {
670             bool ret = Interop.Window.SetBrightness(swigCPtr, brightness);
671             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
672             return ret;
673         }
674
675         /// <summary>
676         /// Gets the preferred brightness of the window.
677         /// </summary>
678         /// <returns>The preferred brightness.</returns>
679         /// <since_tizen> 3 </since_tizen>
680         public int GetBrightness()
681         {
682             int ret = Interop.Window.GetBrightness(swigCPtr);
683             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684             return ret;
685         }
686
687         /// <summary>
688         /// Sets the window name and the class string.
689         /// </summary>
690         /// <param name="name">The name of the window.</param>
691         /// <param name="klass">The class of the window.</param>
692         /// <since_tizen> 4 </since_tizen>
693         public void SetClass(string name, string klass)
694         {
695             Interop.Window.Window_SetClass(swigCPtr, name, klass);
696             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
697         }
698
699         /// <summary>
700         /// Raises the window to the top of the window stack.
701         /// </summary>
702         /// <since_tizen> 3 </since_tizen>
703         public void Raise()
704         {
705             Interop.Window.Window_Raise(swigCPtr);
706             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
707         }
708
709         /// <summary>
710         /// Lowers the window to the bottom of the window stack.
711         /// </summary>
712         /// <since_tizen> 3 </since_tizen>
713         public void Lower()
714         {
715             Interop.Window.Window_Lower(swigCPtr);
716             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
717         }
718
719         /// <summary>
720         /// Activates the window to the top of the window stack even it is iconified.
721         /// </summary>
722         /// <since_tizen> 3 </since_tizen>
723         public void Activate()
724         {
725             Interop.Window.Window_Activate(swigCPtr);
726             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
727         }
728
729         /// <summary>
730         /// Gets the default ( root ) layer.
731         /// </summary>
732         /// <returns>The root layer.</returns>
733         /// <since_tizen> 3 </since_tizen>
734         public Layer GetDefaultLayer()
735         {
736             return this.GetRootLayer();
737         }
738
739         /// <summary>
740         /// Add a child view to window.
741         /// </summary>
742         /// <param name="view">the child should be added to the window.</param>
743         /// <since_tizen> 3 </since_tizen>
744         public void Add(View view)
745         {
746             Interop.Actor.Actor_Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
747             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
748             this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
749             view.InternalParent = this.GetRootLayer();
750         }
751
752         /// <summary>
753         /// Remove a child view from window.
754         /// </summary>
755         /// <param name="view">the child to be removed.</param>
756         /// <since_tizen> 3 </since_tizen>
757         public void Remove(View view)
758         {
759             Interop.Actor.Actor_Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
760             this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
761             view.InternalParent = null;
762         }
763
764         /// <summary>
765         /// Retrieves the layer at a specified depth.
766         /// </summary>
767         /// <param name="depth">The layer's depth index.</param>
768         /// <returns>The layer found at the given depth.</returns>
769         /// <since_tizen> 3 </since_tizen>
770         public Layer GetLayer(uint depth)
771         {
772             if (depth < LayersChildren?.Count)
773             {
774                 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
775                 return ret;
776             }
777             else
778             {
779                 return null;
780             }
781         }
782
783         /// <summary>
784         /// Destroy the window immediately.
785         /// </summary>
786         [EditorBrowsable(EditorBrowsableState.Never)]
787         public void Destroy()
788         {
789             this.Dispose();
790         }
791
792         /// <summary>
793         /// Keep rendering for at least the given amount of time.
794         /// </summary>
795         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
796         /// <since_tizen> 3 </since_tizen>
797         public void KeepRendering(float durationSeconds)
798         {
799             Interop.Stage.Stage_KeepRendering(stageCPtr, durationSeconds);
800             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801         }
802
803         /// <summary>
804         /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
805         /// This function can be used for following example scenarios: <br />
806         /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
807         /// </summary>
808         /// <param name="DaliKey">The key code to grab.</param>
809         /// <returns>True if the grab succeeds.</returns>
810         /// <since_tizen> 3 </since_tizen>
811         public bool GrabKeyTopmost(int DaliKey)
812         {
813             bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
814             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
815             return ret;
816         }
817
818         /// <summary>
819         /// Ungrabs the key specified by a key for the window.<br />
820         /// 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 />
821         /// </summary>
822         /// <param name="DaliKey">The key code to ungrab.</param>
823         /// <returns>True if the ungrab succeeds.</returns>
824         /// <since_tizen> 3 </since_tizen>
825         public bool UngrabKeyTopmost(int DaliKey)
826         {
827             bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
828             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
829             return ret;
830         }
831
832         /// <summary>
833         ///  Grabs the key specified by a key for a window in a GrabMode. <br />
834         ///  Details: This function can be used for following example scenarios: <br />
835         ///  - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
836         ///  - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
837         ///  - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
838         /// </summary>
839         /// <param name="DaliKey">The key code to grab.</param>
840         /// <param name="GrabMode">The grab mode for the key.</param>
841         /// <returns>True if the grab succeeds.</returns>
842         /// <since_tizen> 3 </since_tizen>
843         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
844         {
845             bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
846             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847             return ret;
848         }
849
850         /// <summary>
851         /// Ungrabs the key specified by a key for a window.<br />
852         /// 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 />
853         /// </summary>
854         /// <param name="DaliKey">The key code to ungrab.</param>
855         /// <returns>True if the ungrab succeeds.</returns>
856         /// <since_tizen> 3 </since_tizen>
857         public bool UngrabKey(int DaliKey)
858         {
859             bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
860             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
861             return ret;
862         }
863
864         /// <summary>
865         /// Sets the keyboard repeat information.
866         /// </summary>
867         /// <param name="rate">The key repeat rate value in seconds.</param>
868         /// <param name="delay">The key repeat delay value in seconds.</param>
869         /// <returns>True if setting the keyboard repeat succeeds.</returns>
870         /// <since_tizen> 5 </since_tizen>
871         public bool SetKeyboardRepeatInfo(float rate, float delay)
872         {
873             bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
874             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
875             return ret;
876         }
877
878         /// <summary>
879         /// Gets the keyboard repeat information.
880         /// </summary>
881         /// <param name="rate">The key repeat rate value in seconds.</param>
882         /// <param name="delay">The key repeat delay value in seconds.</param>
883         /// <returns>True if setting the keyboard repeat succeeds.</returns>
884         /// <since_tizen> 5 </since_tizen>
885         public bool GetKeyboardRepeatInfo(out float rate, out float delay)
886         {
887             bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
888             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
889             return ret;
890         }
891
892         /// <summary>
893         /// Adds a layer to the stage.
894         /// </summary>
895         /// <param name="layer">Layer to add.</param>
896         /// <since_tizen> 3 </since_tizen>
897         public void AddLayer(Layer layer)
898         {
899             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
900             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
901
902             LayersChildren?.Add(layer);
903             layer.SetWindow(this);
904         }
905
906         /// <summary>
907         /// Removes a layer from the stage.
908         /// </summary>
909         /// <param name="layer">Layer to remove.</param>
910         /// <since_tizen> 3 </since_tizen>
911         public void RemoveLayer(Layer layer)
912         {
913             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
914             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
915
916             LayersChildren?.Remove(layer);
917             layer.SetWindow(null);
918         }
919
920         /// <summary>
921         /// Feeds a key event into the window.
922         /// </summary>
923         /// <param name="keyEvent">The key event to feed.</param>
924         /// <since_tizen> 5 </since_tizen>
925         public void FeedKey(Key keyEvent)
926         {
927             Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
928             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
929         }
930
931         /// <summary>
932         /// Allows at least one more render, even when paused.
933         /// The window should be shown, not minimised.
934         /// </summary>
935         /// <since_tizen> 4 </since_tizen>
936         public void RenderOnce()
937         {
938             Interop.Window.Window_RenderOnce(swigCPtr);
939             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
940         }
941
942         /// <summary>
943         /// Sets whether the window is transparent or not.
944         /// </summary>
945         /// <param name="transparent">Whether the window is transparent or not.</param>
946         /// <since_tizen> 5 </since_tizen>
947         public void SetTransparency(bool transparent)
948         {
949             Interop.Window.SetTransparency(swigCPtr, transparent);
950             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
951
952             // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
953         }
954
955         /// <summary>
956         /// Sets parent window of the window.
957         /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
958         /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
959         /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
960         /// </summary>
961         /// <param name="parent">The parent window.</param>
962         /// <since_tizen> 6 </since_tizen>
963         public void SetParent(Window parent)
964         {
965             Interop.Window.SetParent(swigCPtr, Window.getCPtr(parent));
966             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967         }
968
969         /// <summary>
970         /// Unsets parent window of the window.
971         /// After unsetting, the window is disconnected his parent window.
972         /// </summary>
973         /// <since_tizen> 6 </since_tizen>
974         public void Unparent()
975         {
976             Interop.Window.Unparent(swigCPtr);
977             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
978         }
979
980         /// <summary>
981         /// Gets parent window of the window.
982         /// </summary>
983         /// <returns>The parent window of the window.</returns>
984         /// <since_tizen> 6 </since_tizen>
985         public Window GetParent()
986         {
987             Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(swigCPtr)) as Window;
988             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
989             return ret;
990         }
991
992         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
993         {
994             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
995         }
996
997         internal static Window GetCurrent()
998         {
999             Window ret = new Window(Interop.Stage.Stage_GetCurrent(), true);
1000             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1001             return ret;
1002         }
1003
1004         internal static bool IsInstalled()
1005         {
1006             bool ret = Interop.Stage.Stage_IsInstalled();
1007             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1008             return ret;
1009         }
1010
1011         internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
1012         {
1013             Interop.WindowInternal.Window_ShowIndicator(swigCPtr, (int)visibleMode);
1014             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1015         }
1016
1017         internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
1018         {
1019             Interop.WindowInternal.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
1020             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1021         }
1022
1023         internal void RotateIndicator(Window.WindowOrientation orientation)
1024         {
1025             Interop.WindowInternal.Window_RotateIndicator(swigCPtr, (int)orientation);
1026             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1027         }
1028
1029         /// <summary>
1030         /// Adds an orientation to the list of available orientations.
1031         /// </summary>
1032         /// <param name="orientation">The available orientation to add</param>
1033         /// <since_tizen> 6 </since_tizen>
1034         public void AddAvailableOrientation(Window.WindowOrientation orientation)
1035         {
1036             Interop.Window.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
1037             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038         }
1039
1040         /// <summary>
1041         /// Removes an orientation from the list of available orientations.
1042         /// </summary>
1043         /// <param name="orientation">The available orientation to remove.</param>
1044         /// <since_tizen> 6 </since_tizen>
1045         public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1046         {
1047             Interop.Window.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
1048             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1049         }
1050
1051         /// <summary>
1052         /// Sets a preferred orientation.
1053         /// </summary>
1054         /// <param name="orientation">The preferred orientation.</param>
1055         /// <since_tizen> 6 </since_tizen>
1056         public void SetPreferredOrientation(Window.WindowOrientation orientation)
1057         {
1058             Interop.Window.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
1059             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1060         }
1061
1062         /// <summary>
1063         /// Gets the preferred orientation.
1064         /// </summary>
1065         /// <since_tizen> 6 </since_tizen>
1066         /// <returns>The preferred orientation if previously set, or none.</returns>
1067         public Window.WindowOrientation GetPreferredOrientation()
1068         {
1069             Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.Window_GetPreferredOrientation(swigCPtr);
1070             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1071             return ret;
1072         }
1073
1074         internal Any GetNativeHandle()
1075         {
1076             Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true);
1077             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078             return ret;
1079         }
1080
1081         internal void Add(Layer layer)
1082         {
1083             Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
1084             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1085
1086             LayersChildren?.Add(layer);
1087             layer.SetWindow(this);
1088         }
1089
1090         internal void Remove(Layer layer)
1091         {
1092             Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
1093             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094
1095             LayersChildren?.Remove(layer);
1096             layer.SetWindow(null);
1097         }
1098
1099         internal Vector2 GetSize()
1100         {
1101             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1102             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1104             return ret;
1105         }
1106
1107         internal RenderTaskList GetRenderTaskList()
1108         {
1109             RenderTaskList ret = new RenderTaskList(Interop.Stage.Stage_GetRenderTaskList(stageCPtr), true);
1110             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1111             return ret;
1112         }
1113
1114         /// <summary>
1115         /// Queries the number of on-window layers.
1116         /// </summary>
1117         /// <returns>The number of layers.</returns>
1118         /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1119         internal uint GetLayerCount()
1120         {
1121             if (LayersChildren == null || LayersChildren.Count < 0)
1122                 return 0;
1123
1124             return (uint) LayersChildren.Count;
1125         }
1126
1127         internal Layer GetRootLayer()
1128         {
1129             // Window.IsInstalled() is actually true only when called from event thread and
1130             // Core has been initialized, not when Stage is ready.
1131             if (_rootLayer == null && Window.IsInstalled())
1132             {
1133                 _rootLayer = new Layer(Interop.Window.GetRootLayer(swigCPtr), true);
1134                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1135                 LayersChildren?.Add(_rootLayer);
1136                 _rootLayer.SetWindow(this);
1137             }
1138             return _rootLayer;
1139         }
1140
1141         internal void SetBackgroundColor(Vector4 color)
1142         {
1143             Interop.Window.SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1144             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1145         }
1146
1147         internal Vector4 GetBackgroundColor()
1148         {
1149             Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(swigCPtr), true);
1150             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1151             return ret;
1152         }
1153
1154         internal Vector2 GetDpi()
1155         {
1156             Vector2 ret = new Vector2(Interop.Stage.Stage_GetDpi(stageCPtr), true);
1157             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1158             return ret;
1159         }
1160
1161         internal ObjectRegistry GetObjectRegistry()
1162         {
1163             ObjectRegistry ret = new ObjectRegistry(Interop.Stage.Stage_GetObjectRegistry(stageCPtr), true);
1164             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1165             return ret;
1166         }
1167
1168         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1169         {
1170             Interop.Stage.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1172         }
1173
1174         internal RenderingBehaviorType GetRenderingBehavior()
1175         {
1176             RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.Stage_GetRenderingBehavior(stageCPtr);
1177             if (NDalicPINVOKE.SWIGPendingException.Pending)
1178                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1179             return ret;
1180         }
1181
1182         internal void SetWindowSize(Size2D size)
1183         {
1184             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1185             Interop.Window.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1186
1187             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188
1189             // Resetting Window size should request a relayout of the tree.
1190         }
1191
1192         internal Size2D GetWindowSize()
1193         {
1194             var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
1195             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1196
1197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1198             return ret;
1199         }
1200
1201         internal void SetPosition(Position2D position)
1202         {
1203             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1204             Interop.Window.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1205
1206             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1207             // Setting Position of the window should request a relayout of the tree.
1208         }
1209
1210         internal Position2D GetPosition()
1211         {
1212             var val = new Uint16Pair(Interop.Window.GetPosition(swigCPtr), true);
1213             Position2D ret = new Position2D(val.GetX(), val.GetY());
1214
1215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1216             return ret;
1217         }
1218
1219         internal void SetPositionSize(Rectangle positionSize)
1220         {
1221             Interop.Window.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
1222
1223             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224
1225             // Setting Position of the window should request a relayout of the tree.
1226         }
1227
1228         /// <summary>
1229         /// Dispose for Window
1230         /// </summary>
1231         [EditorBrowsable(EditorBrowsableState.Never)]
1232         protected override void Dispose(DisposeTypes type)
1233         {
1234             if (disposed)
1235             {
1236                 return;
1237             }
1238
1239             if (type == DisposeTypes.Explicit)
1240             {
1241                 //Called by User
1242                 //Release your own managed resources here.
1243                 //You should release all of your own disposable objects here.
1244
1245                 _rootLayer.Dispose();
1246                 localController.Dispose();
1247
1248                 foreach(var layer in _childLayers)
1249                 {
1250                     layer.Dispose();
1251                 }
1252                 _childLayers.Clear();
1253             }
1254
1255             this.DisconnectNativeSignals();
1256
1257             //Release your own unmanaged resources here.
1258             //You should not access any managed member here except static instance.
1259             //because the execution order of Finalizes is non-deterministic.
1260
1261             if (swigCPtr.Handle != global::System.IntPtr.Zero)
1262             {
1263                 if (swigCMemOwn)
1264                 {
1265                     swigCMemOwn = false;
1266                     Interop.Window.delete_Window(swigCPtr);
1267                 }
1268                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1269             }
1270
1271             base.Dispose(type);
1272         }
1273     }
1274 }