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;
21 using System.Collections.Generic;
26 /// The window class is used internally for drawing.<br />
27 /// The window has an orientation and indicator properties.<br />
29 /// <since_tizen> 3 </since_tizen>
30 public class Window : BaseHandle
32 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33 private global::System.Runtime.InteropServices.HandleRef stageCPtr;
34 private Layer _rootLayer;
35 private string _windowTitle;
37 private List<Layer> _childLayers = new List<Layer>();
38 private List<Layer> LayersChildren
46 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
48 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
49 if (NDalicPINVOKE.Stage_IsInstalled())
51 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
55 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
57 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
61 /// To make the window instance be disposed.
63 /// Please DO NOT use! This will be deprecated!
64 /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
65 /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
66 /// <since_tizen> 3 </since_tizen>
67 [EditorBrowsable(EditorBrowsableState.Never)]
68 protected override void Dispose(DisposeTypes type)
75 if (type == DisposeTypes.Explicit)
78 //Release your own managed resources here.
79 //You should release all of your own disposable objects here.
82 //Release your own unmanaged resources here.
83 //You should not access any managed member here except static instance.
84 //because the execution order of Finalizes is non-deterministic.
86 if (_windowFocusChangedEventCallback != null)
88 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
91 if (_stageTouchCallbackDelegate != null)
93 TouchSignal().Disconnect(_stageTouchCallbackDelegate);
96 if (_stageWheelCallbackDelegate != null)
98 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
101 if (_stageKeyCallbackDelegate != null)
103 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
106 if (_stageEventProcessingFinishedEventCallbackDelegate != null)
108 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
111 if (_stageContextLostEventCallbackDelegate != null)
113 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
116 if (_stageContextRegainedEventCallbackDelegate != null)
118 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
121 if (_stageSceneCreatedEventCallbackDelegate != null)
123 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
126 if (_windowResizedEventCallback != null)
128 ResizedSignal().Disconnect(_windowResizedEventCallback);
131 if (_windowFocusChangedEventCallback2 != null)
133 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
136 if (swigCPtr.Handle != global::System.IntPtr.Zero)
141 NDalicPINVOKE.delete_Window(swigCPtr);
142 NDalicPINVOKE.delete_Stage(stageCPtr);
144 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
150 internal static Window GetCurrent()
152 Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 internal static bool IsInstalled()
159 bool ret = NDalicPINVOKE.Stage_IsInstalled();
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 /// Sets whether the window accepts a focus or not.
167 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
168 /// <since_tizen> 3 </since_tizen>
169 public void SetAcceptFocus(bool accept)
171 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176 /// Returns whether the window accepts a focus or not.
178 /// <returns>True if the window accepts a focus, false otherwise.</returns>
179 /// <since_tizen> 3 </since_tizen>
180 public bool IsFocusAcceptable()
182 bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 /// Shows the window if it is hidden.
191 /// <since_tizen> 3 </since_tizen>
194 NDalicPINVOKE.Show(swigCPtr);
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 /// Hides the window if it is showing.
201 /// <since_tizen> 3 </since_tizen>
204 NDalicPINVOKE.Hide(swigCPtr);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 /// Retrieves whether the window is visible or not.
211 /// <returns>True if the window is visible.</returns>
212 /// <since_tizen> 3 </since_tizen>
213 public bool IsVisible()
215 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 /// Gets the count of supported auxiliary hints of the window.
223 /// <returns>The number of supported auxiliary hints.</returns>
224 /// <since_tizen> 3 </since_tizen>
225 public uint GetSupportedAuxiliaryHintCount()
227 uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 /// Gets the supported auxiliary hint string of the window.
235 /// <param name="index">The index of the supported auxiliary hint lists.</param>
236 /// <returns>The auxiliary hint string of the index.</returns>
237 /// <since_tizen> 3 </since_tizen>
238 public string GetSupportedAuxiliaryHint(uint index)
240 string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 /// Creates an auxiliary hint of the window.
248 /// <param name="hint">The auxiliary hint string.</param>
249 /// <param name="value">The value string.</param>
250 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
251 /// <since_tizen> 3 </since_tizen>
252 public uint AddAuxiliaryHint(string hint, string value)
254 uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 /// Removes an auxiliary hint of the window.
262 /// <param name="id">The ID of the auxiliary hint.</param>
263 /// <returns>True if no error occurred, false otherwise.</returns>
264 /// <since_tizen> 3 </since_tizen>
265 public bool RemoveAuxiliaryHint(uint id)
267 bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 /// Changes a value of the auxiliary hint.
275 /// <param name="id">The auxiliary hint ID.</param>
276 /// <param name="value">The value string to be set.</param>
277 /// <returns>True if no error occurred, false otherwise.</returns>
278 /// <since_tizen> 3 </since_tizen>
279 public bool SetAuxiliaryHintValue(uint id, string value)
281 bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 /// Gets a value of the auxiliary hint.
289 /// <param name="id">The auxiliary hint ID.</param>
290 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
291 /// <since_tizen> 3 </since_tizen>
292 public string GetAuxiliaryHintValue(uint id)
294 string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 /// Gets an ID of the auxiliary hint string.
302 /// <param name="hint">The auxiliary hint string.</param>
303 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
304 /// <since_tizen> 3 </since_tizen>
305 public uint GetAuxiliaryHintId(string hint)
307 uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 /// Sets a region to accept input events.
315 /// <param name="inputRegion">The region to accept input events.</param>
316 /// <since_tizen> 3 </since_tizen>
317 public void SetInputRegion(Rectangle inputRegion)
319 NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 /// Gets or sets a window type.
326 /// <since_tizen> 3 </since_tizen>
327 public WindowType Type
331 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337 NDalicPINVOKE.SetType(swigCPtr, (int)value);
338 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 /// Sets a priority level for the specified notification window.
345 /// <param name="level">The notification window level.</param>
346 /// <returns>True if no error occurred, false otherwise.</returns>
347 /// <since_tizen> 3 </since_tizen>
348 public bool SetNotificationLevel(NotificationLevel level)
350 bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 /// Gets a priority level for the specified notification window.
358 /// <returns>The notification window level.</returns>
359 /// <since_tizen> 3 </since_tizen>
360 public NotificationLevel GetNotificationLevel()
362 NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
368 /// Sets a transparent window's visual state to opaque.
370 /// <param name="opaque">Whether the window's visual state is opaque.</param>
371 /// <since_tizen> 3 </since_tizen>
372 public void SetOpaqueState(bool opaque)
374 NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 /// Returns whether a transparent window's visual state is opaque or not.
381 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
382 /// <since_tizen> 3 </since_tizen>
383 public bool IsOpaqueState()
385 bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391 /// Sets a window's screen off mode.
393 /// <param name="screenOffMode">The screen mode.</param>
394 /// <returns>True if no error occurred, false otherwise.</returns>
395 /// <since_tizen> 4 </since_tizen>
396 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
398 bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode);
399 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 /// Gets the screen mode of the window.
406 /// <returns>The screen off mode.</returns>
407 /// <since_tizen> 4 </since_tizen>
408 public ScreenOffMode GetScreenOffMode()
410 ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr);
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
416 /// Sets preferred brightness of the window.
418 /// <param name="brightness">The preferred brightness (0 to 100).</param>
419 /// <returns>True if no error occurred, false otherwise.</returns>
420 /// <since_tizen> 3 </since_tizen>
421 public bool SetBrightness(int brightness)
423 bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 /// Gets the preferred brightness of the window.
431 /// <returns>The preferred brightness.</returns>
432 /// <since_tizen> 3 </since_tizen>
433 public int GetBrightness()
435 int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
436 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
441 /// The focus changed event argument.
443 /// <since_tizen> 3 </since_tizen>
444 public class FocusChangedEventArgs : EventArgs
447 /// FocusGained flag.
449 /// <since_tizen> 3 </since_tizen>
450 public bool FocusGained
457 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
458 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
459 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
460 private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
463 /// FocusChanged event.
465 /// <since_tizen> 3 </since_tizen>
466 public event EventHandler<FocusChangedEventArgs> FocusChanged
470 if (_windowFocusChangedEventHandler == null)
472 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
473 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
476 _windowFocusChangedEventHandler += value;
480 _windowFocusChangedEventHandler -= value;
482 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
484 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
489 private void OnWindowFocusedChanged(bool focusGained)
491 FocusChangedEventArgs e = new FocusChangedEventArgs();
493 e.FocusGained = focusGained;
495 if (_windowFocusChangedEventHandler != null)
497 _windowFocusChangedEventHandler(this, e);
502 /// Gets/Sets a window title.
504 /// <since_tizen> 4 </since_tizen>
513 _windowTitle = value;
514 SetClass(_windowTitle, "");
518 internal WindowFocusSignalType WindowFocusChangedSignal()
520 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
521 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525 internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
527 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530 internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535 internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540 internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
542 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
547 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
551 internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
553 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557 internal void RotateIndicator(Window.WindowOrientation orientation)
559 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
560 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564 /// Sets the window name and the class string.
566 /// <param name="name">The name of the window.</param>
567 /// <param name="klass">The class of the window.</param>
568 /// <since_tizen> 4 </since_tizen>
569 public void SetClass(string name, string klass)
571 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576 /// Raises the window to the top of the window stack.
578 /// <since_tizen> 3 </since_tizen>
581 NDalicPINVOKE.Window_Raise(swigCPtr);
582 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 /// Lowers the window to the bottom of the window stack.
588 /// <since_tizen> 3 </since_tizen>
591 NDalicPINVOKE.Window_Lower(swigCPtr);
592 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596 /// Activates the window to the top of the window stack even it is iconified.
598 /// <since_tizen> 3 </since_tizen>
599 public void Activate()
601 NDalicPINVOKE.Window_Activate(swigCPtr);
602 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
607 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
608 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
611 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
613 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
619 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
620 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 internal Window.WindowOrientation GetPreferredOrientation()
625 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
626 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 internal DragAndDropDetector GetDragAndDropDetector()
632 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
633 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
637 internal Any GetNativeHandle()
639 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
640 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
644 internal WindowFocusSignalType FocusChangedSignal()
646 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
647 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 /// Gets the default ( root ) layer.
654 /// <returns>The root layer.</returns>
655 /// <since_tizen> 3 </since_tizen>
656 public Layer GetDefaultLayer()
658 return this.GetRootLayer();
661 internal void Add(Layer layer)
663 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666 LayersChildren.Add(layer);
669 internal void Remove(Layer layer)
671 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
672 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
674 LayersChildren.Remove(layer);
678 /// Add a child view to window.
680 /// <param name="view">the child should be added to the window.</param>
681 /// <since_tizen> 3 </since_tizen>
682 public void Add(View view)
684 GetRootLayer()?.Add(view);
688 /// Remove a child view from window.
690 /// <param name="view">the child to be removed.</param>
691 /// <since_tizen> 3 </since_tizen>
692 public void Remove(View view)
694 GetRootLayer()?.Remove(view);
697 internal Vector2 GetSize()
699 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
700 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704 internal RenderTaskList GetRenderTaskList()
706 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
707 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
712 /// Queries the number of on-window layers.
714 /// <returns>The number of layers.</returns>
715 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
716 internal uint GetLayerCount()
718 if (LayersChildren == null || LayersChildren.Count < 0)
721 return (uint) LayersChildren.Count;
725 /// Retrieves the layer at a specified depth.
727 /// <param name="depth">The layer's depth index.</param>
728 /// <returns>The layer found at the given depth.</returns>
729 /// <since_tizen> 3 </since_tizen>
730 public Layer GetLayer(uint depth)
732 IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
733 Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
735 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
739 internal Layer GetRootLayer()
741 // Window.IsInstalled() is actually true only when called from event thread and
742 // Core has been initialized, not when Stage is ready.
743 if (_rootLayer == null && Window.IsInstalled())
745 _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
746 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
747 LayersChildren.Add(_rootLayer);
752 internal void SetBackgroundColor(Vector4 color)
754 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
755 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758 internal Vector4 GetBackgroundColor()
760 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
761 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
765 internal Vector2 GetDpi()
767 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
768 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
772 internal ObjectRegistry GetObjectRegistry()
774 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
775 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
780 /// Keep rendering for at least the given amount of time.
782 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
783 /// <since_tizen> 3 </since_tizen>
784 public void KeepRendering(float durationSeconds)
786 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
787 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
790 internal KeyEventSignal KeyEventSignal()
792 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
793 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
797 internal VoidSignal EventProcessingFinishedSignal()
799 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
800 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
804 internal TouchSignal TouchSignal()
806 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
807 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
811 private StageWheelSignal WheelEventSignal()
813 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
814 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
818 internal VoidSignal ContextLostSignal()
820 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
821 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
825 internal VoidSignal ContextRegainedSignal()
827 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
828 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
832 internal VoidSignal SceneCreatedSignal()
834 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
835 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
839 internal ResizedSignal ResizedSignal()
841 ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
842 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846 internal static Vector4 DEFAULT_BACKGROUND_COLOR
850 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
851 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
852 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
857 internal static Vector4 DEBUG_BACKGROUND_COLOR
861 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
862 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
863 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
868 private static readonly Window instance = Application.Instance.GetWindow();
871 /// The stage instance property (read-only).<br />
872 /// Gets the current window.<br />
874 /// <since_tizen> 3 </since_tizen>
875 public static Window Instance
884 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
885 /// This function can be used for following example scenarios: <br />
886 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
888 /// <param name="DaliKey">The key code to grab.</param>
889 /// <returns>True if the grab succeeds.</returns>
890 /// <since_tizen> 3 </since_tizen>
891 public bool GrabKeyTopmost(int DaliKey)
893 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
894 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
899 /// Ungrabs the key specified by a key for the window.<br />
900 /// 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 />
902 /// <param name="DaliKey">The key code to ungrab.</param>
903 /// <returns>True if the ungrab succeeds.</returns>
904 /// <since_tizen> 3 </since_tizen>
905 public bool UngrabKeyTopmost(int DaliKey)
907 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
908 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
913 /// Grabs the key specified by a key for a window in a GrabMode. <br />
914 /// Details: This function can be used for following example scenarios: <br />
915 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
916 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
917 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
919 /// <param name="DaliKey">The key code to grab.</param>
920 /// <param name="GrabMode">The grab mode for the key.</param>
921 /// <returns>True if the grab succeeds.</returns>
922 /// <since_tizen> 3 </since_tizen>
923 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
925 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
926 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
931 /// Ungrabs the key specified by a key for a window.<br />
932 /// 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 />
934 /// <param name="DaliKey">The key code to ungrab.</param>
935 /// <returns>True if the ungrab succeeds.</returns>
936 /// <since_tizen> 3 </since_tizen>
937 public bool UngrabKey(int DaliKey)
939 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
940 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
944 internal System.IntPtr GetNativeWindowHandler()
946 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
952 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
954 /// <since_tizen> 3 </since_tizen>
955 public enum WindowOrientation
958 /// Portrait orientation. The height of the display area is greater than the width.
960 /// <since_tizen> 3 </since_tizen>
963 /// Landscape orientation. A wide view area is needed.
965 /// <since_tizen> 3 </since_tizen>
968 /// Portrait inverse orientation.
970 /// <since_tizen> 3 </since_tizen>
971 PortraitInverse = 180,
973 /// Landscape inverse orientation.
975 /// <since_tizen> 3 </since_tizen>
976 LandscapeInverse = 270
980 /// Enumeration for the key grab mode for platform-level APIs.
982 /// <since_tizen> 3 </since_tizen>
983 public enum KeyGrabMode
986 /// Grabs a key only when on the top of the grabbing-window stack mode.
990 /// Grabs a key together with the other client window(s) mode.
994 /// 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.
998 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
1004 /// Enumeration for opacity of the indicator.
1006 internal enum IndicatorBackgroundOpacity
1014 /// Enumeration for visible mode of the indicator.
1016 internal enum IndicatorVisibleMode
1024 /// The touch event argument.
1026 /// <since_tizen> 3 </since_tizen>
1027 public class TouchEventArgs : EventArgs
1029 private Touch _touch;
1034 /// <since_tizen> 3 </since_tizen>
1048 private event EventHandler<TouchEventArgs> _stageTouchHandler;
1049 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
1052 /// This event is emitted when the screen is touched and when the touch ends.<br />
1053 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
1054 /// then when the last finger is lifted.<br />
1055 /// An interrupted event will also be emitted (if it occurs).<br />
1057 /// <since_tizen> 3 </since_tizen>
1058 public event EventHandler<TouchEventArgs> TouchEvent
1064 _stageTouchHandler += value;
1065 _stageTouchCallbackDelegate = OnStageTouch;
1066 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
1073 if (_stageTouchHandler != null)
1075 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
1077 _stageTouchHandler -= value;
1082 private void OnStageTouch(IntPtr data)
1084 TouchEventArgs e = new TouchEventArgs();
1088 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
1091 if (_stageTouchHandler != null)
1093 _stageTouchHandler(this, e);
1098 /// Wheel event arguments.
1100 /// <since_tizen> 3 </since_tizen>
1101 public class WheelEventArgs : EventArgs
1103 private Wheel _wheel;
1108 /// <since_tizen> 3 </since_tizen>
1122 private event EventHandler<WheelEventArgs> _stageWheelHandler;
1123 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
1126 /// This event is emitted when the wheel event is received.
1128 /// <since_tizen> 3 </since_tizen>
1129 public event EventHandler<WheelEventArgs> WheelEvent
1133 if (_stageWheelHandler == null)
1135 _stageWheelCallbackDelegate = OnStageWheel;
1136 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
1138 _stageWheelHandler += value;
1142 _stageWheelHandler -= value;
1143 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
1145 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
1150 private void OnStageWheel(IntPtr data)
1152 WheelEventArgs e = new WheelEventArgs();
1156 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1159 if (_stageWheelHandler != null)
1161 _stageWheelHandler(this, e);
1166 /// Key event arguments.
1168 /// <since_tizen> 3 </since_tizen>
1169 public class KeyEventArgs : EventArgs
1176 /// <since_tizen> 3 </since_tizen>
1190 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1191 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1194 /// This event is emitted when the key event is received.
1196 /// <since_tizen> 3 </since_tizen>
1197 public event EventHandler<KeyEventArgs> KeyEvent
1201 if (_stageKeyHandler == null)
1203 _stageKeyCallbackDelegate = OnStageKey;
1204 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1206 _stageKeyHandler += value;
1210 _stageKeyHandler -= value;
1211 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1213 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1218 // Callback for Stage KeyEventsignal
1219 private void OnStageKey(IntPtr data)
1221 KeyEventArgs e = new KeyEventArgs();
1225 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1228 if (_stageKeyHandler != null)
1230 //here we send all data to user event handlers
1231 _stageKeyHandler(this, e);
1236 private event EventHandler _stageEventProcessingFinishedEventHandler;
1237 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1239 internal event EventHandler EventProcessingFinished
1243 if (_stageEventProcessingFinishedEventHandler == null)
1245 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1246 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1248 _stageEventProcessingFinishedEventHandler += value;
1253 _stageEventProcessingFinishedEventHandler -= value;
1254 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1256 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1261 // Callback for Stage EventProcessingFinishedSignal
1262 private void OnEventProcessingFinished()
1264 if (_stageEventProcessingFinishedEventHandler != null)
1266 _stageEventProcessingFinishedEventHandler(this, null);
1271 private EventHandler _stageContextLostEventHandler;
1272 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1274 internal event EventHandler ContextLost
1278 if (_stageContextLostEventHandler == null)
1280 _stageContextLostEventCallbackDelegate = OnContextLost;
1281 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1283 _stageContextLostEventHandler += value;
1287 _stageContextLostEventHandler -= value;
1288 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1290 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1295 // Callback for Stage ContextLostSignal
1296 private void OnContextLost()
1298 if (_stageContextLostEventHandler != null)
1300 _stageContextLostEventHandler(this, null);
1305 private EventHandler _stageContextRegainedEventHandler;
1306 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1308 internal event EventHandler ContextRegained
1312 if (_stageContextRegainedEventHandler == null)
1314 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1315 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1317 _stageContextRegainedEventHandler += value;
1321 _stageContextRegainedEventHandler -= value;
1322 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1324 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1329 // Callback for Stage ContextRegainedSignal
1330 private void OnContextRegained()
1332 if (_stageContextRegainedEventHandler != null)
1334 _stageContextRegainedEventHandler(this, null);
1339 private EventHandler _stageSceneCreatedEventHandler;
1340 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1342 internal event EventHandler SceneCreated
1346 if (_stageSceneCreatedEventHandler == null)
1348 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1349 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1351 _stageSceneCreatedEventHandler += value;
1355 _stageSceneCreatedEventHandler -= value;
1356 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1358 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1363 // Callback for Stage SceneCreatedSignal
1364 private void OnSceneCreated()
1366 if (_stageSceneCreatedEventHandler != null)
1368 _stageSceneCreatedEventHandler(this, null);
1373 /// This resized event arguments.
1375 /// <since_tizen> 3 </since_tizen>
1376 public class ResizedEventArgs : EventArgs
1381 /// This window size.
1383 /// <since_tizen> 4 </since_tizen>
1384 public Size2D WindowSize
1392 _windowSize = value;
1397 private WindowResizedEventCallbackType _windowResizedEventCallback;
1398 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1399 private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
1400 private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
1403 /// This event is emitted when the window resized.
1405 /// <since_tizen> 3 </since_tizen>
1406 public event EventHandler<ResizedEventArgs> Resized
1410 if (_windowResizedEventHandler == null)
1412 _windowResizedEventCallback = OnResized;
1413 ResizedSignal().Connect(_windowResizedEventCallback);
1416 _windowResizedEventHandler += value;
1420 _windowResizedEventHandler -= value;
1422 if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
1424 ResizedSignal().Disconnect(_windowResizedEventCallback);
1429 private void OnResized(IntPtr windowSize)
1431 ResizedEventArgs e = new ResizedEventArgs();
1432 var val = new Uint16Pair(windowSize, false);
1433 e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1436 if (_windowResizedEventHandler != null)
1438 _windowResizedEventHandler(this, e);
1442 internal void SetWindowSize(Size2D size)
1444 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1445 NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1447 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1450 internal Size2D GetWindowSize()
1452 var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
1453 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1459 internal void SetPosition(Position2D position)
1461 var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1462 NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1464 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1467 internal Position2D GetPosition()
1469 var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
1470 Position2D ret = new Position2D(val.GetX(), val.GetY());
1472 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1477 /// The window size property (read-only).
1479 /// <since_tizen> 3 </since_tizen>
1484 Size2D ret = GetSize();
1490 /// The background color property.
1492 /// <since_tizen> 3 </since_tizen>
1493 public Color BackgroundColor
1497 SetBackgroundColor(value);
1501 Color ret = GetBackgroundColor();
1507 /// The DPI property (read-only).<br />
1508 /// Retrieves the DPI of the display device to which the Window is connected.<br />
1510 /// <since_tizen> 3 </since_tizen>
1520 /// The layer count property (read-only).<br />
1521 /// Queries the number of on-Window layers.<br />
1523 /// <since_tizen> 3 </since_tizen>
1524 public uint LayerCount
1528 return GetLayerCount();
1534 /// Adds a layer to the stage.
1536 /// <param name="layer">Layer to add.</param>
1537 /// <since_tizen> 3 </since_tizen>
1538 public void AddLayer(Layer layer)
1540 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
1541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1543 LayersChildren.Add(layer);
1547 /// Removes a layer from the stage.
1549 /// <param name="layer">Layer to remove.</param>
1550 /// <since_tizen> 3 </since_tizen>
1551 public void RemoveLayer(Layer layer)
1553 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
1554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1556 LayersChildren.Remove(layer);
1560 /// Please do not use! this will be deprecated
1562 /// <since_tizen> 3 </since_tizen>
1563 [EditorBrowsable(EditorBrowsableState.Never)]
1564 public class WindowFocusChangedEventArgs : EventArgs
1567 /// Please do not use! this will be deprecated
1569 /// <since_tizen> 3 </since_tizen>
1570 public bool FocusGained
1577 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
1578 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1579 private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
1580 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
1583 /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
1585 /// <since_tizen> 3 </since_tizen>
1586 /// Please do not use! this will be deprecated!
1587 /// Instead please use FocusChanged.
1588 [Obsolete("Please do not use! this will be deprecated, instead please use FocusChanged")]
1589 [EditorBrowsable(EditorBrowsableState.Never)]
1590 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
1594 if (_windowFocusChangedEventHandler2 == null)
1596 _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
1597 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
1600 _windowFocusChangedEventHandler2 += value;
1604 _windowFocusChangedEventHandler2 -= value;
1606 if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
1608 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1613 private void OnWindowFocusedChanged2(bool focusGained)
1615 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
1617 e.FocusGained = focusGained;
1619 if (_windowFocusChangedEventHandler2 != null)
1621 _windowFocusChangedEventHandler2(this, e);
1626 /// Gets or sets a size of the window.
1628 /// <since_tizen> 4 </since_tizen>
1629 public Size2D WindowSize
1633 return GetWindowSize();
1637 SetWindowSize(value);
1642 /// Gets or sets a position of the window.
1644 /// <since_tizen> 4 </since_tizen>
1645 public Position2D WindowPosition
1649 return GetPosition();
1658 /// Feed a key-event into the window.
1660 /// <since_tizen> 4 </since_tizen>
1661 public static void FeedKeyEvent(Key keyEvent)
1663 NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
1664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1668 /// Allows at least one more render, even when paused.
1669 /// The window should be shown, not minimised.
1671 /// <since_tizen> 4 </since_tizen>
1672 public void RenderOnce()
1674 NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
1675 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1679 /// Contains and encapsulates Native Window handle.
1681 /// <since_tizen> 4 </since_tizen>
1682 public class SafeNativeWindowHandle : SafeHandle
1685 /// Contructor, Native window handle is set to handle.
1687 /// <since_tizen> 4 </since_tizen>
1688 public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
1690 SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
1693 /// Null check if the handle is valid or not.
1695 /// <since_tizen> 4 </since_tizen>
1696 public override bool IsInvalid
1700 return this.handle == IntPtr.Zero;
1704 /// Release handle itself.
1706 /// <returns>true when released successfully.</returns>
1707 /// <since_tizen> 4 </since_tizen>
1708 protected override bool ReleaseHandle()