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 public class Window : BaseHandle
30 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31 private global::System.Runtime.InteropServices.HandleRef stageCPtr;
32 private Layer _rootLayer;
33 private string _windowTitle;
35 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
38 if (NDalicPINVOKE.Stage_IsInstalled())
40 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
44 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
46 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 /// To make the window instance be disposed.
52 /// Please DO NOT use! This will be deprecated!
53 /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
54 /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 protected override void Dispose(DisposeTypes type)
63 if (type == DisposeTypes.Explicit)
66 //Release your own managed resources here.
67 //You should release all of your own disposable objects here.
70 //Release your own unmanaged resources here.
71 //You should not access any managed member here except static instance.
72 //because the execution order of Finalizes is non-deterministic.
74 if (_windowFocusChangedEventCallback != null)
76 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
79 if (_stageTouchCallbackDelegate != null)
81 TouchSignal().Disconnect(_stageTouchCallbackDelegate);
84 if (_stageWheelCallbackDelegate != null)
86 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
89 if (_stageKeyCallbackDelegate != null)
91 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
94 if (_stageEventProcessingFinishedEventCallbackDelegate != null)
96 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
99 if (_stageContextLostEventCallbackDelegate != null)
101 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
104 if (_stageContextRegainedEventCallbackDelegate != null)
106 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
109 if (_stageSceneCreatedEventCallbackDelegate != null)
111 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
114 if (_windowResizedEventCallback != null)
116 ResizedSignal().Disconnect(_windowResizedEventCallback);
119 if (_windowFocusChangedEventCallback2 != null)
121 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
124 if (swigCPtr.Handle != global::System.IntPtr.Zero)
129 NDalicPINVOKE.delete_Window(swigCPtr);
130 NDalicPINVOKE.delete_Stage(stageCPtr);
132 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
138 internal static Window GetCurrent()
140 Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 internal static bool IsInstalled()
147 bool ret = NDalicPINVOKE.Stage_IsInstalled();
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 /// Sets whether the window accepts a focus or not.
155 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
156 /// <since_tizen> 3 </since_tizen>
157 public void SetAcceptFocus(bool accept)
159 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 /// Returns whether the window accepts a focus or not.
166 /// <returns>True if the window accepts a focus, false otherwise.</returns>
167 /// <since_tizen> 3 </since_tizen>
168 public bool IsFocusAcceptable()
170 bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 /// Shows the window if it is hidden.
179 /// <since_tizen> 3 </since_tizen>
182 NDalicPINVOKE.Show(swigCPtr);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 /// Hides the window if it is showing.
189 /// <since_tizen> 3 </since_tizen>
192 NDalicPINVOKE.Hide(swigCPtr);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 /// Retrieves whether the window is visible or not.
199 /// <returns>True if the window is visible.</returns>
200 /// <since_tizen> 3 </since_tizen>
201 public bool IsVisible()
203 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 /// Gets the count of supported auxiliary hints of the window.
211 /// <returns>The number of supported auxiliary hints.</returns>
212 /// <since_tizen> 3 </since_tizen>
213 public uint GetSupportedAuxiliaryHintCount()
215 uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 /// Gets the supported auxiliary hint string of the window.
223 /// <param name="index">The index of the supported auxiliary hint lists.</param>
224 /// <returns>The auxiliary hint string of the index.</returns>
225 /// <since_tizen> 3 </since_tizen>
226 public string GetSupportedAuxiliaryHint(uint index)
228 string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 /// Creates an auxiliary hint of the window.
236 /// <param name="hint">The auxiliary hint string.</param>
237 /// <param name="value">The value string.</param>
238 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
239 /// <since_tizen> 3 </since_tizen>
240 public uint AddAuxiliaryHint(string hint, string value)
242 uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 /// Removes an auxiliary hint of the window.
250 /// <param name="id">The ID of the auxiliary hint.</param>
251 /// <returns>True if no error occurred, false otherwise.</returns>
252 /// <since_tizen> 3 </since_tizen>
253 public bool RemoveAuxiliaryHint(uint id)
255 bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 /// Changes a value of the auxiliary hint.
263 /// <param name="id">The auxiliary hint ID.</param>
264 /// <param name="value">The value string to be set.</param>
265 /// <returns>True if no error occurred, false otherwise.</returns>
266 /// <since_tizen> 3 </since_tizen>
267 public bool SetAuxiliaryHintValue(uint id, string value)
269 bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
270 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 /// Gets a value of the auxiliary hint.
277 /// <param name="id">The auxiliary hint ID.</param>
278 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
279 /// <since_tizen> 3 </since_tizen>
280 public string GetAuxiliaryHintValue(uint id)
282 string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 /// Gets an ID of the auxiliary hint string.
290 /// <param name="hint">The auxiliary hint string.</param>
291 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
292 /// <since_tizen> 3 </since_tizen>
293 public uint GetAuxiliaryHintId(string hint)
295 uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 /// Sets a region to accept input events.
303 /// <param name="inputRegion">The region to accept input events.</param>
304 /// <since_tizen> 3 </since_tizen>
305 public void SetInputRegion(Rectangle inputRegion)
307 NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312 /// Gets or sets a window type.
314 /// <since_tizen> 3 </since_tizen>
315 public WindowType Type
319 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325 NDalicPINVOKE.SetType(swigCPtr, (int)value);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331 /// Sets a priority level for the specified notification window.
333 /// <param name="level">The notification window level.</param>
334 /// <returns>True if no error occurred, false otherwise.</returns>
335 /// <since_tizen> 3 </since_tizen>
336 public bool SetNotificationLevel(NotificationLevel level)
338 bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344 /// Gets a priority level for the specified notification window.
346 /// <returns>The notification window level.</returns>
347 /// <since_tizen> 3 </since_tizen>
348 public NotificationLevel GetNotificationLevel()
350 NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 /// Sets a transparent window's visual state to opaque.
358 /// <param name="opaque">Whether the window's visual state is opaque.</param>
359 /// <since_tizen> 3 </since_tizen>
360 public void SetOpaqueState(bool opaque)
362 NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367 /// Returns whether a transparent window's visual state is opaque or not.
369 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
370 /// <since_tizen> 3 </since_tizen>
371 public bool IsOpaqueState()
373 bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
374 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 /// Sets a window's screen off mode.
381 /// <param name="screenOffMode">The screen mode.</param>
382 /// <returns>True if no error occurred, false otherwise.</returns>
383 /// <since_tizen> 3 </since_tizen>
384 public bool SetScreenOffMode(ScreenOffMode screenOffMode)
386 bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode);
387 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 /// Gets the screen mode of the window.
394 /// <returns>The screen off mode.</returns>
395 /// <since_tizen> 3 </since_tizen>
396 public ScreenOffMode GetScreenOffMode()
398 ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr);
399 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 /// Sets preferred brightness of the window.
406 /// <param name="brightness">The preferred brightness (0 to 100).</param>
407 /// <returns>True if no error occurred, false otherwise.</returns>
408 /// <since_tizen> 3 </since_tizen>
409 public bool SetBrightness(int brightness)
411 bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
412 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417 /// Gets the preferred brightness of the window.
419 /// <returns>The preferred brightness.</returns>
420 /// <since_tizen> 3 </since_tizen>
421 public int GetBrightness()
423 int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 /// The focus changed event argument.
431 public class FocusChangedEventArgs : EventArgs
434 /// FocusGained flag.
436 /// <since_tizen> 3 </since_tizen>
437 public bool FocusGained
444 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
445 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
446 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
447 private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
450 /// FocusChanged event.
452 /// <since_tizen> 4 </since_tizen>
453 public event EventHandler<FocusChangedEventArgs> FocusChanged
457 if (_windowFocusChangedEventHandler == null)
459 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
460 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
463 _windowFocusChangedEventHandler += value;
467 _windowFocusChangedEventHandler -= value;
469 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
471 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
476 private void OnWindowFocusedChanged(bool focusGained)
478 FocusChangedEventArgs e = new FocusChangedEventArgs();
480 e.FocusGained = focusGained;
482 if (_windowFocusChangedEventHandler != null)
484 _windowFocusChangedEventHandler(this, e);
489 /// Gets/Sets a window title.
491 /// <since_tizen> 4 </since_tizen>
500 _windowTitle = value;
501 SetClass(_windowTitle, "");
505 internal WindowFocusSignalType WindowFocusChangedSignal()
507 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
512 internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517 internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522 internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
532 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
534 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
535 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538 internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
540 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
544 internal void RotateIndicator(Window.WindowOrientation orientation)
546 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
547 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
551 /// Sets the window name and the class string.
553 /// <param name="name">The name of the window.</param>
554 /// <param name="klass">The class of the window.</param>
555 /// <since_tizen> 4 </since_tizen>
556 public void SetClass(string name, string klass)
558 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
559 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
563 /// Raises the window to the top of the window stack.
565 /// <since_tizen> 3 </since_tizen>
568 NDalicPINVOKE.Window_Raise(swigCPtr);
569 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
573 /// Lowers the window to the bottom of the window stack.
575 /// <since_tizen> 3 </since_tizen>
578 NDalicPINVOKE.Window_Lower(swigCPtr);
579 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583 /// Activates the window to the top of the window stack even it is iconified.
585 /// <since_tizen> 3 </since_tizen>
586 public void Activate()
588 NDalicPINVOKE.Window_Activate(swigCPtr);
589 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
594 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
595 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
600 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
606 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610 internal Window.WindowOrientation GetPreferredOrientation()
612 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
613 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617 internal DragAndDropDetector GetDragAndDropDetector()
619 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
620 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
624 internal Any GetNativeHandle()
626 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
627 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
631 internal WindowFocusSignalType FocusChangedSignal()
633 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
634 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
639 /// Gets the default ( root ) layer.
641 /// <returns>The root layer.</returns>
642 /// <since_tizen> 3 </since_tizen>
643 public Layer GetDefaultLayer()
645 return this.GetRootLayer();
648 internal void Add(Layer layer)
650 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654 internal void Remove(Layer layer)
656 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
657 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661 /// Add a child view to window.
663 /// <param name="view">the child should be added to the window.</param>
664 /// <since_tizen> 3 </since_tizen>
665 public void Add(View view)
667 GetRootLayer()?.Add(view);
671 /// Remove a child view from window.
673 /// <param name="view">the child to be removed.</param>
674 /// <since_tizen> 3 </since_tizen>
675 public void Remove(View view)
677 GetRootLayer()?.Remove(view);
680 internal Vector2 GetSize()
682 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
683 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
687 internal RenderTaskList GetRenderTaskList()
689 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
690 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
695 /// Queries the number of on-window layers.
697 /// <returns>The number of layers.</returns>
698 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
699 internal uint GetLayerCount()
701 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
702 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
707 /// Retrieves the layer at a specified depth.
709 /// <param name="depth">The layer's depth index.</param>
710 /// <returns>The layer found at the given depth.</returns>
711 /// <since_tizen> 3 </since_tizen>
712 public Layer GetLayer(uint depth)
714 IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
715 Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
717 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
721 internal Layer GetRootLayer()
723 // Window.IsInstalled() is actually true only when called from event thread and
724 // Core has been initialized, not when Stage is ready.
725 if (_rootLayer == null && Window.IsInstalled())
727 _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
728 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
733 internal void SetBackgroundColor(Vector4 color)
735 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
739 internal Vector4 GetBackgroundColor()
741 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 internal Vector2 GetDpi()
748 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
749 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
753 internal ObjectRegistry GetObjectRegistry()
755 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
756 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
761 /// Keep rendering for at least the given amount of time.
763 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
764 /// <since_tizen> 3 </since_tizen>
765 public void KeepRendering(float durationSeconds)
767 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
768 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
771 internal KeyEventSignal KeyEventSignal()
773 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
778 internal VoidSignal EventProcessingFinishedSignal()
780 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
781 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785 internal TouchSignal TouchSignal()
787 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
792 private StageWheelSignal WheelEventSignal()
794 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
795 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
799 internal VoidSignal ContextLostSignal()
801 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
802 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806 internal VoidSignal ContextRegainedSignal()
808 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
809 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
813 internal VoidSignal SceneCreatedSignal()
815 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
816 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
820 internal ResizedSignal ResizedSignal()
822 ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
823 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
827 internal static Vector4 DEFAULT_BACKGROUND_COLOR
831 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
832 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
833 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
838 internal static Vector4 DEBUG_BACKGROUND_COLOR
842 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
843 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
844 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
849 private static readonly Window instance = Application.Instance.GetWindow();
852 /// The stage instance property (read-only).<br />
853 /// Gets the current window.<br />
855 /// <since_tizen> 3 </since_tizen>
856 public static Window Instance
865 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
866 /// This function can be used for following example scenarios: <br />
867 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
869 /// <param name="DaliKey">The key code to grab.</param>
870 /// <returns>True if the grab succeeds.</returns>
871 /// <since_tizen> 3 </since_tizen>
872 public bool GrabKeyTopmost(int DaliKey)
874 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
875 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
880 /// Ungrabs the key specified by a key for the window.<br />
881 /// 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 />
883 /// <param name="DaliKey">The key code to ungrab.</param>
884 /// <returns>True if the ungrab succeeds.</returns>
885 /// <since_tizen> 3 </since_tizen>
886 public bool UngrabKeyTopmost(int DaliKey)
888 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
889 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
894 /// Grabs the key specified by a key for a window in a GrabMode. <br />
895 /// Details: This function can be used for following example scenarios: <br />
896 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
897 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
898 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
900 /// <param name="DaliKey">The key code to grab.</param>
901 /// <param name="GrabMode">The grab mode for the key.</param>
902 /// <returns>True if the grab succeeds.</returns>
903 /// <since_tizen> 3 </since_tizen>
904 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
906 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
907 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
912 /// Ungrabs the key specified by a key for a window.<br />
913 /// 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 />
915 /// <param name="DaliKey">The key code to ungrab.</param>
916 /// <returns>True if the ungrab succeeds.</returns>
917 /// <since_tizen> 3 </since_tizen>
918 public bool UngrabKey(int DaliKey)
920 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
921 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
925 internal System.IntPtr GetNativeWindowHandler()
927 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
928 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
933 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
935 /// <since_tizen> 3 </since_tizen>
936 public enum WindowOrientation
939 /// Portrait orientation. The height of the display area is greater than the width.
941 /// <since_tizen> 3 </since_tizen>
944 /// Landscape orientation. A wide view area is needed.
946 /// <since_tizen> 3 </since_tizen>
949 /// Portrait inverse orientation.
951 /// <since_tizen> 3 </since_tizen>
952 PortraitInverse = 180,
954 /// Landscape inverse orientation.
956 /// <since_tizen> 3 </since_tizen>
957 LandscapeInverse = 270
961 /// Enumeration for the key grab mode for platform-level APIs.
963 /// <since_tizen> 3 </since_tizen>
964 public enum KeyGrabMode
967 /// Grabs a key only when on the top of the grabbing-window stack mode.
971 /// Grabs a key together with the other client window(s) mode.
975 /// 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.
979 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
985 /// Enumeration for opacity of the indicator.
987 internal enum IndicatorBackgroundOpacity
995 /// Enumeration for visible mode of the indicator.
997 internal enum IndicatorVisibleMode
1005 /// The touch event argument.
1007 public class TouchEventArgs : EventArgs
1009 private Touch _touch;
1014 /// <since_tizen> 3 </since_tizen>
1028 private event EventHandler<TouchEventArgs> _stageTouchHandler;
1029 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
1032 /// This event is emitted when the screen is touched and when the touch ends.<br />
1033 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
1034 /// then when the last finger is lifted.<br />
1035 /// An interrupted event will also be emitted (if it occurs).<br />
1037 /// <since_tizen> 4 </since_tizen>
1038 public event EventHandler<TouchEventArgs> TouchEvent
1044 _stageTouchHandler += value;
1045 _stageTouchCallbackDelegate = OnStageTouch;
1046 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
1053 if (_stageTouchHandler != null)
1055 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
1057 _stageTouchHandler -= value;
1062 private void OnStageTouch(IntPtr data)
1064 TouchEventArgs e = new TouchEventArgs();
1068 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
1071 if (_stageTouchHandler != null)
1073 _stageTouchHandler(this, e);
1078 /// Wheel event arguments.
1080 public class WheelEventArgs : EventArgs
1082 private Wheel _wheel;
1087 /// <since_tizen> 3 </since_tizen>
1101 private event EventHandler<WheelEventArgs> _stageWheelHandler;
1102 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
1105 /// This event is emitted when the wheel event is received.
1107 /// <since_tizen> 4 </since_tizen>
1108 public event EventHandler<WheelEventArgs> WheelEvent
1112 if (_stageWheelHandler == null)
1114 _stageWheelCallbackDelegate = OnStageWheel;
1115 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
1117 _stageWheelHandler += value;
1121 _stageWheelHandler -= value;
1122 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
1124 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
1129 private void OnStageWheel(IntPtr data)
1131 WheelEventArgs e = new WheelEventArgs();
1135 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1138 if (_stageWheelHandler != null)
1140 _stageWheelHandler(this, e);
1145 /// Key event arguments.
1147 public class KeyEventArgs : EventArgs
1154 /// <since_tizen> 3 </since_tizen>
1168 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1169 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1172 /// This event is emitted when the key event is received.
1174 /// <since_tizen> 4 </since_tizen>
1175 public event EventHandler<KeyEventArgs> KeyEvent
1179 if (_stageKeyHandler == null)
1181 _stageKeyCallbackDelegate = OnStageKey;
1182 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1184 _stageKeyHandler += value;
1188 _stageKeyHandler -= value;
1189 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1191 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1196 // Callback for Stage KeyEventsignal
1197 private void OnStageKey(IntPtr data)
1199 KeyEventArgs e = new KeyEventArgs();
1203 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1206 if (_stageKeyHandler != null)
1208 //here we send all data to user event handlers
1209 _stageKeyHandler(this, e);
1214 private event EventHandler _stageEventProcessingFinishedEventHandler;
1215 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1217 internal event EventHandler EventProcessingFinished
1221 if (_stageEventProcessingFinishedEventHandler == null)
1223 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1224 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1226 _stageEventProcessingFinishedEventHandler += value;
1231 _stageEventProcessingFinishedEventHandler -= value;
1232 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1234 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1239 // Callback for Stage EventProcessingFinishedSignal
1240 private void OnEventProcessingFinished()
1242 if (_stageEventProcessingFinishedEventHandler != null)
1244 _stageEventProcessingFinishedEventHandler(this, null);
1249 private EventHandler _stageContextLostEventHandler;
1250 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1252 internal event EventHandler ContextLost
1256 if (_stageContextLostEventHandler == null)
1258 _stageContextLostEventCallbackDelegate = OnContextLost;
1259 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1261 _stageContextLostEventHandler += value;
1265 _stageContextLostEventHandler -= value;
1266 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1268 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1273 // Callback for Stage ContextLostSignal
1274 private void OnContextLost()
1276 if (_stageContextLostEventHandler != null)
1278 _stageContextLostEventHandler(this, null);
1283 private EventHandler _stageContextRegainedEventHandler;
1284 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1286 internal event EventHandler ContextRegained
1290 if (_stageContextRegainedEventHandler == null)
1292 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1293 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1295 _stageContextRegainedEventHandler += value;
1299 _stageContextRegainedEventHandler -= value;
1300 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1302 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1307 // Callback for Stage ContextRegainedSignal
1308 private void OnContextRegained()
1310 if (_stageContextRegainedEventHandler != null)
1312 _stageContextRegainedEventHandler(this, null);
1317 private EventHandler _stageSceneCreatedEventHandler;
1318 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1320 internal event EventHandler SceneCreated
1324 if (_stageSceneCreatedEventHandler == null)
1326 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1327 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1329 _stageSceneCreatedEventHandler += value;
1333 _stageSceneCreatedEventHandler -= value;
1334 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1336 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1341 // Callback for Stage SceneCreatedSignal
1342 private void OnSceneCreated()
1344 if (_stageSceneCreatedEventHandler != null)
1346 _stageSceneCreatedEventHandler(this, null);
1351 /// This resized event arguments.
1353 /// <since_tizen> 4 </since_tizen>
1354 public class ResizedEventArgs : EventArgs
1359 /// This window size.
1361 /// <since_tizen> 4 </since_tizen>
1362 public Size2D WindowSize
1370 _windowSize = value;
1375 private WindowResizedEventCallbackType _windowResizedEventCallback;
1376 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1377 private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
1378 private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
1381 /// This event is emitted when the window resized.
1383 /// <since_tizen> 4 </since_tizen>
1384 public event EventHandler<ResizedEventArgs> Resized
1388 if (_windowResizedEventHandler == null)
1390 _windowResizedEventCallback = OnResized;
1391 ResizedSignal().Connect(_windowResizedEventCallback);
1394 _windowResizedEventHandler += value;
1398 _windowResizedEventHandler -= value;
1400 if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
1402 ResizedSignal().Disconnect(_windowResizedEventCallback);
1407 private void OnResized(IntPtr windowSize)
1409 ResizedEventArgs e = new ResizedEventArgs();
1410 var val = new Uint16Pair(windowSize, false);
1411 e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1414 if (_windowResizedEventHandler != null)
1416 _windowResizedEventHandler(this, e);
1420 internal void SetWindowSize(Size2D size)
1422 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1423 NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1425 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1428 internal Size2D GetWindowSize()
1430 var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
1431 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1433 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1437 internal void SetPosition(Position2D position)
1439 var val = new Uint16Pair((uint)position.X, (uint)position.Y);
1440 NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1442 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1445 internal Position2D GetPosition()
1447 var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
1448 Position2D ret = new Position2D(val.GetX(), val.GetY());
1450 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1455 /// The window size property (read-only).
1457 /// <since_tizen> 3 </since_tizen>
1462 Size2D ret = GetSize();
1468 /// The background color property.
1470 /// <since_tizen> 3 </since_tizen>
1471 public Color BackgroundColor
1475 SetBackgroundColor(value);
1479 Color ret = GetBackgroundColor();
1485 /// The DPI property (read-only).<br />
1486 /// Retrieves the DPI of the display device to which the Window is connected.<br />
1488 /// <since_tizen> 3 </since_tizen>
1498 /// The layer count property (read-only).<br />
1499 /// Queries the number of on-Window layers.<br />
1501 /// <since_tizen> 3 </since_tizen>
1502 public uint LayerCount
1506 return GetLayerCount();
1512 /// Adds a layer to the stage.
1514 /// <param name="layer">Layer to add.</param>
1515 /// <since_tizen> 3 </since_tizen>
1516 public void AddLayer(Layer layer)
1518 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
1519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1523 /// Removes a layer from the stage.
1525 /// <param name="layer">Layer to remove.</param>
1526 /// <since_tizen> 4 </since_tizen>
1527 public void RemoveLayer(Layer layer)
1529 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
1530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1534 /// Please do not use! this will be deprecated
1536 /// <since_tizen> 3 </since_tizen>
1537 [EditorBrowsable(EditorBrowsableState.Never)]
1538 public class WindowFocusChangedEventArgs : EventArgs
1541 /// Please do not use! this will be deprecated
1543 /// <since_tizen> 3 </since_tizen>
1544 public bool FocusGained
1551 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
1552 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1553 private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
1554 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
1557 /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
1559 /// <since_tizen> 3 </since_tizen>
1560 /// Please do not use! this will be deprecated!
1561 /// Instead please use FocusChanged.
1562 [Obsolete("Please do not use! this will be deprecated, instead please use FocusChanged")]
1563 [EditorBrowsable(EditorBrowsableState.Never)]
1564 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
1568 if (_windowFocusChangedEventHandler2 == null)
1570 _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
1571 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
1574 _windowFocusChangedEventHandler2 += value;
1578 _windowFocusChangedEventHandler2 -= value;
1580 if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
1582 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1587 private void OnWindowFocusedChanged2(bool focusGained)
1589 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
1591 e.FocusGained = focusGained;
1593 if (_windowFocusChangedEventHandler2 != null)
1595 _windowFocusChangedEventHandler2(this, e);
1600 /// Gets or sets a size of the window.
1602 /// <since_tizen> 4 </since_tizen>
1603 public Size2D WindowSize
1607 return GetWindowSize();
1611 SetWindowSize(value);
1616 /// Gets or sets a position of the window.
1618 /// <since_tizen> 4 </since_tizen>
1619 public Position2D WindowPosition
1623 return GetPosition();
1632 /// Feed a key-event into the window.
1634 /// <since_tizen> 4 </since_tizen>
1635 public static void FeedKeyEvent(Key keyEvent)
1637 NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
1638 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1642 /// Allows at least one more render, even when paused.
1643 /// The window should be shown, not minimised.
1645 /// <since_tizen> 4 </since_tizen>
1646 public void RenderOnce()
1648 NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
1649 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1653 /// Contains and encapsulates Native Window handle.
1655 /// <since_tizen> 4 </since_tizen>
1656 public class SafeNativeWindowHandle : SafeHandle
1659 /// Contructor, Native window handle is set to handle.
1661 /// <since_tizen> 4 </since_tizen>
1662 public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
1664 SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
1667 /// Null check if the handle is valid or not.
1669 /// <since_tizen> 4 </since_tizen>
1670 public override bool IsInvalid
1674 return this.handle == IntPtr.Zero;
1678 /// Release handle itself.
1680 /// <returns>true when released successfully.</returns>
1681 /// <since_tizen> 4 </since_tizen>
1682 protected override bool ReleaseHandle()