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();
691 /// Retrieves the layer at a specified depth.
693 /// <param name="depth">The layer's depth index.</param>
694 /// <returns>The layer found at the given depth.</returns>
695 /// <since_tizen> 3 </since_tizen>
696 public Layer GetLayer(uint depth)
698 IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
699 Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
701 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
705 internal Layer GetRootLayer()
707 if (_rootLayer == null)
708 _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
711 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715 internal void SetBackgroundColor(Vector4 color)
717 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
718 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
721 internal Vector4 GetBackgroundColor()
723 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
724 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
728 internal Vector2 GetDpi()
730 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
731 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735 internal ObjectRegistry GetObjectRegistry()
737 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
738 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
743 /// Keep rendering for at least the given amount of time.
745 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
746 /// <since_tizen> 3 </since_tizen>
747 public void KeepRendering(float durationSeconds)
749 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
750 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
753 internal KeyEventSignal KeyEventSignal()
755 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
756 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
760 internal VoidSignal EventProcessingFinishedSignal()
762 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
763 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
767 internal TouchSignal TouchSignal()
769 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
770 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
774 private StageWheelSignal WheelEventSignal()
776 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 internal VoidSignal ContextLostSignal()
783 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
784 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
788 internal VoidSignal ContextRegainedSignal()
790 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
791 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
795 internal VoidSignal SceneCreatedSignal()
797 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
798 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
802 internal ResizedSignal ResizedSignal()
804 ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
805 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809 internal static Vector4 DEFAULT_BACKGROUND_COLOR
813 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
814 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
815 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
820 internal static Vector4 DEBUG_BACKGROUND_COLOR
824 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
825 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
831 private static readonly Window instance = Application.Instance.GetWindow();
834 /// The stage instance property (read-only).<br />
835 /// Gets the current window.<br />
837 /// <since_tizen> 3 </since_tizen>
838 public static Window Instance
847 /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
848 /// This function can be used for following example scenarios: <br />
849 /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
851 /// <param name="DaliKey">The key code to grab.</param>
852 /// <returns>True if the grab succeeds.</returns>
853 /// <since_tizen> 3 </since_tizen>
854 public bool GrabKeyTopmost(int DaliKey)
856 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
857 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
862 /// Ungrabs the key specified by a key for the window.<br />
863 /// 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 />
865 /// <param name="DaliKey">The key code to ungrab.</param>
866 /// <returns>True if the ungrab succeeds.</returns>
867 /// <since_tizen> 3 </since_tizen>
868 public bool UngrabKeyTopmost(int DaliKey)
870 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
871 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
876 /// Grabs the key specified by a key for a window in a GrabMode. <br />
877 /// Details: This function can be used for following example scenarios: <br />
878 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
879 /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
880 /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
882 /// <param name="DaliKey">The key code to grab.</param>
883 /// <param name="GrabMode">The grab mode for the key.</param>
884 /// <returns>True if the grab succeeds.</returns>
885 /// <since_tizen> 3 </since_tizen>
886 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
888 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
889 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
894 /// Ungrabs the key specified by a key for a window.<br />
895 /// 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 />
897 /// <param name="DaliKey">The key code to ungrab.</param>
898 /// <returns>True if the ungrab succeeds.</returns>
899 /// <since_tizen> 3 </since_tizen>
900 public bool UngrabKey(int DaliKey)
902 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
903 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907 internal System.IntPtr GetNativeWindowHandler()
909 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
910 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
915 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
917 /// <since_tizen> 3 </since_tizen>
918 public enum WindowOrientation
921 /// Portrait orientation. The height of the display area is greater than the width.
923 /// <since_tizen> 3 </since_tizen>
926 /// Landscape orientation. A wide view area is needed.
928 /// <since_tizen> 3 </since_tizen>
931 /// Portrait inverse orientation.
933 /// <since_tizen> 3 </since_tizen>
934 PortraitInverse = 180,
936 /// Landscape inverse orientation.
938 /// <since_tizen> 3 </since_tizen>
939 LandscapeInverse = 270
943 /// Enumeration for the key grab mode for platform-level APIs.
945 /// <since_tizen> 3 </since_tizen>
946 public enum KeyGrabMode
949 /// Grabs a key only when on the top of the grabbing-window stack mode.
953 /// Grabs a key together with the other client window(s) mode.
957 /// 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.
961 /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
967 /// Enumeration for opacity of the indicator.
969 internal enum IndicatorBackgroundOpacity
977 /// Enumeration for visible mode of the indicator.
979 internal enum IndicatorVisibleMode
987 /// The touch event argument.
989 public class TouchEventArgs : EventArgs
991 private Touch _touch;
996 /// <since_tizen> 3 </since_tizen>
1010 private event EventHandler<TouchEventArgs> _stageTouchHandler;
1011 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
1014 /// This event is emitted when the screen is touched and when the touch ends.<br />
1015 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
1016 /// then when the last finger is lifted.<br />
1017 /// An interrupted event will also be emitted (if it occurs).<br />
1019 /// <since_tizen> 4 </since_tizen>
1020 public event EventHandler<TouchEventArgs> TouchEvent
1026 _stageTouchHandler += value;
1027 _stageTouchCallbackDelegate = OnStageTouch;
1028 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
1035 if (_stageTouchHandler != null)
1037 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
1039 _stageTouchHandler -= value;
1044 private void OnStageTouch(IntPtr data)
1046 TouchEventArgs e = new TouchEventArgs();
1050 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
1053 if (_stageTouchHandler != null)
1055 _stageTouchHandler(this, e);
1060 /// Wheel event arguments.
1062 public class WheelEventArgs : EventArgs
1064 private Wheel _wheel;
1069 /// <since_tizen> 3 </since_tizen>
1083 private event EventHandler<WheelEventArgs> _stageWheelHandler;
1084 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
1087 /// This event is emitted when the wheel event is received.
1089 /// <since_tizen> 4 </since_tizen>
1090 public event EventHandler<WheelEventArgs> WheelEvent
1094 if (_stageWheelHandler == null)
1096 _stageWheelCallbackDelegate = OnStageWheel;
1097 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
1099 _stageWheelHandler += value;
1103 _stageWheelHandler -= value;
1104 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
1106 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
1111 private void OnStageWheel(IntPtr data)
1113 WheelEventArgs e = new WheelEventArgs();
1117 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1120 if (_stageWheelHandler != null)
1122 _stageWheelHandler(this, e);
1127 /// Key event arguments.
1129 public class KeyEventArgs : EventArgs
1136 /// <since_tizen> 3 </since_tizen>
1150 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1151 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1154 /// This event is emitted when the key event is received.
1156 /// <since_tizen> 4 </since_tizen>
1157 public event EventHandler<KeyEventArgs> KeyEvent
1161 if (_stageKeyHandler == null)
1163 _stageKeyCallbackDelegate = OnStageKey;
1164 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1166 _stageKeyHandler += value;
1170 _stageKeyHandler -= value;
1171 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1173 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1178 // Callback for Stage KeyEventsignal
1179 private void OnStageKey(IntPtr data)
1181 KeyEventArgs e = new KeyEventArgs();
1185 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1188 if (_stageKeyHandler != null)
1190 //here we send all data to user event handlers
1191 _stageKeyHandler(this, e);
1196 private event EventHandler _stageEventProcessingFinishedEventHandler;
1197 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1199 internal event EventHandler EventProcessingFinished
1203 if (_stageEventProcessingFinishedEventHandler == null)
1205 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1206 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1208 _stageEventProcessingFinishedEventHandler += value;
1213 _stageEventProcessingFinishedEventHandler -= value;
1214 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1216 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1221 // Callback for Stage EventProcessingFinishedSignal
1222 private void OnEventProcessingFinished()
1224 if (_stageEventProcessingFinishedEventHandler != null)
1226 _stageEventProcessingFinishedEventHandler(this, null);
1231 private EventHandler _stageContextLostEventHandler;
1232 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1234 internal event EventHandler ContextLost
1238 if (_stageContextLostEventHandler == null)
1240 _stageContextLostEventCallbackDelegate = OnContextLost;
1241 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1243 _stageContextLostEventHandler += value;
1247 _stageContextLostEventHandler -= value;
1248 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1250 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1255 // Callback for Stage ContextLostSignal
1256 private void OnContextLost()
1258 if (_stageContextLostEventHandler != null)
1260 _stageContextLostEventHandler(this, null);
1265 private EventHandler _stageContextRegainedEventHandler;
1266 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1268 internal event EventHandler ContextRegained
1272 if (_stageContextRegainedEventHandler == null)
1274 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1275 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1277 _stageContextRegainedEventHandler += value;
1281 _stageContextRegainedEventHandler -= value;
1282 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1284 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1289 // Callback for Stage ContextRegainedSignal
1290 private void OnContextRegained()
1292 if (_stageContextRegainedEventHandler != null)
1294 _stageContextRegainedEventHandler(this, null);
1299 private EventHandler _stageSceneCreatedEventHandler;
1300 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1302 internal event EventHandler SceneCreated
1306 if (_stageSceneCreatedEventHandler == null)
1308 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1309 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1311 _stageSceneCreatedEventHandler += value;
1315 _stageSceneCreatedEventHandler -= value;
1316 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1318 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1323 // Callback for Stage SceneCreatedSignal
1324 private void OnSceneCreated()
1326 if (_stageSceneCreatedEventHandler != null)
1328 _stageSceneCreatedEventHandler(this, null);
1333 /// This resized event arguments.
1335 /// <since_tizen> 4 </since_tizen>
1336 public class ResizedEventArgs : EventArgs
1341 /// This window size.
1343 /// <since_tizen> 4 </since_tizen>
1344 public Size2D WindowSize
1352 _windowSize = value;
1357 private WindowResizedEventCallbackType _windowResizedEventCallback;
1358 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1359 private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
1360 private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
1363 /// This event is emitted when the window resized.
1365 /// <since_tizen> 4 </since_tizen>
1366 public event EventHandler<ResizedEventArgs> Resized
1370 if (_windowResizedEventHandler == null)
1372 _windowResizedEventCallback = OnResized;
1373 ResizedSignal().Connect(_windowResizedEventCallback);
1376 _windowResizedEventHandler += value;
1380 _windowResizedEventHandler -= value;
1382 if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
1384 ResizedSignal().Disconnect(_windowResizedEventCallback);
1389 private void OnResized(IntPtr windowSize)
1391 ResizedEventArgs e = new ResizedEventArgs();
1392 var val = new Uint16Pair(windowSize, false);
1393 e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
1396 if (_windowResizedEventHandler != null)
1398 _windowResizedEventHandler(this, e);
1402 internal void SetWindowSize(Size2D size)
1404 var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
1405 NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
1407 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1410 internal Size2D GetWindowSize()
1412 var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
1413 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
1415 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1419 internal void SetPosition(Position2D position)
1421 var val = new Uint16Pair( (uint)position.X, (uint)position.Y );
1422 NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
1424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1427 internal Position2D GetPosition()
1429 var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
1430 Position2D ret = new Position2D(val.GetX(), val.GetY());
1432 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1437 /// The window size property (read-only).
1439 /// <since_tizen> 3 </since_tizen>
1444 Size2D ret = GetSize();
1450 /// The background color property.
1452 /// <since_tizen> 3 </since_tizen>
1453 public Color BackgroundColor
1457 SetBackgroundColor(value);
1461 Color ret = GetBackgroundColor();
1467 /// The DPI property (read-only).<br />
1468 /// Retrieves the DPI of the display device to which the Window is connected.<br />
1470 /// <since_tizen> 3 </since_tizen>
1480 /// The layer count property (read-only).<br />
1481 /// Queries the number of on-Window layers.<br />
1483 /// <since_tizen> 3 </since_tizen>
1484 public uint LayerCount
1488 return GetLayerCount();
1494 /// Adds a layer to the stage.
1496 /// <param name="layer">Layer to add.</param>
1497 /// <since_tizen> 3 </since_tizen>
1498 public void AddLayer(Layer layer)
1500 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
1501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1505 /// Removes a layer from the stage.
1507 /// <param name="layer">Layer to remove.</param>
1508 /// <since_tizen> 4 </since_tizen>
1509 public void RemoveLayer(Layer layer)
1511 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
1512 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1516 /// Please do not use! this will be deprecated
1518 /// <since_tizen> 3 </since_tizen>
1519 [EditorBrowsable(EditorBrowsableState.Never)]
1520 public class WindowFocusChangedEventArgs : EventArgs
1523 /// Please do not use! this will be deprecated
1525 /// <since_tizen> 3 </since_tizen>
1526 public bool FocusGained
1533 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
1534 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1535 private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
1536 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
1539 /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
1541 /// <since_tizen> 3 </since_tizen>
1542 [Obsolete("Please do not use! this will be deprecated. Please use 'FocusChanged' event instead")]
1543 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
1547 if (_windowFocusChangedEventHandler2 == null)
1549 _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
1550 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
1553 _windowFocusChangedEventHandler2 += value;
1557 _windowFocusChangedEventHandler2 -= value;
1559 if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
1561 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
1566 private void OnWindowFocusedChanged2(bool focusGained)
1568 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
1570 e.FocusGained = focusGained;
1572 if (_windowFocusChangedEventHandler2 != null)
1574 _windowFocusChangedEventHandler2(this, e);
1579 /// Gets or sets a size of the window.
1581 /// <since_tizen> 4 </since_tizen>
1582 public Size2D WindowSize
1586 return GetWindowSize();
1590 SetWindowSize(value);
1595 /// Gets or sets a position of the window.
1597 /// <since_tizen> 4 </since_tizen>
1598 public Position2D WindowPosition
1602 return GetPosition();
1611 /// Feed a key-event into the window.
1613 /// <since_tizen> 4 </since_tizen>
1614 public static void FeedKeyEvent(Key keyEvent)
1616 NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
1617 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1621 /// Allows at least one more render, even when paused.
1622 /// The window should be shown, not minimised.
1624 /// <since_tizen> 4 </since_tizen>
1625 public void RenderOnce()
1627 NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
1628 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();