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;
32 public override void Dispose() {
34 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
37 NDalicPINVOKE.delete_Stage(swigCPtr);
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41 global::System.GC.SuppressFinalize(this);
48 * @brief Event arguments that passed via Touch signal
51 public class TouchEventArgs : EventArgs
53 private TouchData _touchData;
56 * @brief TouchData - contains the information of touch points
59 public TouchData TouchData
74 * @brief Event arguments that passed via Wheel signal
77 public class WheelEventArgs : EventArgs
79 private WheelEvent _wheelEvent;
82 * @brief WheelEvent - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL
85 public WheelEvent WheelEvent
99 * @brief Event arguments that passed via KeyEvent signal
102 public class KeyEventArgs : EventArgs
104 private KeyEvent _keyEvent;
107 * @brief KeyEvent - is the keyevent sent to Stage.
110 public KeyEvent KeyEvent
124 * @brief Event arguments that passed via EventProcessingFinished signal
127 public class EventProcessingFinishedEventArgs : EventArgs
132 * @brief Event arguments that passed via ContextLost signal
135 public class ContextLostEventArgs : EventArgs
140 * @brief Event arguments that passed via ContextRegained signal
143 public class ContextRegainedEventArgs : EventArgs
148 * @brief Event arguments that passed via SceneCreated signal
151 public class SceneCreatedEventArgs : EventArgs
156 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
157 private delegate void StageTouchCallbackDelegate(IntPtr data);
158 private DaliEventHandler<object,TouchEventArgs> _stageTouchEventHandler;
159 private StageTouchCallbackDelegate _stageTouchCallbackDelegate;
161 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
162 private delegate void WheelCallbackDelegate(IntPtr data);
163 private DaliEventHandler<object,WheelEventArgs> _stageWheelEventHandler;
164 private WheelCallbackDelegate _stageWheelCallbackDelegate;
166 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
167 private delegate void KeyCallbackDelegate(IntPtr data);
168 private DaliEventHandler<object,KeyEventArgs> _stageKeyEventHandler;
169 private KeyCallbackDelegate _stageKeyCallbackDelegate;
171 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
172 private delegate void EventProcessingFinishedEventCallbackDelegate();
173 private DaliEventHandler<object,EventProcessingFinishedEventArgs> _stageEventProcessingFinishedEventHandler;
174 private EventProcessingFinishedEventCallbackDelegate _stageEventProcessingFinishedEventCallbackDelegate;
176 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
177 private delegate void ContextLostEventCallbackDelegate();
178 private DaliEventHandler<object,ContextLostEventArgs> _stageContextLostEventHandler;
179 private ContextLostEventCallbackDelegate _stageContextLostEventCallbackDelegate;
181 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
182 private delegate void ContextRegainedEventCallbackDelegate();
183 private DaliEventHandler<object,ContextRegainedEventArgs> _stageContextRegainedEventHandler;
184 private ContextRegainedEventCallbackDelegate _stageContextRegainedEventCallbackDelegate;
186 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
187 private delegate void SceneCreatedEventCallbackDelegate();
188 private DaliEventHandler<object,SceneCreatedEventArgs> _stageSceneCreatedEventHandler;
189 private SceneCreatedEventCallbackDelegate _stageSceneCreatedEventCallbackDelegate;
192 * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler
193 * (in the type of TouchEventHandler-DaliEventHandler<object,TouchEventArgs>) provided by the user.
194 * Touched signal is emitted when the screen is touched and when the touch ends
195 * (i.e. the down & up touch events only).
198 public event DaliEventHandler<object,TouchEventArgs> Touched
204 // Restricted to only one listener
205 if (_stageTouchEventHandler == null)
207 _stageTouchEventHandler += value;
209 _stageTouchCallbackDelegate = new StageTouchCallbackDelegate(OnStageTouch);
210 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
219 if (_stageTouchEventHandler != null)
221 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
224 _stageTouchEventHandler -= value;
229 // Callback for Stage Touch signal
230 private void OnStageTouch(IntPtr data)
232 TouchEventArgs e = new TouchEventArgs();
234 // Populate all members of "e" (TouchEventArgs) with real data
235 e.TouchData = TouchData.GetTouchDataFromPtr( data );
237 if (_stageTouchEventHandler != null)
239 //here we send all data to user event handlers
240 _stageTouchEventHandler(this, e);
245 * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler
246 * (in the type of WheelEventHandler-DaliEventHandler<object,WheelEventArgs>) provided by the user.
247 * WheelMoved signal is emitted is emitted when wheel event is received.
250 public event DaliEventHandler<object,WheelEventArgs> WheelMoved
256 // Restricted to only one listener
257 if (_stageWheelEventHandler == null)
259 _stageWheelEventHandler += value;
261 _stageWheelCallbackDelegate = new WheelCallbackDelegate(OnStageWheel);
262 this.WheelEventSignal().Connect(_stageWheelCallbackDelegate);
271 if (_stageWheelEventHandler != null)
273 this.WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
276 _stageWheelEventHandler -= value;
281 // Callback for Stage WheelEventsignal
282 private void OnStageWheel(IntPtr data)
284 WheelEventArgs e = new WheelEventArgs();
286 // Populate all members of "e" (WheelEventArgs) with real data
287 e.WheelEvent = Dali.WheelEvent.GetWheelEventFromPtr( data );
289 if (_stageWheelEventHandler != null)
291 //here we send all data to user event handlers
292 _stageWheelEventHandler(this, e);
297 * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
298 * (in the type of KeyEventHandler-DaliEventHandler<object,KeyEventArgs>) provided by the user.
299 * KeyPressed signal is emitted is emitted when key event is received.
302 public event DaliEventHandler<object,KeyEventArgs> KeyPressed
308 // Restricted to only one listener
309 if (_stageKeyEventHandler == null)
311 _stageKeyEventHandler += value;
313 _stageKeyCallbackDelegate = new KeyCallbackDelegate(OnStageKey);
314 this.KeyEventSignal().Connect(_stageKeyCallbackDelegate);
323 if (_stageKeyEventHandler != null)
325 this.KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
328 _stageKeyEventHandler -= value;
333 // Callback for Stage KeyEventsignal
334 private void OnStageKey(IntPtr keyEvent)
336 KeyEventArgs e = new KeyEventArgs();
338 // Populate all members of "e" (KeyEventArgs) with real data
339 e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr( keyEvent );
341 if (_stageKeyEventHandler != null)
343 //here we send all data to user event handlers
344 _stageKeyEventHandler(this, e);
349 * @brief Event for EventProcessingFinished signal which can be used to subscribe/unsubscribe the event handler
350 * (in the type of EventProcessingFinishedEventHandler-DaliEventHandler<object,EventProcessingFinishedEventArgs>)
351 * provided by the user. EventProcessingFinished signal is emitted just after the event processing is finished.
354 public event DaliEventHandler<object,EventProcessingFinishedEventArgs> EventProcessingFinished
360 // Restricted to only one listener
361 if (_stageEventProcessingFinishedEventHandler == null)
363 _stageEventProcessingFinishedEventHandler += value;
365 _stageEventProcessingFinishedEventCallbackDelegate = new EventProcessingFinishedEventCallbackDelegate(OnEventProcessingFinished);
366 this.EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
375 if (_stageEventProcessingFinishedEventHandler != null)
377 this.EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
380 _stageEventProcessingFinishedEventHandler -= value;
385 // Callback for Stage EventProcessingFinishedSignal
386 private void OnEventProcessingFinished()
388 EventProcessingFinishedEventArgs e = new EventProcessingFinishedEventArgs();
390 if (_stageEventProcessingFinishedEventHandler != null)
392 //here we send all data to user event handlers
393 _stageEventProcessingFinishedEventHandler(this, e);
398 * @brief Event for ContextLost signal which can be used to subscribe/unsubscribe the event handler
399 * (in the type of ContextLostEventHandler-DaliEventHandler<object,ContextLostEventArgs>) provided by the user.
400 * ContextLost signal is emitted when the GL context is lost (Platform specific behaviour).
403 public event DaliEventHandler<object,ContextLostEventArgs> ContextLost
409 // Restricted to only one listener
410 if (_stageContextLostEventHandler == null)
412 _stageContextLostEventHandler += value;
414 _stageContextLostEventCallbackDelegate = new ContextLostEventCallbackDelegate(OnContextLost);
415 this.ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
424 if (_stageContextLostEventHandler != null)
426 this.ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
429 _stageContextLostEventHandler -= value;
434 // Callback for Stage ContextLostSignal
435 private void OnContextLost()
437 ContextLostEventArgs e = new ContextLostEventArgs();
439 if (_stageContextLostEventHandler != null)
441 //here we send all data to user event handlers
442 _stageContextLostEventHandler(this, e);
447 * @brief Event for ContextRegained signal which can be used to subscribe/unsubscribe the event handler
448 * (in the type of ContextRegainedEventHandler-DaliEventHandler<object,ContextRegainedEventArgs>)
449 * provided by the user. ContextRegained signal is emitted when the GL context is regained (Platform specific
453 public event DaliEventHandler<object,ContextRegainedEventArgs> ContextRegained
459 // Restricted to only one listener
460 if (_stageContextRegainedEventHandler == null)
462 _stageContextRegainedEventHandler += value;
464 _stageContextRegainedEventCallbackDelegate = new ContextRegainedEventCallbackDelegate(OnContextRegained);
465 this.ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
474 if (_stageContextRegainedEventHandler != null)
476 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
479 _stageContextRegainedEventHandler -= value;
484 // Callback for Stage ContextRegainedSignal
485 private void OnContextRegained()
487 ContextRegainedEventArgs e = new ContextRegainedEventArgs();
489 if (_stageContextRegainedEventHandler != null)
491 //here we send all data to user event handlers
492 _stageContextRegainedEventHandler(this, e);
497 * @brief Event for SceneCreated signal which can be used to subscribe/unsubscribe the event handler
498 * (in the type of SceneCreatedEventHandler-DaliEventHandler<object,SceneCreatedEventArgs>) provided by the user.
499 * SceneCreated signal is emitted after the initial scene is created.
502 public event DaliEventHandler<object,SceneCreatedEventArgs> SceneCreated
508 // Restricted to only one listener
509 if (_stageSceneCreatedEventHandler == null)
511 _stageSceneCreatedEventHandler += value;
513 _stageSceneCreatedEventCallbackDelegate = new SceneCreatedEventCallbackDelegate(OnSceneCreated);
514 this.SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
523 if (_stageSceneCreatedEventHandler != null)
525 this.SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
528 _stageSceneCreatedEventHandler -= value;
533 // Callback for Stage SceneCreatedSignal
534 private void OnSceneCreated()
536 SceneCreatedEventArgs e = new SceneCreatedEventArgs();
538 if (_stageSceneCreatedEventHandler != null)
540 //here we send all data to user event handlers
541 _stageSceneCreatedEventHandler(this, e);
549 Vector2 ret = GetSize();
554 public Vector4 BackgroundColor
558 SetBackgroundColor(value);
562 Vector4 ret = GetBackgroundColor();
568 public static Vector4 DEFAULT_BACKGROUND_COLOR {
570 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
571 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
577 public static Vector4 DEBUG_BACKGROUND_COLOR {
579 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
580 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
581 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 public Stage() : this(NDalicPINVOKE.new_Stage__SWIG_0(), true) {
587 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590 public static Stage GetCurrent() {
591 Stage ret = new Stage(NDalicPINVOKE.Stage_GetCurrent(), true);
592 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596 public static bool IsInstalled() {
597 bool ret = NDalicPINVOKE.Stage_IsInstalled();
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 public Stage(Stage handle) : this(NDalicPINVOKE.new_Stage__SWIG_1(Stage.getCPtr(handle)), true) {
603 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606 public Stage Assign(Stage rhs) {
607 Stage ret = new Stage(NDalicPINVOKE.Stage_Assign(swigCPtr, Stage.getCPtr(rhs)), false);
608 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
612 public void Add(Actor actor) {
613 NDalicPINVOKE.Stage_Add(swigCPtr, Actor.getCPtr(actor));
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617 public void Remove(Actor actor) {
618 NDalicPINVOKE.Stage_Remove(swigCPtr, Actor.getCPtr(actor));
619 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622 public Vector2 GetSize() {
623 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(swigCPtr), true);
624 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
628 public RenderTaskList GetRenderTaskList() {
629 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(swigCPtr), true);
630 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634 public uint GetLayerCount() {
635 uint ret = NDalicPINVOKE.Stage_GetLayerCount(swigCPtr);
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 public Layer GetLayer(uint depth) {
641 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(swigCPtr, depth), true);
642 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646 public Layer GetRootLayer() {
647 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(swigCPtr), true);
648 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 public void SetBackgroundColor(Vector4 color) {
653 NDalicPINVOKE.Stage_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
654 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
657 public Vector4 GetBackgroundColor() {
658 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(swigCPtr), true);
659 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
663 public Vector2 GetDpi() {
664 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(swigCPtr), true);
665 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
669 public ObjectRegistry GetObjectRegistry() {
670 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(swigCPtr), true);
671 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
675 public void KeepRendering(float durationSeconds) {
676 NDalicPINVOKE.Stage_KeepRendering(swigCPtr, durationSeconds);
677 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 public KeyEventSignal KeyEventSignal() {
681 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(swigCPtr), false);
682 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
686 public VoidSignal EventProcessingFinishedSignal() {
687 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(swigCPtr), false);
688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 public TouchEventSignal TouchedSignal() {
693 TouchEventSignal ret = new TouchEventSignal(NDalicPINVOKE.Stage_TouchedSignal(swigCPtr), false);
694 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698 public TouchSignal TouchSignal() {
699 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(swigCPtr), false);
700 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704 public StageWheelEventSignal WheelEventSignal() {
705 StageWheelEventSignal ret = new StageWheelEventSignal(NDalicPINVOKE.Stage_WheelEventSignal(swigCPtr), false);
706 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 public VoidSignal ContextLostSignal() {
711 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(swigCPtr), false);
712 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
716 public VoidSignal ContextRegainedSignal() {
717 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(swigCPtr), false);
718 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
722 public VoidSignal SceneCreatedSignal() {
723 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(swigCPtr), false);
724 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();