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 string windowTitle;
40 private List<Layer> childLayers = new List<Layer>();
41 private LayoutController localController;
43 static internal bool IsSupportedMultiWindow()
45 bool isSupported = false;
46 Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSupported);
50 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
52 if (Interop.Stage.IsInstalled())
54 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.GetCurrent());
56 localController = new LayoutController(this);
57 NUILog.Debug("layoutController id:" + localController.GetId());
62 /// Creates a new Window.<br />
63 /// This creates an extra window in addition to the default main window<br />
65 /// <param name="windowPosition">The position and size of the Window.</param>
66 /// <param name="isTranslucent">Whether Window is translucent.</param>
67 /// <returns>A new Window.</returns>
68 /// <since_tizen> 6 </since_tizen>
69 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
70 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
71 public Window(Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
73 if (IsSupportedMultiWindow() == false)
75 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
77 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81 /// Creates a new Window with a specific name.<br />
82 /// This creates an extra window in addition to the default main window<br />
84 /// <param name="name">The name for extra window. </param>
85 /// <param name="windowPosition">The position and size of the Window.</param>
86 /// <param name="isTranslucent">Whether Window is translucent.</param>
87 /// <returns>A new Window.</returns>
88 /// <since_tizen> 6 </since_tizen>
89 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
90 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
91 public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
93 if (IsSupportedMultiWindow() == false)
95 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
97 this.windowTitle = name;
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
104 /// <since_tizen> 3 </since_tizen>
105 public enum WindowOrientation
108 /// Portrait orientation. The height of the display area is greater than the width.
110 /// <since_tizen> 3 </since_tizen>
113 /// Landscape orientation. A wide view area is needed.
115 /// <since_tizen> 3 </since_tizen>
118 /// Portrait inverse orientation.
120 /// <since_tizen> 3 </since_tizen>
121 PortraitInverse = 180,
123 /// Landscape inverse orientation.
125 /// <since_tizen> 3 </since_tizen>
126 LandscapeInverse = 270,
128 /// No orientation. It is for the preferred orientation
129 /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
130 /// It is used to unset the preferred orientation with SetPreferredOrientation.
132 [EditorBrowsable(EditorBrowsableState.Never)]
133 NoOrientationPreference = -1
137 /// Enumeration for the key grab mode for platform-level APIs.
139 /// <since_tizen> 3 </since_tizen>
140 public enum KeyGrabMode
143 /// Grabs a key only when on the top of the grabbing-window stack mode.
147 /// Grabs a key together with the other client window(s) mode.
151 /// 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.
155 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
161 /// Enumeration for transition effect's state.
163 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState instead!")]
164 [EditorBrowsable(EditorBrowsableState.Never)]
165 public enum EffectStates
170 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.None instead!")]
171 [EditorBrowsable(EditorBrowsableState.Never)]
174 /// Transition effect is started.
176 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.Start instead!")]
177 [EditorBrowsable(EditorBrowsableState.Never)]
180 /// Transition effect is ended.
182 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.End instead!")]
183 [EditorBrowsable(EditorBrowsableState.Never)]
188 /// Enumeration for transition effect's state.
190 [EditorBrowsable(EditorBrowsableState.Never)]
191 public enum EffectState
196 [EditorBrowsable(EditorBrowsableState.Never)]
199 /// Transition effect is started.
201 [EditorBrowsable(EditorBrowsableState.Never)]
204 /// Transition effect is ended.
206 [EditorBrowsable(EditorBrowsableState.Never)]
211 /// Enumeration for transition effect's type.
213 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType instead!")]
214 [EditorBrowsable(EditorBrowsableState.Never)]
215 public enum EffectTypes
220 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.None instead!")]
221 [EditorBrowsable(EditorBrowsableState.Never)]
224 /// Window show effect.
226 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Show instead!")]
227 [EditorBrowsable(EditorBrowsableState.Never)]
230 /// Window hide effect.
232 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Hide instead!")]
233 [EditorBrowsable(EditorBrowsableState.Never)]
238 /// Enumeration for transition effect's type.
240 [EditorBrowsable(EditorBrowsableState.Never)]
241 public enum EffectType
246 [EditorBrowsable(EditorBrowsableState.Never)]
249 /// Window show effect.
251 [EditorBrowsable(EditorBrowsableState.Never)]
254 /// Window hide effect.
256 [EditorBrowsable(EditorBrowsableState.Never)]
261 /// Enumeration for result of window operation.
263 internal enum OperationResult
266 /// Failed for unknown reason
274 /// Permission denied
278 /// The operation is not supported.
285 /// The stage instance property (read-only).<br />
286 /// Gets the current window.<br />
288 /// <since_tizen> 3 </since_tizen>
289 public static Window Instance { get; internal set; }
292 /// Gets or sets a window type.
294 /// <since_tizen> 3 </since_tizen>
295 public WindowType Type
299 WindowType ret = (WindowType)Interop.Window.GetType(SwigCPtr);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
305 Interop.Window.SetType(SwigCPtr, (int)value);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311 /// Gets/Sets a window title.
313 /// <since_tizen> 4 </since_tizen>
323 SetClass(windowTitle, "");
328 /// The rendering behavior of a Window.
330 /// <since_tizen> 5 </since_tizen>
331 public RenderingBehaviorType RenderingBehavior
335 return GetRenderingBehavior();
339 SetRenderingBehavior(value);
344 /// The window size property (read-only).
346 /// <since_tizen> 3 </since_tizen>
351 Size2D ret = GetSize();
357 /// The background color property.
359 /// <since_tizen> 3 </since_tizen>
360 public Color BackgroundColor
364 SetBackgroundColor(value);
368 Color ret = GetBackgroundColor();
374 /// The DPI property (read-only).<br />
375 /// Retrieves the DPI of the display device to which the Window is connected.<br />
377 /// <since_tizen> 3 </since_tizen>
387 /// The layer count property (read-only).<br />
388 /// Queries the number of on-Window layers.<br />
390 /// <since_tizen> 3 </since_tizen>
391 public uint LayerCount
395 return GetLayerCount();
400 /// Gets or sets a size of the window.
402 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
403 /// <since_tizen> 4 </since_tizen>
404 public Size2D WindowSize
408 return GetWindowSize();
412 SetWindowSize(value);
417 /// Gets or sets a position of the window.
419 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
420 /// <since_tizen> 4 </since_tizen>
421 public Position2D WindowPosition
425 return GetPosition();
434 /// Sets position and size of the window. This API guarantees that
435 /// both moving and resizing of window will appear on the screen at once.
437 [EditorBrowsable(EditorBrowsableState.Never)]
438 public Rectangle WindowPositionSize
442 Position2D position = GetPosition();
443 Size2D size = GetSize();
444 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
450 SetPositionSize(value);
454 internal static Vector4 DEFAULT_BACKGROUND_COLOR
458 global::System.IntPtr cPtr = Interop.Stage.DefaultBackgroundColorGet();
459 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
460 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465 internal static Vector4 DEBUG_BACKGROUND_COLOR
469 global::System.IntPtr cPtr = Interop.Stage.DebugBackgroundColorGet();
470 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
471 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 internal List<Layer> LayersChildren
485 /// Get the LayoutController for this Window.
487 internal LayoutController LayoutController
491 return localController;
496 /// Feed a key-event into the window.
498 /// <param name="keyEvent">The key event to feed.</param>
499 /// <since_tizen> 4 </since_tizen>
500 [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
501 public static void FeedKeyEvent(Key keyEvent)
503 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
504 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508 /// Sets whether the window accepts a focus or not.
510 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
511 /// <since_tizen> 3 </since_tizen>
512 public void SetAcceptFocus(bool accept)
514 Interop.Window.SetAcceptFocus(SwigCPtr, accept);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519 /// Returns whether the window accepts a focus or not.
521 /// <returns>True if the window accepts a focus, false otherwise.</returns>
522 /// <since_tizen> 3 </since_tizen>
523 public bool IsFocusAcceptable()
525 bool ret = Interop.Window.IsFocusAcceptable(SwigCPtr);
526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
532 /// Shows the window if it is hidden.
534 /// <since_tizen> 3 </since_tizen>
537 Interop.Window.Show(SwigCPtr);
538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542 /// Hides the window if it is showing.
544 /// <since_tizen> 3 </since_tizen>
547 Interop.Window.Hide(SwigCPtr);
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552 /// Retrieves whether the window is visible or not.
554 /// <returns>True if the window is visible.</returns>
555 /// <since_tizen> 3 </since_tizen>
556 public bool IsVisible()
558 bool temp = Interop.Window.IsVisible(SwigCPtr);
559 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564 /// Gets the count of supported auxiliary hints of the window.
566 /// <returns>The number of supported auxiliary hints.</returns>
567 /// <since_tizen> 3 </since_tizen>
568 public uint GetSupportedAuxiliaryHintCount()
570 uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(SwigCPtr);
571 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576 /// Gets the supported auxiliary hint string of the window.
578 /// <param name="index">The index of the supported auxiliary hint lists.</param>
579 /// <returns>The auxiliary hint string of the index.</returns>
580 /// <since_tizen> 3 </since_tizen>
581 public string GetSupportedAuxiliaryHint(uint index)
583 string ret = Interop.Window.GetSupportedAuxiliaryHint(SwigCPtr, index);
584 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589 /// Creates an auxiliary hint of the window.
591 /// <param name="hint">The auxiliary hint string.</param>
592 /// <param name="value">The value string.</param>
593 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
594 /// <since_tizen> 3 </since_tizen>
595 public uint AddAuxiliaryHint(string hint, string value)
597 uint ret = Interop.Window.AddAuxiliaryHint(SwigCPtr, hint, value);
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603 /// Removes an auxiliary hint of the window.
605 /// <param name="id">The ID of the auxiliary hint.</param>
606 /// <returns>True if no error occurred, false otherwise.</returns>
607 /// <since_tizen> 3 </since_tizen>
608 public bool RemoveAuxiliaryHint(uint id)
610 bool ret = Interop.Window.RemoveAuxiliaryHint(SwigCPtr, id);
611 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
616 /// Changes a value of the auxiliary hint.
618 /// <param name="id">The auxiliary hint ID.</param>
619 /// <param name="value">The value string to be set.</param>
620 /// <returns>True if no error occurred, false otherwise.</returns>
621 /// <since_tizen> 3 </since_tizen>
622 public bool SetAuxiliaryHintValue(uint id, string value)
624 bool ret = Interop.Window.SetAuxiliaryHintValue(SwigCPtr, id, value);
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 /// Gets a value of the auxiliary hint.
632 /// <param name="id">The auxiliary hint ID.</param>
633 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
634 /// <since_tizen> 3 </since_tizen>
635 public string GetAuxiliaryHintValue(uint id)
637 string ret = Interop.Window.GetAuxiliaryHintValue(SwigCPtr, id);
638 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643 /// Gets an ID of the auxiliary hint string.
645 /// <param name="hint">The auxiliary hint string.</param>
646 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
647 /// <since_tizen> 3 </since_tizen>
648 public uint GetAuxiliaryHintId(string hint)
650 uint ret = Interop.Window.GetAuxiliaryHintId(SwigCPtr, hint);
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
656 /// Sets a region to accept input events.
658 /// <param name="inputRegion">The region to accept input events.</param>
659 /// <since_tizen> 3 </since_tizen>
660 public void SetInputRegion(Rectangle inputRegion)
662 Interop.Window.SetInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
663 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 /// Sets a priority level for the specified notification window.
669 /// <param name="level">The notification window level.</param>
670 /// <returns>True if no error occurred, false otherwise.</returns>
671 /// <since_tizen> 3 </since_tizen>
672 public bool SetNotificationLevel(NotificationLevel level)
674 var ret = (OperationResult)Interop.Window.SetNotificationLevel(SwigCPtr, (int)level);
675 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
676 return ret == OperationResult.Succeed;
680 /// Gets a priority level for the specified notification window.
682 /// <returns>The notification window level.</returns>
683 /// <since_tizen> 3 </since_tizen>
684 public NotificationLevel GetNotificationLevel()
686 NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(SwigCPtr);
687 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 /// Sets a transparent window's visual state to opaque. <br />
693 /// If a visual state of a transparent window is opaque, <br />
694 /// then the window manager could handle it as an opaque window when calculating visibility.
696 /// <param name="opaque">Whether the window's visual state is opaque.</param>
697 /// <remarks>This will have no effect on an opaque window. <br />
698 /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
700 /// <since_tizen> 3 </since_tizen>
701 public void SetOpaqueState(bool opaque)
703 Interop.Window.SetOpaqueState(SwigCPtr, opaque);
704 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708 /// Returns whether a transparent window's visual state is opaque or not.
710 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
711 /// <remarks> The return value has no meaning on an opaque window. </remarks>
712 /// <since_tizen> 3 </since_tizen>
713 public bool IsOpaqueState()
715 bool ret = Interop.Window.IsOpaqueState(SwigCPtr);
716 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
721 /// Sets a window's screen off mode.
723 /// <param name="screenOffMode">The screen mode.</param>
724 /// <returns>True if no error occurred, false otherwise.</returns>
725 /// <since_tizen> 4 </since_tizen>
726 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
728 var ret = (OperationResult)Interop.Window.SetScreenOffMode(SwigCPtr, (int)screenOffMode);
729 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
730 return ret == OperationResult.Succeed;
734 /// Gets the screen mode of the window.
736 /// <returns>The screen off mode.</returns>
737 /// <since_tizen> 4 </since_tizen>
738 public ScreenOffMode GetScreenOffMode()
740 ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(SwigCPtr);
741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 /// Sets preferred brightness of the window.
748 /// <param name="brightness">The preferred brightness (0 to 100).</param>
749 /// <returns>True if no error occurred, false otherwise.</returns>
750 /// <since_tizen> 3 </since_tizen>
751 public bool SetBrightness(int brightness)
753 var ret = (OperationResult)Interop.Window.SetBrightness(SwigCPtr, brightness);
754 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755 return ret == OperationResult.Succeed;
759 /// Gets the preferred brightness of the window.
761 /// <returns>The preferred brightness.</returns>
762 /// <since_tizen> 3 </since_tizen>
763 public int GetBrightness()
765 int ret = Interop.Window.GetBrightness(SwigCPtr);
766 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
771 /// Sets the window name and the class string.
773 /// <param name="name">The name of the window.</param>
774 /// <param name="klass">The class of the window.</param>
775 /// <since_tizen> 4 </since_tizen>
776 public void SetClass(string name, string klass)
778 Interop.Window.SetClass(SwigCPtr, name, klass);
779 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
783 /// Raises the window to the top of the window stack.
785 /// <since_tizen> 3 </since_tizen>
788 Interop.Window.Raise(SwigCPtr);
789 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
793 /// Lowers the window to the bottom of the window stack.
795 /// <since_tizen> 3 </since_tizen>
798 Interop.Window.Lower(SwigCPtr);
799 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
803 /// Activates the window to the top of the window stack even it is iconified.
805 /// <since_tizen> 3 </since_tizen>
806 public void Activate()
808 Interop.Window.Activate(SwigCPtr);
809 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
813 /// Gets the default ( root ) layer.
815 /// <returns>The root layer.</returns>
816 /// <since_tizen> 3 </since_tizen>
817 public Layer GetDefaultLayer()
819 return this.GetRootLayer();
823 /// Add a child view to window.
825 /// <param name="view">the child should be added to the window.</param>
826 /// <since_tizen> 3 </since_tizen>
827 public void Add(View view)
829 Interop.Actor.Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
830 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
831 this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
834 view.InternalParent = this.GetRootLayer();
839 /// Remove a child view from window.
841 /// <param name="view">the child to be removed.</param>
842 /// <since_tizen> 3 </since_tizen>
843 public void Remove(View view)
845 Interop.Actor.Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
846 this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
849 view.InternalParent = null;
854 /// Retrieves the layer at a specified depth.
856 /// <param name="depth">The layer's depth index.</param>
857 /// <returns>The layer found at the given depth.</returns>
858 /// <since_tizen> 3 </since_tizen>
859 public Layer GetLayer(uint depth)
861 if (depth < LayersChildren?.Count)
863 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
873 /// Destroy the window immediately.
875 [EditorBrowsable(EditorBrowsableState.Never)]
876 public void Destroy()
882 /// Keep rendering for at least the given amount of time.
884 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
885 /// <since_tizen> 3 </since_tizen>
886 public void KeepRendering(float durationSeconds)
888 Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
889 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
893 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
894 /// This function can be used for following example scenarios: <br />
895 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
897 /// <param name="DaliKey">The key code to grab.</param>
898 /// <returns>True if the grab succeeds.</returns>
899 /// <since_tizen> 3 </since_tizen>
900 public bool GrabKeyTopmost(int DaliKey)
902 bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
903 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
908 /// Ungrabs the key specified by a key for the window.<br />
909 /// 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 />
911 /// <param name="DaliKey">The key code to ungrab.</param>
912 /// <returns>True if the ungrab succeeds.</returns>
913 /// <since_tizen> 3 </since_tizen>
914 public bool UngrabKeyTopmost(int DaliKey)
916 bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
917 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
922 /// Grabs the key specified by a key for a window in a GrabMode. <br />
923 /// Details: This function can be used for following example scenarios: <br />
924 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
925 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
926 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
928 /// <param name="DaliKey">The key code to grab.</param>
929 /// <param name="GrabMode">The grab mode for the key.</param>
930 /// <returns>True if the grab succeeds.</returns>
931 /// <since_tizen> 3 </since_tizen>
932 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
934 bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey, (int)GrabMode);
935 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
940 /// Ungrabs the key specified by a key for a window.<br />
941 /// 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 />
943 /// <param name="DaliKey">The key code to ungrab.</param>
944 /// <returns>True if the ungrab succeeds.</returns>
945 /// <since_tizen> 3 </since_tizen>
946 public bool UngrabKey(int DaliKey)
948 bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
949 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
954 /// Sets the keyboard repeat information.
956 /// <param name="rate">The key repeat rate value in seconds.</param>
957 /// <param name="delay">The key repeat delay value in seconds.</param>
958 /// <returns>True if setting the keyboard repeat succeeds.</returns>
959 /// <since_tizen> 5 </since_tizen>
960 public bool SetKeyboardRepeatInfo(float rate, float delay)
962 bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
963 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
968 /// Gets the keyboard repeat information.
970 /// <param name="rate">The key repeat rate value in seconds.</param>
971 /// <param name="delay">The key repeat delay value in seconds.</param>
972 /// <returns>True if setting the keyboard repeat succeeds.</returns>
973 /// <since_tizen> 5 </since_tizen>
974 public bool GetKeyboardRepeatInfo(out float rate, out float delay)
976 bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
977 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
982 /// Adds a layer to the stage.
984 /// <param name="layer">Layer to add.</param>
985 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
986 /// <since_tizen> 3 </since_tizen>
987 public void AddLayer(Layer layer)
993 /// Removes a layer from the stage.
995 /// <param name="layer">Layer to remove.</param>
996 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
997 /// <since_tizen> 3 </since_tizen>
998 public void RemoveLayer(Layer layer)
1004 /// Feeds a key event into the window.
1006 /// <param name="keyEvent">The key event to feed.</param>
1007 /// <since_tizen> 5 </since_tizen>
1008 public void FeedKey(Key keyEvent)
1010 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
1011 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1015 /// Allows at least one more render, even when paused.
1016 /// The window should be shown, not minimised.
1018 /// <since_tizen> 4 </since_tizen>
1019 public void RenderOnce()
1021 Interop.Window.RenderOnce(SwigCPtr);
1022 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1026 /// Sets whether the window is transparent or not.
1028 /// <param name="transparent">Whether the window is transparent or not.</param>
1029 /// <since_tizen> 5 </since_tizen>
1030 public void SetTransparency(bool transparent)
1032 Interop.Window.SetTransparency(SwigCPtr, transparent);
1033 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1035 // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1039 /// Sets parent window of the window.
1040 /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1041 /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
1042 /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
1044 /// <param name="parent">The parent window.</param>
1045 /// <since_tizen> 6 </since_tizen>
1046 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1047 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1048 public void SetParent(Window parent)
1050 if (IsSupportedMultiWindow() == false)
1052 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1054 Interop.Window.SetParent(SwigCPtr, Window.getCPtr(parent));
1055 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1059 /// Unsets parent window of the window.
1060 /// After unsetting, the window is disconnected his parent window.
1062 /// <since_tizen> 6 </since_tizen>
1063 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1064 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1065 public void Unparent()
1067 if (IsSupportedMultiWindow() == false)
1069 NUILog.Error("Fail to create window. because this device does not support opengles.surfaceless_context.");
1071 Interop.Window.Unparent(SwigCPtr);
1072 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1076 /// Gets parent window of the window.
1078 /// <returns>The parent window of the window.</returns>
1079 /// <since_tizen> 6 </since_tizen>
1080 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1081 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1082 [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1721: Property names should not match get methods")]
1083 public Window GetParent()
1085 if (IsSupportedMultiWindow() == false)
1087 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1089 Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(SwigCPtr)) as Window;
1090 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094 /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
1095 [EditorBrowsable(EditorBrowsableState.Never)]
1096 public void ObjectDump()
1098 Layer rootLayer = GetRootLayer();
1099 foreach (View view in rootLayer.Children)
1105 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
1107 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1110 internal static bool IsInstalled()
1112 bool ret = Interop.Stage.IsInstalled();
1113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118 /// Adds an orientation to the list of available orientations.
1120 /// <param name="orientation">The available orientation to add</param>
1121 /// <since_tizen> 6 </since_tizen>
1122 public void AddAvailableOrientation(Window.WindowOrientation orientation)
1124 Interop.Window.AddAvailableOrientation(SwigCPtr, (int)orientation);
1125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1129 /// Removes an orientation from the list of available orientations.
1131 /// <param name="orientation">The available orientation to remove.</param>
1132 /// <since_tizen> 6 </since_tizen>
1133 public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1135 Interop.Window.RemoveAvailableOrientation(SwigCPtr, (int)orientation);
1136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1140 /// Sets a preferred orientation.
1142 /// <param name="orientation">The preferred orientation.</param>
1143 /// <since_tizen> 6 </since_tizen>
1144 public void SetPreferredOrientation(Window.WindowOrientation orientation)
1146 Interop.Window.SetPreferredOrientation(SwigCPtr, (int)orientation);
1147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1151 /// Gets the preferred orientation.
1153 /// <since_tizen> 6 </since_tizen>
1154 /// <returns>The preferred orientation if previously set, or none.</returns>
1155 public Window.WindowOrientation GetPreferredOrientation()
1157 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetPreferredOrientation(SwigCPtr);
1158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1163 /// Gets current orientation of the window.
1165 /// <since_tizen> 6 </since_tizen>
1166 /// <returns>The current window orientation if previously set, or none.</returns>
1167 [EditorBrowsable(EditorBrowsableState.Never)]
1168 public Window.WindowOrientation GetCurrentOrientation()
1170 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetCurrentOrientation(SwigCPtr);
1171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1176 /// Sets available orientations of the window.
1177 /// This API is for setting several orientations one time.
1179 /// <param name="orientations">The list of orientations.</param>
1180 /// <since_tizen> 6 </since_tizen>
1181 [EditorBrowsable(EditorBrowsableState.Never)]
1182 public void SetAvailableOrientations(List<Window.WindowOrientation> orientations)
1184 PropertyArray orientationArray = new PropertyArray();
1185 if (null != orientations)
1187 for (int i = 0; i < orientations.Count; i++)
1189 PropertyValue value = new PropertyValue((int)orientations[i]);
1190 orientationArray.PushBack(value);
1194 Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray));
1195 for (uint i = 0; i < orientationArray.Count(); i++)
1197 orientationArray[i].Dispose();
1199 orientationArray.Dispose();
1200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1204 /// Get native window ID
1206 /// <returns>native window ID</returns>
1207 [EditorBrowsable(EditorBrowsableState.Never)]
1208 public int GetNativeId()
1210 int ret = Interop.Window.GetNativeId(SwigCPtr);
1211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1215 internal Any GetNativeHandle()
1217 Any ret = new Any(Interop.WindowInternal.WindowGetNativeHandle(SwigCPtr), true);
1218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1222 internal void Add(Layer layer)
1226 throw new ArgumentNullException(nameof(layer));
1228 Interop.Window.Add(SwigCPtr, Layer.getCPtr(layer));
1229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1231 LayersChildren?.Add(layer);
1232 layer.SetWindow(this);
1235 internal void Remove(Layer layer)
1239 throw new ArgumentNullException(nameof(layer));
1241 Interop.Window.Remove(SwigCPtr, Layer.getCPtr(layer));
1242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1244 LayersChildren?.Remove(layer);
1245 layer.SetWindow(null);
1248 internal Vector2 GetSize()
1250 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1251 Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1256 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
1257 [EditorBrowsable(EditorBrowsableState.Never)]
1258 public RenderTaskList GetRenderTaskList()
1260 RenderTaskList ret = new RenderTaskList(Interop.Stage.GetRenderTaskList(stageCPtr), true);
1261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1266 /// Queries the number of on-window layers.
1268 /// <returns>The number of layers.</returns>
1269 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1270 internal uint GetLayerCount()
1272 if (LayersChildren == null || LayersChildren.Count < 0)
1275 return (uint)LayersChildren.Count;
1278 internal Layer GetRootLayer()
1280 // Window.IsInstalled() is actually true only when called from event thread and
1281 // Core has been initialized, not when Stage is ready.
1282 if (rootLayer == null && Window.IsInstalled())
1284 rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
1285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1286 LayersChildren?.Add(rootLayer);
1287 rootLayer.SetWindow(this);
1292 internal void SetBackgroundColor(Vector4 color)
1294 Interop.Window.SetBackgroundColor(SwigCPtr, Vector4.getCPtr(color));
1295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1298 internal Vector4 GetBackgroundColor()
1300 Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(SwigCPtr), true);
1301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305 internal Vector2 GetDpi()
1307 Vector2 ret = new Vector2(Interop.Stage.GetDpi(stageCPtr), true);
1308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1312 internal ObjectRegistry GetObjectRegistry()
1314 ObjectRegistry ret = new ObjectRegistry(Interop.Stage.GetObjectRegistry(stageCPtr), true);
1315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1319 internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1321 Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1325 internal RenderingBehaviorType GetRenderingBehavior()
1327 RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.GetRenderingBehavior(stageCPtr);
1328 if (NDalicPINVOKE.SWIGPendingException.Pending)
1329 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1333 internal void SetWindowSize(Size2D size)
1337 throw new ArgumentNullException(nameof(size));
1339 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1340 Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
1342 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1343 // Resetting Window size should request a relayout of the tree.
1346 internal Size2D GetWindowSize()
1348 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1349 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1354 internal void SetPosition(Position2D position)
1356 if (null == position)
1358 throw new ArgumentNullException(nameof(position));
1360 var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1361 Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
1363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1364 // Setting Position of the window should request a relayout of the tree.
1367 internal Position2D GetPosition()
1369 var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
1370 Position2D ret = new Position2D(val.GetX(), val.GetY());
1372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1376 internal void SetPositionSize(Rectangle positionSize)
1378 Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
1380 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1382 // Setting Position of the window should request a relayout of the tree.
1386 /// Add FrameUpdateCallback
1388 [EditorBrowsable(EditorBrowsableState.Never)]
1389 public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1391 frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer()));
1395 /// Remove FrameUpdateCallback
1397 [EditorBrowsable(EditorBrowsableState.Never)]
1398 public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1400 frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr);
1404 /// Dispose for Window
1406 [EditorBrowsable(EditorBrowsableState.Never)]
1407 protected override void Dispose(DisposeTypes type)
1414 if (type == DisposeTypes.Explicit)
1417 //Release your own managed resources here.
1418 //You should release all of your own disposable objects here.
1420 if (rootLayer != null)
1422 rootLayer.Dispose();
1425 localController?.Dispose();
1427 foreach (var layer in childLayers)
1435 childLayers.Clear();
1438 this.DisconnectNativeSignals();
1443 /// This will not be public opened.
1444 [EditorBrowsable(EditorBrowsableState.Never)]
1445 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1447 Interop.Window.DeleteWindow(swigCPtr);
1450 private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
1452 private static readonly object locker = new object();
1454 private static int key = 0;
1456 private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
1458 private struct internalHookCallbackType
1460 public FrameCallbackType userCallback;
1464 private static void OnInternalHookFrameCallback(int id)
1468 if (frameCallbackList.ContainsKey(id))
1470 if (frameCallbackList[id].userCallback != null)
1472 frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
1473 frameCallbackList.Remove(id);
1477 NUILog.Error($"found userCallback is NULL");
1478 frameCallbackList.Remove(id);
1484 private int AddInterHookCallback(FrameCallbackType callback, int frameId)
1486 if (null == callback)
1488 throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
1490 var assignedKey = 0;
1495 frameCallbackList.Add(assignedKey, new internalHookCallbackType()
1497 userCallback = callback,
1505 /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
1507 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1508 [EditorBrowsable(EditorBrowsableState.Never)]
1509 public delegate void FrameCallbackType(int frameId);
1512 /// Adds a callback that is called when the frame rendering is done by the graphics driver.
1513 /// A callback of the following type may be used:
1515 /// void MyFunction( int frameId )
1517 /// This callback will be deleted once it is called.
1519 /// Ownership of the callback is passed onto this class
1522 /// <param name="callback">The function to call</param>
1523 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1524 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1525 [EditorBrowsable(EditorBrowsableState.Never)]
1526 public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
1528 var assignedKey = AddInterHookCallback(callback, frameId);
1529 Interop.WindowInternal.AddFrameRenderedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1531 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1535 /// Adds a callback that is called when the frame is displayed on the display.
1536 /// A callback of the following type may be used:
1538 /// void MyFunction( int frameId )
1540 /// This callback will be deleted once it is called.
1542 /// Ownership of the callback is passed onto this class
1545 /// <param name="callback">The function to call</param>
1546 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1547 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1548 [EditorBrowsable(EditorBrowsableState.Never)]
1549 public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
1551 var assignedKey = AddInterHookCallback(callback, frameId);
1552 Interop.WindowInternal.AddFramePresentedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1558 /// Search through this Window for a Layer with the given unique ID.
1560 /// <param name="id">The ID of the Layer to find.</param>
1561 /// <remarks>Hidden-API</remarks>
1562 /// <returns>A handle to the Layer if found, or an empty handle if not.</returns>
1563 [EditorBrowsable(EditorBrowsableState.Never)]
1564 public Layer FindLayerByID(uint id)
1566 Layer defaultLayer = this.GetDefaultLayer();
1567 IntPtr cPtr = Interop.Actor.FindChildById(defaultLayer.SwigCPtr, id);
1568 Layer ret = this.GetInstanceSafely<Layer>(cPtr);
1570 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();