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 /// The stage instance property (read-only).<br />
262 /// Gets the current window.<br />
264 /// <since_tizen> 3 </since_tizen>
265 public static Window Instance { get; internal set; }
268 /// Gets or sets a window type.
270 /// <since_tizen> 3 </since_tizen>
271 public WindowType Type
275 WindowType ret = (WindowType)Interop.Window.GetType(SwigCPtr);
276 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
281 Interop.Window.SetType(SwigCPtr, (int)value);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 /// Gets/Sets a window title.
289 /// <since_tizen> 4 </since_tizen>
299 SetClass(windowTitle, "");
304 /// The rendering behavior of a Window.
306 /// <since_tizen> 5 </since_tizen>
307 public RenderingBehaviorType RenderingBehavior
311 return GetRenderingBehavior();
315 SetRenderingBehavior(value);
320 /// The window size property (read-only).
322 /// <since_tizen> 3 </since_tizen>
327 Size2D ret = GetSize();
333 /// The background color property.
335 /// <since_tizen> 3 </since_tizen>
336 public Color BackgroundColor
340 SetBackgroundColor(value);
344 Color ret = GetBackgroundColor();
350 /// The DPI property (read-only).<br />
351 /// Retrieves the DPI of the display device to which the Window is connected.<br />
353 /// <since_tizen> 3 </since_tizen>
363 /// The layer count property (read-only).<br />
364 /// Queries the number of on-Window layers.<br />
366 /// <since_tizen> 3 </since_tizen>
367 public uint LayerCount
371 return GetLayerCount();
376 /// Gets or sets a size of the window.
378 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
379 /// <since_tizen> 4 </since_tizen>
380 public Size2D WindowSize
384 return GetWindowSize();
388 SetWindowSize(value);
393 /// Gets or sets a position of the window.
395 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
396 /// <since_tizen> 4 </since_tizen>
397 public Position2D WindowPosition
401 return GetPosition();
410 /// Sets position and size of the window. This API guarantees that
411 /// both moving and resizing of window will appear on the screen at once.
413 [EditorBrowsable(EditorBrowsableState.Never)]
414 public Rectangle WindowPositionSize
418 Position2D position = GetPosition();
419 Size2D size = GetSize();
420 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
426 SetPositionSize(value);
430 internal static Vector4 DEFAULT_BACKGROUND_COLOR
434 global::System.IntPtr cPtr = Interop.Stage.DefaultBackgroundColorGet();
435 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
436 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
441 internal static Vector4 DEBUG_BACKGROUND_COLOR
445 global::System.IntPtr cPtr = Interop.Stage.DebugBackgroundColorGet();
446 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
447 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
452 internal List<Layer> LayersChildren
461 /// Get the LayoutController for this Window.
463 internal LayoutController LayoutController
467 return localController;
472 /// Feed a key-event into the window.
474 /// <param name="keyEvent">The key event to feed.</param>
475 /// <since_tizen> 4 </since_tizen>
476 [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
477 public static void FeedKeyEvent(Key keyEvent)
479 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
480 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
484 /// Sets whether the window accepts a focus or not.
486 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
487 /// <since_tizen> 3 </since_tizen>
488 public void SetAcceptFocus(bool accept)
490 Interop.Window.SetAcceptFocus(SwigCPtr, accept);
491 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495 /// Returns whether the window accepts a focus or not.
497 /// <returns>True if the window accepts a focus, false otherwise.</returns>
498 /// <since_tizen> 3 </since_tizen>
499 public bool IsFocusAcceptable()
501 bool ret = Interop.Window.IsFocusAcceptable(SwigCPtr);
502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508 /// Shows the window if it is hidden.
510 /// <since_tizen> 3 </since_tizen>
513 Interop.Window.Show(SwigCPtr);
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518 /// Hides the window if it is showing.
520 /// <since_tizen> 3 </since_tizen>
523 Interop.Window.Hide(SwigCPtr);
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528 /// Retrieves whether the window is visible or not.
530 /// <returns>True if the window is visible.</returns>
531 /// <since_tizen> 3 </since_tizen>
532 public bool IsVisible()
534 bool temp = Interop.Window.IsVisible(SwigCPtr);
535 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540 /// Gets the count of supported auxiliary hints of the window.
542 /// <returns>The number of supported auxiliary hints.</returns>
543 /// <since_tizen> 3 </since_tizen>
544 public uint GetSupportedAuxiliaryHintCount()
546 uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(SwigCPtr);
547 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552 /// Gets the supported auxiliary hint string of the window.
554 /// <param name="index">The index of the supported auxiliary hint lists.</param>
555 /// <returns>The auxiliary hint string of the index.</returns>
556 /// <since_tizen> 3 </since_tizen>
557 public string GetSupportedAuxiliaryHint(uint index)
559 string ret = Interop.Window.GetSupportedAuxiliaryHint(SwigCPtr, index);
560 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
565 /// Creates an auxiliary hint of the window.
567 /// <param name="hint">The auxiliary hint string.</param>
568 /// <param name="value">The value string.</param>
569 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
570 /// <since_tizen> 3 </since_tizen>
571 public uint AddAuxiliaryHint(string hint, string value)
573 uint ret = Interop.Window.AddAuxiliaryHint(SwigCPtr, hint, value);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579 /// Removes an auxiliary hint of the window.
581 /// <param name="id">The ID of the auxiliary hint.</param>
582 /// <returns>True if no error occurred, false otherwise.</returns>
583 /// <since_tizen> 3 </since_tizen>
584 public bool RemoveAuxiliaryHint(uint id)
586 bool ret = Interop.Window.RemoveAuxiliaryHint(SwigCPtr, id);
587 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592 /// Changes a value of the auxiliary hint.
594 /// <param name="id">The auxiliary hint ID.</param>
595 /// <param name="value">The value string to be set.</param>
596 /// <returns>True if no error occurred, false otherwise.</returns>
597 /// <since_tizen> 3 </since_tizen>
598 public bool SetAuxiliaryHintValue(uint id, string value)
600 bool ret = Interop.Window.SetAuxiliaryHintValue(SwigCPtr, id, value);
601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606 /// Gets a value of the auxiliary hint.
608 /// <param name="id">The auxiliary hint ID.</param>
609 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
610 /// <since_tizen> 3 </since_tizen>
611 public string GetAuxiliaryHintValue(uint id)
613 string ret = Interop.Window.GetAuxiliaryHintValue(SwigCPtr, id);
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619 /// Gets an ID of the auxiliary hint string.
621 /// <param name="hint">The auxiliary hint string.</param>
622 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
623 /// <since_tizen> 3 </since_tizen>
624 public uint GetAuxiliaryHintId(string hint)
626 uint ret = Interop.Window.GetAuxiliaryHintId(SwigCPtr, hint);
627 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
632 /// Sets a region to accept input events.
634 /// <param name="inputRegion">The region to accept input events.</param>
635 /// <since_tizen> 3 </since_tizen>
636 public void SetInputRegion(Rectangle inputRegion)
638 Interop.Window.SetInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
639 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643 /// Sets a priority level for the specified notification window.
645 /// <param name="level">The notification window level.</param>
646 /// <returns>True if no error occurred, false otherwise.</returns>
647 /// <since_tizen> 3 </since_tizen>
648 public bool SetNotificationLevel(NotificationLevel level)
650 bool ret = Interop.Window.SetNotificationLevel(SwigCPtr, (int)level);
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
656 /// Gets a priority level for the specified notification window.
658 /// <returns>The notification window level.</returns>
659 /// <since_tizen> 3 </since_tizen>
660 public NotificationLevel GetNotificationLevel()
662 NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(SwigCPtr);
663 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
668 /// Sets a transparent window's visual state to opaque. <br />
669 /// If a visual state of a transparent window is opaque, <br />
670 /// then the window manager could handle it as an opaque window when calculating visibility.
672 /// <param name="opaque">Whether the window's visual state is opaque.</param>
673 /// <remarks>This will have no effect on an opaque window. <br />
674 /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
676 /// <since_tizen> 3 </since_tizen>
677 public void SetOpaqueState(bool opaque)
679 Interop.Window.SetOpaqueState(SwigCPtr, opaque);
680 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684 /// Returns whether a transparent window's visual state is opaque or not.
686 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
687 /// <remarks> The return value has no meaning on an opaque window. </remarks>
688 /// <since_tizen> 3 </since_tizen>
689 public bool IsOpaqueState()
691 bool ret = Interop.Window.IsOpaqueState(SwigCPtr);
692 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
697 /// Sets a window's screen off mode.
699 /// <param name="screenOffMode">The screen mode.</param>
700 /// <returns>True if no error occurred, false otherwise.</returns>
701 /// <since_tizen> 4 </since_tizen>
702 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
704 bool ret = Interop.Window.SetScreenOffMode(SwigCPtr, (int)screenOffMode);
705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 /// Gets the screen mode of the window.
712 /// <returns>The screen off mode.</returns>
713 /// <since_tizen> 4 </since_tizen>
714 public ScreenOffMode GetScreenOffMode()
716 ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(SwigCPtr);
717 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
722 /// Sets preferred brightness of the window.
724 /// <param name="brightness">The preferred brightness (0 to 100).</param>
725 /// <returns>True if no error occurred, false otherwise.</returns>
726 /// <since_tizen> 3 </since_tizen>
727 public bool SetBrightness(int brightness)
729 bool ret = Interop.Window.SetBrightness(SwigCPtr, brightness);
730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735 /// Gets the preferred brightness of the window.
737 /// <returns>The preferred brightness.</returns>
738 /// <since_tizen> 3 </since_tizen>
739 public int GetBrightness()
741 int ret = Interop.Window.GetBrightness(SwigCPtr);
742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
747 /// Sets the window name and the class string.
749 /// <param name="name">The name of the window.</param>
750 /// <param name="klass">The class of the window.</param>
751 /// <since_tizen> 4 </since_tizen>
752 public void SetClass(string name, string klass)
754 Interop.Window.SetClass(SwigCPtr, name, klass);
755 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
759 /// Raises the window to the top of the window stack.
761 /// <since_tizen> 3 </since_tizen>
764 Interop.Window.Raise(SwigCPtr);
765 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
769 /// Lowers the window to the bottom of the window stack.
771 /// <since_tizen> 3 </since_tizen>
774 Interop.Window.Lower(SwigCPtr);
775 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
779 /// Activates the window to the top of the window stack even it is iconified.
781 /// <since_tizen> 3 </since_tizen>
782 public void Activate()
784 Interop.Window.Activate(SwigCPtr);
785 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
789 /// Gets the default ( root ) layer.
791 /// <returns>The root layer.</returns>
792 /// <since_tizen> 3 </since_tizen>
793 public Layer GetDefaultLayer()
795 return this.GetRootLayer();
799 /// Add a child view to window.
801 /// <param name="view">the child should be added to the window.</param>
802 /// <since_tizen> 3 </since_tizen>
803 public void Add(View view)
805 Interop.Actor.Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
806 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
807 this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
810 view.InternalParent = this.GetRootLayer();
815 /// Remove a child view from window.
817 /// <param name="view">the child to be removed.</param>
818 /// <since_tizen> 3 </since_tizen>
819 public void Remove(View view)
821 Interop.Actor.Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
822 this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
825 view.InternalParent = null;
830 /// Retrieves the layer at a specified depth.
832 /// <param name="depth">The layer's depth index.</param>
833 /// <returns>The layer found at the given depth.</returns>
834 /// <since_tizen> 3 </since_tizen>
835 public Layer GetLayer(uint depth)
837 if (depth < LayersChildren?.Count)
839 Layer ret = LayersChildren?[Convert.ToInt32(depth)];
849 /// Destroy the window immediately.
851 [EditorBrowsable(EditorBrowsableState.Never)]
852 public void Destroy()
858 /// Keep rendering for at least the given amount of time.
860 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
861 /// <since_tizen> 3 </since_tizen>
862 public void KeepRendering(float durationSeconds)
864 Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
865 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
869 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
870 /// This function can be used for following example scenarios: <br />
871 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
873 /// <param name="DaliKey">The key code to grab.</param>
874 /// <returns>True if the grab succeeds.</returns>
875 /// <since_tizen> 3 </since_tizen>
876 public bool GrabKeyTopmost(int DaliKey)
878 bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
879 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
884 /// Ungrabs the key specified by a key for the window.<br />
885 /// 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 />
887 /// <param name="DaliKey">The key code to ungrab.</param>
888 /// <returns>True if the ungrab succeeds.</returns>
889 /// <since_tizen> 3 </since_tizen>
890 public bool UngrabKeyTopmost(int DaliKey)
892 bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
893 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
898 /// Grabs the key specified by a key for a window in a GrabMode. <br />
899 /// Details: This function can be used for following example scenarios: <br />
900 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
901 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
902 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
904 /// <param name="DaliKey">The key code to grab.</param>
905 /// <param name="GrabMode">The grab mode for the key.</param>
906 /// <returns>True if the grab succeeds.</returns>
907 /// <since_tizen> 3 </since_tizen>
908 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
910 bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey, (int)GrabMode);
911 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
916 /// Ungrabs the key specified by a key for a window.<br />
917 /// 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 />
919 /// <param name="DaliKey">The key code to ungrab.</param>
920 /// <returns>True if the ungrab succeeds.</returns>
921 /// <since_tizen> 3 </since_tizen>
922 public bool UngrabKey(int DaliKey)
924 bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
925 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
930 /// Sets the keyboard repeat information.
932 /// <param name="rate">The key repeat rate value in seconds.</param>
933 /// <param name="delay">The key repeat delay value in seconds.</param>
934 /// <returns>True if setting the keyboard repeat succeeds.</returns>
935 /// <since_tizen> 5 </since_tizen>
936 public bool SetKeyboardRepeatInfo(float rate, float delay)
938 bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
939 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
944 /// Gets the keyboard repeat information.
946 /// <param name="rate">The key repeat rate value in seconds.</param>
947 /// <param name="delay">The key repeat delay value in seconds.</param>
948 /// <returns>True if setting the keyboard repeat succeeds.</returns>
949 /// <since_tizen> 5 </since_tizen>
950 public bool GetKeyboardRepeatInfo(out float rate, out float delay)
952 bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
953 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
958 /// Adds a layer to the stage.
960 /// <param name="layer">Layer to add.</param>
961 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
962 /// <since_tizen> 3 </since_tizen>
963 public void AddLayer(Layer layer)
969 /// Removes a layer from the stage.
971 /// <param name="layer">Layer to remove.</param>
972 /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
973 /// <since_tizen> 3 </since_tizen>
974 public void RemoveLayer(Layer layer)
980 /// Feeds a key event into the window.
982 /// <param name="keyEvent">The key event to feed.</param>
983 /// <since_tizen> 5 </since_tizen>
984 public void FeedKey(Key keyEvent)
986 Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
987 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
991 /// Allows at least one more render, even when paused.
992 /// The window should be shown, not minimised.
994 /// <since_tizen> 4 </since_tizen>
995 public void RenderOnce()
997 Interop.Window.RenderOnce(SwigCPtr);
998 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1002 /// Sets whether the window is transparent or not.
1004 /// <param name="transparent">Whether the window is transparent or not.</param>
1005 /// <since_tizen> 5 </since_tizen>
1006 public void SetTransparency(bool transparent)
1008 Interop.Window.SetTransparency(SwigCPtr, transparent);
1009 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1011 // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
1015 /// Sets parent window of the window.
1016 /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
1017 /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
1018 /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
1020 /// <param name="parent">The parent window.</param>
1021 /// <since_tizen> 6 </since_tizen>
1022 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1023 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1024 public void SetParent(Window parent)
1026 if (IsSupportedMultiWindow() == false)
1028 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1030 Interop.Window.SetParent(SwigCPtr, Window.getCPtr(parent));
1031 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1035 /// Unsets parent window of the window.
1036 /// After unsetting, the window is disconnected his parent window.
1038 /// <since_tizen> 6 </since_tizen>
1039 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1040 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1041 public void Unparent()
1043 if (IsSupportedMultiWindow() == false)
1045 NUILog.Error("Fail to create window. because this device does not support opengles.surfaceless_context.");
1047 Interop.Window.Unparent(SwigCPtr);
1048 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1052 /// Gets parent window of the window.
1054 /// <returns>The parent window of the window.</returns>
1055 /// <since_tizen> 6 </since_tizen>
1056 /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
1057 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
1058 [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1721: Property names should not match get methods")]
1059 public Window GetParent()
1061 if (IsSupportedMultiWindow() == false)
1063 NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
1065 Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(SwigCPtr)) as Window;
1066 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1070 /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
1071 [EditorBrowsable(EditorBrowsableState.Never)]
1072 public void ObjectDump()
1074 Layer rootLayer = GetRootLayer();
1075 foreach (View view in rootLayer.Children)
1081 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
1083 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1086 internal static bool IsInstalled()
1088 bool ret = Interop.Stage.IsInstalled();
1089 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094 /// Adds an orientation to the list of available orientations.
1096 /// <param name="orientation">The available orientation to add</param>
1097 /// <since_tizen> 6 </since_tizen>
1098 public void AddAvailableOrientation(Window.WindowOrientation orientation)
1100 Interop.Window.AddAvailableOrientation(SwigCPtr, (int)orientation);
1101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105 /// Removes an orientation from the list of available orientations.
1107 /// <param name="orientation">The available orientation to remove.</param>
1108 /// <since_tizen> 6 </since_tizen>
1109 public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
1111 Interop.Window.RemoveAvailableOrientation(SwigCPtr, (int)orientation);
1112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1116 /// Sets a preferred orientation.
1118 /// <param name="orientation">The preferred orientation.</param>
1119 /// <since_tizen> 6 </since_tizen>
1120 public void SetPreferredOrientation(Window.WindowOrientation orientation)
1122 Interop.Window.SetPreferredOrientation(SwigCPtr, (int)orientation);
1123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1127 /// Gets the preferred orientation.
1129 /// <since_tizen> 6 </since_tizen>
1130 /// <returns>The preferred orientation if previously set, or none.</returns>
1131 public Window.WindowOrientation GetPreferredOrientation()
1133 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetPreferredOrientation(SwigCPtr);
1134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1139 /// Gets current orientation of the window.
1141 /// <since_tizen> 6 </since_tizen>
1142 /// <returns>The current window orientation if previously set, or none.</returns>
1143 [EditorBrowsable(EditorBrowsableState.Never)]
1144 public Window.WindowOrientation GetCurrentOrientation()
1146 Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetCurrentOrientation(SwigCPtr);
1147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1152 /// Sets available orientations of the window.
1153 /// This API is for setting several orientations one time.
1155 /// <param name="orientations">The list of orientations.</param>
1156 /// <since_tizen> 6 </since_tizen>
1157 [EditorBrowsable(EditorBrowsableState.Never)]
1158 public void SetAvailableOrientations(List<Window.WindowOrientation> orientations)
1160 PropertyArray orientationArray = new PropertyArray();
1161 if (null != orientations)
1163 for (int i = 0; i < orientations.Count; i++)
1165 PropertyValue value = new PropertyValue((int)orientations[i]);
1166 orientationArray.PushBack(value);
1170 Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray));
1171 for (uint i = 0; i < orientationArray.Count(); i++)
1173 orientationArray[i].Dispose();
1175 orientationArray.Dispose();
1176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1180 /// Get native window ID
1182 /// <returns>native window ID</returns>
1183 [EditorBrowsable(EditorBrowsableState.Never)]
1184 public int GetNativeId()
1186 int ret = Interop.Window.GetNativeId(SwigCPtr);
1187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1191 internal Any GetNativeHandle()
1193 Any ret = new Any(Interop.WindowInternal.WindowGetNativeHandle(SwigCPtr), true);
1194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1198 internal void Add(Layer layer)
1202 throw new ArgumentNullException(nameof(layer));
1204 Interop.Window.Add(SwigCPtr, Layer.getCPtr(layer));
1205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1207 LayersChildren?.Add(layer);
1208 layer.SetWindow(this);
1211 internal void Remove(Layer layer)
1215 throw new ArgumentNullException(nameof(layer));
1217 Interop.Window.Remove(SwigCPtr, Layer.getCPtr(layer));
1218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1220 LayersChildren?.Remove(layer);
1221 layer.SetWindow(null);
1224 internal Vector2 GetSize()
1226 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1227 Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
1228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1232 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
1233 [EditorBrowsable(EditorBrowsableState.Never)]
1234 public RenderTaskList GetRenderTaskList()
1236 RenderTaskList ret = new RenderTaskList(Interop.Stage.GetRenderTaskList(stageCPtr), true);
1237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1242 /// Queries the number of on-window layers.
1244 /// <returns>The number of layers.</returns>
1245 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
1246 internal uint GetLayerCount()
1248 if (LayersChildren == null || LayersChildren.Count < 0)
1251 return (uint)LayersChildren.Count;
1254 internal Layer GetRootLayer()
1256 // Window.IsInstalled() is actually true only when called from event thread and
1257 // Core has been initialized, not when Stage is ready.
1258 if (rootLayer == null && Window.IsInstalled())
1260 rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
1261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1262 LayersChildren?.Add(rootLayer);
1263 rootLayer.SetWindow(this);
1268 internal void SetBackgroundColor(Vector4 color)
1270 Interop.Window.SetBackgroundColor(SwigCPtr, Vector4.getCPtr(color));
1271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1274 internal Vector4 GetBackgroundColor()
1276 Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(SwigCPtr), true);
1277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1281 internal Vector2 GetDpi()
1283 Vector2 ret = new Vector2(Interop.Stage.GetDpi(stageCPtr), true);
1284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1288 internal ObjectRegistry GetObjectRegistry()
1290 ObjectRegistry ret = new ObjectRegistry(Interop.Stage.GetObjectRegistry(stageCPtr), true);
1291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1295 internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
1297 Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
1298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1301 internal RenderingBehaviorType GetRenderingBehavior()
1303 RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.GetRenderingBehavior(stageCPtr);
1304 if (NDalicPINVOKE.SWIGPendingException.Pending)
1305 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1309 internal void SetWindowSize(Size2D size)
1313 throw new ArgumentNullException(nameof(size));
1315 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1316 Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
1318 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1319 // Resetting Window size should request a relayout of the tree.
1322 internal Size2D GetWindowSize()
1324 var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
1325 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1330 internal void SetPosition(Position2D position)
1332 if (null == position)
1334 throw new ArgumentNullException(nameof(position));
1336 var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1337 Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
1339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1340 // Setting Position of the window should request a relayout of the tree.
1343 internal Position2D GetPosition()
1345 var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
1346 Position2D ret = new Position2D(val.GetX(), val.GetY());
1348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1352 internal void SetPositionSize(Rectangle positionSize)
1354 Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
1356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358 // Setting Position of the window should request a relayout of the tree.
1362 /// Add FrameUpdateCallback
1364 [EditorBrowsable(EditorBrowsableState.Never)]
1365 public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1367 frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer()));
1371 /// Remove FrameUpdateCallback
1373 [EditorBrowsable(EditorBrowsableState.Never)]
1374 public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
1376 frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr);
1380 /// Dispose for Window
1382 [EditorBrowsable(EditorBrowsableState.Never)]
1383 protected override void Dispose(DisposeTypes type)
1390 if (type == DisposeTypes.Explicit)
1393 //Release your own managed resources here.
1394 //You should release all of your own disposable objects here.
1396 if (rootLayer != null)
1398 rootLayer.Dispose();
1401 localController?.Dispose();
1403 foreach (var layer in childLayers)
1411 childLayers.Clear();
1414 this.DisconnectNativeSignals();
1419 /// This will not be public opened.
1420 [EditorBrowsable(EditorBrowsableState.Never)]
1421 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1423 Interop.Window.DeleteWindow(swigCPtr);
1426 private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
1428 private static readonly object locker = new object();
1430 private static int key = 0;
1432 private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
1434 private struct internalHookCallbackType
1436 public FrameCallbackType userCallback;
1440 private static void OnInternalHookFrameCallback(int id)
1444 if (frameCallbackList.ContainsKey(id))
1446 if (frameCallbackList[id].userCallback != null)
1448 frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
1449 frameCallbackList.Remove(id);
1453 NUILog.Error($"found userCallback is NULL");
1454 frameCallbackList.Remove(id);
1460 private int AddInterHookCallback(FrameCallbackType callback, int frameId)
1462 if (null == callback)
1464 throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
1466 var assignedKey = 0;
1471 frameCallbackList.Add(assignedKey, new internalHookCallbackType()
1473 userCallback = callback,
1481 /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
1483 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1484 [EditorBrowsable(EditorBrowsableState.Never)]
1485 public delegate void FrameCallbackType(int frameId);
1488 /// Adds a callback that is called when the frame rendering is done by the graphics driver.
1489 /// A callback of the following type may be used:
1491 /// void MyFunction( int frameId )
1493 /// This callback will be deleted once it is called.
1495 /// Ownership of the callback is passed onto this class
1498 /// <param name="callback">The function to call</param>
1499 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1500 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1501 [EditorBrowsable(EditorBrowsableState.Never)]
1502 public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
1504 var assignedKey = AddInterHookCallback(callback, frameId);
1505 Interop.WindowInternal.AddFrameRenderedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1507 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1511 /// Adds a callback that is called when the frame is displayed on the display.
1512 /// A callback of the following type may be used:
1514 /// void MyFunction( int frameId )
1516 /// This callback will be deleted once it is called.
1518 /// Ownership of the callback is passed onto this class
1521 /// <param name="callback">The function to call</param>
1522 /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
1523 /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
1524 [EditorBrowsable(EditorBrowsableState.Never)]
1525 public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
1527 var assignedKey = AddInterHookCallback(callback, frameId);
1528 Interop.WindowInternal.AddFramePresentedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
1530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();