X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-swig%2FSWIG%2Fevents%2Factor-event.i;h=0947698f11f3d3fc0d652490ebcd66052d22a90e;hp=e325613713b775772ae7fc88164c7628b9155728;hb=1730389b12a4a189b54c04ce357a7dba026dd7b8;hpb=9d962edfc2200e02b0db2b00250e875805624918 diff --git a/plugins/dali-swig/SWIG/events/actor-event.i b/plugins/dali-swig/SWIG/events/actor-event.i old mode 100644 new mode 100755 index e325613..0947698 --- a/plugins/dali-swig/SWIG/events/actor-event.i +++ b/plugins/dali-swig/SWIG/events/actor-event.i @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,595 +26,207 @@ %define ACTOR_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName) %typemap(cscode) NameSpace::ClassName %{ + public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) { + ClassName ret = new ClassName(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } - /** - * @brief Event arguments that passed via Touch signal - * - */ - public class TouchEventArgs : EventArgs + public IntPtr GetPtrfrom ## ClassName () { - private Actor _actor; - private TouchData _touchData; - - /** - * @brief Actor - is the actor that is being touched - * - */ - public Actor Actor - { - get - { - return _actor; - } - set - { - _actor = value; - } - } - - /** - * @brief TouchData - contains the information of touch points - * - */ - public TouchData TouchData - { - get - { - return _touchData; - } - set - { - _touchData = value; - } - } + return (IntPtr)swigCPtr; } - /** - * @brief Event arguments that passed via Hover signal - * - */ - public class HoverEventArgs : EventArgs + public Position CurrentPosition { - private Actor _actor; - private HoverEvent _hoverEvent; - - /** - * @brief Actor - is the actor that is being hovered - * - */ - public Actor Actor + get { - get - { - return _actor; - } - set - { - _actor = value; - } - } - - /** - * @brief HoverEvent - contains touch points that represent the points - * that are currently being hovered or the points where a hover has stopped - * - */ - public HoverEvent HoverEvent - { - get - { - return _hoverEvent; - } - set - { - _hoverEvent = value; - } + return GetCurrentPosition(); } } - /** - * @brief Event arguments that passed via Wheel signal - * - */ - public class WheelEventArgs : EventArgs + public Size2D Size2D { - private Actor _actor; - private WheelEvent _wheelEvent; - - /** - * @brief Actor - is the actor that is being wheeled - * - */ - public Actor Actor + get { - get - { - return _actor; - } - set - { - _actor = value; - } + Size temp = new Size(0.0f,0.0f,0.0f); + GetProperty( Actor.Property.SIZE).Get( temp ); + return new Size2D(temp); } - - /** - * @brief WheelEvent - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL - * - */ - public WheelEvent WheelEvent + set { - get - { - return _wheelEvent; - } - set - { - _wheelEvent = value; - } + SetProperty( Actor.Property.SIZE, new Dali.Property.Value( new Size(value) ) ); } } - /** - * @brief Event arguments that passed via OnStage signal - * - */ - public class OnStageEventArgs : EventArgs + public Size CurrentSize { - private Actor _actor; - - /** - * @brief Actor - is the actor that is being connected to the stage - * - */ - public Actor Actor + get { - get - { - return _actor; - } - set - { - _actor = value; - } + return GetCurrentSize(); } } - /** - * @brief Event arguments that passed via OffStage signal - * - */ - public class OffStageEventArgs : EventArgs + public Actor Parent { - private Actor _actor; - - /** - * @brief Actor - is the actor that is being disconnected from the stage - * - */ - public Actor Actor + get { - get - { - return _actor; - } - set - { - _actor = value; - } + return GetParent(); } } - /** - * @brief Event arguments that passed via OnRelayout signal - * - */ - public class OnRelayoutEventArgs : EventArgs + public bool Visibility { - private Actor _actor; - - /** - * @brief Actor - is the actor that is being resized upon relayout - * - */ - public Actor Actor + get { - get - { - return _actor; - } - set - { - _actor = value; - } + return IsVisible(); } } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate bool TouchEventHandler(object source, TouchEventArgs e); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate bool HoverEventHandler(object source, HoverEventArgs e); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate bool WheelEventHandler(object source, WheelEventArgs e); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate void OnStageEventHandler(object source, OnStageEventArgs e); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate void OffStageEventHandler(object source, OffStageEventArgs e); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate void OnRelayoutEventHandler(object source, OnRelayoutEventArgs e); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool TouchCallbackDelegate(IntPtr actor, IntPtr touchData); - private TouchEventHandler _actorTouchDataEventHandler; - private TouchCallbackDelegate _actorTouchDataCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool HoverEventCallbackDelegate(IntPtr actor, IntPtr hoverEvent); - private HoverEventHandler _actorHoverEventHandler; - private HoverEventCallbackDelegate _actorHoverEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool WheelEventCallbackDelegate(IntPtr actor, IntPtr wheelEvent); - private WheelEventHandler _actorWheelEventHandler; - private WheelEventCallbackDelegate _actorWheelEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OnStageEventCallbackDelegate(IntPtr actor); - private OnStageEventHandler _actorOnStageEventHandler; - private OnStageEventCallbackDelegate _actorOnStageEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OffStageEventCallbackDelegate(IntPtr actor); - private OffStageEventHandler _actorOffStageEventHandler; - private OffStageEventCallbackDelegate _actorOffStageEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OnRelayoutEventCallbackDelegate(IntPtr actor); - private OnRelayoutEventHandler _actorOnRelayoutEventHandler; - private OnRelayoutEventCallbackDelegate _actorOnRelayoutEventCallbackDelegate; - - /** - * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler - * (in the type of TouchEventHandler) provided by the user. - * Touched signal is emitted when touch input is received. - */ - public event TouchEventHandler Touched + public float Opacity { - add + get { - lock(this) - { - // Restricted to only one listener - if (_actorTouchDataEventHandler == null) - { - _actorTouchDataEventHandler += value; - - _actorTouchDataCallbackDelegate = new TouchCallbackDelegate(OnTouch); - this.TouchSignal().Connect(_actorTouchDataCallbackDelegate); - } - } + float temp = 0; + GetProperty( Actor.Property.OPACITY ).Get( ref temp ); + return temp; } - - remove + set { - lock(this) - { - if (_actorTouchDataEventHandler != null) - { - this.TouchSignal().Disconnect(_actorTouchDataCallbackDelegate); - } - - _actorTouchDataEventHandler -= value; - } + SetProperty( Actor.Property.OPACITY, new Dali.Property.Value( value ) ); } } - // Callback for Actor TouchSignal - private bool OnTouch(IntPtr actor, IntPtr touchData) + public Position2D Position2D { - TouchEventArgs e = new TouchEventArgs(); - - // Populate all members of "e" (TouchEventArgs) with real data - e.Actor = Actor.GetActorFromPtr(actor); - e.TouchData = Dali.TouchData.GetTouchDataFromPtr(touchData); - - if (_actorTouchDataEventHandler != null) + get { - //here we send all data to user event handlers - return _actorTouchDataEventHandler(this, e); + Position temp = new Position(0.0f,0.0f,0.0f); + GetProperty( Actor.Property.POSITION).Get( temp ); + return new Position2D(temp); } - - return false; - } - - /** - * @brief Event for Hovered signal which can be used to subscribe/unsubscribe the event handler - * (in the type of HoverEventHandler) provided by the user. - * Hovered signal is emitted when hover input is received. - */ - public event HoverEventHandler Hovered - { - add - { - lock(this) - { - // Restricted to only one listener - if (_actorHoverEventHandler == null) - { - _actorHoverEventHandler += value; - - _actorHoverEventCallbackDelegate = new HoverEventCallbackDelegate(OnHoverEvent); - this.HoveredSignal().Connect(_actorHoverEventCallbackDelegate); - } - } - } - - remove + set { - lock(this) - { - if (_actorHoverEventHandler != null) - { - this.HoveredSignal().Disconnect(_actorHoverEventCallbackDelegate); - } - - _actorHoverEventHandler -= value; - } + SetProperty( Actor.Property.POSITION, new Dali.Property.Value( new Position(value) ) ); } } - // Callback for Actor Hover signal - private bool OnHoverEvent(IntPtr actor, IntPtr hoverEvent) + public Vector2 ScreenPosition { - HoverEventArgs e = new HoverEventArgs(); - - // Populate all members of "e" (HoverEventArgs) with real data - e.Actor = Actor.GetActorFromPtr(actor); - e.HoverEvent = Dali.HoverEvent.GetHoverEventFromPtr(hoverEvent); - - if (_actorHoverEventHandler != null) + get { - //here we send all data to user event handlers - return _actorHoverEventHandler(this, e); + Vector2 temp = new Vector2( 0.0f, 0.0f ); + GetProperty( Actor.Property.SCREEN_POSITION ).Get( temp ); + return temp; } - - return false; } - /** - * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler - * (in the type of WheelEventHandler) provided by the user. - * WheelMoved signal is emitted when wheel event is received. - */ - public event WheelEventHandler WheelMoved + protected bool PositionUsesAnchorPoint { - add + get { - lock(this) - { - // Restricted to only one listener - if (_actorWheelEventHandler == null) - { - _actorWheelEventHandler += value; - - _actorWheelEventCallbackDelegate = new WheelEventCallbackDelegate(OnWheelEvent); - this.WheelEventSignal().Connect(_actorWheelEventCallbackDelegate); - } - } + bool temp = false; + GetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT ).Get( ref temp ); + return temp; } - - remove + set { - lock(this) - { - if (_actorWheelEventHandler != null) - { - this.WheelEventSignal().Disconnect(_actorWheelEventCallbackDelegate); - } - - _actorWheelEventHandler -= value; - } + SetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT, new Dali.Property.Value( value ) ); } } - // Callback for Actor Wheel signal - private bool OnWheelEvent(IntPtr actor, IntPtr wheelEvent) + public bool StateFocusEnable { - WheelEventArgs e = new WheelEventArgs(); - - // Populate all members of "e" (WheelEventArgs) with real data - e.Actor = Actor.GetActorFromPtr(actor); - e.WheelEvent = Dali.WheelEvent.GetWheelEventFromPtr(wheelEvent); - - if (_actorWheelEventHandler != null) + get { - //here we send all data to user event handlers - return _actorWheelEventHandler(this, e); + return IsKeyboardFocusable(); } - - return false; - } - - /** - * @brief Event for OnStage signal which can be used to subscribe/unsubscribe the event handler - * (in the type of OnStageEventHandler) provided by the user. - * OnStage signal is emitted after the actor has been connected to the stage. - */ - public event OnStageEventHandler OnStageEvent - { - add - { - lock(this) - { - // Restricted to only one listener - if (_actorOnStageEventHandler == null) - { - _actorOnStageEventHandler += value; - - _actorOnStageEventCallbackDelegate = new OnStageEventCallbackDelegate(OnStage); - this.OnStageSignal().Connect(_actorOnStageEventCallbackDelegate); - } - } - } - - remove + set { - lock(this) - { - if (_actorOnStageEventHandler != null) - { - this.OnStageSignal().Disconnect(_actorOnStageEventCallbackDelegate); - } - - _actorOnStageEventHandler -= value; - } + SetKeyboardFocusable(value); } } - // Callback for Actor OnStage signal - private void OnStage(IntPtr data) + public bool IsOnStage { - OnStageEventArgs e = new OnStageEventArgs(); - - // Populate all members of "e" (OnStageEventArgs) with real data - e.Actor = Actor.GetActorFromPtr(data); - - if (_actorOnStageEventHandler != null) + get { - //here we send all data to user event handlers - _actorOnStageEventHandler(this, e); + return OnStage(); } } - /** - * @brief Event for OffStage signal which can be used to subscribe/unsubscribe the event handler - * (in the type of OffStageEventHandler) provided by the user. - * OffStage signal is emitted after the actor has been disconnected from the stage. - */ - public event OffStageEventHandler OffStageEvent + public int SiblingOrder { - add + get { - lock(this) - { - // Restricted to only one listener - if (_actorOffStageEventHandler == null) - { - _actorOffStageEventHandler += value; - - _actorOffStageEventCallbackDelegate = new OffStageEventCallbackDelegate(OffStage); - this.OnStageSignal().Connect(_actorOffStageEventCallbackDelegate); - } - } + int temp = 0; + GetProperty( Actor.Property.SIBLING_ORDER ).Get( ref temp ); + return temp; } - - remove + set { - lock(this) - { - if (_actorOffStageEventHandler != null) - { - this.OnStageSignal().Disconnect(_actorOffStageEventCallbackDelegate); - } - - _actorOffStageEventHandler -= value; - } + SetProperty( Actor.Property.SIBLING_ORDER, new Dali.Property.Value( value ) ); } } - // Callback for Actor OffStage signal - private void OffStage(IntPtr data) + public void Show() { - OffStageEventArgs e = new OffStageEventArgs(); - - // Populate all members of "e" (OffStageEventArgs) with real data - e.Actor = Actor.GetActorFromPtr(data); - - if (_actorOffStageEventHandler != null) - { - //here we send all data to user event handlers - _actorOffStageEventHandler(this, e); - } + SetVisible(true); } - /** - * @brief Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler - * (in the type of OnRelayoutEventHandler) provided by the user. - * OnRelayout signal is emitted after the size has been set on the actor during relayout. - */ - public event OnRelayoutEventHandler OnRelayoutEvent + public void Hide() { - add - { - lock(this) - { - // Restricted to only one listener - if (_actorOnRelayoutEventHandler == null) - { - _actorOnRelayoutEventHandler += value; - - _actorOnRelayoutEventCallbackDelegate = new OnRelayoutEventCallbackDelegate(OnRelayout); - this.OnRelayoutSignal().Connect(_actorOnRelayoutEventCallbackDelegate); - } - } - } - - remove - { - lock(this) - { - if (_actorOnRelayoutEventHandler != null) - { - this.OnRelayoutSignal().Disconnect(_actorOnRelayoutEventCallbackDelegate); - } + SetVisible(false); + } - _actorOnRelayoutEventHandler -= value; - } - } + public void Raise() + { + NDalicPINVOKE.Raise(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - // Callback for Actor OnRelayout signal - private void OnRelayout(IntPtr data) + public void Lower() { - OnRelayoutEventArgs e = new OnRelayoutEventArgs(); + NDalicPINVOKE.Lower(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - // Populate all members of "e" (OnRelayoutEventArgs) with real data - e.Actor = Actor.GetActorFromPtr(data); + public void RaiseToTop() + { + NDalicPINVOKE.RaiseToTop(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - if (_actorOnRelayoutEventHandler != null) - { - //here we send all data to user event handlers - _actorOnRelayoutEventHandler(this, e); - } + public void LowerToBottom() + { + NDalicPINVOKE.LowerToBottom(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) { - ClassName ret = new ClassName(cPtr, false); + public void RaiseAbove(Actor target) + { + NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - public IntPtr GetPtrfrom ## ClassName () + public void LowerBelow(Actor target) { - return (IntPtr)swigCPtr; + NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - %} - %enddef +%} + +%enddef %define DALI_ACTOR_EVENTHANDLER_PARAM( NameSpace, ClassName) - ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName); - ACTOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName); +ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName); +ACTOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName); - %enddef +%enddef - namespace Dali +namespace Dali { DALI_ACTOR_EVENTHANDLER_PARAM( Dali, Actor); }