//------------------------------------------------------------------------------
//
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// 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() {
DisposeQueue.Instance.Add(this);
}
public override void Dispose() {
if (!Stage.IsInstalled()) {
DisposeQueue.Instance.Add(this);
return;
}
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 Touch _touch;
/**
* @brief Touch - contains the information of touch points
*
*/
public Touch Touch
{
get
{
return _touch;
}
set
{
_touch = value;
}
}
}
private event EventHandler _stageTouchHandler;
private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
/**
* @brief Event for TouchEvent signal which can be used to subscribe/unsubscribe the event handler
* TouchEvent signal is emitted when the screen is touched and when the touch ends
* (i.e. the down & up touch events only).
*
*/
public event EventHandler Touch
{
add
{
lock(this)
{
_stageTouchHandler += value;
_stageTouchCallbackDelegate = OnStageTouch;
this.TouchSignal().Connect(_stageTouchCallbackDelegate);
}
}
remove
{
lock(this)
{
if (_stageTouchHandler != null)
{
this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
}
_stageTouchHandler -= value;
}
}
}
private void OnStageTouch(IntPtr data)
{
TouchEventArgs e = new TouchEventArgs();
if( data != null )
{
e.Touch = Dali.Touch.GetTouchFromPtr( data );
}
if (_stageTouchHandler != null)
{
_stageTouchHandler(this, e);
}
}
/**
* @brief Wheel arguments that passed via Wheel signal
*
*/
public class WheelEventArgs : EventArgs
{
private Wheel _wheel;
/**
* @brief Wheel - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL
*
*/
public Wheel Wheel
{
get
{
return _wheel;
}
set
{
_wheel = value;
}
}
}
private event EventHandler _stageWheelHandler;
private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
/**
* @brief Event for Wheel signal which can be used to subscribe/unsubscribe the event handler
* Wheel signal is emitted is emitted when wheel event is received.
*
*/
public event EventHandler Wheel
{
add
{
lock(this)
{
_stageWheelHandler += value;
_stageWheelCallbackDelegate = OnStageWheel;
this.WheelEventSignal().Connect(_stageWheelCallbackDelegate);
}
}
remove
{
lock(this)
{
if (_stageWheelHandler != null)
{
this.WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
}
_stageWheelHandler -= value;
}
}
}
private void OnStageWheel(IntPtr data)
{
WheelEventArgs e = new WheelEventArgs();
if( data != null )
{
e.Wheel = Dali.Wheel.GetWheelFromPtr( data );
}
if (_stageWheelHandler != null)
{
_stageWheelHandler(this, e);
}
}
/**
* @brief Event arguments that passed via Key signal
*
*/
public class KeyEventArgs : EventArgs
{
private Key _key;
/**
* @brief Key - is the keyevent sent to Stage.
*
*/
public Key Key
{
get
{
return _key;
}
set
{
_key = value;
}
}
}
private event EventHandler _stageKeyHandler;
private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
/**
* @brief Event for Key signal which can be used to subscribe/unsubscribe the event handler
* Key signal is emitted is emitted when key event is received.
*
*/
public event EventHandler Key
{
add
{
lock(this)
{
_stageKeyHandler += value;
_stageKeyCallbackDelegate = OnStageKey;
this.KeyEventSignal().Connect(_stageKeyCallbackDelegate);
}
}
remove
{
lock(this)
{
if (_stageKeyHandler != null)
{
this.KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
}
_stageKeyHandler -= value;
}
}
}
// Callback for Stage KeyEventsignal
private void OnStageKey(IntPtr data)
{
KeyEventArgs e = new KeyEventArgs();
if( data != null )
{
e.Key = Dali.Key.GetKeyFromPtr( data );
}
if (_stageKeyHandler != null)
{
//here we send all data to user event handlers
_stageKeyHandler(this, e);
}
}
private event EventHandler _stageEventProcessingFinishedEventHandler;
private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
/**
* @brief Event for EventProcessingFinished signal which can be used to subscribe/unsubscribe the event handler
* provided by the user. EventProcessingFinished signal is emitted just after the event processing is finished.
*
*/
public event EventHandler EventProcessingFinished
{
add
{
lock(this)
{
_stageEventProcessingFinishedEventHandler += value;
_stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
this.EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
}
}
remove
{
lock(this)
{
if (_stageEventProcessingFinishedEventHandler != null)
{
this.EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
}
_stageEventProcessingFinishedEventHandler -= value;
}
}
}
// Callback for Stage EventProcessingFinishedSignal
private void OnEventProcessingFinished()
{
if (_stageEventProcessingFinishedEventHandler != null)
{
_stageEventProcessingFinishedEventHandler(this, null);
}
}
private EventHandler _stageContextLostEventHandler;
private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
/**
* @brief Event for ContextLost signal which can be used to subscribe/unsubscribe the event handler
* ContextLost signal is emitted when the GL context is lost (Platform specific behaviour).
*
*/
public event EventHandler ContextLost
{
add
{
lock(this)
{
_stageContextLostEventHandler += value;
_stageContextLostEventCallbackDelegate = OnContextLost;
this.ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
}
}
remove
{
lock(this)
{
if (_stageContextLostEventHandler != null)
{
this.ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
}
_stageContextLostEventHandler -= value;
}
}
}
// Callback for Stage ContextLostSignal
private void OnContextLost()
{
if (_stageContextLostEventHandler != null)
{
_stageContextLostEventHandler(this, null);
}
}
private EventHandler _stageContextRegainedEventHandler;
private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
/**
* @brief Event for ContextRegained signal which can be used to subscribe/unsubscribe the event handler
* provided by the user. ContextRegained signal is emitted when the GL context is regained (Platform specific
* behaviour).
*
*/
public event EventHandler ContextRegained
{
add
{
lock(this)
{
_stageContextRegainedEventHandler += value;
_stageContextRegainedEventCallbackDelegate = OnContextRegained;
this.ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
}
}
remove
{
lock(this)
{
if (_stageContextRegainedEventHandler != null)
{
this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
}
_stageContextRegainedEventHandler -= value;
}
}
}
// Callback for Stage ContextRegainedSignal
private void OnContextRegained()
{
if (_stageContextRegainedEventHandler != null)
{
_stageContextRegainedEventHandler(this, null);
}
}
private EventHandler _stageSceneCreatedEventHandler;
private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
/**
* @brief Event for SceneCreated signal which can be used to subscribe/unsubscribe the event handler
* SceneCreated signal is emitted after the initial scene is created.
*
*/
public event EventHandler SceneCreated
{
add
{
lock(this)
{
_stageSceneCreatedEventHandler += value;
_stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
this.SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
}
}
remove
{
lock(this)
{
if (_stageSceneCreatedEventHandler != null)
{
this.SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
}
_stageSceneCreatedEventHandler -= value;
}
}
}
// Callback for Stage SceneCreatedSignal
private void OnSceneCreated()
{
if (_stageSceneCreatedEventHandler != null)
{
_stageSceneCreatedEventHandler(this, null);
}
}
public Vector2 Size
{
get
{
Vector2 ret = GetSize();
return ret;
}
}
public Vector4 BackgroundColor
{
set
{
SetBackgroundColor(value);
}
get
{
Vector4 ret = GetBackgroundColor();
return ret;
}
}
private static readonly Stage instance = Stage.GetCurrent();
public static Stage Instance
{
get
{
return instance;
}
}
public Layer GetDefaultLayer()
{
return this.GetRootLayer();
}
public void AddLayer(Layer layer)
{
this.Add( (Actor)layer );
}
public void RemoveLayer(Layer layer)
{
this.Remove( (Actor)layer );
}
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 TouchSignal TouchSignal() {
TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public StageWheelSignal WheelEventSignal() {
StageWheelSignal ret = new StageWheelSignal(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;
}
}
}