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.
22 using System.Runtime.InteropServices;
23 using Tizen.NUI.BaseComponents;
24 using System.ComponentModel;
27 /// The window class is used internally for drawing.<br />
28 /// The window has an orientation and indicator properties.<br />
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 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 if (NDalicPINVOKE.Stage_IsInstalled())
42 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
46 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
48 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52 /// To make the window instance be disposed.
54 protected override void Dispose(DisposeTypes type)
61 if(type == DisposeTypes.Explicit)
64 //Release your own managed resources here.
65 //You should release all of your own disposable objects here.
68 //Release your own unmanaged resources here.
69 //You should not access any managed member here except static instance.
70 //because the execution order of Finalizes is non-deterministic.
72 if (_windowFocusChangedEventCallback != null)
74 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
77 if (_stageTouchCallbackDelegate != null)
79 TouchSignal().Disconnect(_stageTouchCallbackDelegate);
82 if (_stageWheelCallbackDelegate != null)
84 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
87 if (_stageKeyCallbackDelegate != null)
89 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
92 if (_stageEventProcessingFinishedEventCallbackDelegate != null)
94 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
97 if (_stageContextLostEventCallbackDelegate != null)
99 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
102 if (_stageContextRegainedEventCallbackDelegate != null)
104 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
107 if (_stageSceneCreatedEventCallbackDelegate != null)
109 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
112 if (_windowResizedEventCallback != null)
114 ResizedSignal().Disconnect(_windowResizedEventCallback);
117 if (_windowFocusChangedEventCallback2 != null)
119 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
122 if (swigCPtr.Handle != global::System.IntPtr.Zero)
127 NDalicPINVOKE.delete_Window(swigCPtr);
128 NDalicPINVOKE.delete_Stage(stageCPtr);
130 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
136 internal static Window GetCurrent()
138 Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 internal static bool IsInstalled()
145 bool ret = NDalicPINVOKE.Stage_IsInstalled();
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 /// Sets whether the window accepts a focus or not.
153 /// <param name="accept">If a focus is accepted or not. The default is true.</param>
154 /// <since_tizen> 3 </since_tizen>
155 public void SetAcceptFocus(bool accept)
157 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 /// Returns whether the window accepts a focus or not.
164 /// <returns>True if the window accepts a focus, false otherwise.</returns>
165 /// <since_tizen> 3 </since_tizen>
166 public bool IsFocusAcceptable()
168 bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 /// Shows the window if it is hidden.
177 /// <since_tizen> 3 </since_tizen>
180 NDalicPINVOKE.Show(swigCPtr);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 /// Hides the window if it is showing.
187 /// <since_tizen> 3 </since_tizen>
190 NDalicPINVOKE.Hide(swigCPtr);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 /// Retrieves whether the window is visible or not.
197 /// <returns>True if the window is visible.</returns>
198 /// <since_tizen> 3 </since_tizen>
199 public bool IsVisible()
201 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 /// Gets the count of supported auxiliary hints of the window.
209 /// <returns>The number of supported auxiliary hints.</returns>
210 /// <since_tizen> 3 </since_tizen>
211 public uint GetSupportedAuxiliaryHintCount() {
212 uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Gets the supported auxiliary hint string of the window.
220 /// <param name="index">The index of the supported auxiliary hint lists.</param>
221 /// <returns>The auxiliary hint string of the index.</returns>
222 /// <since_tizen> 3 </since_tizen>
223 public string GetSupportedAuxiliaryHint(uint index) {
224 string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 /// Creates an auxiliary hint of the window.
232 /// <param name="hint">The auxiliary hint string.</param>
233 /// <param name="value">The value string.</param>
234 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
235 /// <since_tizen> 3 </since_tizen>
236 public uint AddAuxiliaryHint(string hint, string value) {
237 uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 /// Removes an auxiliary hint of the window.
245 /// <param name="id">The ID of the auxiliary hint.</param>
246 /// <returns>True if no error occurred, false otherwise.</returns>
247 /// <since_tizen> 3 </since_tizen>
248 public bool RemoveAuxiliaryHint(uint id) {
249 bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 /// Changes a value of the auxiliary hint.
257 /// <param name="id">The auxiliary hint ID.</param>
258 /// <param name="value">The value string to be set.</param>
259 /// <returns>True if no error occurred, false otherwise.</returns>
260 /// <since_tizen> 3 </since_tizen>
261 public bool SetAuxiliaryHintValue(uint id, string value) {
262 bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 /// Gets a value of the auxiliary hint.
270 /// <param name="id">The auxiliary hint ID.</param>
271 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
272 /// <since_tizen> 3 </since_tizen>
273 public string GetAuxiliaryHintValue(uint id) {
274 string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 /// Gets an ID of the auxiliary hint string.
282 /// <param name="hint">The auxiliary hint string.</param>
283 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
284 /// <since_tizen> 3 </since_tizen>
285 public uint GetAuxiliaryHintId(string hint) {
286 uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 /// Sets a region to accept input events.
294 /// <param name="inputRegion">The region to accept input events.</param>
295 /// <since_tizen> 3 </since_tizen>
296 public void SetInputRegion(Rectangle inputRegion) {
297 NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 /// Gets or sets a window type.
304 /// <since_tizen> 3 </since_tizen>
305 public WindowType Type
309 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 NDalicPINVOKE.SetType(swigCPtr, (int)value);
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321 /// Sets a priority level for the specified notification window.
323 /// <param name="level">The notification window level.</param>
324 /// <returns>True if no error occurred, false otherwise.</returns>
325 /// <since_tizen> 3 </since_tizen>
326 public bool SetNotificationLevel(NotificationLevel level) {
327 bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
328 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 /// Gets a priority level for the specified notification window.
335 /// <returns>The notification window level.</returns>
336 /// <since_tizen> 3 </since_tizen>
337 public NotificationLevel GetNotificationLevel() {
338 NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344 /// Sets a transparent window's visual state to opaque.
346 /// <param name="opaque">Whether the window's visual state is opaque.</param>
347 /// <since_tizen> 3 </since_tizen>
348 public void SetOpaqueState(bool opaque) {
349 NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 /// Returns whether a transparent window's visual state is opaque or not.
356 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
357 /// <since_tizen> 3 </since_tizen>
358 public bool IsOpaqueState() {
359 bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365 /// Sets a window's screen mode.
367 /// <param name="screenMode">The screen mode.</param>
368 /// <returns>True if no error occurred, false otherwise.</returns>
369 /// <since_tizen> 3 </since_tizen>
370 public bool SetScreenMode(ScreenMode screenMode) {
371 bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode);
372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
377 /// Gets the screen mode of the window.
379 /// <returns>The screen mode.</returns>
380 /// <since_tizen> 3 </since_tizen>
381 public ScreenMode GetScreenMode() {
382 ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr);
383 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
388 /// Sets preferred brightness of the window.
390 /// <param name="brightness">The preferred brightness (0 to 100).</param>
391 /// <returns>True if no error occurred, false otherwise.</returns>
392 /// <since_tizen> 3 </since_tizen>
393 public bool SetBrightness(int brightness) {
394 bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 /// Gets the preferred brightness of the window.
402 /// <returns>The preferred brightness.</returns>
403 /// <since_tizen> 3 </since_tizen>
404 public int GetBrightness() {
405 int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
406 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 /// The focus changed event argument.
413 public class FocusChangedEventArgs : EventArgs
416 /// FocusGained flag.
418 /// <since_tizen> 3 </since_tizen>
419 public bool FocusGained
426 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
427 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
428 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
429 private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
432 /// FocusChanged event.
434 /// <since_tizen> 4 </since_tizen>
435 public event EventHandler<FocusChangedEventArgs> FocusChanged
439 if (_windowFocusChangedEventHandler == null)
441 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
442 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
445 _windowFocusChangedEventHandler += value;
449 _windowFocusChangedEventHandler -= value;
451 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
453 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
458 private void OnWindowFocusedChanged(bool focusGained)
460 FocusChangedEventArgs e = new FocusChangedEventArgs();
462 e.FocusGained = focusGained;
464 if (_windowFocusChangedEventHandler != null)
466 _windowFocusChangedEventHandler(this, e);
471 /// Gets/Sets a window title.
473 /// <since_tizen> 4 </since_tizen>
482 _windowTitle = value;
483 SetClass( _windowTitle, "" );
487 internal WindowFocusSignalType WindowFocusChangedSignal()
489 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
496 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499 internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504 internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
506 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
509 internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
511 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
514 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
516 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
517 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520 internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
522 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
523 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526 internal void RotateIndicator(Window.WindowOrientation orientation)
528 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 /// Sets the window name and the class string.
535 /// <param name="name">The name of the window.</param>
536 /// <param name="klass">The class of the window.</param>
537 /// <since_tizen> 4 </since_tizen>
538 public void SetClass(string name, string klass)
540 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 /// Raises the window to the top of the window stack.
547 /// <since_tizen> 3 </since_tizen>
550 NDalicPINVOKE.Window_Raise(swigCPtr);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 /// Lowers the window to the bottom of the window stack.
557 /// <since_tizen> 3 </since_tizen>
560 NDalicPINVOKE.Window_Lower(swigCPtr);
561 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
565 /// Activates the window to the top of the window stack even it is iconified.
567 /// <since_tizen> 3 </since_tizen>
568 public void Activate()
570 NDalicPINVOKE.Window_Activate(swigCPtr);
571 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
576 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
577 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
580 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
582 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
588 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
589 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592 internal Window.WindowOrientation GetPreferredOrientation()
594 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
595 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599 internal DragAndDropDetector GetDragAndDropDetector()
601 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
602 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606 internal Any GetNativeHandle()
608 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 internal WindowFocusSignalType FocusChangedSignal()
615 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621 /// Gets the default ( root ) layer.
623 /// <returns>The root layer.</returns>
624 /// <since_tizen> 3 </since_tizen>
625 public Layer GetDefaultLayer()
627 return this.GetRootLayer();
630 internal void Add(Layer layer)
632 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
633 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636 internal void Remove(Layer layer)
638 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
639 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643 /// Add a child view to window.
645 /// <param name="view">the child should be added to the window.</param>
646 /// <since_tizen> 3 </since_tizen>
647 public void Add(View view)
649 NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
650 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654 /// Remove a child view from window.
656 /// <param name="view">the child to be removed.</param>
657 /// <since_tizen> 3 </since_tizen>
658 public void Remove(View view)
660 NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
661 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
664 internal Vector2 GetSize()
666 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
667 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671 internal RenderTaskList GetRenderTaskList()
673 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
674 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679 /// Queries the number of on-window layers.
681 /// <returns>The number of layers.</returns>
682 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
683 internal uint GetLayerCount()
685 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690 /// <since_tizen> 3 </since_tizen>
691 public Layer GetLayer(uint depth)
693 IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
694 Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
696 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
700 internal Layer GetRootLayer()
702 if (_rootLayer == null)
703 _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
706 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 internal void SetBackgroundColor(Vector4 color)
712 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
716 internal Vector4 GetBackgroundColor()
718 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
719 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
723 internal Vector2 GetDpi()
725 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
726 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
730 internal ObjectRegistry GetObjectRegistry()
732 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
733 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
738 /// Keep rendering for at least the given amount of time.
740 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
741 /// <since_tizen> 3 </since_tizen>
742 public void KeepRendering(float durationSeconds)
744 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
745 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
748 internal KeyEventSignal KeyEventSignal()
750 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
751 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755 internal VoidSignal EventProcessingFinishedSignal()
757 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
758 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
762 internal TouchSignal TouchSignal()
764 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
765 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
769 private StageWheelSignal WheelEventSignal()
771 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
772 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
776 internal VoidSignal ContextLostSignal()
778 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
779 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
783 internal VoidSignal ContextRegainedSignal()
785 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
790 internal VoidSignal SceneCreatedSignal()
792 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
793 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
797 internal ResizedSignal ResizedSignal()
799 ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
800 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
804 internal static Vector4 DEFAULT_BACKGROUND_COLOR
808 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
809 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
810 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
815 internal static Vector4 DEBUG_BACKGROUND_COLOR
819 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
820 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
821 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826 private static readonly Window instance = Application.Instance.GetWindow();
829 /// The stage instance property (read-only).<br />
830 /// Gets the current window.<br />
832 /// <since_tizen> 3 </since_tizen>
833 public static Window Instance
842 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
843 /// This function can be used for following example scenarios: <br />
844 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
846 /// <param name="DaliKey">The key code to grab.</param>
847 /// <returns>True if the grab succeeds.</returns>
848 /// <since_tizen> 3 </since_tizen>
849 public bool GrabKeyTopmost(int DaliKey)
851 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
852 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
857 /// Ungrabs the key specified by a key for the window.<br />
858 /// 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 />
860 /// <param name="DaliKey">The key code to ungrab.</param>
861 /// <returns>True if the ungrab succeeds.</returns>
862 /// <since_tizen> 3 </since_tizen>
863 public bool UngrabKeyTopmost(int DaliKey)
865 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
866 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
871 /// Grabs the key specified by a key for a window in a GrabMode. <br />
872 /// Details: This function can be used for following example scenarios: <br />
873 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
874 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
875 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
877 /// <param name="DaliKey">The key code to grab.</param>
878 /// <param name="GrabMode">The grab mode for the key.</param>
879 /// <returns>True if the grab succeeds.</returns>
880 /// <since_tizen> 3 </since_tizen>
881 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
883 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
884 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
889 /// Ungrabs the key specified by a key for a window.<br />
890 /// 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 />
892 /// <param name="DaliKey">The key code to ungrab.</param>
893 /// <returns>True if the ungrab succeeds.</returns>
894 /// <since_tizen> 3 </since_tizen>
895 public bool UngrabKey(int DaliKey)
897 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
898 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
902 internal System.IntPtr GetNativeWindowHandler()
904 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
905 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
910 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
912 /// <since_tizen> 3 </since_tizen>
913 public enum WindowOrientation
916 /// Portrait orientation. The height of the display area is greater than the width.
918 /// <since_tizen> 3 </since_tizen>
921 /// Landscape orientation. A wide view area is needed.
923 /// <since_tizen> 3 </since_tizen>
926 /// Portrait inverse orientation.
928 /// <since_tizen> 3 </since_tizen>
929 PortraitInverse = 180,
931 /// Landscape inverse orientation.
933 /// <since_tizen> 3 </since_tizen>
934 LandscapeInverse = 270
938 /// Enumeration for the key grab mode for platform-level APIs.
940 /// <since_tizen> 3 </since_tizen>
941 public enum KeyGrabMode
944 /// Grabs a key only when on the top of the grabbing-window stack mode.
948 /// Grabs a key together with the other client window(s) mode.
952 /// 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.
956 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
962 /// Enumeration for opacity of the indicator.
964 internal enum IndicatorBackgroundOpacity
972 /// Enumeration for visible mode of the indicator.
974 internal enum IndicatorVisibleMode
982 /// The touch event argument.
984 public class TouchEventArgs : EventArgs
986 private Touch _touch;
991 /// <since_tizen> 3 </since_tizen>
1005 private event EventHandler<TouchEventArgs> _stageTouchHandler;
1006 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
1009 /// This event is emitted when the screen is touched and when the touch ends.<br />
1010 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
1011 /// then when the last finger is lifted.<br />
1012 /// An interrupted event will also be emitted (if it occurs).<br />
1014 /// <since_tizen> 4 </since_tizen>
1015 public event EventHandler<TouchEventArgs> TouchEvent
1021 _stageTouchHandler += value;
1022 _stageTouchCallbackDelegate = OnStageTouch;
1023 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
1030 if (_stageTouchHandler != null)
1032 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
1034 _stageTouchHandler -= value;
1039 private void OnStageTouch(IntPtr data)
1041 TouchEventArgs e = new TouchEventArgs();
1045 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
1048 if (_stageTouchHandler != null)
1050 _stageTouchHandler(this, e);
1055 /// Wheel event arguments.
1057 public class WheelEventArgs : EventArgs
1059 private Wheel _wheel;
1064 /// <since_tizen> 3 </since_tizen>
1078 private event EventHandler<WheelEventArgs> _stageWheelHandler;
1079 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
1082 /// This event is emitted when the wheel event is received.
1084 /// <since_tizen> 4 </since_tizen>
1085 public event EventHandler<WheelEventArgs> WheelEvent
1089 if (_stageWheelHandler == null)
1091 _stageWheelCallbackDelegate = OnStageWheel;
1092 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
1094 _stageWheelHandler += value;
1098 _stageWheelHandler -= value;
1099 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
1101 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
1106 private void OnStageWheel(IntPtr data)
1108 WheelEventArgs e = new WheelEventArgs();
1112 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1115 if (_stageWheelHandler != null)
1117 _stageWheelHandler(this, e);
1122 /// Key event arguments.
1124 public class KeyEventArgs : EventArgs
1131 /// <since_tizen> 3 </since_tizen>
1145 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1146 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1149 /// This event is emitted when the key event is received.
1151 /// <since_tizen> 4 </since_tizen>
1152 public event EventHandler<KeyEventArgs> KeyEvent
1156 if (_stageKeyHandler == null)
1158 _stageKeyCallbackDelegate = OnStageKey;
1159 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1161 _stageKeyHandler += value;
1165 _stageKeyHandler -= value;
1166 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1168 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1173 // Callback for Stage KeyEventsignal
1174 private void OnStageKey(IntPtr data)
1176 KeyEventArgs e = new KeyEventArgs();
1180 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1183 if (_stageKeyHandler != null)
1185 //here we send all data to user event handlers
1186 _stageKeyHandler(this, e);
1191 private event EventHandler _stageEventProcessingFinishedEventHandler;
1192 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1194 internal event EventHandler EventProcessingFinished
1198 if (_stageEventProcessingFinishedEventHandler == null)
1200 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1201 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1203 _stageEventProcessingFinishedEventHandler += value;
1208 _stageEventProcessingFinishedEventHandler -= value;
1209 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1211 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1216 // Callback for Stage EventProcessingFinishedSignal
1217 private void OnEventProcessingFinished()
1219 if (_stageEventProcessingFinishedEventHandler != null)
1221 _stageEventProcessingFinishedEventHandler(this, null);
1226 private EventHandler _stageContextLostEventHandler;
1227 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1229 internal event EventHandler ContextLost
1233 if (_stageContextLostEventHandler == null)
1235 _stageContextLostEventCallbackDelegate = OnContextLost;
1236 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1238 _stageContextLostEventHandler += value;
1242 _stageContextLostEventHandler -= value;
1243 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1245 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1250 // Callback for Stage ContextLostSignal
1251 private void OnContextLost()
1253 if (_stageContextLostEventHandler != null)
1255 _stageContextLostEventHandler(this, null);
1260 private EventHandler _stageContextRegainedEventHandler;
1261 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1263 internal event EventHandler ContextRegained
1267 if (_stageContextRegainedEventHandler == null)
1269 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1270 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1272 _stageContextRegainedEventHandler += value;
1276 _stageContextRegainedEventHandler -= value;
1277 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1279 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1284 // Callback for Stage ContextRegainedSignal
1285 private void OnContextRegained()
1287 if (_stageContextRegainedEventHandler != null)
1289 _stageContextRegainedEventHandler(this, null);
1294 private EventHandler _stageSceneCreatedEventHandler;
1295 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1297 internal event EventHandler SceneCreated
1301 if (_stageSceneCreatedEventHandler == null)
1303 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1304 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1306 _stageSceneCreatedEventHandler += value;
1310 _stageSceneCreatedEventHandler -= value;
1311 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1313 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1318 // Callback for Stage SceneCreatedSignal
1319 private void OnSceneCreated()
1321 if (_stageSceneCreatedEventHandler != null)
1323 _stageSceneCreatedEventHandler(this, null);
1328 /// This resized event arguments.
1330 /// <since_tizen> 4 </since_tizen>
1331 public class ResizedEventArgs : EventArgs
1336 /// This window size.
1338 /// <since_tizen> 4 </since_tizen>
1339 public Size2D WindowSize
1347 _windowSize = value;
1352 private WindowResizedEventCallbackType _windowResizedEventCallback;
1353 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1354 private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
1355 private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
1358 /// This event is emitted when the window resized.
1360 /// <since_tizen> 4 </since_tizen>
1361 public event EventHandler<ResizedEventArgs> Resized
1365 if (_windowResizedEventHandler == null)
1367 _windowResizedEventCallback = OnResized;
1368 ResizedSignal().Connect(_windowResizedEventCallback);
1371 _windowResizedEventHandler += value;
1375 _windowResizedEventHandler -= value;
1377 if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
1379 ResizedSignal().Disconnect(_windowResizedEventCallback);
1384 private void OnResized(IntPtr windowSize)
1386 ResizedEventArgs e = new ResizedEventArgs();
1387 var val = new Uint16Pair(windowSize, false);
1388 e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1391 if (_windowResizedEventHandler != null)
1393 _windowResizedEventHandler(this, e);
1397 internal void SetWindowSize(Size2D size)
1399 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1400 NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1405 internal Size2D GetWindowSize()
1407 var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
1408 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1410 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1414 internal void SetPosition(Position2D position)
1416 var val = new Uint16Pair( (uint)position.X, (uint)position.Y );
1417 NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1419 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1422 internal Position2D GetPosition()
1424 var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
1425 Position2D ret = new Position2D(val.GetX(), val.GetY());
1427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1432 /// The window size property (read-only).
1434 /// <since_tizen> 3 </since_tizen>
1439 Size2D ret = GetSize();
1445 /// The background color property.
1447 /// <since_tizen> 3 </since_tizen>
1448 public Color BackgroundColor
1452 SetBackgroundColor(value);
1456 Color ret = GetBackgroundColor();
1462 /// The DPI property (read-only).<br />
1463 /// Retrieves the DPI of the display device to which the Window is connected.<br />
1465 /// <since_tizen> 3 </since_tizen>
1475 /// The layer count property (read-only).<br />
1476 /// Queries the number of on-Window layers.<br />
1478 /// <since_tizen> 3 </since_tizen>
1479 public uint LayerCount
1483 return GetLayerCount();
1489 /// Adds a layer to the stage.
1491 /// <param name="layer">Layer to add.</param>
1492 /// <since_tizen> 3 </since_tizen>
1493 public void AddLayer(Layer layer)
1495 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
1496 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1500 /// Removes a layer from the stage.
1502 /// <param name="layer">Layer to remove.</param>
1503 /// <since_tizen> 4 </since_tizen>
1504 public void RemoveLayer(Layer layer)
1506 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
1507 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1511 /// Please do not use! this will be deprecated
1513 /// <since_tizen> 3 </since_tizen>
1514 [EditorBrowsable(EditorBrowsableState.Never)]
1515 public class WindowFocusChangedEventArgs : EventArgs
1518 /// Please do not use! this will be deprecated
1520 /// <since_tizen> 3 </since_tizen>
1521 public bool FocusGained
1528 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
1529 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1530 private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
1531 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
1534 /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
1536 /// <since_tizen> 3 </since_tizen>
1537 [Obsolete("Please do not use! this will be deprecated. Please use 'FocusChanged' event instead")]
1538 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
1542 if (_windowFocusChangedEventHandler2 == null)
1544 _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
1545 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
1548 _windowFocusChangedEventHandler2 += value;
1552 _windowFocusChangedEventHandler2 -= value;
1554 if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
1556 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1561 private void OnWindowFocusedChanged2(bool focusGained)
1563 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
1565 e.FocusGained = focusGained;
1567 if (_windowFocusChangedEventHandler2 != null)
1569 _windowFocusChangedEventHandler2(this, e);
1574 /// Gets or sets a size of the window.
1576 /// <since_tizen> 4 </since_tizen>
1577 public Size2D WindowSize
1581 return GetWindowSize();
1585 SetWindowSize(value);
1590 /// Gets or sets a position of the window.
1592 /// <since_tizen> 4 </since_tizen>
1593 public Position2D WindowPosition
1597 return GetPosition();
1606 /// Feed a key-event into the window.
1608 /// <since_tizen> 4 </since_tizen>
1609 public static void FeedKeyEvent(Key keyEvent)
1611 NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
1612 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1616 /// Allows at least one more render, even when paused.
1617 /// The window should be shown, not minimised.
1619 /// <since_tizen> 4 </since_tizen>
1620 public void RenderOnce()
1622 NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
1623 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();