//------------------------------------------------------------------------------ // // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.9 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ namespace Dali { using System; using System.Runtime.InteropServices; public class Stage : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal Stage(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Stage_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Stage obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Stage() { Dispose(); } public override void Dispose() { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicPINVOKE.delete_Stage(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } global::System.GC.SuppressFinalize(this); base.Dispose(); } } /** * @brief Event arguments that passed via Touch signal * */ public class TouchEventArgs : EventArgs { private TouchData _touchData; /** * @brief TouchData - contains the information of touch points * */ public TouchData TouchData { get { return _touchData; } set { _touchData = value; } } } /** * @brief Event arguments that passed via Wheel signal * */ public class WheelEventArgs : EventArgs { private WheelEvent _wheelEvent; /** * @brief WheelEvent - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL * */ public WheelEvent WheelEvent { get { return _wheelEvent; } set { _wheelEvent = value; } } } /** * @brief Event arguments that passed via KeyEvent signal * */ public class KeyEventArgs : EventArgs { private KeyEvent _keyEvent; /** * @brief KeyEvent - is the keyevent sent to Stage. * */ public KeyEvent KeyEvent { get { return _keyEvent; } set { _keyEvent = value; } } } /** * @brief Event arguments that passed via EventProcessingFinished signal * */ public class EventProcessingFinishedEventArgs : EventArgs { } /** * @brief Event arguments that passed via ContextLost signal * */ public class ContextLostEventArgs : EventArgs { } /** * @brief Event arguments that passed via ContextRegained signal * */ public class ContextRegainedEventArgs : EventArgs { } /** * @brief Event arguments that passed via SceneCreated signal * */ public class SceneCreatedEventArgs : EventArgs { } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void StageTouchCallbackDelegate(IntPtr data); private DaliEventHandler _stageTouchEventHandler; private StageTouchCallbackDelegate _stageTouchCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WheelCallbackDelegate(IntPtr data); private DaliEventHandler _stageWheelEventHandler; private WheelCallbackDelegate _stageWheelCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void KeyCallbackDelegate(IntPtr data); private DaliEventHandler _stageKeyEventHandler; private KeyCallbackDelegate _stageKeyCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void EventProcessingFinishedEventCallbackDelegate(); private DaliEventHandler _stageEventProcessingFinishedEventHandler; private EventProcessingFinishedEventCallbackDelegate _stageEventProcessingFinishedEventCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ContextLostEventCallbackDelegate(); private DaliEventHandler _stageContextLostEventHandler; private ContextLostEventCallbackDelegate _stageContextLostEventCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ContextRegainedEventCallbackDelegate(); private DaliEventHandler _stageContextRegainedEventHandler; private ContextRegainedEventCallbackDelegate _stageContextRegainedEventCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void SceneCreatedEventCallbackDelegate(); private DaliEventHandler _stageSceneCreatedEventHandler; private SceneCreatedEventCallbackDelegate _stageSceneCreatedEventCallbackDelegate; /** * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler * (in the type of TouchEventHandler-DaliEventHandler) provided by the user. * Touched signal is emitted when the screen is touched and when the touch ends * (i.e. the down & up touch events only). * */ public event DaliEventHandler Touched { add { lock(this) { // Restricted to only one listener if (_stageTouchEventHandler == null) { _stageTouchEventHandler += value; _stageTouchCallbackDelegate = new StageTouchCallbackDelegate(OnStageTouch); this.TouchSignal().Connect(_stageTouchCallbackDelegate); } } } remove { lock(this) { if (_stageTouchEventHandler != null) { this.TouchSignal().Disconnect(_stageTouchCallbackDelegate); } _stageTouchEventHandler -= value; } } } // Callback for Stage Touch signal private void OnStageTouch(IntPtr data) { TouchEventArgs e = new TouchEventArgs(); // Populate all members of "e" (TouchEventArgs) with real data e.TouchData = TouchData.GetTouchDataFromPtr( data ); if (_stageTouchEventHandler != null) { //here we send all data to user event handlers _stageTouchEventHandler(this, e); } } /** * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler * (in the type of WheelEventHandler-DaliEventHandler) provided by the user. * WheelMoved signal is emitted is emitted when wheel event is received. * */ public event DaliEventHandler WheelMoved { add { lock(this) { // Restricted to only one listener if (_stageWheelEventHandler == null) { _stageWheelEventHandler += value; _stageWheelCallbackDelegate = new WheelCallbackDelegate(OnStageWheel); this.WheelEventSignal().Connect(_stageWheelCallbackDelegate); } } } remove { lock(this) { if (_stageWheelEventHandler != null) { this.WheelEventSignal().Disconnect(_stageWheelCallbackDelegate); } _stageWheelEventHandler -= value; } } } // Callback for Stage WheelEventsignal private void OnStageWheel(IntPtr data) { WheelEventArgs e = new WheelEventArgs(); // Populate all members of "e" (WheelEventArgs) with real data e.WheelEvent = Dali.WheelEvent.GetWheelEventFromPtr( data ); if (_stageWheelEventHandler != null) { //here we send all data to user event handlers _stageWheelEventHandler(this, e); } } /** * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler * (in the type of KeyEventHandler-DaliEventHandler) provided by the user. * KeyPressed signal is emitted is emitted when key event is received. * */ public event DaliEventHandler KeyPressed { add { lock(this) { // Restricted to only one listener if (_stageKeyEventHandler == null) { _stageKeyEventHandler += value; _stageKeyCallbackDelegate = new KeyCallbackDelegate(OnStageKey); this.KeyEventSignal().Connect(_stageKeyCallbackDelegate); } } } remove { lock(this) { if (_stageKeyEventHandler != null) { this.KeyEventSignal().Disconnect(_stageKeyCallbackDelegate); } _stageKeyEventHandler -= value; } } } // Callback for Stage KeyEventsignal private void OnStageKey(IntPtr keyEvent) { KeyEventArgs e = new KeyEventArgs(); // Populate all members of "e" (KeyEventArgs) with real data e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr( keyEvent ); if (_stageKeyEventHandler != null) { //here we send all data to user event handlers _stageKeyEventHandler(this, e); } } /** * @brief Event for EventProcessingFinished signal which can be used to subscribe/unsubscribe the event handler * (in the type of EventProcessingFinishedEventHandler-DaliEventHandler) * provided by the user. EventProcessingFinished signal is emitted just after the event processing is finished. * */ public event DaliEventHandler EventProcessingFinished { add { lock(this) { // Restricted to only one listener if (_stageEventProcessingFinishedEventHandler == null) { _stageEventProcessingFinishedEventHandler += value; _stageEventProcessingFinishedEventCallbackDelegate = new EventProcessingFinishedEventCallbackDelegate(OnEventProcessingFinished); this.EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate); } } } remove { lock(this) { if (_stageEventProcessingFinishedEventHandler != null) { this.EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate); } _stageEventProcessingFinishedEventHandler -= value; } } } // Callback for Stage EventProcessingFinishedSignal private void OnEventProcessingFinished() { EventProcessingFinishedEventArgs e = new EventProcessingFinishedEventArgs(); if (_stageEventProcessingFinishedEventHandler != null) { //here we send all data to user event handlers _stageEventProcessingFinishedEventHandler(this, e); } } /** * @brief Event for ContextLost signal which can be used to subscribe/unsubscribe the event handler * (in the type of ContextLostEventHandler-DaliEventHandler) provided by the user. * ContextLost signal is emitted when the GL context is lost (Platform specific behaviour). * */ public event DaliEventHandler ContextLost { add { lock(this) { // Restricted to only one listener if (_stageContextLostEventHandler == null) { _stageContextLostEventHandler += value; _stageContextLostEventCallbackDelegate = new ContextLostEventCallbackDelegate(OnContextLost); this.ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate); } } } remove { lock(this) { if (_stageContextLostEventHandler != null) { this.ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate); } _stageContextLostEventHandler -= value; } } } // Callback for Stage ContextLostSignal private void OnContextLost() { ContextLostEventArgs e = new ContextLostEventArgs(); if (_stageContextLostEventHandler != null) { //here we send all data to user event handlers _stageContextLostEventHandler(this, e); } } /** * @brief Event for ContextRegained signal which can be used to subscribe/unsubscribe the event handler * (in the type of ContextRegainedEventHandler-DaliEventHandler) * provided by the user. ContextRegained signal is emitted when the GL context is regained (Platform specific * behaviour). * */ public event DaliEventHandler ContextRegained { add { lock(this) { // Restricted to only one listener if (_stageContextRegainedEventHandler == null) { _stageContextRegainedEventHandler += value; _stageContextRegainedEventCallbackDelegate = new ContextRegainedEventCallbackDelegate(OnContextRegained); this.ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate); } } } remove { lock(this) { if (_stageContextRegainedEventHandler != null) { this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate); } _stageContextRegainedEventHandler -= value; } } } // Callback for Stage ContextRegainedSignal private void OnContextRegained() { ContextRegainedEventArgs e = new ContextRegainedEventArgs(); if (_stageContextRegainedEventHandler != null) { //here we send all data to user event handlers _stageContextRegainedEventHandler(this, e); } } /** * @brief Event for SceneCreated signal which can be used to subscribe/unsubscribe the event handler * (in the type of SceneCreatedEventHandler-DaliEventHandler) provided by the user. * SceneCreated signal is emitted after the initial scene is created. * */ public event DaliEventHandler SceneCreated { add { lock(this) { // Restricted to only one listener if (_stageSceneCreatedEventHandler == null) { _stageSceneCreatedEventHandler += value; _stageSceneCreatedEventCallbackDelegate = new SceneCreatedEventCallbackDelegate(OnSceneCreated); this.SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate); } } } remove { lock(this) { if (_stageSceneCreatedEventHandler != null) { this.SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate); } _stageSceneCreatedEventHandler -= value; } } } // Callback for Stage SceneCreatedSignal private void OnSceneCreated() { SceneCreatedEventArgs e = new SceneCreatedEventArgs(); if (_stageSceneCreatedEventHandler != null) { //here we send all data to user event handlers _stageSceneCreatedEventHandler(this, e); } } public Vector2 Size { get { Vector2 ret = GetSize(); return ret; } } public Vector4 BackgroundColor { set { SetBackgroundColor(value); } get { Vector4 ret = GetBackgroundColor(); return ret; } } public static Vector4 DEFAULT_BACKGROUND_COLOR { get { global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get(); Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } public static Vector4 DEBUG_BACKGROUND_COLOR { get { global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get(); Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } public Stage() : this(NDalicPINVOKE.new_Stage__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public static Stage GetCurrent() { Stage ret = new Stage(NDalicPINVOKE.Stage_GetCurrent(), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public static bool IsInstalled() { bool ret = NDalicPINVOKE.Stage_IsInstalled(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Stage(Stage handle) : this(NDalicPINVOKE.new_Stage__SWIG_1(Stage.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Stage Assign(Stage rhs) { Stage ret = new Stage(NDalicPINVOKE.Stage_Assign(swigCPtr, Stage.getCPtr(rhs)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void Add(Actor actor) { NDalicPINVOKE.Stage_Add(swigCPtr, Actor.getCPtr(actor)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Remove(Actor actor) { NDalicPINVOKE.Stage_Remove(swigCPtr, Actor.getCPtr(actor)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Vector2 GetSize() { Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public RenderTaskList GetRenderTaskList() { RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public uint GetLayerCount() { uint ret = NDalicPINVOKE.Stage_GetLayerCount(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Layer GetLayer(uint depth) { Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(swigCPtr, depth), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Layer GetRootLayer() { Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetBackgroundColor(Vector4 color) { NDalicPINVOKE.Stage_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Vector4 GetBackgroundColor() { Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Vector2 GetDpi() { Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public ObjectRegistry GetObjectRegistry() { ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void KeepRendering(float durationSeconds) { NDalicPINVOKE.Stage_KeepRendering(swigCPtr, durationSeconds); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public KeyEventSignal KeyEventSignal() { KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public VoidSignal EventProcessingFinishedSignal() { VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public TouchEventSignal TouchedSignal() { TouchEventSignal ret = new TouchEventSignal(NDalicPINVOKE.Stage_TouchedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public TouchSignal TouchSignal() { TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public StageWheelEventSignal WheelEventSignal() { StageWheelEventSignal ret = new StageWheelEventSignal(NDalicPINVOKE.Stage_WheelEventSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public VoidSignal ContextLostSignal() { VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public VoidSignal ContextRegainedSignal() { VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public VoidSignal SceneCreatedSignal() { VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } }