2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 extern alias TizenSystemInformation;
19 using TizenSystemInformation.Tizen.System;
22 using System.ComponentModel;
23 using System.Collections.Generic;
24 using System.Runtime.InteropServices;
26 using Tizen.NUI.BaseComponents;
31 /// The window class is used internally for drawing.<br />
32 /// The window has an orientation and indicator properties.<br />
34 /// <since_tizen> 3 </since_tizen>
35 public partial class Window : BaseHandle
37 private HandleRef stageCPtr;
38 private Layer rootLayer;
39 private Layer overlayLayer;
40 private Layer borderLayer;
41 private string windowTitle;
42 private List<Layer> childLayers = new List<Layer>();
43 private LayoutController localController;
44 private Key internalLastKeyEvent;
45 private Touch internalLastTouchEvent;
46 private Timer internalHoverTimer;
48 static internal bool IsSupportedMultiWindow()
50 bool isSupported = false;
53 Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSupported);
55 catch (DllNotFoundException e)
57 Tizen.Log.Fatal("NUI", $"{e}\n");
62 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
64 if (Interop.Stage.IsInstalled())
66 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.GetCurrent());
68 localController = new LayoutController(this);
69 NUILog.Debug("layoutController id:" + localController.GetId());
74 /// A helper method to get the current window where the view is added
76 /// <param name="view">The View added to the window</param>
77 /// <returns>A Window.</returns>
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 static public Window Get(View view)
83 NUILog.Error("if there is no view, it can not get a window");
87 //to fix memory leak issue, match the handle count with native side.
88 Window ret = view.GetInstanceSafely<Window>(Interop.Window.Get(View.getCPtr(view)));
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94 /// Creates a new Window.<br />
95 /// This creates an extra window in addition to the default main window<br />
97 /// <param name="windowPosition">The position and size of the Window.</param>
98 /// <param name="isTranslucent">Whether Window is translucent.</param>
99 /// <returns>A new Window.</returns>
100 /// <since_tizen> 6 </since_tizen>
101 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
102 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
103 public Window(Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
105 if (IsSupportedMultiWindow() == false)
107 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 /// Creates a new Window with a specific name.<br />
114 /// This creates an extra window in addition to the default main window<br />
116 /// <param name="name">The name for extra window. </param>
117 /// <param name="windowPosition">The position and size of the Window.</param>
118 /// <param name="isTranslucent">Whether Window is translucent.</param>
119 /// <returns>A new Window.</returns>
120 /// <since_tizen> 6 </since_tizen>
121 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
122 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
123 public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
125 if (IsSupportedMultiWindow() == false)
127 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
129 this.windowTitle = name;
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 /// Creates a new Window with a specific name.<br />
135 /// This creates an extra window in addition to the default main window<br />
137 /// <param name="name">The name for extra window. </param>
138 /// <param name="borderInterface"><see cref="Tizen.NUI.IBorderInterface"/>If borderInterface is null, defaultBorder is enabled.</param>
139 /// <param name="windowPosition">The position and size of the Window.</param>
140 /// <param name="isTranslucent">Whether Window is translucent.</param>
141 /// <returns>A new Window.</returns>
142 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
143 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
144 [EditorBrowsable(EditorBrowsableState.Never)]
145 public Window(string name, IBorderInterface borderInterface, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
147 if (IsSupportedMultiWindow() == false)
149 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
151 this.windowTitle = name;
152 this.EnableBorder(borderInterface);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
160 /// <since_tizen> 3 </since_tizen>
161 public enum WindowOrientation
164 /// Portrait orientation. The height of the display area is greater than the width.
166 /// <since_tizen> 3 </since_tizen>
169 /// Landscape orientation. A wide view area is needed.
171 /// <since_tizen> 3 </since_tizen>
174 /// Portrait inverse orientation.
176 /// <since_tizen> 3 </since_tizen>
177 PortraitInverse = 180,
179 /// Landscape inverse orientation.
181 /// <since_tizen> 3 </since_tizen>
182 LandscapeInverse = 270,
184 /// No orientation. It is for the preferred orientation
185 /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
186 /// It is used to unset the preferred orientation with SetPreferredOrientation.
188 [EditorBrowsable(EditorBrowsableState.Never)]
189 NoOrientationPreference = -1
193 /// Enumeration for the key grab mode for platform-level APIs.
195 /// <since_tizen> 3 </since_tizen>
196 public enum KeyGrabMode
199 /// Grabs a key only when on the top of the grabbing-window stack mode.
203 /// Grabs a key together with the other client window(s) mode.
207 /// 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.
211 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
217 /// Enumeration for transition effect's state.
219 [Obsolete("Do not use this, that will be removed. Use Window.EffectState instead.")]
220 [EditorBrowsable(EditorBrowsableState.Never)]
221 // This is already deprecated, so suppress warning here.
222 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
223 public enum EffectStates
228 [Obsolete("Do not use this, that will be removed. Use Window.EffectState.None instead.")]
229 [EditorBrowsable(EditorBrowsableState.Never)]
232 /// Transition effect is started.
234 [Obsolete("Do not use this, that will be removed. Use Window.EffectState.Start instead.")]
235 [EditorBrowsable(EditorBrowsableState.Never)]
238 /// Transition effect is ended.
240 [Obsolete("Do not use this, that will be removed. Use Window.EffectState.End instead.")]
241 [EditorBrowsable(EditorBrowsableState.Never)]
246 /// Enumeration for transition effect's state.
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public enum EffectState
254 [EditorBrowsable(EditorBrowsableState.Never)]
257 /// Transition effect is started.
259 [EditorBrowsable(EditorBrowsableState.Never)]
262 /// Transition effect is ended.
264 [EditorBrowsable(EditorBrowsableState.Never)]
269 /// Enumeration for transition effect's type.
271 [Obsolete("Do not use this, that will be removed. Use Window.EffectType instead.")]
272 [EditorBrowsable(EditorBrowsableState.Never)]
273 // This is already deprecated, so suppress warning here.
274 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
275 public enum EffectTypes
280 [Obsolete("Do not use this, that will be removed. Use Window.EffectType.None instead.")]
281 [EditorBrowsable(EditorBrowsableState.Never)]
284 /// Window show effect.
286 [Obsolete("Do not use this, that will be removed. Use Window.EffectType.Show instead.")]
287 [EditorBrowsable(EditorBrowsableState.Never)]
290 /// Window hide effect.
292 [Obsolete("Do not use this, that will be removed. Use Window.EffectType.Hide instead.")]
293 [EditorBrowsable(EditorBrowsableState.Never)]
298 /// Enumeration for transition effect's type.
300 [EditorBrowsable(EditorBrowsableState.Never)]
301 public enum EffectType
306 [EditorBrowsable(EditorBrowsableState.Never)]
309 /// Window show effect.
311 [EditorBrowsable(EditorBrowsableState.Never)]
314 /// Window hide effect.
316 [EditorBrowsable(EditorBrowsableState.Never)]
321 /// Enumeration for result of window operation.
323 internal enum OperationResult
326 /// Failed for unknown reason
334 /// Permission denied
338 /// The operation is not supported.
344 /// Enumeration for window resized mode by display server.
346 [EditorBrowsable(EditorBrowsableState.Never)]
347 public enum ResizeDirection
352 [EditorBrowsable(EditorBrowsableState.Never)]
355 /// Start resizing window to the top-left edge.
357 [EditorBrowsable(EditorBrowsableState.Never)]
360 /// Start resizing window to the top side.
362 [EditorBrowsable(EditorBrowsableState.Never)]
365 /// Start resizing window to the top-right edge.
367 [EditorBrowsable(EditorBrowsableState.Never)]
370 /// Start resizing window to the left side.
372 [EditorBrowsable(EditorBrowsableState.Never)]
375 /// Start resizing window to the right side.
377 [EditorBrowsable(EditorBrowsableState.Never)]
380 /// Start resizing window to the bottom-left edge.
382 [EditorBrowsable(EditorBrowsableState.Never)]
385 /// Start resizing window to the bottom side.
387 [EditorBrowsable(EditorBrowsableState.Never)]
390 /// Start resizing window to the bottom-right edge.
392 [EditorBrowsable(EditorBrowsableState.Never)]
398 /// The stage instance property (read-only).<br />
399 /// Gets the current window.<br />
401 /// <since_tizen> 3 </since_tizen>
402 public static Window Instance { get; internal set; }
405 /// Gets or sets a window type.
406 /// Most of window type can be set to use WindowType, except for IME type.
407 /// IME type can be set to use one of NUIApplication's constrcutors.
409 /// <since_tizen> 3 </since_tizen>
410 public WindowType Type
414 WindowType ret = (WindowType)Interop.Window.GetType(SwigCPtr);
415 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
420 Interop.Window.SetType(SwigCPtr, (int)value);
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426 /// Gets/Sets a window title.
428 /// <since_tizen> 4 </since_tizen>
438 SetClass(windowTitle, "");
443 /// The rendering behavior of a Window.
445 /// <since_tizen> 5 </since_tizen>
446 public RenderingBehaviorType RenderingBehavior
450 return GetRenderingBehavior();
454 SetRenderingBehavior(value);
459 /// The window size property (read-only).
461 /// <since_tizen> 3 </since_tizen>
466 Size2D ret = GetSize();
472 /// The background color property.
474 /// <since_tizen> 3 </since_tizen>
475 public Color BackgroundColor
479 SetBackgroundColor(value);
483 Color ret = GetBackgroundColor();
489 /// The DPI property (read-only).<br />
490 /// Retrieves the DPI of the display device to which the Window is connected.<br />
492 /// <since_tizen> 3 </since_tizen>
502 /// The layer count property (read-only).<br />
503 /// Queries the number of on-Window layers.<br />
505 /// <since_tizen> 3 </since_tizen>
506 public uint LayerCount
510 return GetLayerCount();
515 /// Gets or sets a size of the window.
517 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
518 /// <since_tizen> 4 </since_tizen>
519 public Size2D WindowSize
523 return GetWindowSize();
527 SetWindowSize(value);
532 /// Gets or sets a position of the window.
534 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
535 /// <since_tizen> 4 </since_tizen>
536 public Position2D WindowPosition
540 return GetPosition();
549 /// Sets position and size of the window. This API guarantees that
550 /// both moving and resizing of window will appear on the screen at once.
552 [EditorBrowsable(EditorBrowsableState.Never)]
553 public Rectangle WindowPositionSize
557 Position2D position = GetPosition();
558 Size2D size = GetSize();
559 Rectangle ret = new Rectangle(position?.X ?? 0, position?.Y ?? 0, size?.Width ?? 0, size?.Height ?? 0);
565 SetPositionSize(value);
569 internal static Vector4 DEFAULT_BACKGROUND_COLOR
573 global::System.IntPtr cPtr = Interop.Stage.DefaultBackgroundColorGet();
574 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
580 internal static Vector4 DEBUG_BACKGROUND_COLOR
584 global::System.IntPtr cPtr = Interop.Stage.DebugBackgroundColorGet();
585 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
591 internal List<Layer> LayersChildren
600 /// Get the LayoutController for this Window.
602 internal LayoutController LayoutController
606 return localController;
611 /// Feed a key-event into the window.
613 /// <param name="keyEvent">The key event to feed.</param>
614 /// <since_tizen> 4 </since_tizen>
615 [Obsolete("Do not use this, that will be deprecated. Use FeedKey(Key keyEvent) instead.")]
616 public static void FeedKeyEvent(Key keyEvent)
618 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
619 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 /// Sets whether the window accepts a focus or not.
625 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
626 /// <since_tizen> 3 </since_tizen>
627 public void SetAcceptFocus(bool accept)
629 Interop.Window.SetAcceptFocus(SwigCPtr, accept);
630 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634 /// Returns whether the window accepts a focus or not.
636 /// <returns>True if the window accepts a focus, false otherwise.</returns>
637 /// <since_tizen> 3 </since_tizen>
638 public bool IsFocusAcceptable()
640 bool ret = Interop.Window.IsFocusAcceptable(SwigCPtr);
641 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647 /// Shows the window if it is hidden.
649 /// <since_tizen> 3 </since_tizen>
652 Interop.Window.Show(SwigCPtr);
653 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
657 /// Hides the window if it is showing.
659 /// <since_tizen> 3 </since_tizen>
662 Interop.Window.Hide(SwigCPtr);
663 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 /// Retrieves whether the window is visible or not.
669 /// <returns>True if the window is visible.</returns>
670 /// <since_tizen> 3 </since_tizen>
671 public bool IsVisible()
673 bool temp = Interop.Window.IsVisible(SwigCPtr);
674 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679 /// Gets the count of supported auxiliary hints of the window.
681 /// <returns>The number of supported auxiliary hints.</returns>
682 /// <since_tizen> 3 </since_tizen>
683 public uint GetSupportedAuxiliaryHintCount()
685 uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(SwigCPtr);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691 /// Gets the supported auxiliary hint string of the window.
693 /// <param name="index">The index of the supported auxiliary hint lists.</param>
694 /// <returns>The auxiliary hint string of the index.</returns>
695 /// <since_tizen> 3 </since_tizen>
696 public string GetSupportedAuxiliaryHint(uint index)
698 string ret = Interop.Window.GetSupportedAuxiliaryHint(SwigCPtr, index);
699 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704 /// Creates an auxiliary hint of the window.
706 /// <param name="hint">The auxiliary hint string.</param>
707 /// <param name="value">The value string.</param>
708 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
709 /// <since_tizen> 3 </since_tizen>
710 public uint AddAuxiliaryHint(string hint, string value)
712 uint ret = Interop.Window.AddAuxiliaryHint(SwigCPtr, hint, value);
713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718 /// Removes an auxiliary hint of the window.
720 /// <param name="id">The ID of the auxiliary hint.</param>
721 /// <returns>True if no error occurred, false otherwise.</returns>
722 /// <since_tizen> 3 </since_tizen>
723 public bool RemoveAuxiliaryHint(uint id)
725 bool ret = Interop.Window.RemoveAuxiliaryHint(SwigCPtr, id);
726 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
731 /// Changes a value of the auxiliary hint.
733 /// <param name="id">The auxiliary hint ID.</param>
734 /// <param name="value">The value string to be set.</param>
735 /// <returns>True if no error occurred, false otherwise.</returns>
736 /// <since_tizen> 3 </since_tizen>
737 public bool SetAuxiliaryHintValue(uint id, string value)
739 bool ret = Interop.Window.SetAuxiliaryHintValue(SwigCPtr, id, value);
740 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745 /// Gets a value of the auxiliary hint.
747 /// <param name="id">The auxiliary hint ID.</param>
748 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
749 /// <since_tizen> 3 </since_tizen>
750 public string GetAuxiliaryHintValue(uint id)
752 string ret = Interop.Window.GetAuxiliaryHintValue(SwigCPtr, id);
753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758 /// Gets an ID of the auxiliary hint string.
760 /// <param name="hint">The auxiliary hint string.</param>
761 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
762 /// <since_tizen> 3 </since_tizen>
763 public uint GetAuxiliaryHintId(string hint)
765 uint ret = Interop.Window.GetAuxiliaryHintId(SwigCPtr, hint);
766 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
771 /// Sets a region to accept input events.
773 /// <param name="inputRegion">The region to accept input events.</param>
774 /// <since_tizen> 3 </since_tizen>
775 public void SetInputRegion(Rectangle inputRegion)
777 Interop.Window.SetInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
778 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
782 /// Sets a priority level for the specified notification window.
784 /// <param name="level">The notification window level.</param>
785 /// <returns>True if no error occurred, false otherwise.</returns>
786 /// <since_tizen> 3 </since_tizen>
787 public bool SetNotificationLevel(NotificationLevel level)
789 var ret = (OperationResult)Interop.Window.SetNotificationLevel(SwigCPtr, (int)level);
790 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
791 return ret == OperationResult.Succeed;
795 /// Gets a priority level for the specified notification window.
797 /// <returns>The notification window level.</returns>
798 /// <since_tizen> 3 </since_tizen>
799 public NotificationLevel GetNotificationLevel()
801 NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(SwigCPtr);
802 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
807 /// Sets a transparent window's visual state to opaque. <br />
808 /// If a visual state of a transparent window is opaque, <br />
809 /// then the window manager could handle it as an opaque window when calculating visibility.
811 /// <param name="opaque">Whether the window's visual state is opaque.</param>
812 /// <remarks>This will have no effect on an opaque window. <br />
813 /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
815 /// <since_tizen> 3 </since_tizen>
816 public void SetOpaqueState(bool opaque)
818 Interop.Window.SetOpaqueState(SwigCPtr, opaque);
819 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 /// Returns whether a transparent window's visual state is opaque or not.
825 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
826 /// <remarks> The return value has no meaning on an opaque window. </remarks>
827 /// <since_tizen> 3 </since_tizen>
828 public bool IsOpaqueState()
830 bool ret = Interop.Window.IsOpaqueState(SwigCPtr);
831 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
836 /// Sets a window's screen off mode.
838 /// <param name="screenOffMode">The screen mode.</param>
839 /// <returns>True if no error occurred, false otherwise.</returns>
840 /// <since_tizen> 4 </since_tizen>
841 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
843 var ret = (OperationResult)Interop.Window.SetScreenOffMode(SwigCPtr, (int)screenOffMode);
844 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
845 return ret == OperationResult.Succeed;
849 /// Gets the screen mode of the window.
851 /// <returns>The screen off mode.</returns>
852 /// <since_tizen> 4 </since_tizen>
853 public ScreenOffMode GetScreenOffMode()
855 ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(SwigCPtr);
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
861 /// Sets preferred brightness of the window.
863 /// <param name="brightness">The preferred brightness (0 to 100).</param>
864 /// <returns>True if no error occurred, false otherwise.</returns>
865 /// <since_tizen> 3 </since_tizen>
866 public bool SetBrightness(int brightness)
868 var ret = (OperationResult)Interop.Window.SetBrightness(SwigCPtr, brightness);
869 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
870 return ret == OperationResult.Succeed;
874 /// Gets the preferred brightness of the window.
876 /// <returns>The preferred brightness.</returns>
877 /// <since_tizen> 3 </since_tizen>
878 public int GetBrightness()
880 int ret = Interop.Window.GetBrightness(SwigCPtr);
881 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
886 /// Sets the window name and the class string.
888 /// <param name="name">The name of the window.</param>
889 /// <param name="klass">The class of the window.</param>
890 /// <since_tizen> 4 </since_tizen>
891 public void SetClass(string name, string klass)
893 Interop.Window.SetClass(SwigCPtr, name, klass);
894 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
898 /// Raises the window to the top of the window stack.
900 /// <since_tizen> 3 </since_tizen>
903 Interop.Window.Raise(SwigCPtr);
904 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
908 /// Lowers the window to the bottom of the window stack.
910 /// <since_tizen> 3 </since_tizen>
913 Interop.Window.Lower(SwigCPtr);
914 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
918 /// Activates the window to the top of the window stack even it is iconified.
920 /// <since_tizen> 3 </since_tizen>
921 public void Activate()
923 Interop.Window.Activate(SwigCPtr);
924 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
928 /// Gets the default ( root ) layer.
930 /// <returns>The root layer.</returns>
931 /// <since_tizen> 3 </since_tizen>
932 public Layer GetDefaultLayer()
934 return this.GetRootLayer();
938 /// Gets the overlay layer.
940 /// <returns>The overlay layer.</returns>
941 [EditorBrowsable(EditorBrowsableState.Never)]
942 public Layer GetOverlayLayer()
944 // Window.IsInstalled() is actually true only when called from event thread and
945 // Core has been initialized, not when Stage is ready.
946 if (overlayLayer == null && Window.IsInstalled())
948 overlayLayer = new Layer(Interop.Window.GetOverlayLayer(SwigCPtr), true);
949 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
950 LayersChildren?.Add(overlayLayer);
951 overlayLayer.SetWindow(this);
957 /// Add a child view to window.
959 /// <param name="view">the child should be added to the window.</param>
960 /// <since_tizen> 3 </since_tizen>
961 public void Add(View view)
963 this.GetRootLayer().Add(view);
967 /// Remove a child view from window.
969 /// <param name="view">the child to be removed.</param>
970 /// <since_tizen> 3 </since_tizen>
971 public void Remove(View view)
973 this.GetRootLayer().Remove(view);
977 /// Retrieves the layer at a specified depth.
979 /// <param name="depth">The layer's depth index.</param>
980 /// <returns>The layer found at the given depth.</returns>
981 /// <since_tizen> 3 </since_tizen>
982 public Layer GetLayer(uint depth)
984 if (depth < LayersChildren?.Count)
986 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
996 /// Destroy the window immediately.
998 [EditorBrowsable(EditorBrowsableState.Never)]
999 public void Destroy()
1005 /// Keep rendering for at least the given amount of time.
1007 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
1008 /// <since_tizen> 3 </since_tizen>
1009 public void KeepRendering(float durationSeconds)
1011 Interop.Window.KeepRendering(SwigCPtr, durationSeconds);
1012 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1016 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
1017 /// This function can be used for following example scenarios: <br />
1018 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
1020 /// <param name="DaliKey">The key code to grab.</param>
1021 /// <returns>True if the grab succeeds.</returns>
1022 /// <since_tizen> 3 </since_tizen>
1023 public bool GrabKeyTopmost(int DaliKey)
1025 bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1026 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1031 /// Ungrabs the key specified by a key for the window.<br />
1032 /// 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 />
1034 /// <param name="DaliKey">The key code to ungrab.</param>
1035 /// <returns>True if the ungrab succeeds.</returns>
1036 /// <since_tizen> 3 </since_tizen>
1037 public bool UngrabKeyTopmost(int DaliKey)
1039 bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1040 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1045 /// Grabs the key specified by a key for a window in a GrabMode. <br />
1046 /// Details: This function can be used for following example scenarios: <br />
1047 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
1048 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
1049 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
1051 /// <param name="DaliKey">The key code to grab.</param>
1052 /// <param name="GrabMode">The grab mode for the key.</param>
1053 /// <returns>True if the grab succeeds.</returns>
1054 /// <since_tizen> 3 </since_tizen>
1055 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
1057 bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey, (int)GrabMode);
1058 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1063 /// Ungrabs the key specified by a key for a window.<br />
1064 /// 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 />
1066 /// <param name="DaliKey">The key code to ungrab.</param>
1067 /// <returns>True if the ungrab succeeds.</returns>
1068 /// <since_tizen> 3 </since_tizen>
1069 public bool UngrabKey(int DaliKey)
1071 bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1072 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1077 /// Sets the keyboard repeat information.
1079 /// <param name="rate">The key repeat rate value in seconds.</param>
1080 /// <param name="delay">The key repeat delay value in seconds.</param>
1081 /// <returns>True if setting the keyboard repeat succeeds.</returns>
1082 /// <since_tizen> 5 </since_tizen>
1083 public bool SetKeyboardRepeatInfo(float rate, float delay)
1085 bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
1086 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1091 /// Gets the keyboard repeat information.
1093 /// <param name="rate">The key repeat rate value in seconds.</param>
1094 /// <param name="delay">The key repeat delay value in seconds.</param>
1095 /// <returns>True if setting the keyboard repeat succeeds.</returns>
1096 /// <since_tizen> 5 </since_tizen>
1097 public bool GetKeyboardRepeatInfo(out float rate, out float delay)
1099 bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
1100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105 /// Adds a layer to the stage.
1107 /// <param name="layer">Layer to add.</param>
1108 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
1109 /// <since_tizen> 3 </since_tizen>
1110 public void AddLayer(Layer layer)
1116 /// Removes a layer from the stage.
1118 /// <param name="layer">Layer to remove.</param>
1119 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
1120 /// <since_tizen> 3 </since_tizen>
1121 public void RemoveLayer(Layer layer)
1127 /// Feeds a key event into the window.
1129 /// <param name="keyEvent">The key event to feed.</param>
1130 /// <since_tizen> 5 </since_tizen>
1131 public void FeedKey(Key keyEvent)
1133 Interop.Window.FeedKeyEvent(SwigCPtr, Key.getCPtr(keyEvent));
1134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1138 /// Feeds a hover event into the window. <br />
1139 /// This is feed after a default time of 48 ms. You can also set this time.
1141 /// <param name="time">The time of how much later it will be feed (default is 48ms)</param>
1142 /// <remarks>If you want to do FeedHover after the UI is updated, it is recommended to set the time to at least 16ms. This will be a good time waiting for the UI to update.<br />
1143 /// and LazyFeedHover called within the set time are ignored. Only the last request becomes a FeedHover.
1145 [EditorBrowsable(EditorBrowsableState.Never)]
1146 public void LazyFeedHover(uint time = 48)
1148 if (internalHoverTimer == null)
1150 internalHoverTimer = new Timer(time);
1151 internalHoverTimer.Tick += (s, e) =>
1154 internalHoverTimer?.Stop();
1155 internalHoverTimer?.Dispose();
1156 internalHoverTimer = null;
1159 internalHoverTimer.Start();
1163 internalHoverTimer.Start();
1168 /// Feeds a touch point into the window.
1170 /// <param name="touchPoint">The touch point to feed.</param>
1171 /// <param name="timeStamp">The timeStamp.</param>
1172 internal void FeedTouch(TouchPoint touchPoint, int timeStamp)
1174 Interop.Window.FeedTouchPoint(SwigCPtr, TouchPoint.getCPtr(touchPoint), timeStamp);
1175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1179 /// Feeds a wheel event into the window.
1181 /// <param name="wheelEvent">The wheel event to feed.</param>
1182 internal void FeedWheel(Wheel wheelEvent)
1184 Interop.Window.FeedWheelEvent(SwigCPtr, Wheel.getCPtr(wheelEvent));
1185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1189 /// Feeds a hover event into the window.
1191 /// <param name="touchPoint">The touch point to feed hover event. If null is entered, the feed hover event is generated with the last inputed touch point.</param>
1192 [EditorBrowsable(EditorBrowsableState.Never)]
1193 internal void FeedHover(TouchPoint touchPoint = null)
1195 if (touchPoint == null)
1197 using Touch touch = GetLastTouchEvent();
1198 using Vector2 screenPosition = touch.GetScreenPosition(0);
1199 touchPoint = new TouchPoint(touch.GetDeviceId(0), TouchPoint.StateType.Motion, screenPosition.X, screenPosition.Y);
1201 Interop.Window.FeedHoverEvent(SwigCPtr, TouchPoint.getCPtr(touchPoint));
1202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206 /// Allows at least one more render, even when paused.
1207 /// The window should be shown, not minimised.
1209 /// <since_tizen> 4 </since_tizen>
1210 public void RenderOnce()
1212 Interop.Window.RenderOnce(SwigCPtr);
1213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1217 /// Sets whether the window is transparent or not.
1219 /// <param name="transparent">Whether the window is transparent or not.</param>
1220 /// <since_tizen> 5 </since_tizen>
1221 public void SetTransparency(bool transparent)
1223 Interop.Window.SetTransparency(SwigCPtr, transparent);
1224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1226 // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1230 /// Sets parent window of the window.
1231 /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1232 /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
1233 /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
1235 /// <param name="parent">The parent window.</param>
1236 /// <since_tizen> 6 </since_tizen>
1237 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1238 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1239 public void SetParent(Window parent)
1241 if (IsSupportedMultiWindow() == false)
1243 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1245 Interop.Window.SetParent(SwigCPtr, Window.getCPtr(parent));
1246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1250 /// Sets parent window of the window.
1251 /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1252 /// This function has the additional flag whether the child is located above or below of the parent.
1254 /// <param name="parent">The parent window.</param>
1255 /// <param name="belowParent">The flag is whether the child is located above or below of the parent.</param>
1256 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1257 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1258 [EditorBrowsable(EditorBrowsableState.Never)]
1259 public void SetParent(Window parent, bool belowParent)
1261 if (IsSupportedMultiWindow() == false)
1263 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1265 Interop.Window.SetParentWithStack(SwigCPtr, Window.getCPtr(parent), belowParent);
1266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1270 /// Unsets parent window of the window.
1271 /// After unsetting, the window is disconnected his parent window.
1273 /// <since_tizen> 6 </since_tizen>
1274 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1275 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1276 public void Unparent()
1278 if (IsSupportedMultiWindow() == false)
1280 NUILog.Error("Fail to create window. because this device does not support opengles.surfaceless_context.");
1282 Interop.Window.Unparent(SwigCPtr);
1283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1287 /// Gets parent window of the window.
1289 /// <returns>The parent window of the window.</returns>
1290 /// <since_tizen> 6 </since_tizen>
1291 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1292 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1293 [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1721: Property names should not match get methods")]
1294 public Window GetParent()
1296 if (IsSupportedMultiWindow() == false)
1298 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1300 Window ret = this.GetInstanceSafely<Window>(Interop.Window.GetParent(SwigCPtr));
1301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305 /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
1306 [EditorBrowsable(EditorBrowsableState.Never)]
1307 public void ObjectDump()
1309 Layer rootLayer = GetRootLayer();
1310 foreach (View view in rootLayer.Children)
1316 internal static bool IsInstalled()
1318 bool ret = Interop.Stage.IsInstalled();
1319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1324 /// Adds an orientation to the list of available orientations.
1326 /// <param name="orientation">The available orientation to add</param>
1327 /// <since_tizen> 6 </since_tizen>
1328 public void AddAvailableOrientation(Window.WindowOrientation orientation)
1330 Interop.Window.AddAvailableOrientation(SwigCPtr, (int)orientation);
1331 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1335 /// Removes an orientation from the list of available orientations.
1337 /// <param name="orientation">The available orientation to remove.</param>
1338 /// <since_tizen> 6 </since_tizen>
1339 public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1341 Interop.Window.RemoveAvailableOrientation(SwigCPtr, (int)orientation);
1342 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1346 /// Sets a preferred orientation.
1348 /// <param name="orientation">The preferred orientation.</param>
1349 /// <since_tizen> 6 </since_tizen>
1350 public void SetPreferredOrientation(Window.WindowOrientation orientation)
1352 Interop.Window.SetPreferredOrientation(SwigCPtr, (int)orientation);
1353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1357 /// Gets the preferred orientation.
1359 /// <since_tizen> 6 </since_tizen>
1360 /// <returns>The preferred orientation if previously set, or none.</returns>
1361 public Window.WindowOrientation GetPreferredOrientation()
1363 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetPreferredOrientation(SwigCPtr);
1364 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1369 /// Gets current orientation of the window.
1371 /// <since_tizen> 6 </since_tizen>
1372 /// <returns>The current window orientation if previously set, or none.</returns>
1373 [EditorBrowsable(EditorBrowsableState.Never)]
1374 public Window.WindowOrientation GetCurrentOrientation()
1376 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetCurrentOrientation(SwigCPtr);
1377 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1382 /// Sets available orientations of the window.
1383 /// This API is for setting several orientations one time.
1385 /// <param name="orientations">The list of orientations.</param>
1386 /// <since_tizen> 6 </since_tizen>
1387 [EditorBrowsable(EditorBrowsableState.Never)]
1388 public void SetAvailableOrientations(List<Window.WindowOrientation> orientations)
1390 if (null == orientations)
1392 throw new ArgumentNullException(nameof(orientations));
1395 PropertyArray orientationArray = new PropertyArray();
1396 for (int i = 0; i < orientations.Count; i++)
1398 PropertyValue value = new PropertyValue((int)orientations[i]);
1399 orientationArray.PushBack(value);
1403 Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray), orientations.Count);
1404 orientationArray.Dispose();
1405 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1409 /// Get native window ID
1411 /// <returns>native window ID</returns>
1412 [EditorBrowsable(EditorBrowsableState.Never)]
1413 public int GetNativeId()
1415 int ret = Interop.Window.GetNativeId(SwigCPtr);
1416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1420 internal Any GetNativeHandle()
1422 Any ret = new Any(Interop.WindowInternal.WindowGetNativeHandle(SwigCPtr), true);
1423 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1427 internal void Add(Layer layer)
1431 throw new ArgumentNullException(nameof(layer));
1436 Interop.Actor.Add(GetRootLayer().SwigCPtr, layer.SwigCPtr);
1437 if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }
1441 Interop.Window.Add(SwigCPtr, Layer.getCPtr(layer));
1442 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1445 LayersChildren?.Add(layer);
1446 layer.SetWindow(this);
1449 internal void Remove(Layer layer)
1453 throw new ArgumentNullException(nameof(layer));
1455 Interop.Window.Remove(SwigCPtr, Layer.getCPtr(layer));
1456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1458 LayersChildren?.Remove(layer);
1459 layer.SetWindow(null);
1462 internal Vector2 GetSize()
1464 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1466 convertRealWindowSizeToBorderWindowSize(val);
1468 Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1474 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
1475 [EditorBrowsable(EditorBrowsableState.Never)]
1476 public RenderTaskList GetRenderTaskList()
1478 RenderTaskList ret = new RenderTaskList(Interop.Stage.GetRenderTaskList(stageCPtr), true);
1479 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1484 /// Queries the number of on-window layers.
1486 /// <returns>The number of layers.</returns>
1487 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1488 internal uint GetLayerCount()
1490 if (LayersChildren == null || LayersChildren.Count < 0)
1493 return (uint)LayersChildren.Count;
1496 internal Layer GetRootLayer()
1500 if (borderLayer == null)
1502 borderLayer = GetBorderWindowRootLayer();
1503 LayersChildren?.Add(borderLayer);
1504 borderLayer.SetWindow(this);
1510 // Window.IsInstalled() is actually true only when called from event thread and
1511 // Core has been initialized, not when Stage is ready.
1512 if (rootLayer == null && Window.IsInstalled())
1514 rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
1515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1516 LayersChildren?.Add(rootLayer);
1517 rootLayer.SetWindow(this);
1523 internal void SetBackgroundColor(Vector4 color)
1525 Interop.Window.SetBackgroundColor(SwigCPtr, Vector4.getCPtr(color));
1526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1529 internal Vector4 GetBackgroundColor()
1531 Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(SwigCPtr), true);
1532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1536 internal Vector2 GetDpi()
1538 Vector2 ret = new Vector2(Interop.Stage.GetDpi(stageCPtr), true);
1539 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1543 internal ObjectRegistry GetObjectRegistry()
1545 ObjectRegistry ret = new ObjectRegistry(Interop.Stage.GetObjectRegistry(stageCPtr), true);
1546 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1550 internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1552 Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1553 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1556 internal RenderingBehaviorType GetRenderingBehavior()
1558 RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.GetRenderingBehavior(stageCPtr);
1559 if (NDalicPINVOKE.SWIGPendingException.Pending)
1560 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1564 internal void SetWindowSize(Size2D size)
1568 throw new ArgumentNullException(nameof(size));
1570 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1572 convertBorderWindowSizeToRealWindowSize(val);
1574 Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
1576 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1577 // Resetting Window size should request a relayout of the tree.
1580 internal Size2D GetWindowSize()
1582 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1584 convertRealWindowSizeToBorderWindowSize(val);
1586 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1587 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1592 internal void SetPosition(Position2D position)
1594 if (null == position)
1596 throw new ArgumentNullException(nameof(position));
1598 var val = new Int32Pair(position.X, position.Y);
1599 Interop.Window.SetPosition(SwigCPtr, Int32Pair.getCPtr(val));
1601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1602 // Setting Position of the window should request a relayout of the tree.
1605 internal Position2D GetPosition()
1607 var val = new Int32Pair(Interop.Window.GetPosition(SwigCPtr), true);
1608 Position2D ret = new Position2D((int)val.GetX(), (int)val.GetY());
1610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1614 internal void SetPositionSize(Rectangle positionSize)
1616 if (positionSize == null)
1618 throw new ArgumentNullException(nameof(positionSize));
1620 var val = new Uint16Pair((uint)positionSize.Width, (uint)positionSize.Height);
1622 convertBorderWindowSizeToRealWindowSize(val);
1624 positionSize.Width = val.GetX();
1625 positionSize.Height = val.GetY();
1627 Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
1630 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1632 // Setting Position of the window should request a relayout of the tree.
1636 /// Enables the floating mode of window.
1637 /// The floating mode is to support window is moved or resized by display server.
1638 /// For example, if the video-player window sets the floating mode,
1639 /// then display server changes its geometry and handles it like a popup.
1640 /// The way of handling floating mode window is decided by display server.
1641 /// A special display server(as a Tizen display server) supports this mode.
1643 /// <param name="enable">Enable floating mode or not.</param>
1644 [EditorBrowsable(EditorBrowsableState.Never)]
1645 public void EnableFloatingMode(bool enable)
1647 Interop.Window.EnableFloatingMode(SwigCPtr, enable);
1648 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1652 /// Requests to display server for the window is moved by display server.
1653 /// It can be work with setting window floating mode.
1655 [EditorBrowsable(EditorBrowsableState.Never)]
1656 public void RequestMoveToServer()
1658 Interop.Window.RequestMoveToServer(SwigCPtr);
1659 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1663 /// Requests to display server for the window is resized by display server.
1664 /// It can be work with setting window floating mode.
1666 /// <param name="direction">It is indicated the window's side or edge for starting point.</param>
1667 [EditorBrowsable(EditorBrowsableState.Never)]
1668 public void RequestResizeToServer(ResizeDirection direction)
1670 Interop.Window.RequestResizeToServer(SwigCPtr, (int)direction);
1671 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1675 /// Includes input region.
1676 /// This function inlcudes input regions.
1677 /// It can be used multiple times and supports multiple regions.
1678 /// It means input region will be extended.
1679 /// This input is related to mouse and touch event.
1680 /// If device has touch screen, this function is useful.
1681 /// Otherwise device does not have that, we can use it after connecting mouse to the device.
1683 /// <param name="inputRegion">The included region to accept input events.</param>
1684 [EditorBrowsable(EditorBrowsableState.Never)]
1685 public void IncludeInputRegion(Rectangle inputRegion)
1687 Interop.Window.IncludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
1688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1692 /// This function excludes input regions.
1693 /// It can be used multiple times and supports multiple regions.
1694 /// It means input region will be reduced.
1695 /// Nofice, should be set input area by IncludeInputRegion() before this function is used.
1696 /// This input is related to mouse and touch event.
1697 /// If device has touch screen, this function is useful.
1698 /// Otherwise device does not have that, we can use it after connecting mouse to the device.
1700 /// <param name="inputRegion">The excluded region to except input events.</param>
1701 [EditorBrowsable(EditorBrowsableState.Never)]
1702 public void ExcludeInputRegion(Rectangle inputRegion)
1704 Interop.Window.ExcludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
1705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1709 /// Maximizes window's size.
1710 /// If this function is called with true, window will be resized with screen size.
1711 /// Otherwise window will be resized with previous size.
1712 /// It is for the window's MAX button in window's border.
1713 /// If window border is supported by display server, it is not necessary.
1715 /// <param name="max">If window is maximized or unmaximized.</param>
1716 [EditorBrowsable(EditorBrowsableState.Never)]
1717 public void Maximize(bool max)
1719 Interop.Window.Maximize(SwigCPtr, max);
1720 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1724 /// Returns whether the window is maximized or not.
1726 /// <returns>True if the window is maximized, false otherwise.</returns>
1727 [EditorBrowsable(EditorBrowsableState.Never)]
1728 public bool IsMaximized()
1730 bool ret = Interop.Window.IsMaximized(SwigCPtr);
1731 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1736 /// Sets window's maximum size.
1738 /// It is to set the maximized size when window is maximized or the window's size is increased by RequestResizeToServer().
1739 /// Although the size is set by this function, window's size can be increased over the limitation by SetPositionSize() or SetSize().
1741 /// After setting, if Maximize() is called, window is resized with the setting size and move the center.
1744 /// <param name="size">the maximum size.</param>
1745 [EditorBrowsable(EditorBrowsableState.Never)]
1746 public void SetMaximumSize(Size2D size)
1750 throw new ArgumentNullException(nameof(size));
1752 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1754 Interop.Window.SetMaximumSize(SwigCPtr, Uint16Pair.getCPtr(val));
1756 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1760 /// Minimizes window's size.
1761 /// If this function is called with true, window will be iconified.
1762 /// Otherwise window will be activated.
1763 /// It is for the window's MIN button in window border.
1764 /// If window border is supported by display server, it is not necessary.
1766 /// <param name="min">If window is minimized or unminimized.</param>
1767 [EditorBrowsable(EditorBrowsableState.Never)]
1768 public void Minimize(bool min)
1770 Interop.Window.Minimize(SwigCPtr, min);
1771 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1775 /// Returns whether the window is minimized or not.
1777 /// <returns>True if the window is minimized, false otherwise.</returns>
1778 [EditorBrowsable(EditorBrowsableState.Never)]
1779 public bool IsMinimized()
1781 bool ret = Interop.Window.IsMinimized(SwigCPtr);
1782 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1787 /// Sets window's minimum size.
1788 /// It is to set the minimum size when window's size is decreased by RequestResizeToServer().
1789 /// Although the size is set by this function, window's size can be decreased over the limitation by SetPositionSize() or SetSize().
1791 /// <param name="size">the minimum size.</param>
1792 [EditorBrowsable(EditorBrowsableState.Never)]
1793 public void SetMimimumSize(Size2D size)
1797 throw new ArgumentNullException(nameof(size));
1799 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1801 Interop.Window.SetMimimumSize(SwigCPtr, Uint16Pair.getCPtr(val));
1803 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1807 /// Sets the layout of the window.
1809 /// <param name="numCols">The number of columns in the layout.</param>
1810 /// <param name="numRows">The number of rows in the layout.</param>
1811 /// <param name="column">The column number of the window within the layout.</param>
1812 /// <param name="row">The row number of the window within the layout.</param>
1813 /// <param name="colSpan">The number of columns the window should span within the layout.</param>
1814 /// <param name="rowSpan">The number of rows the window should span within the layout.</param>
1815 [EditorBrowsable(EditorBrowsableState.Never)]
1816 public void SetLayout(uint numCols, uint numRows, uint column, uint row, uint colSpan, uint rowSpan)
1818 Interop.Window.SetLayout(SwigCPtr, numCols, numRows, column, row, colSpan, rowSpan);
1819 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1824 /// Sets the layout of the window.
1826 /// <param name="layoutType">The type of layout to set for the window.</param>
1827 [EditorBrowsable(EditorBrowsableState.Never)]
1828 public void SetLayout(WindowLayoutType layoutType)
1832 case WindowLayoutType.LeftHalf:
1833 Interop.Window.SetLayout(SwigCPtr, 2, 1, 0, 0, 1, 1);
1835 case WindowLayoutType.RightHalf:
1836 Interop.Window.SetLayout(SwigCPtr, 2, 1, 1, 0, 1, 1);
1839 case WindowLayoutType.TopHalf:
1840 Interop.Window.SetLayout(SwigCPtr, 1, 2, 0, 0, 1, 1);
1842 case WindowLayoutType.BottomHalf:
1843 Interop.Window.SetLayout(SwigCPtr, 1, 2, 0, 1, 1, 1);
1846 case WindowLayoutType.UpperLeftQuarter:
1847 Interop.Window.SetLayout(SwigCPtr, 2, 2, 0, 0, 1, 1);
1849 case WindowLayoutType.UpperRightQuarter:
1850 Interop.Window.SetLayout(SwigCPtr, 2, 2, 1, 0, 1, 1);
1852 case WindowLayoutType.LowerLeftQuarter:
1853 Interop.Window.SetLayout(SwigCPtr, 2, 2, 0, 1, 1, 1);
1855 case WindowLayoutType.LowerRightQuarter:
1856 Interop.Window.SetLayout(SwigCPtr, 2, 2, 1, 1, 1, 1);
1859 case WindowLayoutType.LeftThird:
1860 Interop.Window.SetLayout(SwigCPtr, 3, 1, 0, 0, 1, 1);
1862 case WindowLayoutType.CenterThird:
1863 Interop.Window.SetLayout(SwigCPtr, 3, 1, 1, 0, 1, 1);
1865 case WindowLayoutType.RightThird:
1866 Interop.Window.SetLayout(SwigCPtr, 3, 1, 2, 0, 1, 1);
1869 case WindowLayoutType.TopThird:
1870 Interop.Window.SetLayout(SwigCPtr, 1, 3, 0, 0, 1, 1);
1872 case WindowLayoutType.MiddleThird:
1873 Interop.Window.SetLayout(SwigCPtr, 1, 3, 0, 1, 1, 1);
1875 case WindowLayoutType.BottomThird:
1876 Interop.Window.SetLayout(SwigCPtr, 1, 3, 0, 2, 1, 1);
1879 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1884 /// Query whether window is rotating or not.
1886 /// <returns>True if window is rotating, false otherwise.</returns>
1887 [EditorBrowsable(EditorBrowsableState.Never)]
1888 public bool IsWindowRotating()
1890 bool ret = Interop.Window.IsWindowRotating(SwigCPtr);
1891 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1896 /// Gets the last key event the window gets.
1898 /// <returns>The last key event the window gets.</returns>
1899 [EditorBrowsable(EditorBrowsableState.Never)]
1900 public Key GetLastKeyEvent()
1902 if(internalLastKeyEvent == null)
1904 internalLastKeyEvent = new Key();
1906 Interop.Window.InternalRetrievingLastKeyEvent(SwigCPtr, internalLastKeyEvent.SwigCPtr);
1907 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1908 return internalLastKeyEvent;
1912 /// Gets the last touch event the window gets.
1914 /// <returns>The last touch event the window gets.</returns>
1915 [EditorBrowsable(EditorBrowsableState.Never)]
1916 public Touch GetLastTouchEvent()
1918 if(internalLastTouchEvent == null)
1920 internalLastTouchEvent = new Touch();
1922 Interop.Window.InternalRetrievingLastTouchEvent(SwigCPtr, internalLastTouchEvent.SwigCPtr);
1923 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1924 return internalLastTouchEvent;
1928 /// Sets the necessary for window rotation Acknowledgement.
1929 /// After this function called, SendRotationCompletedAcknowledgement() should be called to complete window rotation.
1931 /// This function is supprot that application has the window rotation acknowledgement's control.
1932 /// It means display server waits when application's rotation work is finished.
1933 /// It is useful application has the other rendering engine which works asynchronous.
1934 /// For instance, GlView.
1936 /// <param name="needAcknowledgement">the flag is true if window rotation acknowledge is sent.</param>
1937 [EditorBrowsable(EditorBrowsableState.Never)]
1938 public void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement)
1940 Interop.Window.SetNeedsRotationCompletedAcknowledgement(SwigCPtr, needAcknowledgement);
1941 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1945 /// send the Acknowledgement to complete window rotation.
1946 /// For this function, SetNeedsRotationCompletedAcknowledgement should be already called with true.
1948 [EditorBrowsable(EditorBrowsableState.Never)]
1949 public void SendRotationCompletedAcknowledgement()
1951 Interop.Window.SendRotationCompletedAcknowledgement(SwigCPtr);
1952 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1956 /// Add FrameUpdateCallback
1958 [EditorBrowsable(EditorBrowsableState.Never)]
1959 public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1961 frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer()));
1965 /// Remove FrameUpdateCallback
1967 [EditorBrowsable(EditorBrowsableState.Never)]
1968 public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1970 frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr);
1974 /// Dispose for Window
1976 [EditorBrowsable(EditorBrowsableState.Never)]
1977 protected override void Dispose(DisposeTypes type)
1984 this.DisconnectNativeSignals();
1986 if (type == DisposeTypes.Explicit)
1989 //Release your own managed resources here.
1990 //You should release all of your own disposable objects here.
1992 if (IsBorderEnabled)
1997 foreach (var layer in childLayers)
2005 childLayers.Clear();
2007 localController?.Dispose();
2009 internalLastKeyEvent?.Dispose();
2010 internalLastKeyEvent = null;
2011 internalLastTouchEvent?.Dispose();
2012 internalLastTouchEvent = null;
2014 internalHoverTimer?.Stop();
2015 internalHoverTimer?.Dispose();
2016 internalHoverTimer = null;
2023 /// This will not be public opened.
2024 [EditorBrowsable(EditorBrowsableState.Never)]
2025 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
2027 Interop.Window.DeleteWindow(swigCPtr);
2030 private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
2032 private static readonly object locker = new object();
2034 private static int key = 0;
2036 private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
2038 private struct internalHookCallbackType
2040 public FrameCallbackType userCallback;
2044 private static void OnInternalHookFrameCallback(int id)
2048 if (frameCallbackList.ContainsKey(id))
2050 if (frameCallbackList[id].userCallback != null)
2052 frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
2053 frameCallbackList.Remove(id);
2057 NUILog.Error($"found userCallback is NULL");
2058 frameCallbackList.Remove(id);
2064 private int AddInterHookCallback(FrameCallbackType callback, int frameId)
2066 if (null == callback)
2068 throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
2070 var assignedKey = 0;
2075 frameCallbackList.Add(assignedKey, new internalHookCallbackType()
2077 userCallback = callback,
2085 /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
2087 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
2088 [EditorBrowsable(EditorBrowsableState.Never)]
2089 public delegate void FrameCallbackType(int frameId);
2092 /// Adds a callback that is called when the frame rendering is done by the graphics driver.
2093 /// A callback of the following type may be used:
2095 /// void MyFunction( int frameId )
2097 /// This callback will be deleted once it is called.
2099 /// Ownership of the callback is passed onto this class
2102 /// <param name="callback">The function to call</param>
2103 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
2104 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
2105 [EditorBrowsable(EditorBrowsableState.Never)]
2106 public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
2108 var assignedKey = AddInterHookCallback(callback, frameId);
2109 Interop.WindowInternal.AddFrameRenderedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
2111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2115 /// Adds a callback that is called when the frame is displayed on the display.
2116 /// A callback of the following type may be used:
2118 /// void MyFunction( int frameId )
2120 /// This callback will be deleted once it is called.
2122 /// Ownership of the callback is passed onto this class
2125 /// <param name="callback">The function to call</param>
2126 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
2127 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
2128 [EditorBrowsable(EditorBrowsableState.Never)]
2129 public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
2131 var assignedKey = AddInterHookCallback(callback, frameId);
2132 Interop.WindowInternal.AddFramePresentedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
2134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2138 /// Search through this Window for a Layer with the given unique ID.
2140 /// <param name="id">The ID of the Layer to find.</param>
2141 /// <remarks>Hidden-API</remarks>
2142 /// <returns>A handle to the Layer if found, or an empty handle if not.</returns>
2143 [EditorBrowsable(EditorBrowsableState.Never)]
2144 public Layer FindLayerByID(uint id)
2146 Layer defaultLayer = this.GetDefaultLayer();
2147 IntPtr cPtr = Interop.Actor.FindChildById(defaultLayer.SwigCPtr, id);
2148 Layer ret = this.GetInstanceSafely<Layer>(cPtr);
2150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2155 /// Get Native Window handle.
2157 /// How to get Native Window handle
2159 /// Window window = NUIApplication.GetDefaultWindow();
2160 /// var handle = window.NativeHandle;
2161 /// if(handle.IsInvalid == false)
2163 /// IntPtr nativeHandle = handle.DangerousGetHandle();
2164 /// // do something with nativeHandle
2169 /// <since_tizen> 9 </since_tizen>
2170 public SafeHandle NativeHandle
2174 return new NUI.SafeNativeWindowHandle(this);