New directory structure for C#
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / Stage.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.10
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Dali {
12
13 using System;
14 using System.Runtime.InteropServices;
15
16
17 public class Stage : BaseHandle {
18   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19
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);
22   }
23
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;
26   }
27
28   ~Stage() {
29     DisposeQueue.Instance.Add(this);
30   }
31
32   public override void Dispose() {
33     if (!Stage.IsInstalled()) {
34       DisposeQueue.Instance.Add(this);
35       return;
36     }
37
38     lock(this) {
39       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
40         if (swigCMemOwn) {
41           swigCMemOwn = false;
42           NDalicPINVOKE.delete_Stage(swigCPtr);
43         }
44         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
45       }
46       global::System.GC.SuppressFinalize(this);
47       base.Dispose();
48     }
49   }
50
51
52
53
54   /**
55     * @brief Event arguments that passed via Touch signal
56     *
57     */
58   public class TouchEventArgs : EventArgs
59   {
60      private Touch _touch;
61
62      /**
63        * @brief Touch - contains the information of touch points
64        *
65        */
66      public Touch Touch
67      {
68         get
69         {
70            return _touch;
71         }
72         set
73         {
74            _touch = value;
75         }
76      }
77   }
78
79   private event EventHandler<TouchEventArgs> _stageTouchHandler;
80   private EventCallbackDelegateType1<IntPtr> _stageTouchCallbackDelegate;
81
82   /**
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).
86     *
87     */
88   public event EventHandler<TouchEventArgs> Touch
89   {
90      add
91      {
92         lock(this)
93         {
94           _stageTouchHandler += value;
95           _stageTouchCallbackDelegate = OnStageTouch;
96           this.TouchSignal().Connect(_stageTouchCallbackDelegate);
97         }
98      }
99      remove
100      {
101         lock(this)
102         {
103            if (_stageTouchHandler != null)
104            {
105               this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
106            }
107            _stageTouchHandler -= value;
108         }
109      }
110   }
111
112   private void OnStageTouch(IntPtr data)
113   {
114     TouchEventArgs e = new TouchEventArgs();
115
116     if( data != null )
117     {
118       e.Touch = Dali.Touch.GetTouchFromPtr( data );
119     }
120
121     if (_stageTouchHandler != null)
122     {
123       _stageTouchHandler(this, e);
124     }
125   }
126
127   /**
128     * @brief Wheel arguments that passed via Wheel signal
129     *
130     */
131   public class WheelEventArgs : EventArgs
132   {
133      private Wheel _wheel;
134
135      /**
136        * @brief Wheel - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL
137        *
138        */
139      public Wheel Wheel
140      {
141         get
142         {
143            return _wheel;
144         }
145         set
146         {
147            _wheel = value;
148         }
149      }
150   }
151
152   private event EventHandler<WheelEventArgs> _stageWheelHandler;
153   private EventCallbackDelegateType1<IntPtr> _stageWheelCallbackDelegate;
154
155   /**
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.
158     *
159     */
160   public event EventHandler<WheelEventArgs> Wheel
161   {
162      add
163      {
164         lock(this)
165         {
166           _stageWheelHandler += value;
167           _stageWheelCallbackDelegate = OnStageWheel;
168           this.WheelEventSignal().Connect(_stageWheelCallbackDelegate);
169         }
170      }
171      remove
172      {
173         lock(this)
174         {
175            if (_stageWheelHandler != null)
176            {
177               this.WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
178            }
179            _stageWheelHandler -= value;
180         }
181      }
182   }
183
184   private void OnStageWheel(IntPtr data)
185   {
186     WheelEventArgs e = new WheelEventArgs();
187
188     if( data != null )
189     {
190       e.Wheel = Dali.Wheel.GetWheelFromPtr( data );
191     }
192
193     if (_stageWheelHandler != null)
194     {
195       _stageWheelHandler(this, e);
196     }
197   }
198
199   /**
200     * @brief Event arguments that passed via Key signal
201     *
202     */
203   public class KeyEventArgs : EventArgs
204   {
205      private Key _key;
206
207      /**
208        * @brief Key - is the keyevent sent to Stage.
209        *
210        */
211      public Key Key
212      {
213         get
214         {
215            return _key;
216         }
217         set
218         {
219            _key = value;
220         }
221      }
222   }
223
224   private event EventHandler<KeyEventArgs> _stageKeyHandler;
225   private EventCallbackDelegateType1<IntPtr> _stageKeyCallbackDelegate;
226
227   /**
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.
230     *
231     */
232   public event EventHandler<KeyEventArgs> Key
233   {
234      add
235      {
236         lock(this)
237         {
238             _stageKeyHandler += value;
239             _stageKeyCallbackDelegate = OnStageKey;
240             this.KeyEventSignal().Connect(_stageKeyCallbackDelegate);
241         }
242      }
243      remove
244      {
245         lock(this)
246         {
247            if (_stageKeyHandler != null)
248            {
249               this.KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
250            }
251            _stageKeyHandler -= value;
252         }
253      }
254   }
255
256   // Callback for Stage KeyEventsignal
257   private void OnStageKey(IntPtr data)
258   {
259     KeyEventArgs e = new KeyEventArgs();
260
261     if( data != null )
262     {
263       e.Key = Dali.Key.GetKeyFromPtr( data );
264     }
265
266     if (_stageKeyHandler != null)
267     {
268       //here we send all data to user event handlers
269       _stageKeyHandler(this, e);
270     }
271   }
272
273
274   private event EventHandler _stageEventProcessingFinishedEventHandler;
275   private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
276
277   /**
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.
280     *
281     */
282   public event EventHandler EventProcessingFinished
283   {
284      add
285      {
286         lock(this)
287         {
288           _stageEventProcessingFinishedEventHandler += value;
289           _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
290           this.EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
291         }
292      }
293      remove
294      {
295         lock(this)
296         {
297            if (_stageEventProcessingFinishedEventHandler != null)
298            {
299               this.EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
300            }
301            _stageEventProcessingFinishedEventHandler -= value;
302         }
303      }
304   }
305
306   // Callback for Stage EventProcessingFinishedSignal
307   private void OnEventProcessingFinished()
308   {
309      if (_stageEventProcessingFinishedEventHandler != null)
310      {
311         _stageEventProcessingFinishedEventHandler(this, null);
312      }
313   }
314
315
316   private EventHandler _stageContextLostEventHandler;
317   private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
318
319   /**
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).
322     *
323     */
324   public event EventHandler ContextLost
325   {
326      add
327      {
328         lock(this)
329         {
330             _stageContextLostEventHandler += value;
331             _stageContextLostEventCallbackDelegate = OnContextLost;
332             this.ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
333         }
334      }
335      remove
336      {
337         lock(this)
338         {
339            if (_stageContextLostEventHandler != null)
340            {
341               this.ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
342            }
343
344            _stageContextLostEventHandler -= value;
345         }
346      }
347   }
348
349   // Callback for Stage ContextLostSignal
350   private void OnContextLost()
351   {
352      if (_stageContextLostEventHandler != null)
353      {
354         _stageContextLostEventHandler(this, null);
355      }
356   }
357
358
359   private EventHandler _stageContextRegainedEventHandler;
360   private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
361
362   /**
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
365     * behaviour).
366     *
367     */
368   public event EventHandler ContextRegained
369   {
370      add
371      {
372         lock(this)
373         {
374             _stageContextRegainedEventHandler += value;
375             _stageContextRegainedEventCallbackDelegate = OnContextRegained;
376             this.ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
377         }
378      }
379      remove
380      {
381         lock(this)
382         {
383            if (_stageContextRegainedEventHandler != null)
384            {
385               this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
386            }
387
388            _stageContextRegainedEventHandler -= value;
389         }
390      }
391   }
392
393   // Callback for Stage ContextRegainedSignal
394   private void OnContextRegained()
395   {
396      if (_stageContextRegainedEventHandler != null)
397      {
398         _stageContextRegainedEventHandler(this, null);
399      }
400   }
401
402
403   private EventHandler _stageSceneCreatedEventHandler;
404   private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
405
406   /**
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.
409     *
410     */
411   public event EventHandler SceneCreated
412   {
413      add
414      {
415         lock(this)
416         {
417             _stageSceneCreatedEventHandler += value;
418             _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
419             this.SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
420         }
421      }
422      remove
423      {
424         lock(this)
425         {
426            if (_stageSceneCreatedEventHandler != null)
427            {
428               this.SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
429            }
430
431            _stageSceneCreatedEventHandler -= value;
432         }
433      }
434   }
435
436   // Callback for Stage SceneCreatedSignal
437   private void OnSceneCreated()
438   {
439      if (_stageSceneCreatedEventHandler != null)
440      {
441         _stageSceneCreatedEventHandler(this, null);
442      }
443   }
444
445
446   public Vector2 Size
447   {
448      get
449      {
450         Vector2 ret = GetSize();
451         return ret;
452      }
453   }
454
455   public Vector4 BackgroundColor
456   {
457      set
458      {
459         SetBackgroundColor(value);
460      }
461      get
462      {
463         Vector4 ret = GetBackgroundColor();
464         return ret;
465      }
466    }
467
468   private static readonly Stage instance = Stage.GetCurrent();
469
470   public static Stage Instance
471   {
472       get
473       {
474           return instance;
475       }
476   }
477
478   public Layer GetDefaultLayer()
479   {
480     return this.GetRootLayer();
481   }
482
483   public void AddLayer(Layer layer)
484   {
485     this.Add( (Actor)layer );
486   }
487
488   public void RemoveLayer(Layer layer)
489   {
490     this.Remove( (Actor)layer );
491   }
492
493
494
495   public static Vector4 DEFAULT_BACKGROUND_COLOR {
496     get {
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();
500       return ret;
501     } 
502   }
503
504   public static Vector4 DEBUG_BACKGROUND_COLOR {
505     get {
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();
509       return ret;
510     } 
511   }
512
513   public Stage() : this(NDalicPINVOKE.new_Stage__SWIG_0(), true) {
514     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515   }
516
517   public static Stage GetCurrent() {
518     Stage ret = new Stage(NDalicPINVOKE.Stage_GetCurrent(), true);
519     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520     return ret;
521   }
522
523   public static bool IsInstalled() {
524     bool ret = NDalicPINVOKE.Stage_IsInstalled();
525     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526     return ret;
527   }
528
529   public Stage(Stage handle) : this(NDalicPINVOKE.new_Stage__SWIG_1(Stage.getCPtr(handle)), true) {
530     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531   }
532
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();
536     return ret;
537   }
538
539   public void Add(Actor actor) {
540     NDalicPINVOKE.Stage_Add(swigCPtr, Actor.getCPtr(actor));
541     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542   }
543
544   public void Remove(Actor actor) {
545     NDalicPINVOKE.Stage_Remove(swigCPtr, Actor.getCPtr(actor));
546     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547   }
548
549   public Vector2 GetSize() {
550     Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(swigCPtr), true);
551     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552     return ret;
553   }
554
555   public RenderTaskList GetRenderTaskList() {
556     RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(swigCPtr), true);
557     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
558     return ret;
559   }
560
561   public uint GetLayerCount() {
562     uint ret = NDalicPINVOKE.Stage_GetLayerCount(swigCPtr);
563     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564     return ret;
565   }
566
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();
570     return ret;
571   }
572
573   public Layer GetRootLayer() {
574     Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(swigCPtr), true);
575     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576     return ret;
577   }
578
579   public void SetBackgroundColor(Vector4 color) {
580     NDalicPINVOKE.Stage_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
581     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582   }
583
584   public Vector4 GetBackgroundColor() {
585     Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(swigCPtr), true);
586     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587     return ret;
588   }
589
590   public Vector2 GetDpi() {
591     Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(swigCPtr), true);
592     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593     return ret;
594   }
595
596   public ObjectRegistry GetObjectRegistry() {
597     ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(swigCPtr), true);
598     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599     return ret;
600   }
601
602   public void KeepRendering(float durationSeconds) {
603     NDalicPINVOKE.Stage_KeepRendering(swigCPtr, durationSeconds);
604     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605   }
606
607   public KeyEventSignal KeyEventSignal() {
608     KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(swigCPtr), false);
609     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610     return ret;
611   }
612
613   public VoidSignal EventProcessingFinishedSignal() {
614     VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(swigCPtr), false);
615     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
616     return ret;
617   }
618
619   public TouchSignal TouchSignal() {
620     TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(swigCPtr), false);
621     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622     return ret;
623   }
624
625   public StageWheelSignal WheelEventSignal() {
626     StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(swigCPtr), false);
627     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
628     return ret;
629   }
630
631   public VoidSignal ContextLostSignal() {
632     VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(swigCPtr), false);
633     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634     return ret;
635   }
636
637   public VoidSignal ContextRegainedSignal() {
638     VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(swigCPtr), false);
639     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640     return ret;
641   }
642
643   public VoidSignal SceneCreatedSignal() {
644     VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(swigCPtr), false);
645     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646     return ret;
647   }
648
649 }
650
651 }