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 borderLayer;
40 private string windowTitle;
41 private List<Layer> childLayers = new List<Layer>();
42 private LayoutController localController;
44 static internal bool IsSupportedMultiWindow()
46 bool isSupported = false;
49 Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSupported);
51 catch (DllNotFoundException e)
53 Tizen.Log.Fatal("NUI", $"{e}\n");
57 #if NUI_PROPERTY_CHANGE_DEBUG
58 private bool flag1 = false;
60 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
62 if (Interop.Stage.IsInstalled())
64 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.GetCurrent());
66 localController = new LayoutController(this);
67 NUILog.Debug("layoutController id:" + localController.GetId());
69 #if NUI_PROPERTY_CHANGE_DEBUG
70 Tizen.Log.Fatal("NUITEST", $"Window constructor called!");
74 var curTh = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
75 Tizen.Log.Fatal("NUITEST", $"current threadID : {curTh}");
78 this.KeyEvent += TestWindowKeyEventHandler;
79 Tizen.Log.Fatal("NUITEST", $"TestWindowKeyEventHandler() added");
87 #if NUI_PROPERTY_CHANGE_DEBUG
88 private void TestWindowKeyEventHandler(object o, Window.KeyEventArgs e)
90 if(e.Key.State == Key.StateType.Down && e.Key.KeyPressedName == "1")
92 #if NUI_PROPERTY_CHANGE_1
93 Tizen.Log.Fatal("NUITEST", $"### (FIXED) currently used properties ###");
95 Tizen.Log.Fatal("NUITEST", $"### currently used properties ###");
97 Tizen.Log.Fatal("NUITEST", $"View properties =>");
98 Tizen.Log.Fatal("NUITEST", $"PropertyValueConstructor: {Tizen.NUI.PropertyValue.PropertyValueConstructor}");
99 Tizen.Log.Fatal("NUITEST", $"SizeGetter: {View.SizeGetter}, SizeSetter: {View.SizeSetter}");
100 Tizen.Log.Fatal("NUITEST", $"Size2DGetter: {View.Size2DGetter}, Size2DSetter: {View.Size2DSetter}");
101 Tizen.Log.Fatal("NUITEST", $"SizeWidthGetter: {View.SizeWidthGetter}, SizeWidthSetter: {View.SizeWidthSetter}");
102 Tizen.Log.Fatal("NUITEST", $"SizeHeightGetter: {View.SizeHeightGetter}, SizeHeightSetter: {View.SizeHeightSetter}");
103 Tizen.Log.Fatal("NUITEST", $"PositionGetter: {View.PositionGetter}, PositionSetter: {View.PositionSetter}");
104 Tizen.Log.Fatal("NUITEST", $"Position2DGetter: {View.Position2DGetter}, Position2DSetter: {View.Position2DSetter}");
105 Tizen.Log.Fatal("NUITEST", $"PositionXGetter: {View.PositionXGetter}, PositionXSetter: {View.PositionXSetter}");
106 Tizen.Log.Fatal("NUITEST", $"PositionYGetter: {View.PositionYGetter}, PositionYSetter: {View.PositionYSetter}");
107 Tizen.Log.Fatal("NUITEST", $"PositionZGetter: {View.PositionZGetter}, PositionZSetter: {View.PositionZSetter}");
108 Tizen.Log.Fatal("NUITEST", $"MaximumSizeGetter: {View.MaximumSizeGetter}, MaximumSizeSetter: {View.MaximumSizeSetter}");
109 Tizen.Log.Fatal("NUITEST", $"MinimumSizeGetter: {View.MinimumSizeGetter}, MinimumSizeSetter: {View.MinimumSizeSetter}");
110 Tizen.Log.Fatal("NUITEST", $"StyleNameGetter: {View.StyleNameGetter}, StyleNameSetter: {View.StyleNameSetter}");
111 Tizen.Log.Fatal("NUITEST", $"KeyInputFocusGetter: {View.KeyInputFocusGetter}, KeyInputFocusSetter: {View.KeyInputFocusSetter}");
112 Tizen.Log.Fatal("NUITEST", $"ColorGetter: {View.ColorGetter}, ColorSetter: {View.ColorSetter}");
113 Tizen.Log.Fatal("NUITEST", $"ColorRedGetter: {View.ColorRedGetter}, ColorRedSetter: {View.ColorRedSetter}");
114 Tizen.Log.Fatal("NUITEST", $"ColorGreenGetter: {View.ColorGreenGetter}, ColorGreenSetter: {View.ColorGreenSetter}");
115 Tizen.Log.Fatal("NUITEST", $"ColorBlueGetter: {View.ColorBlueGetter}, ColorBlueSetter: {View.ColorBlueSetter}");
116 Tizen.Log.Fatal("NUITEST", $"StateGetter: {View.StateGetter}, StateSetter: {View.StateSetter}");
117 Tizen.Log.Fatal("NUITEST", $"SubStateGetter: {View.SubStateGetter}, SubStateSetter: {View.SubStateSetter}");
118 Tizen.Log.Fatal("NUITEST", $"FlexGetter: {View.FlexGetter}, FlexSetter: {View.FlexSetter}");
119 Tizen.Log.Fatal("NUITEST", $"AlignSelfGetter: {View.AlignSelfGetter}, AlignSelfSetter: {View.AlignSelfSetter}");
120 Tizen.Log.Fatal("NUITEST", $"FlexMarginGetter: {View.FlexMarginGetter}, FlexMarginSetter: {View.FlexMarginSetter}");
121 Tizen.Log.Fatal("NUITEST", $"CellIndexGetter: {View.CellIndexGetter}, CellIndexSetter: {View.CellIndexSetter}");
122 Tizen.Log.Fatal("NUITEST", $"RowSpanGetter: {View.RowSpanGetter}, RowSpanSetter: {View.RowSpanSetter}");
123 Tizen.Log.Fatal("NUITEST", $"ColumnSpanGetter: {View.ColumnSpanGetter}, ColumnSpanSetter: {View.ColumnSpanSetter}");
124 Tizen.Log.Fatal("NUITEST", $"CellHorizontalAlignmentGetter: {View.CellHorizontalAlignmentGetter}, CellHorizontalAlignmentSetter: {View.CellHorizontalAlignmentSetter}");
125 Tizen.Log.Fatal("NUITEST", $"CellVerticalAlignmentGetter: {View.CellVerticalAlignmentGetter}, CellVerticalAlignmentSetter: {View.CellVerticalAlignmentSetter}");
126 Tizen.Log.Fatal("NUITEST", $"OpacityGetter: {View.OpacityGetter}, OpacitySetter: {View.OpacitySetter}");
127 Tizen.Log.Fatal("NUITEST", $"PositionUsesPivotPointGetter: {View.PositionUsesPivotPointGetter}, PositionUsesPivotPointSetter: {View.PositionUsesPivotPointSetter}");
128 Tizen.Log.Fatal("NUITEST", $"ParentOriginGetter: {View.ParentOriginGetter}, ParentOriginSetter: {View.ParentOriginSetter}");
129 Tizen.Log.Fatal("NUITEST", $"PivotPointGetter: {View.PivotPointGetter}, PivotPointSetter: {View.PivotPointSetter}");
130 Tizen.Log.Fatal("NUITEST", $"OrientationGetter: {View.OrientationGetter}, OrientationSetter: {View.OrientationSetter}");
131 Tizen.Log.Fatal("NUITEST", $"ScaleGetter: {View.ScaleGetter}, ScaleSetter: {View.ScaleSetter}");
132 Tizen.Log.Fatal("NUITEST", $"ScaleXGetter: {View.ScaleXGetter}, ScaleXSetter: {View.ScaleXSetter}");
133 Tizen.Log.Fatal("NUITEST", $"ScaleYGetter: {View.ScaleYGetter}, ScaleYSetter: {View.ScaleYSetter}");
134 Tizen.Log.Fatal("NUITEST", $"ScaleZGetter: {View.ScaleZGetter}, ScaleZSetter: {View.ScaleZSetter}");
135 Tizen.Log.Fatal("NUITEST", $"NameGetter: {View.NameGetter}, NameSetter: {View.NameSetter}");
136 Tizen.Log.Fatal("NUITEST", $"SensitiveGetter: {View.SensitiveGetter}, SensitiveSetter: {View.SensitiveSetter}");
137 Tizen.Log.Fatal("NUITEST", $"IsEnabledGetter: {View.IsEnabledGetter}, IsEnabledSetter: {View.IsEnabledSetter}");
138 Tizen.Log.Fatal("NUITEST", $"DispatchKeyEventsGetter: {View.DispatchKeyEventsGetter}, DispatchKeyEventsSetter: {View.DispatchKeyEventsSetter}");
139 Tizen.Log.Fatal("NUITEST", $"LeaveRequiredGetter: {View.LeaveRequiredGetter}, LeaveRequiredSetter: {View.LeaveRequiredSetter}");
140 Tizen.Log.Fatal("NUITEST", $"InheritOrientationGetter: {View.InheritOrientationGetter}, InheritOrientationSetter: {View.InheritOrientationSetter}");
141 Tizen.Log.Fatal("NUITEST", $"InheritScaleGetter: {View.InheritScaleGetter}, InheritScaleSetter: {View.InheritScaleSetter}");
142 Tizen.Log.Fatal("NUITEST", $"DrawModeGetter: {View.DrawModeGetter}, DrawModeSetter: {View.DrawModeSetter}");
143 Tizen.Log.Fatal("NUITEST", $"SizeModeFactorGetter: {View.SizeModeFactorGetter}, SizeModeFactorSetter: {View.SizeModeFactorSetter}");
144 Tizen.Log.Fatal("NUITEST", $"WidthResizePolicyGetter: {View.WidthResizePolicyGetter}, WidthResizePolicySetter: {View.WidthResizePolicySetter}");
145 Tizen.Log.Fatal("NUITEST", $"HeightResizePolicyGetter: {View.HeightResizePolicyGetter}, HeightResizePolicySetter: {View.HeightResizePolicySetter}");
146 Tizen.Log.Fatal("NUITEST", $"SizeScalePolicyGetter: {View.SizeScalePolicyGetter}, SizeScalePolicySetter: {View.SizeScalePolicySetter}");
147 Tizen.Log.Fatal("NUITEST", $"WidthForHeightGetter: {View.WidthForHeightGetter}, WidthForHeightSetter: {View.WidthForHeightSetter}");
148 Tizen.Log.Fatal("NUITEST", $"HeightForWidthGetter: {View.HeightForWidthGetter}, HeightForWidthSetter: {View.HeightForWidthSetter}");
149 Tizen.Log.Fatal("NUITEST", $"InheritPositionGetter: {View.InheritPositionGetter}, InheritPositionSetter: {View.InheritPositionSetter}");
150 Tizen.Log.Fatal("NUITEST", $"ClippingModeGetter: {View.ClippingModeGetter}, ClippingModeSetter: {View.ClippingModeSetter}");
151 Tizen.Log.Fatal("NUITEST", $"InheritLayoutDirectionGetter: {View.InheritLayoutDirectionGetter}, InheritLayoutDirectionSetter: {View.InheritLayoutDirectionSetter}");
152 Tizen.Log.Fatal("NUITEST", $"LayoutDirectionGetter: {View.LayoutDirectionGetter}, LayoutDirectionSetter: {View.LayoutDirectionSetter}");
153 Tizen.Log.Fatal("NUITEST", $"UpdateAreaHintGetter: {View.UpdateAreaHintGetter}, UpdateAreaHintSetter: {View.UpdateAreaHintSetter}");
154 Tizen.Log.Fatal("NUITEST", $"AccessibilityNameGetter: {View.AccessibilityNameGetter}, AccessibilityNameSetter: {View.AccessibilityNameSetter}");
155 Tizen.Log.Fatal("NUITEST", $"AccessibilityDescriptionGetter: {View.AccessibilityDescriptionGetter}, AccessibilityDescriptionSetter: {View.AccessibilityDescriptionSetter}");
156 Tizen.Log.Fatal("NUITEST", $"AccessibilityTranslationDomainGetter: {View.AccessibilityTranslationDomainGetter}, AccessibilityTranslationDomainSetter: {View.AccessibilityTranslationDomainSetter}");
157 Tizen.Log.Fatal("NUITEST", $"AccessibilityRoleGetter: {View.AccessibilityRoleGetter}, AccessibilityRoleSetter: {View.AccessibilityRoleSetter}");
158 Tizen.Log.Fatal("NUITEST", $"AccessibilityHighlightableGetter: {View.AccessibilityHighlightableGetter}, AccessibilityHighlightableSetter: {View.AccessibilityHighlightableSetter}");
159 Tizen.Log.Fatal("NUITEST", $"AccessibilityHiddenGetter: {View.AccessibilityHiddenGetter}, AccessibilityHiddenSetter: {View.AccessibilityHiddenSetter}");
160 Tizen.Log.Fatal("NUITEST", $"AutomationIdGetter: {View.AutomationIdGetter}, AutomationIdSetter: {View.AutomationIdSetter}");
161 Tizen.Log.Fatal("NUITEST", $"ImageView properties =>");
162 Tizen.Log.Fatal("NUITEST", $"PreMultipliedAlphaGetter: {ImageView.PreMultipliedAlphaGetter}, PreMultipliedAlphaSetter: {ImageView.PreMultipliedAlphaSetter}");
163 Tizen.Log.Fatal("NUITEST", $"PixelAreaGetter: {ImageView.PixelAreaGetter}, PixelAreaSetter: {ImageView.PixelAreaSetter}");
164 Tizen.Log.Fatal("NUITEST", $"TextLabel properties =>");
165 Tizen.Log.Fatal("NUITEST", $"TextGetter: {TextLabel.TextGetter}, TextSetter: {TextLabel.TextSetter}");
166 Tizen.Log.Fatal("NUITEST", $"FontFamilyGetter: {TextLabel.FontFamilyGetter}, FontFamilySetter: {TextLabel.FontFamilySetter}");
167 Tizen.Log.Fatal("NUITEST", $"PointSizeGetter: {TextLabel.PointSizeGetter}");
174 /// A helper method to get the current window where the view is added
176 /// <param name="view">The View added to the window</param>
177 /// <returns>A Window.</returns>
178 [EditorBrowsable(EditorBrowsableState.Never)]
179 static public Window Get(View view)
183 NUILog.Error("if there is no view, it can not get a window");
187 //to fix memory leak issue, match the handle count with native side.
188 Window ret = view.GetInstanceSafely<Window>(Interop.Window.Get(View.getCPtr(view)));
189 if (NDalicPINVOKE.SWIGPendingException.Pending)throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 /// Creates a new Window.<br />
195 /// This creates an extra window in addition to the default main window<br />
197 /// <param name="windowPosition">The position and size of the Window.</param>
198 /// <param name="isTranslucent">Whether Window is translucent.</param>
199 /// <returns>A new Window.</returns>
200 /// <since_tizen> 6 </since_tizen>
201 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
202 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
203 public Window(Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
205 if (IsSupportedMultiWindow() == false)
207 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 /// Creates a new Window with a specific name.<br />
214 /// This creates an extra window in addition to the default main window<br />
216 /// <param name="name">The name for extra window. </param>
217 /// <param name="windowPosition">The position and size of the Window.</param>
218 /// <param name="isTranslucent">Whether Window is translucent.</param>
219 /// <returns>A new Window.</returns>
220 /// <since_tizen> 6 </since_tizen>
221 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
222 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
223 public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
225 if (IsSupportedMultiWindow() == false)
227 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
229 this.windowTitle = name;
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 /// Creates a new Window with a specific name.<br />
235 /// This creates an extra window in addition to the default main window<br />
237 /// <param name="name">The name for extra window. </param>
238 /// <param name="borderInterface"><see cref="Tizen.NUI.IBorderInterface"/>If borderInterface is null, defaultBorder is enabled.</param>
239 /// <param name="windowPosition">The position and size of the Window.</param>
240 /// <param name="isTranslucent">Whether Window is translucent.</param>
241 /// <returns>A new Window.</returns>
242 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
243 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
244 [EditorBrowsable(EditorBrowsableState.Never)]
245 public Window(string name, IBorderInterface borderInterface, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
247 if (IsSupportedMultiWindow() == false)
249 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
251 this.windowTitle = name;
252 this.EnableBorder(borderInterface);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
260 /// <since_tizen> 3 </since_tizen>
261 public enum WindowOrientation
264 /// Portrait orientation. The height of the display area is greater than the width.
266 /// <since_tizen> 3 </since_tizen>
269 /// Landscape orientation. A wide view area is needed.
271 /// <since_tizen> 3 </since_tizen>
274 /// Portrait inverse orientation.
276 /// <since_tizen> 3 </since_tizen>
277 PortraitInverse = 180,
279 /// Landscape inverse orientation.
281 /// <since_tizen> 3 </since_tizen>
282 LandscapeInverse = 270,
284 /// No orientation. It is for the preferred orientation
285 /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
286 /// It is used to unset the preferred orientation with SetPreferredOrientation.
288 [EditorBrowsable(EditorBrowsableState.Never)]
289 NoOrientationPreference = -1
293 /// Enumeration for the key grab mode for platform-level APIs.
295 /// <since_tizen> 3 </since_tizen>
296 public enum KeyGrabMode
299 /// Grabs a key only when on the top of the grabbing-window stack mode.
303 /// Grabs a key together with the other client window(s) mode.
307 /// 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.
311 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
317 /// Enumeration for transition effect's state.
319 [Obsolete("Do not use this, that will be removed. Use Window.EffectState instead.")]
320 [EditorBrowsable(EditorBrowsableState.Never)]
321 // This is already deprecated, so suppress warning here.
322 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
323 public enum EffectStates
328 [Obsolete("Do not use this, that will be removed. Use Window.EffectState.None instead.")]
329 [EditorBrowsable(EditorBrowsableState.Never)]
332 /// Transition effect is started.
334 [Obsolete("Do not use this, that will be removed. Use Window.EffectState.Start instead.")]
335 [EditorBrowsable(EditorBrowsableState.Never)]
338 /// Transition effect is ended.
340 [Obsolete("Do not use this, that will be removed. Use Window.EffectState.End instead.")]
341 [EditorBrowsable(EditorBrowsableState.Never)]
346 /// Enumeration for transition effect's state.
348 [EditorBrowsable(EditorBrowsableState.Never)]
349 public enum EffectState
354 [EditorBrowsable(EditorBrowsableState.Never)]
357 /// Transition effect is started.
359 [EditorBrowsable(EditorBrowsableState.Never)]
362 /// Transition effect is ended.
364 [EditorBrowsable(EditorBrowsableState.Never)]
369 /// Enumeration for transition effect's type.
371 [Obsolete("Do not use this, that will be removed. Use Window.EffectType instead.")]
372 [EditorBrowsable(EditorBrowsableState.Never)]
373 // This is already deprecated, so suppress warning here.
374 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names", Justification = "<Pending>")]
375 public enum EffectTypes
380 [Obsolete("Do not use this, that will be removed. Use Window.EffectType.None instead.")]
381 [EditorBrowsable(EditorBrowsableState.Never)]
384 /// Window show effect.
386 [Obsolete("Do not use this, that will be removed. Use Window.EffectType.Show instead.")]
387 [EditorBrowsable(EditorBrowsableState.Never)]
390 /// Window hide effect.
392 [Obsolete("Do not use this, that will be removed. Use Window.EffectType.Hide instead.")]
393 [EditorBrowsable(EditorBrowsableState.Never)]
398 /// Enumeration for transition effect's type.
400 [EditorBrowsable(EditorBrowsableState.Never)]
401 public enum EffectType
406 [EditorBrowsable(EditorBrowsableState.Never)]
409 /// Window show effect.
411 [EditorBrowsable(EditorBrowsableState.Never)]
414 /// Window hide effect.
416 [EditorBrowsable(EditorBrowsableState.Never)]
421 /// Enumeration for result of window operation.
423 internal enum OperationResult
426 /// Failed for unknown reason
434 /// Permission denied
438 /// The operation is not supported.
444 /// Enumeration for window resized mode by display server.
446 [EditorBrowsable(EditorBrowsableState.Never)]
447 public enum ResizeDirection
452 [EditorBrowsable(EditorBrowsableState.Never)]
455 /// Start resizing window to the top-left edge.
457 [EditorBrowsable(EditorBrowsableState.Never)]
460 /// Start resizing window to the top side.
462 [EditorBrowsable(EditorBrowsableState.Never)]
465 /// Start resizing window to the top-right edge.
467 [EditorBrowsable(EditorBrowsableState.Never)]
470 /// Start resizing window to the left side.
472 [EditorBrowsable(EditorBrowsableState.Never)]
475 /// Start resizing window to the right side.
477 [EditorBrowsable(EditorBrowsableState.Never)]
480 /// Start resizing window to the bottom-left edge.
482 [EditorBrowsable(EditorBrowsableState.Never)]
485 /// Start resizing window to the bottom side.
487 [EditorBrowsable(EditorBrowsableState.Never)]
490 /// Start resizing window to the bottom-right edge.
492 [EditorBrowsable(EditorBrowsableState.Never)]
498 /// The stage instance property (read-only).<br />
499 /// Gets the current window.<br />
501 /// <since_tizen> 3 </since_tizen>
502 public static Window Instance { get; internal set; }
505 /// Gets or sets a window type.
506 /// Most of window type can be set to use WindowType, except for IME type.
507 /// IME type can be set to use one of NUIApplication's constrcutors.
509 /// <since_tizen> 3 </since_tizen>
510 public WindowType Type
514 WindowType ret = (WindowType)Interop.Window.GetType(SwigCPtr);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
520 Interop.Window.SetType(SwigCPtr, (int)value);
521 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526 /// Gets/Sets a window title.
528 /// <since_tizen> 4 </since_tizen>
538 SetClass(windowTitle, "");
543 /// The rendering behavior of a Window.
545 /// <since_tizen> 5 </since_tizen>
546 public RenderingBehaviorType RenderingBehavior
550 return GetRenderingBehavior();
554 SetRenderingBehavior(value);
559 /// The window size property (read-only).
561 /// <since_tizen> 3 </since_tizen>
566 Size2D ret = GetSize();
572 /// The background color property.
574 /// <since_tizen> 3 </since_tizen>
575 public Color BackgroundColor
579 SetBackgroundColor(value);
583 Color ret = GetBackgroundColor();
589 /// The DPI property (read-only).<br />
590 /// Retrieves the DPI of the display device to which the Window is connected.<br />
592 /// <since_tizen> 3 </since_tizen>
602 /// The layer count property (read-only).<br />
603 /// Queries the number of on-Window layers.<br />
605 /// <since_tizen> 3 </since_tizen>
606 public uint LayerCount
610 return GetLayerCount();
615 /// Gets or sets a size of the window.
617 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
618 /// <since_tizen> 4 </since_tizen>
619 public Size2D WindowSize
623 return GetWindowSize();
627 SetWindowSize(value);
632 /// Gets or sets a position of the window.
634 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
635 /// <since_tizen> 4 </since_tizen>
636 public Position2D WindowPosition
640 return GetPosition();
649 /// Sets position and size of the window. This API guarantees that
650 /// both moving and resizing of window will appear on the screen at once.
652 [EditorBrowsable(EditorBrowsableState.Never)]
653 public Rectangle WindowPositionSize
657 Position2D position = GetPosition();
658 Size2D size = GetSize();
659 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
665 SetPositionSize(value);
669 internal static Vector4 DEFAULT_BACKGROUND_COLOR
673 global::System.IntPtr cPtr = Interop.Stage.DefaultBackgroundColorGet();
674 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
675 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 internal static Vector4 DEBUG_BACKGROUND_COLOR
684 global::System.IntPtr cPtr = Interop.Stage.DebugBackgroundColorGet();
685 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691 internal List<Layer> LayersChildren
700 /// Get the LayoutController for this Window.
702 internal LayoutController LayoutController
706 return localController;
711 /// Feed a key-event into the window.
713 /// <param name="keyEvent">The key event to feed.</param>
714 /// <since_tizen> 4 </since_tizen>
715 [Obsolete("Do not use this, that will be deprecated. Use FeedKey(Key keyEvent) instead.")]
716 public static void FeedKeyEvent(Key keyEvent)
718 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
719 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
723 /// Sets whether the window accepts a focus or not.
725 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
726 /// <since_tizen> 3 </since_tizen>
727 public void SetAcceptFocus(bool accept)
729 Interop.Window.SetAcceptFocus(SwigCPtr, accept);
730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
734 /// Returns whether the window accepts a focus or not.
736 /// <returns>True if the window accepts a focus, false otherwise.</returns>
737 /// <since_tizen> 3 </since_tizen>
738 public bool IsFocusAcceptable()
740 bool ret = Interop.Window.IsFocusAcceptable(SwigCPtr);
741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
747 /// Shows the window if it is hidden.
749 /// <since_tizen> 3 </since_tizen>
752 Interop.Window.Show(SwigCPtr);
753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
757 /// Hides the window if it is showing.
759 /// <since_tizen> 3 </since_tizen>
762 Interop.Window.Hide(SwigCPtr);
763 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
767 /// Retrieves whether the window is visible or not.
769 /// <returns>True if the window is visible.</returns>
770 /// <since_tizen> 3 </since_tizen>
771 public bool IsVisible()
773 bool temp = Interop.Window.IsVisible(SwigCPtr);
774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
779 /// Gets the count of supported auxiliary hints of the window.
781 /// <returns>The number of supported auxiliary hints.</returns>
782 /// <since_tizen> 3 </since_tizen>
783 public uint GetSupportedAuxiliaryHintCount()
785 uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(SwigCPtr);
786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
791 /// Gets the supported auxiliary hint string of the window.
793 /// <param name="index">The index of the supported auxiliary hint lists.</param>
794 /// <returns>The auxiliary hint string of the index.</returns>
795 /// <since_tizen> 3 </since_tizen>
796 public string GetSupportedAuxiliaryHint(uint index)
798 string ret = Interop.Window.GetSupportedAuxiliaryHint(SwigCPtr, index);
799 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
804 /// Creates an auxiliary hint of the window.
806 /// <param name="hint">The auxiliary hint string.</param>
807 /// <param name="value">The value string.</param>
808 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
809 /// <since_tizen> 3 </since_tizen>
810 public uint AddAuxiliaryHint(string hint, string value)
812 uint ret = Interop.Window.AddAuxiliaryHint(SwigCPtr, hint, value);
813 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
818 /// Removes an auxiliary hint of the window.
820 /// <param name="id">The ID of the auxiliary hint.</param>
821 /// <returns>True if no error occurred, false otherwise.</returns>
822 /// <since_tizen> 3 </since_tizen>
823 public bool RemoveAuxiliaryHint(uint id)
825 bool ret = Interop.Window.RemoveAuxiliaryHint(SwigCPtr, id);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
831 /// Changes a value of the auxiliary hint.
833 /// <param name="id">The auxiliary hint ID.</param>
834 /// <param name="value">The value string to be set.</param>
835 /// <returns>True if no error occurred, false otherwise.</returns>
836 /// <since_tizen> 3 </since_tizen>
837 public bool SetAuxiliaryHintValue(uint id, string value)
839 bool ret = Interop.Window.SetAuxiliaryHintValue(SwigCPtr, id, value);
840 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
845 /// Gets a value of the auxiliary hint.
847 /// <param name="id">The auxiliary hint ID.</param>
848 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
849 /// <since_tizen> 3 </since_tizen>
850 public string GetAuxiliaryHintValue(uint id)
852 string ret = Interop.Window.GetAuxiliaryHintValue(SwigCPtr, id);
853 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
858 /// Gets an ID of the auxiliary hint string.
860 /// <param name="hint">The auxiliary hint string.</param>
861 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
862 /// <since_tizen> 3 </since_tizen>
863 public uint GetAuxiliaryHintId(string hint)
865 uint ret = Interop.Window.GetAuxiliaryHintId(SwigCPtr, hint);
866 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
871 /// Sets a region to accept input events.
873 /// <param name="inputRegion">The region to accept input events.</param>
874 /// <since_tizen> 3 </since_tizen>
875 public void SetInputRegion(Rectangle inputRegion)
877 Interop.Window.IncludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
878 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
882 /// Sets a priority level for the specified notification window.
884 /// <param name="level">The notification window level.</param>
885 /// <returns>True if no error occurred, false otherwise.</returns>
886 /// <since_tizen> 3 </since_tizen>
887 public bool SetNotificationLevel(NotificationLevel level)
889 var ret = (OperationResult)Interop.Window.SetNotificationLevel(SwigCPtr, (int)level);
890 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
891 return ret == OperationResult.Succeed;
895 /// Gets a priority level for the specified notification window.
897 /// <returns>The notification window level.</returns>
898 /// <since_tizen> 3 </since_tizen>
899 public NotificationLevel GetNotificationLevel()
901 NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(SwigCPtr);
902 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907 /// Sets a transparent window's visual state to opaque. <br />
908 /// If a visual state of a transparent window is opaque, <br />
909 /// then the window manager could handle it as an opaque window when calculating visibility.
911 /// <param name="opaque">Whether the window's visual state is opaque.</param>
912 /// <remarks>This will have no effect on an opaque window. <br />
913 /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
915 /// <since_tizen> 3 </since_tizen>
916 public void SetOpaqueState(bool opaque)
918 Interop.Window.SetOpaqueState(SwigCPtr, opaque);
919 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
923 /// Returns whether a transparent window's visual state is opaque or not.
925 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
926 /// <remarks> The return value has no meaning on an opaque window. </remarks>
927 /// <since_tizen> 3 </since_tizen>
928 public bool IsOpaqueState()
930 bool ret = Interop.Window.IsOpaqueState(SwigCPtr);
931 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
936 /// Sets a window's screen off mode.
938 /// <param name="screenOffMode">The screen mode.</param>
939 /// <returns>True if no error occurred, false otherwise.</returns>
940 /// <since_tizen> 4 </since_tizen>
941 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
943 var ret = (OperationResult)Interop.Window.SetScreenOffMode(SwigCPtr, (int)screenOffMode);
944 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
945 return ret == OperationResult.Succeed;
949 /// Gets the screen mode of the window.
951 /// <returns>The screen off mode.</returns>
952 /// <since_tizen> 4 </since_tizen>
953 public ScreenOffMode GetScreenOffMode()
955 ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(SwigCPtr);
956 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
961 /// Sets preferred brightness of the window.
963 /// <param name="brightness">The preferred brightness (0 to 100).</param>
964 /// <returns>True if no error occurred, false otherwise.</returns>
965 /// <since_tizen> 3 </since_tizen>
966 public bool SetBrightness(int brightness)
968 var ret = (OperationResult)Interop.Window.SetBrightness(SwigCPtr, brightness);
969 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
970 return ret == OperationResult.Succeed;
974 /// Gets the preferred brightness of the window.
976 /// <returns>The preferred brightness.</returns>
977 /// <since_tizen> 3 </since_tizen>
978 public int GetBrightness()
980 int ret = Interop.Window.GetBrightness(SwigCPtr);
981 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
986 /// Sets the window name and the class string.
988 /// <param name="name">The name of the window.</param>
989 /// <param name="klass">The class of the window.</param>
990 /// <since_tizen> 4 </since_tizen>
991 public void SetClass(string name, string klass)
993 Interop.Window.SetClass(SwigCPtr, name, klass);
994 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
998 /// Raises the window to the top of the window stack.
1000 /// <since_tizen> 3 </since_tizen>
1003 Interop.Window.Raise(SwigCPtr);
1004 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1008 /// Lowers the window to the bottom of the window stack.
1010 /// <since_tizen> 3 </since_tizen>
1013 Interop.Window.Lower(SwigCPtr);
1014 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1018 /// Activates the window to the top of the window stack even it is iconified.
1020 /// <since_tizen> 3 </since_tizen>
1021 public void Activate()
1023 Interop.Window.Activate(SwigCPtr);
1024 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1028 /// Gets the default ( root ) layer.
1030 /// <returns>The root layer.</returns>
1031 /// <since_tizen> 3 </since_tizen>
1032 public Layer GetDefaultLayer()
1034 return this.GetRootLayer();
1038 /// Add a child view to window.
1040 /// <param name="view">the child should be added to the window.</param>
1041 /// <since_tizen> 3 </since_tizen>
1042 public void Add(View view)
1044 this.GetRootLayer().Add(view);
1048 /// Remove a child view from window.
1050 /// <param name="view">the child to be removed.</param>
1051 /// <since_tizen> 3 </since_tizen>
1052 public void Remove(View view)
1054 this.GetRootLayer().Remove(view);
1058 /// Retrieves the layer at a specified depth.
1060 /// <param name="depth">The layer's depth index.</param>
1061 /// <returns>The layer found at the given depth.</returns>
1062 /// <since_tizen> 3 </since_tizen>
1063 public Layer GetLayer(uint depth)
1065 if (depth < LayersChildren?.Count)
1067 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
1077 /// Destroy the window immediately.
1079 [EditorBrowsable(EditorBrowsableState.Never)]
1080 public void Destroy()
1086 /// Keep rendering for at least the given amount of time.
1088 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
1089 /// <since_tizen> 3 </since_tizen>
1090 public void KeepRendering(float durationSeconds)
1092 Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
1093 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1097 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
1098 /// This function can be used for following example scenarios: <br />
1099 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
1101 /// <param name="DaliKey">The key code to grab.</param>
1102 /// <returns>True if the grab succeeds.</returns>
1103 /// <since_tizen> 3 </since_tizen>
1104 public bool GrabKeyTopmost(int DaliKey)
1106 bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1112 /// Ungrabs the key specified by a key for the window.<br />
1113 /// 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 />
1115 /// <param name="DaliKey">The key code to ungrab.</param>
1116 /// <returns>True if the ungrab succeeds.</returns>
1117 /// <since_tizen> 3 </since_tizen>
1118 public bool UngrabKeyTopmost(int DaliKey)
1120 bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1126 /// Grabs the key specified by a key for a window in a GrabMode. <br />
1127 /// Details: This function can be used for following example scenarios: <br />
1128 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
1129 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
1130 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
1132 /// <param name="DaliKey">The key code to grab.</param>
1133 /// <param name="GrabMode">The grab mode for the key.</param>
1134 /// <returns>True if the grab succeeds.</returns>
1135 /// <since_tizen> 3 </since_tizen>
1136 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
1138 bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey, (int)GrabMode);
1139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1144 /// Ungrabs the key specified by a key for a window.<br />
1145 /// 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 />
1147 /// <param name="DaliKey">The key code to ungrab.</param>
1148 /// <returns>True if the ungrab succeeds.</returns>
1149 /// <since_tizen> 3 </since_tizen>
1150 public bool UngrabKey(int DaliKey)
1152 bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
1153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1158 /// Sets the keyboard repeat information.
1160 /// <param name="rate">The key repeat rate value in seconds.</param>
1161 /// <param name="delay">The key repeat delay value in seconds.</param>
1162 /// <returns>True if setting the keyboard repeat succeeds.</returns>
1163 /// <since_tizen> 5 </since_tizen>
1164 public bool SetKeyboardRepeatInfo(float rate, float delay)
1166 bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
1167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1172 /// Gets the keyboard repeat information.
1174 /// <param name="rate">The key repeat rate value in seconds.</param>
1175 /// <param name="delay">The key repeat delay value in seconds.</param>
1176 /// <returns>True if setting the keyboard repeat succeeds.</returns>
1177 /// <since_tizen> 5 </since_tizen>
1178 public bool GetKeyboardRepeatInfo(out float rate, out float delay)
1180 bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
1181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1186 /// Adds a layer to the stage.
1188 /// <param name="layer">Layer to add.</param>
1189 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
1190 /// <since_tizen> 3 </since_tizen>
1191 public void AddLayer(Layer layer)
1197 /// Removes a layer from the stage.
1199 /// <param name="layer">Layer to remove.</param>
1200 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
1201 /// <since_tizen> 3 </since_tizen>
1202 public void RemoveLayer(Layer layer)
1208 /// Feeds a key event into the window.
1210 /// <param name="keyEvent">The key event to feed.</param>
1211 /// <since_tizen> 5 </since_tizen>
1212 public void FeedKey(Key keyEvent)
1214 Interop.Window.FeedKeyEvent(SwigCPtr, Key.getCPtr(keyEvent));
1215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1219 /// Feeds a touch point into the window.
1221 /// <param name="touchPoint">The touch point to feed.</param>
1222 /// <param name="timeStamp">The timeStamp.</param>
1223 internal void FeedTouch(TouchPoint touchPoint, int timeStamp)
1225 Interop.Window.FeedTouchPoint(SwigCPtr, TouchPoint.getCPtr(touchPoint), timeStamp);
1226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1230 /// Feeds a wheel event into the window.
1232 /// <param name="wheelEvent">The wheel event to feed.</param>
1233 internal void FeedWheel(Wheel wheelEvent)
1235 Interop.Window.FeedWheelEvent(SwigCPtr, Wheel.getCPtr(wheelEvent));
1236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1240 /// Allows at least one more render, even when paused.
1241 /// The window should be shown, not minimised.
1243 /// <since_tizen> 4 </since_tizen>
1244 public void RenderOnce()
1246 Interop.Window.RenderOnce(SwigCPtr);
1247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1251 /// Sets whether the window is transparent or not.
1253 /// <param name="transparent">Whether the window is transparent or not.</param>
1254 /// <since_tizen> 5 </since_tizen>
1255 public void SetTransparency(bool transparent)
1257 Interop.Window.SetTransparency(SwigCPtr, transparent);
1258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1260 // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1264 /// Sets parent window of the window.
1265 /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1266 /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
1267 /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
1269 /// <param name="parent">The parent window.</param>
1270 /// <since_tizen> 6 </since_tizen>
1271 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1272 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1273 public void SetParent(Window parent)
1275 if (IsSupportedMultiWindow() == false)
1277 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1279 Interop.Window.SetParent(SwigCPtr, Window.getCPtr(parent));
1280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1284 /// Sets parent window of the window.
1285 /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1286 /// This function has the additional flag whether the child is located above or below of the parent.
1288 /// <param name="parent">The parent window.</param>
1289 /// <param name="belowParent">The flag is whether the child is located above or below of the parent.</param>
1290 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1291 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1292 [EditorBrowsable(EditorBrowsableState.Never)]
1293 public void SetParent(Window parent, bool belowParent)
1295 if (IsSupportedMultiWindow() == false)
1297 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1299 Interop.Window.SetParentWithStack(SwigCPtr, Window.getCPtr(parent), belowParent);
1300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1304 /// Unsets parent window of the window.
1305 /// After unsetting, the window is disconnected his parent window.
1307 /// <since_tizen> 6 </since_tizen>
1308 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1309 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1310 public void Unparent()
1312 if (IsSupportedMultiWindow() == false)
1314 NUILog.Error("Fail to create window. because this device does not support opengles.surfaceless_context.");
1316 Interop.Window.Unparent(SwigCPtr);
1317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1321 /// Gets parent window of the window.
1323 /// <returns>The parent window of the window.</returns>
1324 /// <since_tizen> 6 </since_tizen>
1325 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1326 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1327 [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1721: Property names should not match get methods")]
1328 public Window GetParent()
1330 if (IsSupportedMultiWindow() == false)
1332 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1334 Window ret = this.GetInstanceSafely<Window>(Interop.Window.GetParent(SwigCPtr));
1335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1339 /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
1340 [EditorBrowsable(EditorBrowsableState.Never)]
1341 public void ObjectDump()
1343 Layer rootLayer = GetRootLayer();
1344 foreach (View view in rootLayer.Children)
1350 internal static bool IsInstalled()
1352 bool ret = Interop.Stage.IsInstalled();
1353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358 /// Adds an orientation to the list of available orientations.
1360 /// <param name="orientation">The available orientation to add</param>
1361 /// <since_tizen> 6 </since_tizen>
1362 public void AddAvailableOrientation(Window.WindowOrientation orientation)
1364 Interop.Window.AddAvailableOrientation(SwigCPtr, (int)orientation);
1365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1369 /// Removes an orientation from the list of available orientations.
1371 /// <param name="orientation">The available orientation to remove.</param>
1372 /// <since_tizen> 6 </since_tizen>
1373 public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1375 Interop.Window.RemoveAvailableOrientation(SwigCPtr, (int)orientation);
1376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1380 /// Sets a preferred orientation.
1382 /// <param name="orientation">The preferred orientation.</param>
1383 /// <since_tizen> 6 </since_tizen>
1384 public void SetPreferredOrientation(Window.WindowOrientation orientation)
1386 Interop.Window.SetPreferredOrientation(SwigCPtr, (int)orientation);
1387 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1391 /// Gets the preferred orientation.
1393 /// <since_tizen> 6 </since_tizen>
1394 /// <returns>The preferred orientation if previously set, or none.</returns>
1395 public Window.WindowOrientation GetPreferredOrientation()
1397 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetPreferredOrientation(SwigCPtr);
1398 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1403 /// Gets current orientation of the window.
1405 /// <since_tizen> 6 </since_tizen>
1406 /// <returns>The current window orientation if previously set, or none.</returns>
1407 [EditorBrowsable(EditorBrowsableState.Never)]
1408 public Window.WindowOrientation GetCurrentOrientation()
1410 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetCurrentOrientation(SwigCPtr);
1411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1416 /// Sets available orientations of the window.
1417 /// This API is for setting several orientations one time.
1419 /// <param name="orientations">The list of orientations.</param>
1420 /// <since_tizen> 6 </since_tizen>
1421 [EditorBrowsable(EditorBrowsableState.Never)]
1422 public void SetAvailableOrientations(List<Window.WindowOrientation> orientations)
1424 if (null == orientations)
1426 throw new ArgumentNullException(nameof(orientations));
1429 PropertyArray orientationArray = new PropertyArray();
1430 for (int i = 0; i < orientations.Count; i++)
1432 PropertyValue value = new PropertyValue((int)orientations[i]);
1433 orientationArray.PushBack(value);
1437 Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray), orientations.Count);
1438 orientationArray.Dispose();
1439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1443 /// Get native window ID
1445 /// <returns>native window ID</returns>
1446 [EditorBrowsable(EditorBrowsableState.Never)]
1447 public int GetNativeId()
1449 int ret = Interop.Window.GetNativeId(SwigCPtr);
1450 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1454 internal Any GetNativeHandle()
1456 Any ret = new Any(Interop.WindowInternal.WindowGetNativeHandle(SwigCPtr), true);
1457 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1461 internal void Add(Layer layer)
1465 throw new ArgumentNullException(nameof(layer));
1470 Interop.Actor.Add(GetBorderWindowRootLayer().SwigCPtr, layer.SwigCPtr);
1471 if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }
1475 Interop.Window.Add(SwigCPtr, Layer.getCPtr(layer));
1476 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1479 LayersChildren?.Add(layer);
1480 layer.SetWindow(this);
1483 internal void Remove(Layer layer)
1487 throw new ArgumentNullException(nameof(layer));
1489 Interop.Window.Remove(SwigCPtr, Layer.getCPtr(layer));
1490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1492 LayersChildren?.Remove(layer);
1493 layer.SetWindow(null);
1496 internal Vector2 GetSize()
1498 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1500 convertRealWindowSizeToBorderWindowSize(val);
1502 Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1503 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1508 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
1509 [EditorBrowsable(EditorBrowsableState.Never)]
1510 public RenderTaskList GetRenderTaskList()
1512 RenderTaskList ret = new RenderTaskList(Interop.Stage.GetRenderTaskList(stageCPtr), true);
1513 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1518 /// Queries the number of on-window layers.
1520 /// <returns>The number of layers.</returns>
1521 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1522 internal uint GetLayerCount()
1524 if (LayersChildren == null || LayersChildren.Count < 0)
1527 return (uint)LayersChildren.Count;
1530 internal Layer GetRootLayer()
1534 if(borderLayer == null)
1536 borderLayer = GetBorderWindowRootLayer();
1537 LayersChildren?.Add(borderLayer);
1538 borderLayer.SetWindow(this);
1544 // Window.IsInstalled() is actually true only when called from event thread and
1545 // Core has been initialized, not when Stage is ready.
1546 if (rootLayer == null && Window.IsInstalled())
1548 rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
1549 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1550 LayersChildren?.Add(rootLayer);
1551 rootLayer.SetWindow(this);
1557 internal void SetBackgroundColor(Vector4 color)
1559 Interop.Window.SetBackgroundColor(SwigCPtr, Vector4.getCPtr(color));
1560 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1563 internal Vector4 GetBackgroundColor()
1565 Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(SwigCPtr), true);
1566 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1570 internal Vector2 GetDpi()
1572 Vector2 ret = new Vector2(Interop.Stage.GetDpi(stageCPtr), true);
1573 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1577 internal ObjectRegistry GetObjectRegistry()
1579 ObjectRegistry ret = new ObjectRegistry(Interop.Stage.GetObjectRegistry(stageCPtr), true);
1580 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1584 internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1586 Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1587 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1590 internal RenderingBehaviorType GetRenderingBehavior()
1592 RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.GetRenderingBehavior(stageCPtr);
1593 if (NDalicPINVOKE.SWIGPendingException.Pending)
1594 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1598 internal void SetWindowSize(Size2D size)
1602 throw new ArgumentNullException(nameof(size));
1604 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1606 convertBorderWindowSizeToRealWindowSize(val);
1608 Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
1610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1611 // Resetting Window size should request a relayout of the tree.
1614 internal Size2D GetWindowSize()
1616 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1618 convertRealWindowSizeToBorderWindowSize(val);
1620 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1621 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1626 internal void SetPosition(Position2D position)
1628 if (null == position)
1630 throw new ArgumentNullException(nameof(position));
1632 var val = new IntPair(position.X, position.Y);
1633 Interop.Window.SetPosition(SwigCPtr, IntPair.getCPtr(val));
1635 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1636 // Setting Position of the window should request a relayout of the tree.
1639 internal Position2D GetPosition()
1641 var val = new IntPair(Interop.Window.GetPosition(SwigCPtr), true);
1642 Position2D ret = new Position2D((int)val.GetX(), (int)val.GetY());
1644 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1648 internal void SetPositionSize(Rectangle positionSize)
1650 if (positionSize == null)
1652 throw new ArgumentNullException(nameof(positionSize));
1654 var val = new Uint16Pair((uint)positionSize.Width, (uint)positionSize.Height);
1656 convertBorderWindowSizeToRealWindowSize(val);
1658 positionSize.Width = val.GetX();
1659 positionSize.Height = val.GetY();
1661 Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
1664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1666 // Setting Position of the window should request a relayout of the tree.
1670 /// Enables the floating mode of window.
1671 /// The floating mode is to support window is moved or resized by display server.
1672 /// For example, if the video-player window sets the floating mode,
1673 /// then display server changes its geometry and handles it like a popup.
1674 /// The way of handling floating mode window is decided by display server.
1675 /// A special display server(as a Tizen display server) supports this mode.
1677 /// <param name="enable">Enable floating mode or not.</param>
1678 [EditorBrowsable(EditorBrowsableState.Never)]
1679 public void EnableFloatingMode(bool enable)
1681 Interop.Window.EnableFloatingMode(SwigCPtr, enable);
1682 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1686 /// Requests to display server for the window is moved by display server.
1687 /// It can be work with setting window floating mode.
1689 [EditorBrowsable(EditorBrowsableState.Never)]
1690 public void RequestMoveToServer()
1692 Interop.Window.RequestMoveToServer(SwigCPtr);
1693 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1697 /// Requests to display server for the window is resized by display server.
1698 /// It can be work with setting window floating mode.
1700 /// <param name="direction">It is indicated the window's side or edge for starting point.</param>
1701 [EditorBrowsable(EditorBrowsableState.Never)]
1702 public void RequestResizeToServer(ResizeDirection direction)
1704 Interop.Window.RequestResizeToServer(SwigCPtr, (int)direction);
1705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1709 /// Includes input region.
1710 /// This function inlcudes input regions.
1711 /// It can be used multiple times and supports multiple regions.
1712 /// It means input region will be extended.
1713 /// This input is related to mouse and touch event.
1714 /// If device has touch screen, this function is useful.
1715 /// Otherwise device does not have that, we can use it after connecting mouse to the device.
1717 /// <param name="inputRegion">The included region to accept input events.</param>
1718 [EditorBrowsable(EditorBrowsableState.Never)]
1719 public void IncludeInputRegion(Rectangle inputRegion)
1721 Interop.Window.IncludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
1722 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1726 /// This function excludes input regions.
1727 /// It can be used multiple times and supports multiple regions.
1728 /// It means input region will be reduced.
1729 /// Nofice, should be set input area by IncludeInputRegion() before this function is used.
1730 /// This input is related to mouse and touch event.
1731 /// If device has touch screen, this function is useful.
1732 /// Otherwise device does not have that, we can use it after connecting mouse to the device.
1734 /// <param name="inputRegion">The excluded region to except input events.</param>
1735 [EditorBrowsable(EditorBrowsableState.Never)]
1736 public void ExcludeInputRegion(Rectangle inputRegion)
1738 Interop.Window.ExcludeInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
1739 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1743 /// Maximizes window's size.
1744 /// If this function is called with true, window will be resized with screen size.
1745 /// Otherwise window will be resized with previous size.
1746 /// It is for the window's MAX button in window's border.
1747 /// If window border is supported by display server, it is not necessary.
1749 /// <param name="max">If window is maximized or unmaximized.</param>
1750 [EditorBrowsable(EditorBrowsableState.Never)]
1751 public void Maximize(bool max)
1753 Interop.Window.Maximize(SwigCPtr, max);
1754 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1758 /// Returns whether the window is maximized or not.
1760 /// <returns>True if the window is maximized, false otherwise.</returns>
1761 [EditorBrowsable(EditorBrowsableState.Never)]
1762 public bool IsMaximized()
1764 bool ret = Interop.Window.IsMaximized(SwigCPtr);
1765 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1770 /// Sets window's maximum size.
1772 /// It is to set the maximized size when window is maximized or the window's size is increased by RequestResizeToServer().
1773 /// Although the size is set by this function, window's size can be increased over the limitation by SetPositionSize() or SetSize().
1775 /// After setting, if Maximize() is called, window is resized with the setting size and move the center.
1778 /// <param name="size">the maximum size.</param>
1779 [EditorBrowsable(EditorBrowsableState.Never)]
1780 public void SetMaximumSize(Size2D size)
1784 throw new ArgumentNullException(nameof(size));
1786 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1788 Interop.Window.SetMaximumSize(SwigCPtr, Uint16Pair.getCPtr(val));
1790 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1794 /// Minimizes window's size.
1795 /// If this function is called with true, window will be iconified.
1796 /// Otherwise window will be activated.
1797 /// It is for the window's MIN button in window border.
1798 /// If window border is supported by display server, it is not necessary.
1800 /// <param name="min">If window is minimized or unminimized.</param>
1801 [EditorBrowsable(EditorBrowsableState.Never)]
1802 public void Minimize(bool min)
1804 Interop.Window.Minimize(SwigCPtr, min);
1805 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1809 /// Returns whether the window is minimized or not.
1811 /// <returns>True if the window is minimized, false otherwise.</returns>
1812 [EditorBrowsable(EditorBrowsableState.Never)]
1813 public bool IsMinimized()
1815 bool ret = Interop.Window.IsMinimized(SwigCPtr);
1816 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1821 /// Sets window's minimum size.
1822 /// It is to set the minimum size when window's size is decreased by RequestResizeToServer().
1823 /// Although the size is set by this function, window's size can be decreased over the limitation by SetPositionSize() or SetSize().
1825 /// <param name="size">the minimum size.</param>
1826 [EditorBrowsable(EditorBrowsableState.Never)]
1827 public void SetMimimumSize(Size2D size)
1831 throw new ArgumentNullException(nameof(size));
1833 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1835 Interop.Window.SetMimimumSize(SwigCPtr, Uint16Pair.getCPtr(val));
1837 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1841 /// Query whether window is rotating or not.
1843 /// <returns>True if window is rotating, false otherwise.</returns>
1844 [EditorBrowsable(EditorBrowsableState.Never)]
1845 public bool IsWindowRotating()
1847 bool ret = Interop.Window.IsWindowRotating(SwigCPtr);
1848 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1853 /// Gets the last key event the window gets.
1855 /// <returns>The last key event the window gets.</returns>
1856 [EditorBrowsable(EditorBrowsableState.Never)]
1857 public Key GetLastKeyEvent()
1859 Key ret = new Key(Interop.Window.GetLastKeyEvent(SwigCPtr), false);
1860 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1865 /// Gets the last touch event the window gets.
1867 /// <returns>The last touch event the window gets.</returns>
1868 [EditorBrowsable(EditorBrowsableState.Never)]
1869 public Touch GetLastTouchEvent()
1871 Touch ret = new Touch(Interop.Window.GetLastTouchEvent(SwigCPtr), false);
1872 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1877 /// Add FrameUpdateCallback
1879 [EditorBrowsable(EditorBrowsableState.Never)]
1880 public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1882 frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer()));
1886 /// Remove FrameUpdateCallback
1888 [EditorBrowsable(EditorBrowsableState.Never)]
1889 public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1891 frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr);
1895 /// Dispose for Window
1897 [EditorBrowsable(EditorBrowsableState.Never)]
1898 protected override void Dispose(DisposeTypes type)
1905 if (type == DisposeTypes.Explicit)
1908 //Release your own managed resources here.
1909 //You should release all of your own disposable objects here.
1911 if (IsBorderEnabled)
1916 foreach (var layer in childLayers)
1924 childLayers.Clear();
1926 localController?.Dispose();
1929 this.DisconnectNativeSignals();
1934 /// This will not be public opened.
1935 [EditorBrowsable(EditorBrowsableState.Never)]
1936 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1938 Interop.Window.DeleteWindow(swigCPtr);
1941 private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
1943 private static readonly object locker = new object();
1945 private static int key = 0;
1947 private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
1949 private struct internalHookCallbackType
1951 public FrameCallbackType userCallback;
1955 private static void OnInternalHookFrameCallback(int id)
1959 if (frameCallbackList.ContainsKey(id))
1961 if (frameCallbackList[id].userCallback != null)
1963 frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
1964 frameCallbackList.Remove(id);
1968 NUILog.Error($"found userCallback is NULL");
1969 frameCallbackList.Remove(id);
1975 private int AddInterHookCallback(FrameCallbackType callback, int frameId)
1977 if (null == callback)
1979 throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
1981 var assignedKey = 0;
1986 frameCallbackList.Add(assignedKey, new internalHookCallbackType()
1988 userCallback = callback,
1996 /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
1998 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1999 [EditorBrowsable(EditorBrowsableState.Never)]
2000 public delegate void FrameCallbackType(int frameId);
2003 /// Adds a callback that is called when the frame rendering is done by the graphics driver.
2004 /// A callback of the following type may be used:
2006 /// void MyFunction( int frameId )
2008 /// This callback will be deleted once it is called.
2010 /// Ownership of the callback is passed onto this class
2013 /// <param name="callback">The function to call</param>
2014 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
2015 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
2016 [EditorBrowsable(EditorBrowsableState.Never)]
2017 public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
2019 var assignedKey = AddInterHookCallback(callback, frameId);
2020 Interop.WindowInternal.AddFrameRenderedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
2022 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2026 /// Adds a callback that is called when the frame is displayed on the display.
2027 /// A callback of the following type may be used:
2029 /// void MyFunction( int frameId )
2031 /// This callback will be deleted once it is called.
2033 /// Ownership of the callback is passed onto this class
2036 /// <param name="callback">The function to call</param>
2037 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
2038 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
2039 [EditorBrowsable(EditorBrowsableState.Never)]
2040 public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
2042 var assignedKey = AddInterHookCallback(callback, frameId);
2043 Interop.WindowInternal.AddFramePresentedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
2045 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2049 /// Search through this Window for a Layer with the given unique ID.
2051 /// <param name="id">The ID of the Layer to find.</param>
2052 /// <remarks>Hidden-API</remarks>
2053 /// <returns>A handle to the Layer if found, or an empty handle if not.</returns>
2054 [EditorBrowsable(EditorBrowsableState.Never)]
2055 public Layer FindLayerByID(uint id)
2057 Layer defaultLayer = this.GetDefaultLayer();
2058 IntPtr cPtr = Interop.Actor.FindChildById(defaultLayer.SwigCPtr, id);
2059 Layer ret = this.GetInstanceSafely<Layer>(cPtr);
2061 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2066 /// Get Native Window handle.
2068 /// How to get Native Window handle
2070 /// Window window = NUIApplication.GetDefaultWindow();
2071 /// var handle = window.NativeHandle;
2072 /// if(handle.IsInvalid == false)
2074 /// IntPtr nativeHandle = handle.DangerousGetHandle();
2075 /// // do something with nativeHandle
2080 /// <since_tizen> 9 </since_tizen>
2081 public SafeHandle NativeHandle
2085 return new NUI.SafeNativeWindowHandle(this);