2 * Copyright(c) 2017 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 using System.Runtime.InteropServices;
19 using Tizen.NUI.BaseComponents;
20 using System.ComponentModel;
25 /// The window class is used internally for drawing.<br />
26 /// The window has an orientation and indicator properties.<br />
28 /// <since_tizen> 3 </since_tizen>
29 public class Window : BaseHandle
31 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32 private global::System.Runtime.InteropServices.HandleRef stageCPtr;
33 private Layer _rootLayer;
34 private string _windowTitle;
36 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
38 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 if (NDalicPINVOKE.Stage_IsInstalled())
41 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
45 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
47 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
51 /// To make the window instance be disposed.
53 /// Please DO NOT use! This will be deprecated!
54 /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
55 /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
56 /// <since_tizen> 3 </since_tizen>
57 [EditorBrowsable(EditorBrowsableState.Never)]
58 protected override void Dispose(DisposeTypes type)
65 if (type == DisposeTypes.Explicit)
68 //Release your own managed resources here.
69 //You should release all of your own disposable objects here.
72 //Release your own unmanaged resources here.
73 //You should not access any managed member here except static instance.
74 //because the execution order of Finalizes is non-deterministic.
76 if (_windowFocusChangedEventCallback != null)
78 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
81 if (_stageTouchCallbackDelegate != null)
83 TouchSignal().Disconnect(_stageTouchCallbackDelegate);
86 if (_stageWheelCallbackDelegate != null)
88 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
91 if (_stageKeyCallbackDelegate != null)
93 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
96 if (_stageEventProcessingFinishedEventCallbackDelegate != null)
98 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
101 if (_stageContextLostEventCallbackDelegate != null)
103 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
106 if (_stageContextRegainedEventCallbackDelegate != null)
108 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
111 if (_stageSceneCreatedEventCallbackDelegate != null)
113 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
116 if (_windowResizedEventCallback != null)
118 ResizedSignal().Disconnect(_windowResizedEventCallback);
121 if (_windowFocusChangedEventCallback2 != null)
123 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
126 if (swigCPtr.Handle != global::System.IntPtr.Zero)
131 NDalicPINVOKE.delete_Window(swigCPtr);
132 NDalicPINVOKE.delete_Stage(stageCPtr);
134 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
140 internal static Window GetCurrent()
142 Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 internal static bool IsInstalled()
149 bool ret = NDalicPINVOKE.Stage_IsInstalled();
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 /// Sets whether the window accepts a focus or not.
157 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
158 /// <since_tizen> 3 </since_tizen>
159 public void SetAcceptFocus(bool accept)
161 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 /// Returns whether the window accepts a focus or not.
168 /// <returns>True if the window accepts a focus, false otherwise.</returns>
169 /// <since_tizen> 3 </since_tizen>
170 public bool IsFocusAcceptable()
172 bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 /// Shows the window if it is hidden.
181 /// <since_tizen> 3 </since_tizen>
184 NDalicPINVOKE.Show(swigCPtr);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 /// Hides the window if it is showing.
191 /// <since_tizen> 3 </since_tizen>
194 NDalicPINVOKE.Hide(swigCPtr);
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 /// Retrieves whether the window is visible or not.
201 /// <returns>True if the window is visible.</returns>
202 /// <since_tizen> 3 </since_tizen>
203 public bool IsVisible()
205 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// Gets the count of supported auxiliary hints of the window.
213 /// <returns>The number of supported auxiliary hints.</returns>
214 /// <since_tizen> 3 </since_tizen>
215 public uint GetSupportedAuxiliaryHintCount()
217 uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// Gets the supported auxiliary hint string of the window.
225 /// <param name="index">The index of the supported auxiliary hint lists.</param>
226 /// <returns>The auxiliary hint string of the index.</returns>
227 /// <since_tizen> 3 </since_tizen>
228 public string GetSupportedAuxiliaryHint(uint index)
230 string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 /// Creates an auxiliary hint of the window.
238 /// <param name="hint">The auxiliary hint string.</param>
239 /// <param name="value">The value string.</param>
240 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
241 /// <since_tizen> 3 </since_tizen>
242 public uint AddAuxiliaryHint(string hint, string value)
244 uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 /// Removes an auxiliary hint of the window.
252 /// <param name="id">The ID of the auxiliary hint.</param>
253 /// <returns>True if no error occurred, false otherwise.</returns>
254 /// <since_tizen> 3 </since_tizen>
255 public bool RemoveAuxiliaryHint(uint id)
257 bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 /// Changes a value of the auxiliary hint.
265 /// <param name="id">The auxiliary hint ID.</param>
266 /// <param name="value">The value string to be set.</param>
267 /// <returns>True if no error occurred, false otherwise.</returns>
268 /// <since_tizen> 3 </since_tizen>
269 public bool SetAuxiliaryHintValue(uint id, string value)
271 bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 /// Gets a value of the auxiliary hint.
279 /// <param name="id">The auxiliary hint ID.</param>
280 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
281 /// <since_tizen> 3 </since_tizen>
282 public string GetAuxiliaryHintValue(uint id)
284 string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 /// Gets an ID of the auxiliary hint string.
292 /// <param name="hint">The auxiliary hint string.</param>
293 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
294 /// <since_tizen> 3 </since_tizen>
295 public uint GetAuxiliaryHintId(string hint)
297 uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 /// Sets a region to accept input events.
305 /// <param name="inputRegion">The region to accept input events.</param>
306 /// <since_tizen> 3 </since_tizen>
307 public void SetInputRegion(Rectangle inputRegion)
309 NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 /// Gets or sets a window type.
316 /// <since_tizen> 3 </since_tizen>
317 public WindowType Type
321 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 NDalicPINVOKE.SetType(swigCPtr, (int)value);
328 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 /// Sets a priority level for the specified notification window.
335 /// <param name="level">The notification window level.</param>
336 /// <returns>True if no error occurred, false otherwise.</returns>
337 /// <since_tizen> 3 </since_tizen>
338 public bool SetNotificationLevel(NotificationLevel level)
340 bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 /// Gets a priority level for the specified notification window.
348 /// <returns>The notification window level.</returns>
349 /// <since_tizen> 3 </since_tizen>
350 public NotificationLevel GetNotificationLevel()
352 NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358 /// Sets a transparent window's visual state to opaque.
360 /// <param name="opaque">Whether the window's visual state is opaque.</param>
361 /// <since_tizen> 3 </since_tizen>
362 public void SetOpaqueState(bool opaque)
364 NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 /// Returns whether a transparent window's visual state is opaque or not.
371 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
372 /// <since_tizen> 3 </since_tizen>
373 public bool IsOpaqueState()
375 bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
381 /// Sets a window's screen off mode.
383 /// <param name="screenOffMode">The screen mode.</param>
384 /// <returns>True if no error occurred, false otherwise.</returns>
385 /// <since_tizen> 4 </since_tizen>
386 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
388 bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode);
389 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 /// Gets the screen mode of the window.
396 /// <returns>The screen off mode.</returns>
397 /// <since_tizen> 4 </since_tizen>
398 public ScreenOffMode GetScreenOffMode()
400 ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr);
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406 /// Sets preferred brightness of the window.
408 /// <param name="brightness">The preferred brightness (0 to 100).</param>
409 /// <returns>True if no error occurred, false otherwise.</returns>
410 /// <since_tizen> 3 </since_tizen>
411 public bool SetBrightness(int brightness)
413 bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
414 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
419 /// Gets the preferred brightness of the window.
421 /// <returns>The preferred brightness.</returns>
422 /// <since_tizen> 3 </since_tizen>
423 public int GetBrightness()
425 int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 /// The focus changed event argument.
433 /// <since_tizen> 3 </since_tizen>
434 public class FocusChangedEventArgs : EventArgs
437 /// FocusGained flag.
439 /// <since_tizen> 3 </since_tizen>
440 public bool FocusGained
447 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
448 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
449 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
450 private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
453 /// FocusChanged event.
455 /// <since_tizen> 3 </since_tizen>
456 public event EventHandler<FocusChangedEventArgs> FocusChanged
460 if (_windowFocusChangedEventHandler == null)
462 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
463 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
466 _windowFocusChangedEventHandler += value;
470 _windowFocusChangedEventHandler -= value;
472 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
474 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
479 private void OnWindowFocusedChanged(bool focusGained)
481 FocusChangedEventArgs e = new FocusChangedEventArgs();
483 e.FocusGained = focusGained;
485 if (_windowFocusChangedEventHandler != null)
487 _windowFocusChangedEventHandler(this, e);
492 /// Gets/Sets a window title.
494 /// <since_tizen> 4 </since_tizen>
503 _windowTitle = value;
504 SetClass(_windowTitle, "");
508 internal WindowFocusSignalType WindowFocusChangedSignal()
510 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
511 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515 internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
517 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520 internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525 internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
527 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530 internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
537 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541 internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
543 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
544 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547 internal void RotateIndicator(Window.WindowOrientation orientation)
549 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
550 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554 /// Sets the window name and the class string.
556 /// <param name="name">The name of the window.</param>
557 /// <param name="klass">The class of the window.</param>
558 /// <since_tizen> 4 </since_tizen>
559 public void SetClass(string name, string klass)
561 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 /// Raises the window to the top of the window stack.
568 /// <since_tizen> 3 </since_tizen>
571 NDalicPINVOKE.Window_Raise(swigCPtr);
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576 /// Lowers the window to the bottom of the window stack.
578 /// <since_tizen> 3 </since_tizen>
581 NDalicPINVOKE.Window_Lower(swigCPtr);
582 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 /// Activates the window to the top of the window stack even it is iconified.
588 /// <since_tizen> 3 </since_tizen>
589 public void Activate()
591 NDalicPINVOKE.Window_Activate(swigCPtr);
592 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
595 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
597 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
601 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
603 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
604 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
609 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 internal Window.WindowOrientation GetPreferredOrientation()
615 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
620 internal DragAndDropDetector GetDragAndDropDetector()
622 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
623 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627 internal Any GetNativeHandle()
629 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
630 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634 internal WindowFocusSignalType FocusChangedSignal()
636 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
637 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
642 /// Gets the default ( root ) layer.
644 /// <returns>The root layer.</returns>
645 /// <since_tizen> 3 </since_tizen>
646 public Layer GetDefaultLayer()
648 return this.GetRootLayer();
651 internal void Add(Layer layer)
653 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
654 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
657 internal void Remove(Layer layer)
659 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
660 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
664 /// Add a child view to window.
666 /// <param name="view">the child should be added to the window.</param>
667 /// <since_tizen> 3 </since_tizen>
668 public void Add(View view)
670 GetRootLayer()?.Add(view);
674 /// Remove a child view from window.
676 /// <param name="view">the child to be removed.</param>
677 /// <since_tizen> 3 </since_tizen>
678 public void Remove(View view)
680 GetRootLayer()?.Remove(view);
683 internal Vector2 GetSize()
685 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690 internal RenderTaskList GetRenderTaskList()
692 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
693 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698 /// Queries the number of on-window layers.
700 /// <returns>The number of layers.</returns>
701 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
702 internal uint GetLayerCount()
704 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 /// Retrieves the layer at a specified depth.
712 /// <param name="depth">The layer's depth index.</param>
713 /// <returns>The layer found at the given depth.</returns>
714 /// <since_tizen> 3 </since_tizen>
715 public Layer GetLayer(uint depth)
717 IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
718 Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
720 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
724 internal Layer GetRootLayer()
726 // Window.IsInstalled() is actually true only when called from event thread and
727 // Core has been initialized, not when Stage is ready.
728 if (_rootLayer == null && Window.IsInstalled())
730 _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
731 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
736 internal void SetBackgroundColor(Vector4 color)
738 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
739 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
742 internal Vector4 GetBackgroundColor()
744 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
745 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
749 internal Vector2 GetDpi()
751 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
752 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756 internal ObjectRegistry GetObjectRegistry()
758 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
759 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
764 /// Keep rendering for at least the given amount of time.
766 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
767 /// <since_tizen> 3 </since_tizen>
768 public void KeepRendering(float durationSeconds)
770 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
771 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
774 internal KeyEventSignal KeyEventSignal()
776 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 internal VoidSignal EventProcessingFinishedSignal()
783 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
784 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
788 internal TouchSignal TouchSignal()
790 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
791 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
795 private StageWheelSignal WheelEventSignal()
797 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
798 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
802 internal VoidSignal ContextLostSignal()
804 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
805 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809 internal VoidSignal ContextRegainedSignal()
811 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
812 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
816 internal VoidSignal SceneCreatedSignal()
818 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
819 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 internal ResizedSignal ResizedSignal()
825 ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
830 internal static Vector4 DEFAULT_BACKGROUND_COLOR
834 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
835 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
836 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
841 internal static Vector4 DEBUG_BACKGROUND_COLOR
845 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
846 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
847 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
852 private static readonly Window instance = Application.Instance.GetWindow();
855 /// The stage instance property (read-only).<br />
856 /// Gets the current window.<br />
858 /// <since_tizen> 3 </since_tizen>
859 public static Window Instance
868 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
869 /// This function can be used for following example scenarios: <br />
870 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
872 /// <param name="DaliKey">The key code to grab.</param>
873 /// <returns>True if the grab succeeds.</returns>
874 /// <since_tizen> 3 </since_tizen>
875 public bool GrabKeyTopmost(int DaliKey)
877 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
878 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
883 /// Ungrabs the key specified by a key for the window.<br />
884 /// 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 />
886 /// <param name="DaliKey">The key code to ungrab.</param>
887 /// <returns>True if the ungrab succeeds.</returns>
888 /// <since_tizen> 3 </since_tizen>
889 public bool UngrabKeyTopmost(int DaliKey)
891 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
892 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
897 /// Grabs the key specified by a key for a window in a GrabMode. <br />
898 /// Details: This function can be used for following example scenarios: <br />
899 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
900 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
901 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
903 /// <param name="DaliKey">The key code to grab.</param>
904 /// <param name="GrabMode">The grab mode for the key.</param>
905 /// <returns>True if the grab succeeds.</returns>
906 /// <since_tizen> 3 </since_tizen>
907 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
909 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
910 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
915 /// Ungrabs the key specified by a key for a window.<br />
916 /// 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 />
918 /// <param name="DaliKey">The key code to ungrab.</param>
919 /// <returns>True if the ungrab succeeds.</returns>
920 /// <since_tizen> 3 </since_tizen>
921 public bool UngrabKey(int DaliKey)
923 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
924 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
928 internal System.IntPtr GetNativeWindowHandler()
930 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
931 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
936 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
938 /// <since_tizen> 3 </since_tizen>
939 public enum WindowOrientation
942 /// Portrait orientation. The height of the display area is greater than the width.
944 /// <since_tizen> 3 </since_tizen>
947 /// Landscape orientation. A wide view area is needed.
949 /// <since_tizen> 3 </since_tizen>
952 /// Portrait inverse orientation.
954 /// <since_tizen> 3 </since_tizen>
955 PortraitInverse = 180,
957 /// Landscape inverse orientation.
959 /// <since_tizen> 3 </since_tizen>
960 LandscapeInverse = 270
964 /// Enumeration for the key grab mode for platform-level APIs.
966 /// <since_tizen> 3 </since_tizen>
967 public enum KeyGrabMode
970 /// Grabs a key only when on the top of the grabbing-window stack mode.
974 /// Grabs a key together with the other client window(s) mode.
978 /// 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.
982 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
988 /// Enumeration for opacity of the indicator.
990 internal enum IndicatorBackgroundOpacity
998 /// Enumeration for visible mode of the indicator.
1000 internal enum IndicatorVisibleMode
1008 /// The touch event argument.
1010 /// <since_tizen> 3 </since_tizen>
1011 public class TouchEventArgs : EventArgs
1013 private Touch _touch;
1018 /// <since_tizen> 3 </since_tizen>
1032 private event EventHandler<TouchEventArgs> _stageTouchHandler;
1033 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
1036 /// This event is emitted when the screen is touched and when the touch ends.<br />
1037 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
1038 /// then when the last finger is lifted.<br />
1039 /// An interrupted event will also be emitted (if it occurs).<br />
1041 /// <since_tizen> 3 </since_tizen>
1042 public event EventHandler<TouchEventArgs> TouchEvent
1048 _stageTouchHandler += value;
1049 _stageTouchCallbackDelegate = OnStageTouch;
1050 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
1057 if (_stageTouchHandler != null)
1059 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
1061 _stageTouchHandler -= value;
1066 private void OnStageTouch(IntPtr data)
1068 TouchEventArgs e = new TouchEventArgs();
1072 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
1075 if (_stageTouchHandler != null)
1077 _stageTouchHandler(this, e);
1082 /// Wheel event arguments.
1084 /// <since_tizen> 3 </since_tizen>
1085 public class WheelEventArgs : EventArgs
1087 private Wheel _wheel;
1092 /// <since_tizen> 3 </since_tizen>
1106 private event EventHandler<WheelEventArgs> _stageWheelHandler;
1107 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
1110 /// This event is emitted when the wheel event is received.
1112 /// <since_tizen> 3 </since_tizen>
1113 public event EventHandler<WheelEventArgs> WheelEvent
1117 if (_stageWheelHandler == null)
1119 _stageWheelCallbackDelegate = OnStageWheel;
1120 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
1122 _stageWheelHandler += value;
1126 _stageWheelHandler -= value;
1127 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
1129 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
1134 private void OnStageWheel(IntPtr data)
1136 WheelEventArgs e = new WheelEventArgs();
1140 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1143 if (_stageWheelHandler != null)
1145 _stageWheelHandler(this, e);
1150 /// Key event arguments.
1152 /// <since_tizen> 3 </since_tizen>
1153 public class KeyEventArgs : EventArgs
1160 /// <since_tizen> 3 </since_tizen>
1174 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1175 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1178 /// This event is emitted when the key event is received.
1180 /// <since_tizen> 3 </since_tizen>
1181 public event EventHandler<KeyEventArgs> KeyEvent
1185 if (_stageKeyHandler == null)
1187 _stageKeyCallbackDelegate = OnStageKey;
1188 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1190 _stageKeyHandler += value;
1194 _stageKeyHandler -= value;
1195 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1197 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1202 // Callback for Stage KeyEventsignal
1203 private void OnStageKey(IntPtr data)
1205 KeyEventArgs e = new KeyEventArgs();
1209 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1212 if (_stageKeyHandler != null)
1214 //here we send all data to user event handlers
1215 _stageKeyHandler(this, e);
1220 private event EventHandler _stageEventProcessingFinishedEventHandler;
1221 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1223 internal event EventHandler EventProcessingFinished
1227 if (_stageEventProcessingFinishedEventHandler == null)
1229 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1230 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1232 _stageEventProcessingFinishedEventHandler += value;
1237 _stageEventProcessingFinishedEventHandler -= value;
1238 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1240 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1245 // Callback for Stage EventProcessingFinishedSignal
1246 private void OnEventProcessingFinished()
1248 if (_stageEventProcessingFinishedEventHandler != null)
1250 _stageEventProcessingFinishedEventHandler(this, null);
1255 private EventHandler _stageContextLostEventHandler;
1256 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1258 internal event EventHandler ContextLost
1262 if (_stageContextLostEventHandler == null)
1264 _stageContextLostEventCallbackDelegate = OnContextLost;
1265 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1267 _stageContextLostEventHandler += value;
1271 _stageContextLostEventHandler -= value;
1272 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1274 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1279 // Callback for Stage ContextLostSignal
1280 private void OnContextLost()
1282 if (_stageContextLostEventHandler != null)
1284 _stageContextLostEventHandler(this, null);
1289 private EventHandler _stageContextRegainedEventHandler;
1290 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1292 internal event EventHandler ContextRegained
1296 if (_stageContextRegainedEventHandler == null)
1298 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1299 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1301 _stageContextRegainedEventHandler += value;
1305 _stageContextRegainedEventHandler -= value;
1306 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1308 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1313 // Callback for Stage ContextRegainedSignal
1314 private void OnContextRegained()
1316 if (_stageContextRegainedEventHandler != null)
1318 _stageContextRegainedEventHandler(this, null);
1323 private EventHandler _stageSceneCreatedEventHandler;
1324 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1326 internal event EventHandler SceneCreated
1330 if (_stageSceneCreatedEventHandler == null)
1332 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1333 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1335 _stageSceneCreatedEventHandler += value;
1339 _stageSceneCreatedEventHandler -= value;
1340 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1342 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1347 // Callback for Stage SceneCreatedSignal
1348 private void OnSceneCreated()
1350 if (_stageSceneCreatedEventHandler != null)
1352 _stageSceneCreatedEventHandler(this, null);
1357 /// This resized event arguments.
1359 /// <since_tizen> 3 </since_tizen>
1360 public class ResizedEventArgs : EventArgs
1365 /// This window size.
1367 /// <since_tizen> 4 </since_tizen>
1368 public Size2D WindowSize
1376 _windowSize = value;
1381 private WindowResizedEventCallbackType _windowResizedEventCallback;
1382 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1383 private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
1384 private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
1387 /// This event is emitted when the window resized.
1389 /// <since_tizen> 3 </since_tizen>
1390 public event EventHandler<ResizedEventArgs> Resized
1394 if (_windowResizedEventHandler == null)
1396 _windowResizedEventCallback = OnResized;
1397 ResizedSignal().Connect(_windowResizedEventCallback);
1400 _windowResizedEventHandler += value;
1404 _windowResizedEventHandler -= value;
1406 if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
1408 ResizedSignal().Disconnect(_windowResizedEventCallback);
1413 private void OnResized(IntPtr windowSize)
1415 ResizedEventArgs e = new ResizedEventArgs();
1416 var val = new Uint16Pair(windowSize, false);
1417 e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1420 if (_windowResizedEventHandler != null)
1422 _windowResizedEventHandler(this, e);
1426 internal void SetWindowSize(Size2D size)
1428 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1429 NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1434 internal Size2D GetWindowSize()
1436 var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
1437 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1443 internal void SetPosition(Position2D position)
1445 var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1446 NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1448 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1451 internal Position2D GetPosition()
1453 var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
1454 Position2D ret = new Position2D(val.GetX(), val.GetY());
1456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1461 /// Sets whether the window is transparent or not.
1463 /// <param name="transparent">Whether the window is transparent.</param>
1464 /// <since_tizen> 5 </since_tizen>
1465 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1466 [EditorBrowsable(EditorBrowsableState.Never)]
1467 public void SetTransparency(bool transparent) {
1468 NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
1469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1473 /// The window size property (read-only).
1475 /// <since_tizen> 3 </since_tizen>
1480 Size2D ret = GetSize();
1486 /// The background color property.
1488 /// <since_tizen> 3 </since_tizen>
1489 public Color BackgroundColor
1493 SetBackgroundColor(value);
1497 Color ret = GetBackgroundColor();
1503 /// The DPI property (read-only).<br />
1504 /// Retrieves the DPI of the display device to which the Window is connected.<br />
1506 /// <since_tizen> 3 </since_tizen>
1516 /// The layer count property (read-only).<br />
1517 /// Queries the number of on-Window layers.<br />
1519 /// <since_tizen> 3 </since_tizen>
1520 public uint LayerCount
1524 return GetLayerCount();
1530 /// Adds a layer to the stage.
1532 /// <param name="layer">Layer to add.</param>
1533 /// <since_tizen> 3 </since_tizen>
1534 public void AddLayer(Layer layer)
1536 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
1537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1541 /// Removes a layer from the stage.
1543 /// <param name="layer">Layer to remove.</param>
1544 /// <since_tizen> 3 </since_tizen>
1545 public void RemoveLayer(Layer layer)
1547 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
1548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1552 /// Please do not use! this will be deprecated
1554 /// <since_tizen> 3 </since_tizen>
1555 [EditorBrowsable(EditorBrowsableState.Never)]
1556 public class WindowFocusChangedEventArgs : EventArgs
1559 /// Please do not use! this will be deprecated
1561 /// <since_tizen> 3 </since_tizen>
1562 public bool FocusGained
1569 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
1570 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1571 private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
1572 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
1575 /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
1577 /// <since_tizen> 3 </since_tizen>
1578 /// Please do not use! this will be deprecated!
1579 /// Instead please use FocusChanged.
1580 [Obsolete("Please do not use! this will be deprecated, instead please use FocusChanged")]
1581 [EditorBrowsable(EditorBrowsableState.Never)]
1582 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
1586 if (_windowFocusChangedEventHandler2 == null)
1588 _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
1589 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
1592 _windowFocusChangedEventHandler2 += value;
1596 _windowFocusChangedEventHandler2 -= value;
1598 if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
1600 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1605 private void OnWindowFocusedChanged2(bool focusGained)
1607 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
1609 e.FocusGained = focusGained;
1611 if (_windowFocusChangedEventHandler2 != null)
1613 _windowFocusChangedEventHandler2(this, e);
1618 /// Gets or sets a size of the window.
1620 /// <since_tizen> 4 </since_tizen>
1621 public Size2D WindowSize
1625 return GetWindowSize();
1629 SetWindowSize(value);
1634 /// Gets or sets a position of the window.
1636 /// <since_tizen> 4 </since_tizen>
1637 public Position2D WindowPosition
1641 return GetPosition();
1650 /// Feed a key-event into the window.
1652 /// <since_tizen> 4 </since_tizen>
1653 public static void FeedKeyEvent(Key keyEvent)
1655 NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
1656 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1660 /// Allows at least one more render, even when paused.
1661 /// The window should be shown, not minimised.
1663 /// <since_tizen> 4 </since_tizen>
1664 public void RenderOnce()
1666 NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
1667 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1671 /// Contains and encapsulates Native Window handle.
1673 /// <since_tizen> 4 </since_tizen>
1674 public class SafeNativeWindowHandle : SafeHandle
1677 /// Contructor, Native window handle is set to handle.
1679 /// <since_tizen> 4 </since_tizen>
1680 public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
1682 SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
1685 /// Null check if the handle is valid or not.
1687 /// <since_tizen> 4 </since_tizen>
1688 public override bool IsInvalid
1692 return this.handle == IntPtr.Zero;
1696 /// Release handle itself.
1698 /// <returns>true when released successfully.</returns>
1699 /// <since_tizen> 4 </since_tizen>
1700 protected override bool ReleaseHandle()