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 static readonly Window instance = Application.Instance?.GetWindow();
39 private HandleRef stageCPtr;
40 private Layer rootLayer;
41 private string windowTitle;
42 private List<Layer> childLayers = new List<Layer>();
43 private LayoutController localController;
45 private bool IsSupportedMultiWindow()
47 bool isSupported = false;
48 Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSupported);
52 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
54 if (Interop.Stage.IsInstalled())
56 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.GetCurrent());
58 localController = new LayoutController(this);
59 NUILog.Debug("layoutController id:" + localController.GetId());
64 /// Creates a new Window.<br />
65 /// This creates an extra window in addition to the default main window<br />
67 /// <param name="windowPosition">The position and size of the Window.</param>
68 /// <param name="isTranslucent">Whether Window is translucent.</param>
69 /// <returns>A new Window.</returns>
70 /// <since_tizen> 6 </since_tizen>
71 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
72 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
73 public Window(Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
75 if (IsSupportedMultiWindow() == false)
77 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
79 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83 /// Creates a new Window with a specific name.<br />
84 /// This creates an extra window in addition to the default main window<br />
86 /// <param name="name">The name for extra window. </param>
87 /// <param name="windowPosition">The position and size of the Window.</param>
88 /// <param name="isTranslucent">Whether Window is translucent.</param>
89 /// <returns>A new Window.</returns>
90 /// <since_tizen> 6 </since_tizen>
91 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
92 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
93 public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
95 if (IsSupportedMultiWindow() == false)
97 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
99 this.windowTitle = name;
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
106 /// <since_tizen> 3 </since_tizen>
107 public enum WindowOrientation
110 /// Portrait orientation. The height of the display area is greater than the width.
112 /// <since_tizen> 3 </since_tizen>
115 /// Landscape orientation. A wide view area is needed.
117 /// <since_tizen> 3 </since_tizen>
120 /// Portrait inverse orientation.
122 /// <since_tizen> 3 </since_tizen>
123 PortraitInverse = 180,
125 /// Landscape inverse orientation.
127 /// <since_tizen> 3 </since_tizen>
128 LandscapeInverse = 270,
130 /// No orientation. It is for the preferred orientation
131 /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
132 /// It is used to unset the preferred orientation with SetPreferredOrientation.
134 [EditorBrowsable(EditorBrowsableState.Never)]
135 NoOrientationPreference = -1
139 /// Enumeration for the key grab mode for platform-level APIs.
141 /// <since_tizen> 3 </since_tizen>
142 public enum KeyGrabMode
145 /// Grabs a key only when on the top of the grabbing-window stack mode.
149 /// Grabs a key together with the other client window(s) mode.
153 /// 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.
157 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
163 /// Enumeration for transition effect's state.
165 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState instead!")]
166 [EditorBrowsable(EditorBrowsableState.Never)]
167 public enum EffectStates
172 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.None instead!")]
173 [EditorBrowsable(EditorBrowsableState.Never)]
176 /// Transition effect is started.
178 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.Start instead!")]
179 [EditorBrowsable(EditorBrowsableState.Never)]
182 /// Transition effect is ended.
184 [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.End instead!")]
185 [EditorBrowsable(EditorBrowsableState.Never)]
190 /// Enumeration for transition effect's state.
192 [EditorBrowsable(EditorBrowsableState.Never)]
193 public enum EffectState
198 [EditorBrowsable(EditorBrowsableState.Never)]
201 /// Transition effect is started.
203 [EditorBrowsable(EditorBrowsableState.Never)]
206 /// Transition effect is ended.
208 [EditorBrowsable(EditorBrowsableState.Never)]
213 /// Enumeration for transition effect's type.
215 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType instead!")]
216 [EditorBrowsable(EditorBrowsableState.Never)]
217 public enum EffectTypes
222 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.None instead!")]
223 [EditorBrowsable(EditorBrowsableState.Never)]
226 /// Window show effect.
228 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Show instead!")]
229 [EditorBrowsable(EditorBrowsableState.Never)]
232 /// Window hide effect.
234 [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Hide instead!")]
235 [EditorBrowsable(EditorBrowsableState.Never)]
240 /// Enumeration for transition effect's type.
242 [EditorBrowsable(EditorBrowsableState.Never)]
243 public enum EffectType
248 [EditorBrowsable(EditorBrowsableState.Never)]
251 /// Window show effect.
253 [EditorBrowsable(EditorBrowsableState.Never)]
256 /// Window hide effect.
258 [EditorBrowsable(EditorBrowsableState.Never)]
263 /// The stage instance property (read-only).<br />
264 /// Gets the current window.<br />
266 /// <since_tizen> 3 </since_tizen>
267 public static Window Instance
276 /// Gets or sets a window type.
278 /// <since_tizen> 3 </since_tizen>
279 public WindowType Type
283 WindowType ret = (WindowType)Interop.Window.GetType(SwigCPtr);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
289 Interop.Window.SetType(SwigCPtr, (int)value);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 /// Gets/Sets a window title.
297 /// <since_tizen> 4 </since_tizen>
307 SetClass(windowTitle, "");
312 /// The rendering behavior of a Window.
314 /// <since_tizen> 5 </since_tizen>
315 public RenderingBehaviorType RenderingBehavior
319 return GetRenderingBehavior();
323 SetRenderingBehavior(value);
328 /// The window size property (read-only).
330 /// <since_tizen> 3 </since_tizen>
335 Size2D ret = GetSize();
341 /// The background color property.
343 /// <since_tizen> 3 </since_tizen>
344 public Color BackgroundColor
348 SetBackgroundColor(value);
352 Color ret = GetBackgroundColor();
358 /// The DPI property (read-only).<br />
359 /// Retrieves the DPI of the display device to which the Window is connected.<br />
361 /// <since_tizen> 3 </since_tizen>
371 /// The layer count property (read-only).<br />
372 /// Queries the number of on-Window layers.<br />
374 /// <since_tizen> 3 </since_tizen>
375 public uint LayerCount
379 return GetLayerCount();
384 /// Gets or sets a size of the window.
386 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
387 /// <since_tizen> 4 </since_tizen>
388 public Size2D WindowSize
392 return GetWindowSize();
396 SetWindowSize(value);
401 /// Gets or sets a position of the window.
403 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
404 /// <since_tizen> 4 </since_tizen>
405 public Position2D WindowPosition
409 return GetPosition();
418 /// Sets position and size of the window. This API guarantees that
419 /// both moving and resizing of window will appear on the screen at once.
421 [EditorBrowsable(EditorBrowsableState.Never)]
422 public Rectangle WindowPositionSize
426 Position2D position = GetPosition();
427 Size2D size = GetSize();
428 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
434 SetPositionSize(value);
438 internal static Vector4 DEFAULT_BACKGROUND_COLOR
442 global::System.IntPtr cPtr = Interop.Stage.DefaultBackgroundColorGet();
443 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
444 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449 internal static Vector4 DEBUG_BACKGROUND_COLOR
453 global::System.IntPtr cPtr = Interop.Stage.DebugBackgroundColorGet();
454 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
460 internal List<Layer> LayersChildren
469 /// Get the LayoutController for this Window.
471 internal LayoutController LayoutController
475 return localController;
480 /// Feed a key-event into the window.
482 /// <param name="keyEvent">The key event to feed.</param>
483 /// <since_tizen> 4 </since_tizen>
484 [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
485 public static void FeedKeyEvent(Key keyEvent)
487 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492 /// Sets whether the window accepts a focus or not.
494 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
495 /// <since_tizen> 3 </since_tizen>
496 public void SetAcceptFocus(bool accept)
498 Interop.Window.SetAcceptFocus(SwigCPtr, accept);
499 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
503 /// Returns whether the window accepts a focus or not.
505 /// <returns>True if the window accepts a focus, false otherwise.</returns>
506 /// <since_tizen> 3 </since_tizen>
507 public bool IsFocusAcceptable()
509 bool ret = Interop.Window.IsFocusAcceptable(SwigCPtr);
510 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516 /// Shows the window if it is hidden.
518 /// <since_tizen> 3 </since_tizen>
521 Interop.Window.Show(SwigCPtr);
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526 /// Hides the window if it is showing.
528 /// <since_tizen> 3 </since_tizen>
531 Interop.Window.Hide(SwigCPtr);
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536 /// Retrieves whether the window is visible or not.
538 /// <returns>True if the window is visible.</returns>
539 /// <since_tizen> 3 </since_tizen>
540 public bool IsVisible()
542 bool temp = Interop.Window.IsVisible(SwigCPtr);
543 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548 /// Gets the count of supported auxiliary hints of the window.
550 /// <returns>The number of supported auxiliary hints.</returns>
551 /// <since_tizen> 3 </since_tizen>
552 public uint GetSupportedAuxiliaryHintCount()
554 uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(SwigCPtr);
555 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
560 /// Gets the supported auxiliary hint string of the window.
562 /// <param name="index">The index of the supported auxiliary hint lists.</param>
563 /// <returns>The auxiliary hint string of the index.</returns>
564 /// <since_tizen> 3 </since_tizen>
565 public string GetSupportedAuxiliaryHint(uint index)
567 string ret = Interop.Window.GetSupportedAuxiliaryHint(SwigCPtr, index);
568 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
573 /// Creates an auxiliary hint of the window.
575 /// <param name="hint">The auxiliary hint string.</param>
576 /// <param name="value">The value string.</param>
577 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
578 /// <since_tizen> 3 </since_tizen>
579 public uint AddAuxiliaryHint(string hint, string value)
581 uint ret = Interop.Window.AddAuxiliaryHint(SwigCPtr, hint, value);
582 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587 /// Removes an auxiliary hint of the window.
589 /// <param name="id">The ID of the auxiliary hint.</param>
590 /// <returns>True if no error occurred, false otherwise.</returns>
591 /// <since_tizen> 3 </since_tizen>
592 public bool RemoveAuxiliaryHint(uint id)
594 bool ret = Interop.Window.RemoveAuxiliaryHint(SwigCPtr, id);
595 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600 /// Changes a value of the auxiliary hint.
602 /// <param name="id">The auxiliary hint ID.</param>
603 /// <param name="value">The value string to be set.</param>
604 /// <returns>True if no error occurred, false otherwise.</returns>
605 /// <since_tizen> 3 </since_tizen>
606 public bool SetAuxiliaryHintValue(uint id, string value)
608 bool ret = Interop.Window.SetAuxiliaryHintValue(SwigCPtr, id, value);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 /// Gets a value of the auxiliary hint.
616 /// <param name="id">The auxiliary hint ID.</param>
617 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
618 /// <since_tizen> 3 </since_tizen>
619 public string GetAuxiliaryHintValue(uint id)
621 string ret = Interop.Window.GetAuxiliaryHintValue(SwigCPtr, id);
622 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627 /// Gets an ID of the auxiliary hint string.
629 /// <param name="hint">The auxiliary hint string.</param>
630 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
631 /// <since_tizen> 3 </since_tizen>
632 public uint GetAuxiliaryHintId(string hint)
634 uint ret = Interop.Window.GetAuxiliaryHintId(SwigCPtr, hint);
635 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 /// Sets a region to accept input events.
642 /// <param name="inputRegion">The region to accept input events.</param>
643 /// <since_tizen> 3 </since_tizen>
644 public void SetInputRegion(Rectangle inputRegion)
646 Interop.Window.SetInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
647 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651 /// Sets a priority level for the specified notification window.
653 /// <param name="level">The notification window level.</param>
654 /// <returns>True if no error occurred, false otherwise.</returns>
655 /// <since_tizen> 3 </since_tizen>
656 public bool SetNotificationLevel(NotificationLevel level)
658 bool ret = Interop.Window.SetNotificationLevel(SwigCPtr, (int)level);
659 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
664 /// Gets a priority level for the specified notification window.
666 /// <returns>The notification window level.</returns>
667 /// <since_tizen> 3 </since_tizen>
668 public NotificationLevel GetNotificationLevel()
670 NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(SwigCPtr);
671 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
676 /// Sets a transparent window's visual state to opaque. <br />
677 /// If a visual state of a transparent window is opaque, <br />
678 /// then the window manager could handle it as an opaque window when calculating visibility.
680 /// <param name="opaque">Whether the window's visual state is opaque.</param>
681 /// <remarks>This will have no effect on an opaque window. <br />
682 /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
684 /// <since_tizen> 3 </since_tizen>
685 public void SetOpaqueState(bool opaque)
687 Interop.Window.SetOpaqueState(SwigCPtr, opaque);
688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 /// Returns whether a transparent window's visual state is opaque or not.
694 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
695 /// <remarks> The return value has no meaning on an opaque window. </remarks>
696 /// <since_tizen> 3 </since_tizen>
697 public bool IsOpaqueState()
699 bool ret = Interop.Window.IsOpaqueState(SwigCPtr);
700 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
705 /// Sets a window's screen off mode.
707 /// <param name="screenOffMode">The screen mode.</param>
708 /// <returns>True if no error occurred, false otherwise.</returns>
709 /// <since_tizen> 4 </since_tizen>
710 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
712 bool ret = Interop.Window.SetScreenOffMode(SwigCPtr, (int)screenOffMode);
713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718 /// Gets the screen mode of the window.
720 /// <returns>The screen off mode.</returns>
721 /// <since_tizen> 4 </since_tizen>
722 public ScreenOffMode GetScreenOffMode()
724 ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(SwigCPtr);
725 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
730 /// Sets preferred brightness of the window.
732 /// <param name="brightness">The preferred brightness (0 to 100).</param>
733 /// <returns>True if no error occurred, false otherwise.</returns>
734 /// <since_tizen> 3 </since_tizen>
735 public bool SetBrightness(int brightness)
737 bool ret = Interop.Window.SetBrightness(SwigCPtr, brightness);
738 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
743 /// Gets the preferred brightness of the window.
745 /// <returns>The preferred brightness.</returns>
746 /// <since_tizen> 3 </since_tizen>
747 public int GetBrightness()
749 int ret = Interop.Window.GetBrightness(SwigCPtr);
750 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755 /// Sets the window name and the class string.
757 /// <param name="name">The name of the window.</param>
758 /// <param name="klass">The class of the window.</param>
759 /// <since_tizen> 4 </since_tizen>
760 public void SetClass(string name, string klass)
762 Interop.Window.SetClass(SwigCPtr, name, klass);
763 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
767 /// Raises the window to the top of the window stack.
769 /// <since_tizen> 3 </since_tizen>
772 Interop.Window.Raise(SwigCPtr);
773 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
777 /// Lowers the window to the bottom of the window stack.
779 /// <since_tizen> 3 </since_tizen>
782 Interop.Window.Lower(SwigCPtr);
783 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787 /// Activates the window to the top of the window stack even it is iconified.
789 /// <since_tizen> 3 </since_tizen>
790 public void Activate()
792 Interop.Window.Activate(SwigCPtr);
793 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
797 /// Gets the default ( root ) layer.
799 /// <returns>The root layer.</returns>
800 /// <since_tizen> 3 </since_tizen>
801 public Layer GetDefaultLayer()
803 return this.GetRootLayer();
807 /// Add a child view to window.
809 /// <param name="view">the child should be added to the window.</param>
810 /// <since_tizen> 3 </since_tizen>
811 public void Add(View view)
813 Interop.Actor.Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
814 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
815 this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
818 view.InternalParent = this.GetRootLayer();
823 /// Remove a child view from window.
825 /// <param name="view">the child to be removed.</param>
826 /// <since_tizen> 3 </since_tizen>
827 public void Remove(View view)
829 Interop.Actor.Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
830 this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
833 view.InternalParent = null;
838 /// Retrieves the layer at a specified depth.
840 /// <param name="depth">The layer's depth index.</param>
841 /// <returns>The layer found at the given depth.</returns>
842 /// <since_tizen> 3 </since_tizen>
843 public Layer GetLayer(uint depth)
845 if (depth < LayersChildren?.Count)
847 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
857 /// Destroy the window immediately.
859 [EditorBrowsable(EditorBrowsableState.Never)]
860 public void Destroy()
866 /// Keep rendering for at least the given amount of time.
868 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
869 /// <since_tizen> 3 </since_tizen>
870 public void KeepRendering(float durationSeconds)
872 Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
873 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
877 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
878 /// This function can be used for following example scenarios: <br />
879 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
881 /// <param name="DaliKey">The key code to grab.</param>
882 /// <returns>True if the grab succeeds.</returns>
883 /// <since_tizen> 3 </since_tizen>
884 public bool GrabKeyTopmost(int DaliKey)
886 bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
887 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
892 /// Ungrabs the key specified by a key for the window.<br />
893 /// 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 />
895 /// <param name="DaliKey">The key code to ungrab.</param>
896 /// <returns>True if the ungrab succeeds.</returns>
897 /// <since_tizen> 3 </since_tizen>
898 public bool UngrabKeyTopmost(int DaliKey)
900 bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
906 /// Grabs the key specified by a key for a window in a GrabMode. <br />
907 /// Details: This function can be used for following example scenarios: <br />
908 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
909 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
910 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
912 /// <param name="DaliKey">The key code to grab.</param>
913 /// <param name="GrabMode">The grab mode for the key.</param>
914 /// <returns>True if the grab succeeds.</returns>
915 /// <since_tizen> 3 </since_tizen>
916 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
918 bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey, (int)GrabMode);
919 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
924 /// Ungrabs the key specified by a key for a window.<br />
925 /// 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 />
927 /// <param name="DaliKey">The key code to ungrab.</param>
928 /// <returns>True if the ungrab succeeds.</returns>
929 /// <since_tizen> 3 </since_tizen>
930 public bool UngrabKey(int DaliKey)
932 bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
933 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
938 /// Sets the keyboard repeat information.
940 /// <param name="rate">The key repeat rate value in seconds.</param>
941 /// <param name="delay">The key repeat delay value in seconds.</param>
942 /// <returns>True if setting the keyboard repeat succeeds.</returns>
943 /// <since_tizen> 5 </since_tizen>
944 public bool SetKeyboardRepeatInfo(float rate, float delay)
946 bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
952 /// Gets the keyboard repeat information.
954 /// <param name="rate">The key repeat rate value in seconds.</param>
955 /// <param name="delay">The key repeat delay value in seconds.</param>
956 /// <returns>True if setting the keyboard repeat succeeds.</returns>
957 /// <since_tizen> 5 </since_tizen>
958 public bool GetKeyboardRepeatInfo(out float rate, out float delay)
960 bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
961 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
966 /// Adds a layer to the stage.
968 /// <param name="layer">Layer to add.</param>
969 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
970 /// <since_tizen> 3 </since_tizen>
971 public void AddLayer(Layer layer)
977 /// Removes a layer from the stage.
979 /// <param name="layer">Layer to remove.</param>
980 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
981 /// <since_tizen> 3 </since_tizen>
982 public void RemoveLayer(Layer layer)
988 /// Feeds a key event into the window.
990 /// <param name="keyEvent">The key event to feed.</param>
991 /// <since_tizen> 5 </since_tizen>
992 public void FeedKey(Key keyEvent)
994 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
995 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
999 /// Allows at least one more render, even when paused.
1000 /// The window should be shown, not minimised.
1002 /// <since_tizen> 4 </since_tizen>
1003 public void RenderOnce()
1005 Interop.Window.RenderOnce(SwigCPtr);
1006 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1010 /// Sets whether the window is transparent or not.
1012 /// <param name="transparent">Whether the window is transparent or not.</param>
1013 /// <since_tizen> 5 </since_tizen>
1014 public void SetTransparency(bool transparent)
1016 Interop.Window.SetTransparency(SwigCPtr, transparent);
1017 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1019 // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1023 /// Sets parent window of the window.
1024 /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1025 /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
1026 /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
1028 /// <param name="parent">The parent window.</param>
1029 /// <since_tizen> 6 </since_tizen>
1030 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1031 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1032 public void SetParent(Window parent)
1034 if (IsSupportedMultiWindow() == false)
1036 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1038 Interop.Window.SetParent(SwigCPtr, Window.getCPtr(parent));
1039 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1043 /// Unsets parent window of the window.
1044 /// After unsetting, the window is disconnected his parent window.
1046 /// <since_tizen> 6 </since_tizen>
1047 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1048 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1049 public void Unparent()
1051 if (IsSupportedMultiWindow() == false)
1053 NUILog.Error("Fail to create window. because this device does not support opengles.surfaceless_context.");
1055 Interop.Window.Unparent(SwigCPtr);
1056 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1060 /// Gets parent window of the window.
1062 /// <returns>The parent window of the window.</returns>
1063 /// <since_tizen> 6 </since_tizen>
1064 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1065 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1066 [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1721: Property names should not match get methods")]
1067 public Window GetParent()
1069 if (IsSupportedMultiWindow() == false)
1071 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1073 Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(SwigCPtr)) as Window;
1074 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078 /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
1079 [EditorBrowsable(EditorBrowsableState.Never)]
1080 public void ObjectDump()
1082 Layer rootLayer = GetRootLayer();
1083 foreach (View view in rootLayer.Children)
1089 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
1091 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1094 internal static bool IsInstalled()
1096 bool ret = Interop.Stage.IsInstalled();
1097 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1102 /// Adds an orientation to the list of available orientations.
1104 /// <param name="orientation">The available orientation to add</param>
1105 /// <since_tizen> 6 </since_tizen>
1106 public void AddAvailableOrientation(Window.WindowOrientation orientation)
1108 Interop.Window.AddAvailableOrientation(SwigCPtr, (int)orientation);
1109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1113 /// Removes an orientation from the list of available orientations.
1115 /// <param name="orientation">The available orientation to remove.</param>
1116 /// <since_tizen> 6 </since_tizen>
1117 public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1119 Interop.Window.RemoveAvailableOrientation(SwigCPtr, (int)orientation);
1120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1124 /// Sets a preferred orientation.
1126 /// <param name="orientation">The preferred orientation.</param>
1127 /// <since_tizen> 6 </since_tizen>
1128 public void SetPreferredOrientation(Window.WindowOrientation orientation)
1130 Interop.Window.SetPreferredOrientation(SwigCPtr, (int)orientation);
1131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1135 /// Gets the preferred orientation.
1137 /// <since_tizen> 6 </since_tizen>
1138 /// <returns>The preferred orientation if previously set, or none.</returns>
1139 public Window.WindowOrientation GetPreferredOrientation()
1141 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetPreferredOrientation(SwigCPtr);
1142 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1147 /// Gets current orientation of the window.
1149 /// <since_tizen> 6 </since_tizen>
1150 /// <returns>The current window orientation if previously set, or none.</returns>
1151 [EditorBrowsable(EditorBrowsableState.Never)]
1152 public Window.WindowOrientation GetCurrentOrientation()
1154 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetCurrentOrientation(SwigCPtr);
1155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1160 /// Sets available orientations of the window.
1161 /// This API is for setting several orientations one time.
1163 /// <param name="orientations">The list of orientations.</param>
1164 /// <since_tizen> 6 </since_tizen>
1165 [EditorBrowsable(EditorBrowsableState.Never)]
1166 public void SetAvailableOrientations(List<Window.WindowOrientation> orientations)
1168 PropertyArray orientationArray = new PropertyArray();
1169 if (null != orientations)
1171 for (int i = 0; i < orientations.Count; i++)
1173 PropertyValue value = new PropertyValue((int)orientations[i]);
1174 orientationArray.PushBack(value);
1178 Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray));
1179 for (uint i = 0; i < orientationArray.Count(); i++)
1181 orientationArray[i].Dispose();
1183 orientationArray.Dispose();
1184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188 /// Get native window ID
1190 /// <returns>native window ID</returns>
1191 [EditorBrowsable(EditorBrowsableState.Never)]
1192 public int GetNativeId()
1194 int ret = Interop.Window.GetNativeId(SwigCPtr);
1195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1199 internal Any GetNativeHandle()
1201 Any ret = new Any(Interop.WindowInternal.WindowGetNativeHandle(SwigCPtr), true);
1202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206 internal void Add(Layer layer)
1210 throw new ArgumentNullException(nameof(layer));
1212 Interop.Window.Add(SwigCPtr, Layer.getCPtr(layer));
1213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1215 LayersChildren?.Add(layer);
1216 layer.SetWindow(this);
1219 internal void Remove(Layer layer)
1223 throw new ArgumentNullException(nameof(layer));
1225 Interop.Window.Remove(SwigCPtr, Layer.getCPtr(layer));
1226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1228 LayersChildren?.Remove(layer);
1229 layer.SetWindow(null);
1232 internal Vector2 GetSize()
1234 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1235 Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1240 internal RenderTaskList GetRenderTaskList()
1242 RenderTaskList ret = new RenderTaskList(Interop.Stage.GetRenderTaskList(stageCPtr), true);
1243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1248 /// Queries the number of on-window layers.
1250 /// <returns>The number of layers.</returns>
1251 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1252 internal uint GetLayerCount()
1254 if (LayersChildren == null || LayersChildren.Count < 0)
1257 return (uint)LayersChildren.Count;
1260 internal Layer GetRootLayer()
1262 // Window.IsInstalled() is actually true only when called from event thread and
1263 // Core has been initialized, not when Stage is ready.
1264 if (rootLayer == null && Window.IsInstalled())
1266 rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
1267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1268 LayersChildren?.Add(rootLayer);
1269 rootLayer.SetWindow(this);
1274 internal void SetBackgroundColor(Vector4 color)
1276 Interop.Window.SetBackgroundColor(SwigCPtr, Vector4.getCPtr(color));
1277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1280 internal Vector4 GetBackgroundColor()
1282 Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(SwigCPtr), true);
1283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1287 internal Vector2 GetDpi()
1289 Vector2 ret = new Vector2(Interop.Stage.GetDpi(stageCPtr), true);
1290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1294 internal ObjectRegistry GetObjectRegistry()
1296 ObjectRegistry ret = new ObjectRegistry(Interop.Stage.GetObjectRegistry(stageCPtr), true);
1297 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1301 internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1303 Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1307 internal RenderingBehaviorType GetRenderingBehavior()
1309 RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.GetRenderingBehavior(stageCPtr);
1310 if (NDalicPINVOKE.SWIGPendingException.Pending)
1311 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1315 internal void SetWindowSize(Size2D size)
1319 throw new ArgumentNullException(nameof(size));
1321 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1322 Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
1324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1325 // Resetting Window size should request a relayout of the tree.
1328 internal Size2D GetWindowSize()
1330 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1331 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1336 internal void SetPosition(Position2D position)
1338 if (null == position)
1340 throw new ArgumentNullException(nameof(position));
1342 var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1343 Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
1345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1346 // Setting Position of the window should request a relayout of the tree.
1349 internal Position2D GetPosition()
1351 var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
1352 Position2D ret = new Position2D(val.GetX(), val.GetY());
1354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358 internal void SetPositionSize(Rectangle positionSize)
1360 Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
1362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1364 // Setting Position of the window should request a relayout of the tree.
1368 /// Add FrameUpdateCallback
1370 [EditorBrowsable(EditorBrowsableState.Never)]
1371 public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1373 frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer()));
1377 /// Remove FrameUpdateCallback
1379 [EditorBrowsable(EditorBrowsableState.Never)]
1380 public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1382 frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr);
1386 /// Dispose for Window
1388 [EditorBrowsable(EditorBrowsableState.Never)]
1389 protected override void Dispose(DisposeTypes type)
1396 if (type == DisposeTypes.Explicit)
1399 //Release your own managed resources here.
1400 //You should release all of your own disposable objects here.
1402 if (rootLayer != null)
1404 rootLayer.Dispose();
1407 localController?.Dispose();
1409 foreach (var layer in childLayers)
1417 childLayers.Clear();
1420 this.DisconnectNativeSignals();
1425 /// This will not be public opened.
1426 [EditorBrowsable(EditorBrowsableState.Never)]
1427 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1429 Interop.Window.DeleteWindow(swigCPtr);
1432 private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
1434 private static readonly object locker = new object();
1436 private static int key = 0;
1438 private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
1440 private struct internalHookCallbackType
1442 public FrameCallbackType userCallback;
1446 private static void OnInternalHookFrameCallback(int id)
1450 if (frameCallbackList.ContainsKey(id))
1452 if (frameCallbackList[id].userCallback != null)
1454 frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
1455 frameCallbackList.Remove(id);
1459 NUILog.Error($"found userCallback is NULL");
1460 frameCallbackList.Remove(id);
1466 private int AddInterHookCallback(FrameCallbackType callback, int frameId)
1468 if (null == callback)
1470 throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
1472 var assignedKey = 0;
1477 frameCallbackList.Add(assignedKey, new internalHookCallbackType()
1479 userCallback = callback,
1487 /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
1489 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1490 [EditorBrowsable(EditorBrowsableState.Never)]
1491 public delegate void FrameCallbackType(int frameId);
1494 /// Adds a callback that is called when the frame rendering is done by the graphics driver.
1495 /// A callback of the following type may be used:
1497 /// void MyFunction( int frameId )
1499 /// This callback will be deleted once it is called.
1501 /// Ownership of the callback is passed onto this class
1504 /// <param name="callback">The function to call</param>
1505 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1506 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1507 [EditorBrowsable(EditorBrowsableState.Never)]
1508 public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
1510 var assignedKey = AddInterHookCallback(callback, frameId);
1511 Interop.WindowInternal.AddFrameRenderedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1513 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1517 /// Adds a callback that is called when the frame is displayed on the display.
1518 /// A callback of the following type may be used:
1520 /// void MyFunction( int frameId )
1522 /// This callback will be deleted once it is called.
1524 /// Ownership of the callback is passed onto this class
1527 /// <param name="callback">The function to call</param>
1528 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1529 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1530 [EditorBrowsable(EditorBrowsableState.Never)]
1531 public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
1533 var assignedKey = AddInterHookCallback(callback, frameId);
1534 Interop.WindowInternal.AddFramePresentedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();