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 //------------------------------------------------------------------------------
14 using System.Runtime.InteropServices;
17 public class Stage : BaseHandle {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 internal Stage(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Stage_SWIGUpcast(cPtr), cMemoryOwn) {
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Stage obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 DisposeQueue.Instance.Add(this);
32 public override void Dispose() {
33 if (!Stage.IsInstalled()) {
34 DisposeQueue.Instance.Add(this);
39 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 NDalicPINVOKE.delete_Stage(swigCPtr);
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46 global::System.GC.SuppressFinalize(this);
55 * @brief Event arguments that passed via Touch signal
58 public class TouchEventArgs : EventArgs
63 * @brief Touch - contains the information of touch points
79 private event EventHandler<TouchEventArgs> _stageTouchHandler;
80 private EventCallbackDelegateType1<IntPtr> _stageTouchCallbackDelegate;
83 * @brief Event for TouchEvent signal which can be used to subscribe/unsubscribe the event handler
84 * TouchEvent signal is emitted when the screen is touched and when the touch ends
85 * (i.e. the down & up touch events only).
88 public event EventHandler<TouchEventArgs> Touch
94 _stageTouchHandler += value;
95 _stageTouchCallbackDelegate = OnStageTouch;
96 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
103 if (_stageTouchHandler != null)
105 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
107 _stageTouchHandler -= value;
112 private void OnStageTouch(IntPtr data)
114 TouchEventArgs e = new TouchEventArgs();
118 e.Touch = Dali.Touch.GetTouchFromPtr( data );
121 if (_stageTouchHandler != null)
123 _stageTouchHandler(this, e);
128 * @brief Wheel arguments that passed via Wheel signal
131 public class WheelEventArgs : EventArgs
133 private Wheel _wheel;
136 * @brief Wheel - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL
152 private event EventHandler<WheelEventArgs> _stageWheelHandler;
153 private EventCallbackDelegateType1<IntPtr> _stageWheelCallbackDelegate;
156 * @brief Event for Wheel signal which can be used to subscribe/unsubscribe the event handler
157 * Wheel signal is emitted is emitted when wheel event is received.
160 public event EventHandler<WheelEventArgs> Wheel
166 _stageWheelHandler += value;
167 _stageWheelCallbackDelegate = OnStageWheel;
168 this.WheelEventSignal().Connect(_stageWheelCallbackDelegate);
175 if (_stageWheelHandler != null)
177 this.WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
179 _stageWheelHandler -= value;
184 private void OnStageWheel(IntPtr data)
186 WheelEventArgs e = new WheelEventArgs();
190 e.Wheel = Dali.Wheel.GetWheelFromPtr( data );
193 if (_stageWheelHandler != null)
195 _stageWheelHandler(this, e);
200 * @brief Event arguments that passed via Key signal
203 public class KeyEventArgs : EventArgs
208 * @brief Key - is the keyevent sent to Stage.
224 private event EventHandler<KeyEventArgs> _stageKeyHandler;
225 private EventCallbackDelegateType1<IntPtr> _stageKeyCallbackDelegate;
228 * @brief Event for Key signal which can be used to subscribe/unsubscribe the event handler
229 * Key signal is emitted is emitted when key event is received.
232 public event EventHandler<KeyEventArgs> Key
238 _stageKeyHandler += value;
239 _stageKeyCallbackDelegate = OnStageKey;
240 this.KeyEventSignal().Connect(_stageKeyCallbackDelegate);
247 if (_stageKeyHandler != null)
249 this.KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
251 _stageKeyHandler -= value;
256 // Callback for Stage KeyEventsignal
257 private void OnStageKey(IntPtr data)
259 KeyEventArgs e = new KeyEventArgs();
263 e.Key = Dali.Key.GetKeyFromPtr( data );
266 if (_stageKeyHandler != null)
268 //here we send all data to user event handlers
269 _stageKeyHandler(this, e);
274 private event EventHandler _stageEventProcessingFinishedEventHandler;
275 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
278 * @brief Event for EventProcessingFinished signal which can be used to subscribe/unsubscribe the event handler
279 * provided by the user. EventProcessingFinished signal is emitted just after the event processing is finished.
282 public event EventHandler EventProcessingFinished
288 _stageEventProcessingFinishedEventHandler += value;
289 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
290 this.EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
297 if (_stageEventProcessingFinishedEventHandler != null)
299 this.EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
301 _stageEventProcessingFinishedEventHandler -= value;
306 // Callback for Stage EventProcessingFinishedSignal
307 private void OnEventProcessingFinished()
309 if (_stageEventProcessingFinishedEventHandler != null)
311 _stageEventProcessingFinishedEventHandler(this, null);
316 private EventHandler _stageContextLostEventHandler;
317 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
320 * @brief Event for ContextLost signal which can be used to subscribe/unsubscribe the event handler
321 * ContextLost signal is emitted when the GL context is lost (Platform specific behaviour).
324 public event EventHandler ContextLost
330 _stageContextLostEventHandler += value;
331 _stageContextLostEventCallbackDelegate = OnContextLost;
332 this.ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
339 if (_stageContextLostEventHandler != null)
341 this.ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
344 _stageContextLostEventHandler -= value;
349 // Callback for Stage ContextLostSignal
350 private void OnContextLost()
352 if (_stageContextLostEventHandler != null)
354 _stageContextLostEventHandler(this, null);
359 private EventHandler _stageContextRegainedEventHandler;
360 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
363 * @brief Event for ContextRegained signal which can be used to subscribe/unsubscribe the event handler
364 * provided by the user. ContextRegained signal is emitted when the GL context is regained (Platform specific
368 public event EventHandler ContextRegained
374 _stageContextRegainedEventHandler += value;
375 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
376 this.ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
383 if (_stageContextRegainedEventHandler != null)
385 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
388 _stageContextRegainedEventHandler -= value;
393 // Callback for Stage ContextRegainedSignal
394 private void OnContextRegained()
396 if (_stageContextRegainedEventHandler != null)
398 _stageContextRegainedEventHandler(this, null);
403 private EventHandler _stageSceneCreatedEventHandler;
404 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
407 * @brief Event for SceneCreated signal which can be used to subscribe/unsubscribe the event handler
408 * SceneCreated signal is emitted after the initial scene is created.
411 public event EventHandler SceneCreated
417 _stageSceneCreatedEventHandler += value;
418 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
419 this.SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
426 if (_stageSceneCreatedEventHandler != null)
428 this.SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
431 _stageSceneCreatedEventHandler -= value;
436 // Callback for Stage SceneCreatedSignal
437 private void OnSceneCreated()
439 if (_stageSceneCreatedEventHandler != null)
441 _stageSceneCreatedEventHandler(this, null);
450 Vector2 ret = GetSize();
455 public Vector4 BackgroundColor
459 SetBackgroundColor(value);
463 Vector4 ret = GetBackgroundColor();
468 private static readonly Stage instance = Stage.GetCurrent();
470 public static Stage Instance
478 public Layer GetDefaultLayer()
480 return this.GetRootLayer();
483 public void AddLayer(Layer layer)
485 this.Add( (Actor)layer );
488 public void RemoveLayer(Layer layer)
490 this.Remove( (Actor)layer );
495 public static Vector4 DEFAULT_BACKGROUND_COLOR {
497 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
498 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
499 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504 public static Vector4 DEBUG_BACKGROUND_COLOR {
506 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
507 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
513 public Stage() : this(NDalicPINVOKE.new_Stage__SWIG_0(), true) {
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517 public static Stage GetCurrent() {
518 Stage ret = new Stage(NDalicPINVOKE.Stage_GetCurrent(), true);
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523 public static bool IsInstalled() {
524 bool ret = NDalicPINVOKE.Stage_IsInstalled();
525 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529 public Stage(Stage handle) : this(NDalicPINVOKE.new_Stage__SWIG_1(Stage.getCPtr(handle)), true) {
530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 public Stage Assign(Stage rhs) {
534 Stage ret = new Stage(NDalicPINVOKE.Stage_Assign(swigCPtr, Stage.getCPtr(rhs)), false);
535 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
539 public void Add(Actor actor) {
540 NDalicPINVOKE.Stage_Add(swigCPtr, Actor.getCPtr(actor));
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
544 public void Remove(Actor actor) {
545 NDalicPINVOKE.Stage_Remove(swigCPtr, Actor.getCPtr(actor));
546 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549 public Vector2 GetSize() {
550 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(swigCPtr), true);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 public RenderTaskList GetRenderTaskList() {
556 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(swigCPtr), true);
557 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561 public uint GetLayerCount() {
562 uint ret = NDalicPINVOKE.Stage_GetLayerCount(swigCPtr);
563 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567 public Layer GetLayer(uint depth) {
568 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(swigCPtr, depth), true);
569 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
573 public Layer GetRootLayer() {
574 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(swigCPtr), true);
575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579 public void SetBackgroundColor(Vector4 color) {
580 NDalicPINVOKE.Stage_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
581 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584 public Vector4 GetBackgroundColor() {
585 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(swigCPtr), true);
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590 public Vector2 GetDpi() {
591 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(swigCPtr), true);
592 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596 public ObjectRegistry GetObjectRegistry() {
597 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(swigCPtr), true);
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 public void KeepRendering(float durationSeconds) {
603 NDalicPINVOKE.Stage_KeepRendering(swigCPtr, durationSeconds);
604 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607 public KeyEventSignal KeyEventSignal() {
608 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(swigCPtr), false);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 public VoidSignal EventProcessingFinishedSignal() {
614 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(swigCPtr), false);
615 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619 public TouchSignal TouchSignal() {
620 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(swigCPtr), false);
621 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625 public StageWheelSignal WheelEventSignal() {
626 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(swigCPtr), false);
627 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
631 public VoidSignal ContextLostSignal() {
632 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(swigCPtr), false);
633 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
637 public VoidSignal ContextRegainedSignal() {
638 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(swigCPtr), false);
639 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643 public VoidSignal SceneCreatedSignal() {
644 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(swigCPtr), false);
645 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();