1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
15 using System.Runtime.InteropServices;
18 public class Stage : BaseHandle
20 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 internal Stage(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Stage_SWIGUpcast(cPtr), cMemoryOwn)
24 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Stage obj)
29 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34 DisposeQueue.Instance.Add(this);
37 public override void Dispose()
39 if (!Stage.IsInstalled())
41 DisposeQueue.Instance.Add(this);
47 if (swigCPtr.Handle != global::System.IntPtr.Zero)
52 NDalicPINVOKE.delete_Stage(swigCPtr);
54 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56 global::System.GC.SuppressFinalize(this);
65 * @brief Event arguments that passed via Touch signal
68 public class TouchEventArgs : EventArgs
73 * @brief Touch - contains the information of touch points
89 private event EventHandler<TouchEventArgs> _stageTouchHandler;
90 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
93 * @brief Event for TouchEvent signal which can be used to subscribe/unsubscribe the event handler
94 * TouchEvent signal is emitted when the screen is touched and when the touch ends
95 * (i.e. the down & up touch events only).
98 public event EventHandler<TouchEventArgs> Touch
102 if (_stageTouchHandler == null)
104 _stageTouchCallbackDelegate = OnStageTouch;
105 TouchSignal().Connect(_stageTouchCallbackDelegate);
107 _stageTouchHandler += value;
111 _stageTouchHandler -= value;
112 if (_stageTouchHandler == null && _stageTouchCallbackDelegate != null)
114 TouchSignal().Disconnect(_stageTouchCallbackDelegate);
119 private void OnStageTouch(IntPtr data)
121 TouchEventArgs e = new TouchEventArgs();
125 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
128 if (_stageTouchHandler != null)
130 _stageTouchHandler(this, e);
135 * @brief Wheel arguments that passed via Wheel signal
138 public class WheelEventArgs : EventArgs
140 private Wheel _wheel;
143 * @brief Wheel - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL
159 private event EventHandler<WheelEventArgs> _stageWheelHandler;
160 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
163 * @brief Event for Wheel signal which can be used to subscribe/unsubscribe the event handler
164 * Wheel signal is emitted is emitted when wheel event is received.
167 public event EventHandler<WheelEventArgs> Wheel
171 if (_stageWheelHandler == null)
173 _stageWheelCallbackDelegate = OnStageWheel;
174 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
176 _stageWheelHandler += value;
180 _stageWheelHandler -= value;
181 if (_stageWheelHandler == null && _stageWheelCallbackDelegate != null)
183 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
188 private void OnStageWheel(IntPtr data)
190 WheelEventArgs e = new WheelEventArgs();
194 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
197 if (_stageWheelHandler != null)
199 _stageWheelHandler(this, e);
204 * @brief Event arguments that passed via Key signal
207 public class KeyEventArgs : EventArgs
212 * @brief Key - is the keyevent sent to Stage.
228 private event EventHandler<KeyEventArgs> _stageKeyHandler;
229 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
232 * @brief Event for Key signal which can be used to subscribe/unsubscribe the event handler
233 * Key signal is emitted is emitted when key event is received.
236 public event EventHandler<KeyEventArgs> Key
240 if (_stageKeyHandler == null)
242 _stageKeyCallbackDelegate = OnStageKey;
243 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
245 _stageKeyHandler += value;
249 _stageKeyHandler -= value;
250 if (_stageKeyHandler == null && _stageKeyCallbackDelegate != null)
252 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
257 // Callback for Stage KeyEventsignal
258 private void OnStageKey(IntPtr data)
260 KeyEventArgs e = new KeyEventArgs();
264 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
267 if (_stageKeyHandler != null)
269 //here we send all data to user event handlers
270 _stageKeyHandler(this, e);
275 private event EventHandler _stageEventProcessingFinishedEventHandler;
276 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
279 * @brief Event for EventProcessingFinished signal which can be used to subscribe/unsubscribe the event handler
280 * provided by the user. EventProcessingFinished signal is emitted just after the event processing is finished.
283 internal event EventHandler EventProcessingFinished
287 if (_stageEventProcessingFinishedEventHandler == null)
289 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
290 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
292 _stageEventProcessingFinishedEventHandler += value;
297 _stageEventProcessingFinishedEventHandler -= value;
298 if (_stageEventProcessingFinishedEventHandler == null && _stageEventProcessingFinishedEventCallbackDelegate != null)
300 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
305 // Callback for Stage EventProcessingFinishedSignal
306 private void OnEventProcessingFinished()
308 if (_stageEventProcessingFinishedEventHandler != null)
310 _stageEventProcessingFinishedEventHandler(this, null);
315 private EventHandler _stageContextLostEventHandler;
316 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
319 * @brief Event for ContextLost signal which can be used to subscribe/unsubscribe the event handler
320 * ContextLost signal is emitted when the GL context is lost (Platform specific behaviour).
323 internal event EventHandler ContextLost
327 if (_stageContextLostEventHandler == null)
329 _stageContextLostEventCallbackDelegate = OnContextLost;
330 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
332 _stageContextLostEventHandler += value;
336 _stageContextLostEventHandler -= value;
337 if (_stageContextLostEventHandler == null && _stageContextLostEventCallbackDelegate != null)
339 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
344 // Callback for Stage ContextLostSignal
345 private void OnContextLost()
347 if (_stageContextLostEventHandler != null)
349 _stageContextLostEventHandler(this, null);
354 private EventHandler _stageContextRegainedEventHandler;
355 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
358 * @brief Event for ContextRegained signal which can be used to subscribe/unsubscribe the event handler
359 * provided by the user. ContextRegained signal is emitted when the GL context is regained (Platform specific
363 internal event EventHandler ContextRegained
367 if (_stageContextRegainedEventHandler == null)
369 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
370 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
372 _stageContextRegainedEventHandler += value;
376 _stageContextRegainedEventHandler -= value;
377 if (_stageContextRegainedEventHandler == null && _stageContextRegainedEventCallbackDelegate != null)
379 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
384 // Callback for Stage ContextRegainedSignal
385 private void OnContextRegained()
387 if (_stageContextRegainedEventHandler != null)
389 _stageContextRegainedEventHandler(this, null);
394 private EventHandler _stageSceneCreatedEventHandler;
395 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
398 * @brief Event for SceneCreated signal which can be used to subscribe/unsubscribe the event handler
399 * SceneCreated signal is emitted after the initial scene is created.
402 internal event EventHandler SceneCreated
406 if (_stageSceneCreatedEventHandler == null)
408 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
409 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
411 _stageSceneCreatedEventHandler += value;
415 _stageSceneCreatedEventHandler -= value;
416 if (_stageSceneCreatedEventHandler == null && _stageSceneCreatedEventCallbackDelegate != null)
418 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
423 // Callback for Stage SceneCreatedSignal
424 private void OnSceneCreated()
426 if (_stageSceneCreatedEventHandler != null)
428 _stageSceneCreatedEventHandler(this, null);
437 Size2D ret = GetSize();
442 public Color BackgroundColor
446 SetBackgroundColor(value);
450 Color ret = GetBackgroundColor();
463 public uint LayerCount
467 return GetLayerCount();
471 private static readonly Stage instance = Stage.GetCurrent();
473 public static Stage Instance
481 public Layer GetDefaultLayer()
483 return this.GetRootLayer();
486 public void AddLayer(Layer layer)
488 this.Add((Actor)layer);
491 public void RemoveLayer(Layer layer)
493 this.Remove((Actor)layer);
498 internal static Vector4 DEFAULT_BACKGROUND_COLOR
502 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
503 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
504 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
509 internal static Vector4 DEBUG_BACKGROUND_COLOR
513 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
514 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520 internal Stage() : this(NDalicPINVOKE.new_Stage__SWIG_0(), true)
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525 internal static Stage GetCurrent()
527 Stage ret = new Stage(NDalicPINVOKE.Stage_GetCurrent(), true);
528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
532 internal static bool IsInstalled()
534 bool ret = NDalicPINVOKE.Stage_IsInstalled();
535 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
539 internal Stage(Stage handle) : this(NDalicPINVOKE.new_Stage__SWIG_1(Stage.getCPtr(handle)), true)
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
544 internal Stage Assign(Stage rhs)
546 Stage ret = new Stage(NDalicPINVOKE.Stage_Assign(swigCPtr, Stage.getCPtr(rhs)), false);
547 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
551 internal void Add(Actor actor)
553 NDalicPINVOKE.Stage_Add(swigCPtr, Actor.getCPtr(actor));
554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557 internal void Remove(Actor actor)
559 NDalicPINVOKE.Stage_Remove(swigCPtr, Actor.getCPtr(actor));
560 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
563 internal Size2D GetSize()
565 Size2D ret = new Size2D(NDalicPINVOKE.Stage_GetSize(swigCPtr), true);
566 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
570 internal RenderTaskList GetRenderTaskList()
572 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(swigCPtr), true);
573 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
577 internal uint GetLayerCount()
579 uint ret = NDalicPINVOKE.Stage_GetLayerCount(swigCPtr);
580 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584 public Layer GetLayer(uint depth)
586 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(swigCPtr, depth), true);
587 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
591 internal Layer GetRootLayer()
593 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(swigCPtr), true);
594 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598 internal void SetBackgroundColor(Color color)
600 NDalicPINVOKE.Stage_SetBackgroundColor(swigCPtr, Color.getCPtr(color));
601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604 internal Color GetBackgroundColor()
606 Color ret = new Color(NDalicPINVOKE.Stage_GetBackgroundColor(swigCPtr), true);
607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
611 internal Vector2 GetDpi()
613 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(swigCPtr), true);
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
618 internal ObjectRegistry GetObjectRegistry()
620 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(swigCPtr), true);
621 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625 public void KeepRendering(float durationSeconds)
627 NDalicPINVOKE.Stage_KeepRendering(swigCPtr, durationSeconds);
628 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
631 internal KeyEventSignal KeyEventSignal()
633 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(swigCPtr), false);
634 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638 internal VoidSignal EventProcessingFinishedSignal()
640 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(swigCPtr), false);
641 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
645 internal TouchSignal TouchSignal()
647 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(swigCPtr), false);
648 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 internal StageWheelSignal WheelEventSignal()
654 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(swigCPtr), false);
655 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659 internal VoidSignal ContextLostSignal()
661 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(swigCPtr), false);
662 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666 internal VoidSignal ContextRegainedSignal()
668 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(swigCPtr), false);
669 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673 internal VoidSignal SceneCreatedSignal()
675 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(swigCPtr), false);
676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();