From: Umar Date: Fri, 27 Jan 2017 18:49:49 +0000 (+0000) Subject: Manual binding to add getter/setter APIs for various event classes (i.e. Gesture... X-Git-Tag: dali_1.2.27~14 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=2a7e2358bd82572eb9c4024655dc0050cc25d0b0 Manual binding to add getter/setter APIs for various event classes (i.e. Gesture, PanGesture, HoverEvent etc) Change-Id: I7997428f66c73770b4d33f8e898a552f3d82366d --- diff --git a/plugins/dali-swig/SWIG/dali-core.i b/plugins/dali-swig/SWIG/dali-core.i index 48d8ff6..3034cf4 100755 --- a/plugins/dali-swig/SWIG/dali-core.i +++ b/plugins/dali-swig/SWIG/dali-core.i @@ -85,6 +85,7 @@ %ignore *::SetPositionInheritanceMode(PositionInheritanceMode); %ignore *::GetKeyValue(SizeType) const; %ignore *::TypeInfo::GetCreator() const; +%ignore Dali::Stage::TouchedSignal; %rename(ParentOriginTop) Dali::ParentOrigin::TOP; %rename(ParentOriginBottom) Dali::ParentOrigin::BOTTOM; @@ -260,7 +261,6 @@ typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair; %include %include %include -%include %include %include @@ -304,12 +304,12 @@ typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair; //%template(ActorTouchEventSignal) Dali::Signal; %template(ActorTouchDataSignal) Dali::Signal; %template(ActorHoverSignal) Dali::Signal; -%template(ActorWheelEventSignal) Dali::Signal; +%template(ActorWheelSignal) Dali::Signal; %template(ActorSignal) Dali::Signal; %template(KeyEventSignal) Dali::Signal; //%template(TouchEventSignal) Dali::Signal; %template(TouchSignal) Dali::Signal; -%template(StageWheelEventSignal) Dali::Signal; +%template(StageWheelSignal) Dali::Signal; %template(AngleThresholdPair) std::pair; %template(PanGestureDetectedSignal) Dali::Signal; %template(PinchGestureDetectedSignal) Dali::Signal; diff --git a/plugins/dali-swig/SWIG/dali-gc.i b/plugins/dali-swig/SWIG/dali-gc.i index 2e86045..cf7bdab 100644 --- a/plugins/dali-swig/SWIG/dali-gc.i +++ b/plugins/dali-swig/SWIG/dali-gc.i @@ -66,6 +66,57 @@ %} %enddef +%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( NameSpace, ClassName, NewClassName ) +%typemap(csfinalize) NameSpace::ClassName %{ + ~NewClassName() { + DisposeQueue.Instance.Add(this); + } +%} +%enddef + +%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( NameSpace, ClassName, NewClassName ) +%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{ + if (!Stage.IsInstalled()) { + DisposeQueue.Instance.Add(this); + return; + } + + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + NDalicPINVOKE.delete_##NewClassName(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + global::System.GC.SuppressFinalize(this); + } + } +%} +%enddef + +%define DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION_RENAME( NameSpace, ClassName, NewClassName ) +%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{ + if (!Stage.IsInstalled()) { + DisposeQueue.Instance.Add(this); + return; + } + + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + NDalicPINVOKE.delete_##NewClassName(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + global::System.GC.SuppressFinalize(this); + base.Dispose(); + } + } +%} +%enddef + %define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VIDEOVIEWSIGNAL( NameSpace, ClassName ) %typemap(csfinalize) NameSpace::ClassName %{ ~VideoViewSignal() { @@ -996,7 +1047,7 @@ %define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STAGESIGNAL( NameSpace, ClassName ) %typemap(csfinalize) NameSpace::ClassName %{ - ~StageWheelEventSignal() { + ~StageWheelSignal() { DisposeQueue.Instance.Add(this); } %} @@ -1013,7 +1064,7 @@ if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; - NDalicPINVOKE.delete_StageWheelEventSignal(swigCPtr); + NDalicPINVOKE.delete_StageWheelSignal(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } @@ -1205,12 +1256,14 @@ DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, LongPressGesture ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, LongPressGestureDetector ); DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, LongPressGestureDetector ); -DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, KeyEvent ); -DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, KeyEvent ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, KeyEvent, Key ); +DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, KeyEvent, Key ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, HoverEvent, Hover ); +DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, HoverEvent, Hover ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, TouchEvent ); DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, TouchEvent ); -DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, WheelEvent ); -DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, WheelEvent ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, WheelEvent, Wheel ); +DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, WheelEvent, Wheel ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Renderer ); DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, Renderer ); @@ -1295,8 +1348,8 @@ DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, PathConstrainer ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, TouchPoint ); DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, TouchPoint ); -DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, TouchData ); -DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, TouchData ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, TouchData, Touch ); +DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION_RENAME( Dali, TouchData, Touch ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Application ); DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, Application ); diff --git a/plugins/dali-swig/SWIG/dali-toolkit.i b/plugins/dali-swig/SWIG/dali-toolkit.i index 3e7a512..946a250 100755 --- a/plugins/dali-swig/SWIG/dali-toolkit.i +++ b/plugins/dali-swig/SWIG/dali-toolkit.i @@ -98,6 +98,7 @@ %ignore *::Button::SetUnselectedImage(const std::string &); %ignore Dali::Toolkit::DevelVisual::Type; %ignore Dali::Toolkit::DevelVisual::Property::Type; +%ignore Dali::Toolkit::AccessibilityManager::AccessibilityActionScrollSignalType; %rename(View) Dali::Toolkit::Control; %rename(ViewImpl) Dali::Toolkit::Internal::Control; @@ -296,7 +297,6 @@ typedef Dali::IntrusivePtr RulerPtr; %template(ItemContainer) std::vector>; %template(ActorContainer) std::vector; %template(AccessibilityActionSignal) Dali::Signal; -%template(AccessibilityActionScrollSignal) Dali::Signal; %template(AccessibilityFocusOvershotSignal) Dali::Signal; %template(FocusChangedSignal) Dali::Signal; %template(FocusGroupChangedSignal) Dali::Signal; @@ -309,7 +309,7 @@ typedef Dali::IntrusivePtr RulerPtr; %template(ScrollableSignal) Dali::Signal< void(const Dali::Vector2&)>; %template(TextEditorSignal) Dali::Signal; %template(TextFieldSignal) Dali::Signal; -%template(ControlKeyEventSignal) Dali::Signal; +%template(ControlKeySignal) Dali::Signal; %template(KeyInputFocusSignal) Dali::Signal; %template(VideoViewSignal) Dali::Signal; %template(SliderValueChangedSignal) Dali::Signal; diff --git a/plugins/dali-swig/SWIG/dali.i b/plugins/dali-swig/SWIG/dali.i index 20558f4..d2d4e28 100755 --- a/plugins/dali-swig/SWIG/dali.i +++ b/plugins/dali-swig/SWIG/dali.i @@ -288,7 +288,14 @@ using namespace Dali::Toolkit; %include devel-properties.i %include gestures/hover.i - +%include gestures/gesture.i +%include gestures/long-press-gesture.i +%include gestures/pan-gesture.i +%include gestures/tap-gesture.i +%include gestures/pinch-gesture.i +%include gestures/wheel.i +%include gestures/touch.i +%include gestures/key.i %include dali-core.i %include dali-adaptor.i diff --git a/plugins/dali-swig/SWIG/events/accessibilitymanager-event.i b/plugins/dali-swig/SWIG/events/accessibilitymanager-event.i index 64e070d..34a6a51 100644 --- a/plugins/dali-swig/SWIG/events/accessibilitymanager-event.i +++ b/plugins/dali-swig/SWIG/events/accessibilitymanager-event.i @@ -578,6 +578,8 @@ * @brief Event arguments that passed via ActionScroll signal * */ +/* + // To be replaced by a new event that takes Touch public class ActionScrollEventArgs : EventArgs { private AccessibilityManager _accessibilityManager; @@ -607,6 +609,7 @@ } } } +*/ /** * @brief Event arguments that passed via ActionPageUp signal @@ -829,10 +832,13 @@ private DaliEventHandlerWithReturnType _accessibilityManagerActionStartStopEventHandler; private ActionStartStopEventCallbackDelegate _accessibilityManagerActionStartStopEventCallbackDelegate; +/* + // To be replaced by a new event that takes Touch [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool ActionScrollEventCallbackDelegate(IntPtr accessibilityManager, IntPtr touchEvent); private DaliEventHandlerWithReturnType _accessibilityManagerActionScrollEventHandler; private ActionScrollEventCallbackDelegate _accessibilityManagerActionScrollEventCallbackDelegate; +*/ [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void FocusChangedEventCallbackDelegate(IntPtr actor1, IntPtr actor2); @@ -2075,6 +2081,8 @@ return false; } +/* + // To be replaced by a new event that takes Touch public event DaliEventHandlerWithReturnType ActionScroll { add @@ -2122,6 +2130,7 @@ } return false; } +*/ public event DaliEventHandler FocusChanged { diff --git a/plugins/dali-swig/SWIG/events/control-event.i b/plugins/dali-swig/SWIG/events/control-event.i index 36704ca..8e13349 100755 --- a/plugins/dali-swig/SWIG/events/control-event.i +++ b/plugins/dali-swig/SWIG/events/control-event.i @@ -78,16 +78,16 @@ } /** - * @brief Event arguments that passed via KeyEvent signal + * @brief Event arguments that passed via Key signal * */ public class KeyEventArgs : EventArgs { private View _view; - private KeyEvent _keyEvent; + private Key _key; /** - * @brief View - is the view that recieves the keyevent. + * @brief View - is the view that recieves the key. * */ public View View @@ -103,18 +103,18 @@ } /** - * @brief KeyEvent - is the keyevent sent to the View. + * @brief Key - is the key sent to the View. * */ - public KeyEvent KeyEvent + public Key Key { get { - return _keyEvent; + return _key; } set { - _keyEvent = value; + _key = value; } } } @@ -152,7 +152,7 @@ public class TouchEventArgs : EventArgs { private View _view; - private TouchData _touchData; + private Touch _touch; /** * @brief View - is the view that is being touched @@ -171,18 +171,18 @@ } /** - * @brief TouchData - contains the information of touch points + * @brief Touch - contains the information of touch points * */ - public TouchData TouchData + public Touch Touch { get { - return _touchData; + return _touch; } set { - _touchData = value; + _touch = value; } } } @@ -191,10 +191,10 @@ * @brief Event arguments that passed via Hover signal * */ - public class HoverArgs : EventArgs + public class HoverEventArgs : EventArgs { - private View _view; - private Hover _hover; + private View _view; + private Hover _hover; /** * @brief View - is the view that is being hovered @@ -236,8 +236,8 @@ */ public class WheelEventArgs : EventArgs { - private View _view; - private WheelEvent _wheelEvent; + private View _view; + private Wheel _wheel; /** * @brief View - is the view that is being wheeled @@ -256,18 +256,18 @@ } /** - * @brief WheelEvent - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL + * @brief Wheel - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL * */ - public WheelEvent WheelEvent + public Wheel Wheel { get { - return _wheelEvent; + return _wheel; } set { - _wheelEvent = value; + _wheel = value; } } } @@ -333,8 +333,8 @@ private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr keyEvent); - private DaliEventHandlerWithReturnType _KeyEventHandler; + private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr key); + private DaliEventHandlerWithReturnType _KeyHandler; private KeyCallbackDelegate _KeyCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] @@ -343,19 +343,19 @@ private OnRelayoutEventCallbackDelegate _viewOnRelayoutEventCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool TouchCallbackDelegate(IntPtr view, IntPtr touchData); - private DaliEventHandlerWithReturnType _viewTouchDataEventHandler; - private TouchCallbackDelegate _viewTouchDataCallbackDelegate; + private delegate bool TouchCallbackDelegate(IntPtr view, IntPtr touch); + private DaliEventHandlerWithReturnType _viewTouchHandler; + private TouchCallbackDelegate _viewTouchCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool HoverCallbackDelegate(IntPtr view, IntPtr hover); - private DaliEventHandlerWithReturnType _viewHoverHandler; + private DaliEventHandlerWithReturnType _viewHoverHandler; private HoverCallbackDelegate _viewHoverCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool WheelEventCallbackDelegate(IntPtr view, IntPtr wheelEvent); - private DaliEventHandlerWithReturnType _viewWheelEventHandler; - private WheelEventCallbackDelegate _viewWheelEventCallbackDelegate; + private delegate bool WheelCallbackDelegate(IntPtr view, IntPtr wheel); + private DaliEventHandlerWithReturnType _viewWheelHandler; + private WheelCallbackDelegate _viewWheelCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void OnStageEventCallbackDelegate(IntPtr control); @@ -382,7 +382,7 @@ if (_KeyInputFocusGainedEventHandler == null) { _KeyInputFocusGainedEventHandler += value; - Console.WriteLine("View Keyevent EVENT Locked...."); + Console.WriteLine("View Key EVENT Locked...."); _KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained); this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate); } @@ -406,7 +406,7 @@ private void OnKeyInputFocusGained(IntPtr view) { KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs(); - Console.WriteLine("View Keyevent ...."); + Console.WriteLine("View Key ...."); // Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data e.View = Dali.View.GetViewFromPtr(view); @@ -470,7 +470,7 @@ /** * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler - * (in the type of KeyEventEventHandler-DaliEventHandlerWithReturnType) + * (in the type of KeyHandler-DaliEventHandlerWithReturnType) * provided by the user. KeyPressed signal is emitted when key event is received. */ public event DaliEventHandlerWithReturnType KeyPressed @@ -480,11 +480,11 @@ lock(this) { // Restricted to only one listener - if (_KeyEventHandler == null) + if (_KeyHandler == null) { - _KeyEventHandler += value; + _KeyHandler += value; - _KeyCallbackDelegate = new KeyCallbackDelegate(OnKeyEvent); + _KeyCallbackDelegate = new KeyCallbackDelegate(OnKey); this.KeyEventSignal().Connect(_KeyCallbackDelegate); } } @@ -494,28 +494,28 @@ { lock(this) { - if (_KeyEventHandler != null) + if (_KeyHandler != null) { this.KeyEventSignal().Disconnect(_KeyCallbackDelegate); } - _KeyEventHandler -= value; + _KeyHandler -= value; } } } - private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) + private bool OnKey(IntPtr view, IntPtr key) { KeyEventArgs e = new KeyEventArgs(); // Populate all members of "e" (KeyEventArgs) with real data e.View = Dali.View.GetViewFromPtr(view); - e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr(keyEvent); + e.Key = Dali.Key.GetKeyFromPtr(key); - if (_KeyEventHandler != null) + if (_KeyHandler != null) { //here we send all data to user event handlers - return _KeyEventHandler(this, e); + return _KeyHandler(this, e); } return false; @@ -574,7 +574,7 @@ /** * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler - * (in the type of TouchEventHandler-DaliEventHandlerWithReturnType) + * (in the type of TouchHandler-DaliEventHandlerWithReturnType) * provided by the user. Touched signal is emitted when touch input is received. */ public event DaliEventHandlerWithReturnType Touched @@ -584,12 +584,12 @@ lock(this) { // Restricted to only one listener - if (_viewTouchDataEventHandler == null) + if (_viewTouchHandler == null) { - _viewTouchDataEventHandler += value; + _viewTouchHandler += value; Console.WriteLine("View Touch EVENT LOCKED...."); - _viewTouchDataCallbackDelegate = new TouchCallbackDelegate(OnTouch); - this.TouchSignal().Connect(_viewTouchDataCallbackDelegate); + _viewTouchCallbackDelegate = new TouchCallbackDelegate(OnTouch); + this.TouchSignal().Connect(_viewTouchCallbackDelegate); } } } @@ -598,29 +598,29 @@ { lock(this) { - if (_viewTouchDataEventHandler != null) + if (_viewTouchHandler != null) { - this.TouchSignal().Disconnect(_viewTouchDataCallbackDelegate); + this.TouchSignal().Disconnect(_viewTouchCallbackDelegate); } - _viewTouchDataEventHandler -= value; + _viewTouchHandler -= value; } } } // Callback for View TouchSignal - private bool OnTouch(IntPtr view, IntPtr touchData) + private bool OnTouch(IntPtr view, IntPtr touch) { TouchEventArgs e = new TouchEventArgs(); Console.WriteLine("View Touch EVENT...."); // Populate all members of "e" (TouchEventArgs) with real data e.View = View.GetViewFromPtr(view); - e.TouchData = Dali.TouchData.GetTouchDataFromPtr(touchData); + e.Touch = Dali.Touch.GetTouchFromPtr(touch); - if (_viewTouchDataEventHandler != null) + if (_viewTouchHandler != null) { //here we send all data to user event handlers - return _viewTouchDataEventHandler(this, e); + return _viewTouchHandler(this, e); } return false; @@ -628,10 +628,10 @@ /** * @brief Event for Hovered signal which can be used to subscribe/unsubscribe the event handler - * (in the type of HoverHandler-DaliEventHandlerWithReturnType) + * (in the type of HoverHandler-DaliEventHandlerWithReturnType) * provided by the user. Hovered signal is emitted when hover input is received. */ - public event DaliEventHandlerWithReturnType Hovered + public event DaliEventHandlerWithReturnType Hovered { add { @@ -665,9 +665,9 @@ // Callback for View Hover signal private bool OnHover(IntPtr view, IntPtr hover) { - HoverArgs e = new HoverArgs(); + HoverEventArgs e = new HoverEventArgs(); - // Populate all members of "e" (HoverArgs) with real data + // Populate all members of "e" (HoverEventArgs) with real data e.View = View.GetViewFromPtr(view); e.Hover = Dali.Hover.GetHoverFromPtr(hover); @@ -682,7 +682,7 @@ /** * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler - * (in the type of WheelEventHandler-DaliEventHandlerWithReturnType) + * (in the type of WheelHandler-DaliEventHandlerWithReturnType) * provided by the user. WheelMoved signal is emitted when wheel event is received. */ public event DaliEventHandlerWithReturnType WheelMoved @@ -692,12 +692,12 @@ lock(this) { // Restricted to only one listener - if (_viewWheelEventHandler == null) + if (_viewWheelHandler == null) { - _viewWheelEventHandler += value; + _viewWheelHandler += value; Console.WriteLine("View Wheel EVENT LOCKED...."); - _viewWheelEventCallbackDelegate = new WheelEventCallbackDelegate(OnWheelEvent); - this.WheelEventSignal().Connect(_viewWheelEventCallbackDelegate); + _viewWheelCallbackDelegate = new WheelCallbackDelegate(OnWheel); + this.WheelEventSignal().Connect(_viewWheelCallbackDelegate); } } } @@ -706,29 +706,29 @@ { lock(this) { - if (_viewWheelEventHandler != null) + if (_viewWheelHandler != null) { - this.WheelEventSignal().Disconnect(_viewWheelEventCallbackDelegate); + this.WheelEventSignal().Disconnect(_viewWheelCallbackDelegate); } - _viewWheelEventHandler -= value; + _viewWheelHandler -= value; } } } // Callback for View Wheel signal - private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) + private bool OnWheel(IntPtr view, IntPtr wheel) { WheelEventArgs e = new WheelEventArgs(); Console.WriteLine("View Wheel EVENT ...."); // Populate all members of "e" (WheelEventArgs) with real data e.View = View.GetViewFromPtr(view); - e.WheelEvent = Dali.WheelEvent.GetWheelEventFromPtr(wheelEvent); + e.Wheel = Dali.Wheel.GetWheelFromPtr(wheel); - if (_viewWheelEventHandler != null) + if (_viewWheelHandler != null) { //here we send all data to user event handlers - return _viewWheelEventHandler(this, e); + return _viewWheelHandler(this, e); } return false; diff --git a/plugins/dali-swig/SWIG/events/stage-event.i b/plugins/dali-swig/SWIG/events/stage-event.i index 6b2329b..5067594 100755 --- a/plugins/dali-swig/SWIG/events/stage-event.i +++ b/plugins/dali-swig/SWIG/events/stage-event.i @@ -33,26 +33,26 @@ using System.Runtime.InteropServices; */ public class TouchEventArgs : EventArgs { - private TouchData _touchData; + private Touch _touch; /** - * @brief TouchData - contains the information of touch points + * @brief Touch - contains the information of touch points * */ - public TouchData TouchData + public Touch Touch { get { - return _touchData; + return _touch; } set { - _touchData = value; + _touch = value; } } } - private event EventHandler _stageTouchEventHandler; + private event EventHandler _stageTouchHandler; private EventCallbackDelegateType1 _stageTouchCallbackDelegate; /** @@ -61,13 +61,13 @@ using System.Runtime.InteropServices; * (i.e. the down & up touch events only). * */ - public event EventHandler TouchEvent + public event EventHandler Touch { add { lock(this) { - _stageTouchEventHandler += value; + _stageTouchHandler += value; _stageTouchCallbackDelegate = OnStageTouch; this.TouchSignal().Connect(_stageTouchCallbackDelegate); } @@ -76,11 +76,11 @@ using System.Runtime.InteropServices; { lock(this) { - if (_stageTouchEventHandler != null) + if (_stageTouchHandler != null) { this.TouchSignal().Disconnect(_stageTouchCallbackDelegate); } - _stageTouchEventHandler -= value; + _stageTouchHandler -= value; } } } @@ -91,56 +91,55 @@ using System.Runtime.InteropServices; if( data != null ) { - e.TouchData = TouchData.GetTouchDataFromPtr( data ); + e.Touch = Dali.Touch.GetTouchFromPtr( data ); } - if (_stageTouchEventHandler != null) + if (_stageTouchHandler != null) { - _stageTouchEventHandler(this, e); + _stageTouchHandler(this, e); } } - /** - * @brief WheelEvent arguments that passed via Wheel signal + * @brief Wheel arguments that passed via Wheel signal * */ public class WheelEventArgs : EventArgs { - private WheelEvent _wheelEvent; + private Wheel _wheel; /** - * @brief WheelEvent - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL + * @brief Wheel - store a wheel rolling type MOUSE_WHEEL or CUSTOM_WHEEL * */ - public WheelEvent WheelEvent + public Wheel Wheel { get { - return _wheelEvent; + return _wheel; } set { - _wheelEvent = value; + _wheel = value; } } } - private event EventHandler _stageWheelEventHandler; + private event EventHandler _stageWheelHandler; private EventCallbackDelegateType1 _stageWheelCallbackDelegate; /** - * @brief Event for WheelEvent signal which can be used to subscribe/unsubscribe the event handler - * WheelEvent signal is emitted is emitted when wheel event is received. + * @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 WheelEvent + public event EventHandler Wheel { add { lock(this) { - _stageWheelEventHandler += value; + _stageWheelHandler += value; _stageWheelCallbackDelegate = OnStageWheel; this.WheelEventSignal().Connect(_stageWheelCallbackDelegate); } @@ -149,11 +148,11 @@ using System.Runtime.InteropServices; { lock(this) { - if (_stageWheelEventHandler != null) + if (_stageWheelHandler != null) { this.WheelEventSignal().Disconnect(_stageWheelCallbackDelegate); } - _stageWheelEventHandler -= value; + _stageWheelHandler -= value; } } } @@ -164,55 +163,55 @@ using System.Runtime.InteropServices; if( data != null ) { - e.WheelEvent = Dali.WheelEvent.GetWheelEventFromPtr( data ); + e.Wheel = Dali.Wheel.GetWheelFromPtr( data ); } - if (_stageWheelEventHandler != null) + if (_stageWheelHandler != null) { - _stageWheelEventHandler(this, e); + _stageWheelHandler(this, e); } } /** - * @brief Event arguments that passed via KeyEvent signal + * @brief Event arguments that passed via Key signal * */ public class KeyEventArgs : EventArgs { - private KeyEvent _keyEvent; + private Key _key; /** - * @brief KeyEvent - is the keyevent sent to Stage. + * @brief Key - is the keyevent sent to Stage. * */ - public KeyEvent KeyEvent + public Key Key { get { - return _keyEvent; + return _key; } set { - _keyEvent = value; + _key = value; } } } - private event EventHandler _stageKeyEventHandler; + private event EventHandler _stageKeyHandler; private EventCallbackDelegateType1 _stageKeyCallbackDelegate; /** - * @brief Event for KeyEvent signal which can be used to subscribe/unsubscribe the event handler - * KeyEvent signal is emitted is emitted when key event is received. + * @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 KeyEvent + public event EventHandler Key { add { lock(this) { - _stageKeyEventHandler += value; + _stageKeyHandler += value; _stageKeyCallbackDelegate = OnStageKey; this.KeyEventSignal().Connect(_stageKeyCallbackDelegate); } @@ -221,11 +220,11 @@ using System.Runtime.InteropServices; { lock(this) { - if (_stageKeyEventHandler != null) + if (_stageKeyHandler != null) { this.KeyEventSignal().Disconnect(_stageKeyCallbackDelegate); } - _stageKeyEventHandler -= value; + _stageKeyHandler -= value; } } } @@ -237,13 +236,13 @@ using System.Runtime.InteropServices; if( data != null ) { - e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr( data ); + e.Key = Dali.Key.GetKeyFromPtr( data ); } - if (_stageKeyEventHandler != null) + if (_stageKeyHandler != null) { //here we send all data to user event handlers - _stageKeyEventHandler(this, e); + _stageKeyHandler(this, e); } } diff --git a/plugins/dali-swig/SWIG/gestures/gesture.i b/plugins/dali-swig/SWIG/gestures/gesture.i new file mode 100644 index 0000000..cfb7510 --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/gesture.i @@ -0,0 +1,32 @@ +%rename(GestureType) Dali::Gesture::Type; +%rename(StateType) Dali::Gesture::State; + +%csmethodmodifiers Dali::Gesture::type "private"; +%csmethodmodifiers Dali::Gesture::state "private"; +%csmethodmodifiers Dali::Gesture::time "private"; + +%typemap(cscode) Dali::Gesture %{ + public Gesture.GestureType Type + { + get + { + return type; + } + } + + public Gesture.StateType State + { + get + { + return state; + } + } + + public uint Time + { + get + { + return time; + } + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/gestures/hover.i b/plugins/dali-swig/SWIG/gestures/hover.i index 6116efc..da7c275 100644 --- a/plugins/dali-swig/SWIG/gestures/hover.i +++ b/plugins/dali-swig/SWIG/gestures/hover.i @@ -10,8 +10,12 @@ return ret; } - public uint GetTime() { - return time; + public uint Time + { + get + { + return time; + } } public int GetDeviceId(uint point) { diff --git a/plugins/dali-swig/SWIG/gestures/key.i b/plugins/dali-swig/SWIG/gestures/key.i new file mode 100644 index 0000000..9ba9232 --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/key.i @@ -0,0 +1,65 @@ +%rename(Key) Dali::KeyEvent; +%rename(StateType) Dali::KeyEvent::State; + +%csmethodmodifiers Dali::KeyEvent::keyPressedName "private"; +%csmethodmodifiers Dali::KeyEvent::keyPressed "private"; +%csmethodmodifiers Dali::KeyEvent::keyCode "private"; +%csmethodmodifiers Dali::KeyEvent::keyModifier "private"; +%csmethodmodifiers Dali::KeyEvent::time "private"; +%csmethodmodifiers Dali::KeyEvent::state "private"; + +%typemap(cscode) Dali::KeyEvent %{ + public static Key GetKeyFromPtr(global::System.IntPtr cPtr) { + Key ret = new Key(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public string KeyPressedName + { + get + { + return keyPressedName; + } + } + + public string KeyPressed + { + get + { + return keyPressed; + } + } + + public int KeyCode + { + get + { + return keyCode; + } + } + + public int KeyModifier + { + get + { + return keyModifier; + } + } + + public uint Time + { + get + { + return time; + } + } + + public Key.StateType State + { + get + { + return state; + } + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/gestures/long-press-gesture.i b/plugins/dali-swig/SWIG/gestures/long-press-gesture.i new file mode 100644 index 0000000..c89e897 --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/long-press-gesture.i @@ -0,0 +1,35 @@ +%csmethodmodifiers Dali::LongPressGesture::numberOfTouches "private"; +%csmethodmodifiers Dali::LongPressGesture::screenPoint "private"; +%csmethodmodifiers Dali::LongPressGesture::localPoint "private"; + +%typemap(cscode) Dali::LongPressGesture %{ + public static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr) { + LongPressGesture ret = new LongPressGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint NumberOfTouches + { + get + { + return numberOfTouches; + } + } + + public Vector2 ScreenPoint + { + get + { + return screenPoint; + } + } + + public Vector2 LocalPoint + { + get + { + return localPoint; + } + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/gestures/pan-gesture.i b/plugins/dali-swig/SWIG/gestures/pan-gesture.i new file mode 100644 index 0000000..efcfc16 --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/pan-gesture.i @@ -0,0 +1,71 @@ +%csmethodmodifiers Dali::PanGesture::velocity "private"; +%csmethodmodifiers Dali::PanGesture::displacement "private"; +%csmethodmodifiers Dali::PanGesture::position "private"; +%csmethodmodifiers Dali::PanGesture::screenVelocity "private"; +%csmethodmodifiers Dali::PanGesture::screenDisplacement "private"; +%csmethodmodifiers Dali::PanGesture::screenPosition "private"; +%csmethodmodifiers Dali::PanGesture::numberOfTouches "private"; + +%typemap(cscode) Dali::PanGesture %{ + public static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr) { + PanGesture ret = new PanGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public Vector2 Velocity + { + get + { + return velocity; + } + } + + public Vector2 Displacement + { + get + { + return displacement; + } + } + + public Vector2 Position + { + get + { + return position; + } + } + + public Vector2 ScreenVelocity + { + get + { + return screenVelocity; + } + } + + public Vector2 ScreenDisplacement + { + get + { + return screenDisplacement; + } + } + + public Vector2 ScreenPosition + { + get + { + return screenPosition; + } + } + + public uint NumberOfTouches + { + get + { + return numberOfTouches; + } + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/gestures/pinch-gesture.i b/plugins/dali-swig/SWIG/gestures/pinch-gesture.i new file mode 100644 index 0000000..41af12e --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/pinch-gesture.i @@ -0,0 +1,44 @@ +%csmethodmodifiers Dali::PinchGesture::scale "private"; +%csmethodmodifiers Dali::PinchGesture::speed "private"; +%csmethodmodifiers Dali::PinchGesture::screenCenterPoint "private"; +%csmethodmodifiers Dali::PinchGesture::localCenterPoint "private"; + +%typemap(cscode) Dali::PinchGesture %{ + public static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr) { + PinchGesture ret = new PinchGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public float Scale + { + get + { + return scale; + } + } + + public float Speed + { + get + { + return speed; + } + } + + public Vector2 ScreenCenterPoint + { + get + { + return screenCenterPoint; + } + } + + public Vector2 LocalCenterPoint + { + get + { + return localCenterPoint; + } + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/gestures/tap-gesture.i b/plugins/dali-swig/SWIG/gestures/tap-gesture.i new file mode 100644 index 0000000..72b29cc --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/tap-gesture.i @@ -0,0 +1,44 @@ +%csmethodmodifiers Dali::TapGesture::numberOfTaps "private"; +%csmethodmodifiers Dali::TapGesture::numberOfTouches "private"; +%csmethodmodifiers Dali::TapGesture::screenPoint "private"; +%csmethodmodifiers Dali::TapGesture::localPoint "private"; + +%typemap(cscode) Dali::TapGesture %{ + public static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr) { + TapGesture ret = new TapGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint NumberOfTaps + { + get + { + return numberOfTaps; + } + } + + public uint NumberOfTouches + { + get + { + return numberOfTouches; + } + } + + public Vector2 ScreenPoint + { + get + { + return screenPoint; + } + } + + public Vector2 LocalPoint + { + get + { + return localPoint; + } + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/gestures/touch.i b/plugins/dali-swig/SWIG/gestures/touch.i new file mode 100644 index 0000000..ec63732 --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/touch.i @@ -0,0 +1,9 @@ +%rename(Touch) Dali::TouchData; + +%typemap(cscode) Dali::TouchData %{ + public static Touch GetTouchFromPtr(global::System.IntPtr cPtr) { + Touch ret = new Touch(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/gestures/wheel.i b/plugins/dali-swig/SWIG/gestures/wheel.i new file mode 100644 index 0000000..4da34a4 --- /dev/null +++ b/plugins/dali-swig/SWIG/gestures/wheel.i @@ -0,0 +1,65 @@ +%rename(Wheel) Dali::WheelEvent; +%rename(WheelType) Dali::WheelEvent::Type; + +%csmethodmodifiers Dali::WheelEvent::type "private"; +%csmethodmodifiers Dali::WheelEvent::direction "private"; +%csmethodmodifiers Dali::WheelEvent::modifiers "private"; +%csmethodmodifiers Dali::WheelEvent::point "private"; +%csmethodmodifiers Dali::WheelEvent::z "private"; +%csmethodmodifiers Dali::WheelEvent::timeStamp "private"; + +%typemap(cscode) Dali::WheelEvent %{ + public static Wheel GetWheelFromPtr(global::System.IntPtr cPtr) { + Wheel ret = new Wheel(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public Wheel.WheelType Type + { + get + { + return type; + } + } + + public int Direction + { + get + { + return direction; + } + } + + public uint Modifiers + { + get + { + return modifiers; + } + } + + public Vector2 Point + { + get + { + return point; + } + } + + public int Z + { + get + { + return z; + } + } + + public uint TimeStamp + { + get + { + return timeStamp; + } + } +%} \ No newline at end of file diff --git a/plugins/dali-swig/SWIG/signal-parameters.i b/plugins/dali-swig/SWIG/signal-parameters.i index ffb8ec7..e339809 100644 --- a/plugins/dali-swig/SWIG/signal-parameters.i +++ b/plugins/dali-swig/SWIG/signal-parameters.i @@ -25,12 +25,12 @@ * Required to get access to any data passed as a parameter in a Signal ( in C# they are delegate parameters). * E.g. * - * CREATE_CSHARP_WRAPPER_FROM_C_PTR_FUNCTION( TouchData ); - * Creates a function called GetTouchDataFromPtr which allows you to: + * CREATE_CSHARP_WRAPPER_FROM_C_PTR_FUNCTION( Touch ); + * Creates a function called GetTouchFromPtr which allows you to: * * static void OnStageTouched(IntPtr data) * { - * TouchData touchData = TouchData.GetTouchDataFromPtr( data ); + * Touch touch = Touch.GetTouchFromPtr( data ); * } * * ## means concat in a SWIG macro @@ -54,14 +54,6 @@ DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Actor ); DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Image ); DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, ResourceImage ); DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Animation ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, TouchEvent ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, TouchData ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, WheelEvent ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, KeyEvent ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, LongPressGesture ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, PanGesture ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, PinchGesture ); -DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, TapGesture ); DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, PropertyNotification ); DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, BaseHandle ); DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, RefObject ); diff --git a/plugins/dali-swig/examples/custom-control.cs b/plugins/dali-swig/examples/custom-control.cs index adf3a42..20531a2 100644 --- a/plugins/dali-swig/examples/custom-control.cs +++ b/plugins/dali-swig/examples/custom-control.cs @@ -62,7 +62,7 @@ namespace MyCSharpExample UpdateStartImages(_myRating); // Enable pan gesture detection - EnableGestureDetection(Gesture.Type.Pan); + EnableGestureDetection(Gesture.GestureType.Pan); _myDragEnabled = true; // Allow dragging by default (can be disabled) } @@ -72,18 +72,18 @@ namespace MyCSharpExample // Only handle pan gesture if dragging is allowed if(_myDragEnabled) { - switch (gesture.state) + switch (gesture.State) { - case Gesture.State.Started: + case Gesture.StateType.Started: { _gestureDisplacement = new Vector3(0.0f, 0.0f, 0.0f); _currentValue = 0; break; } - case Gesture.State.Continuing: + case Gesture.StateType.Continuing: { // Calculate the rating according to pan desture displacement - _gestureDisplacement.X += gesture.displacement.X; + _gestureDisplacement.X += gesture.Displacement.X; int delta = (int)Math.Ceiling(_gestureDisplacement.X / 40.0f); _currentValue = _myRating + delta; diff --git a/plugins/dali-swig/examples/hello-world.cs b/plugins/dali-swig/examples/hello-world.cs index 324d5dd..314c9a8 100755 --- a/plugins/dali-swig/examples/hello-world.cs +++ b/plugins/dali-swig/examples/hello-world.cs @@ -39,7 +39,7 @@ namespace MyCSharpExample Console.WriteLine("Customized Application Initialize event handler"); Stage stage = Stage.Instance; stage.BackgroundColor = Color.White; - stage.TouchEvent += OnStageTouched; + stage.Touch += OnStageTouched; // Add a _text label to the stage _text = new TextLabel("Hello Mono World"); @@ -66,7 +66,7 @@ namespace MyCSharpExample public void OnStageTouched(object sender, Stage.TouchEventArgs e) { // Only animate the _text label when touch down happens - if( e.TouchData.GetState(0) == PointStateType.DOWN ) + if( e.Touch.GetState(0) == PointStateType.DOWN ) { Console.WriteLine("Customized Stage Touch event handler"); // Create a new _animation diff --git a/plugins/dali-swig/examples/image-view.cs b/plugins/dali-swig/examples/image-view.cs index 43656a2..7cd5359 100755 --- a/plugins/dali-swig/examples/image-view.cs +++ b/plugins/dali-swig/examples/image-view.cs @@ -49,9 +49,9 @@ namespace ImageViewExample Log("Customized Application Initialize event handler"); stage = Stage.Instance; stage.BackgroundColor = Color.Cyan; - stage.TouchEvent += OnStageTouched; - stage.WheelEvent += OnStageWheelMoved; - stage.KeyEvent += OnStageKeyPressed; + stage.Touch += OnStageTouched; + stage.Wheel += OnStageWheelMoved; + stage.Key += OnStageKeyPressed; //stage.EventProcessingFinished += OnStageEventProcessingFinished; layer = stage.GetDefaultLayer(); @@ -202,21 +202,21 @@ namespace ImageViewExample public void OnStageKeyPressed(object sender, Stage.KeyEventArgs e) { Log("OnStageKeyEventOccured()!"); - Log("keyPressedName=" + e.KeyEvent.keyPressedName); - Log("state=" + e.KeyEvent.state); + Log("keyPressedName=" + e.Key.KeyPressedName); + Log("state=" + e.Key.State); } public void OnStageWheelMoved(object sender, Stage.WheelEventArgs e) { Log("OnStageWheelEventOccured()!"); - Log("direction=" + e.WheelEvent.direction); - Log("type=" + e.WheelEvent.type); + Log("direction=" + e.Wheel.Direction); + Log("type=" + e.Wheel.Type); } // Callback for stage touched signal handling public void OnStageTouched(object sender, Stage.TouchEventArgs e) { - Log("OnStageTouched()! e.TouchData.GetState(0)=" + e.TouchData.GetState(0) ); + Log("OnStageTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0)); } public void MainLoop() diff --git a/plugins/dali-swig/examples/scroll-view.cs b/plugins/dali-swig/examples/scroll-view.cs index 71e7ff0..834c4bd 100755 --- a/plugins/dali-swig/examples/scroll-view.cs +++ b/plugins/dali-swig/examples/scroll-view.cs @@ -154,7 +154,7 @@ namespace MyCSharpExample Console.WriteLine("View TOUCH EVENT callback...."); // Only animate the _text label when touch down happens - if( e.TouchData.GetState(0) == PointStateType.DOWN ) + if( e.Touch.GetState(0) == PointStateType.DOWN ) { Console.WriteLine("Customized Stage Touch event handler"); // Create a new _animation diff --git a/plugins/dali-swig/examples/user-alphafunction.cs b/plugins/dali-swig/examples/user-alphafunction.cs index cd11e87..5b521b0 100755 --- a/plugins/dali-swig/examples/user-alphafunction.cs +++ b/plugins/dali-swig/examples/user-alphafunction.cs @@ -51,10 +51,10 @@ namespace MyCSharpExample Log("Initialize() is called!"); Stage stage = Stage.GetCurrent(); stage.BackgroundColor = Color.White; - stage.TouchEvent += OnStageTouched; - stage.TouchEvent += OnStageTouched2; + stage.Touch += OnStageTouched; + stage.Touch += OnStageTouched2; //stage.EventProcessingFinished += OnEventProcessingFinished; - stage.WheelEvent += OnStageWheelEvent; + stage.Wheel += OnStageWheelEvent; // Add a _text label to the stage _text = new TextLabel("Hello Mono World"); @@ -142,7 +142,7 @@ namespace MyCSharpExample public void OnStageTouched(object source, Stage.TouchEventArgs e) { // Only animate the _text label when touch down happens - if( e.TouchData.GetState(0) == PointStateType.DOWN ) + if( e.Touch.GetState(0) == PointStateType.DOWN ) { Log("OnStageTouched() is called! PointStateType.DOWN came!"); myCount++; @@ -157,7 +157,7 @@ namespace MyCSharpExample // Callback for stage touched signal handling public void OnStageTouched2(object source, Stage.TouchEventArgs e) { - Log("OnStageTouched2() is called!state="+ e.TouchData.GetState(0) ); + Log("OnStageTouched2() is called!state="+ e.Touch.GetState(0) ); } public void OnEventProcessingFinished(object source) diff --git a/plugins/dali-swig/manual/csharp/CustomView.cs b/plugins/dali-swig/manual/csharp/CustomView.cs index 020fad0..7e84f5b 100644 --- a/plugins/dali-swig/manual/csharp/CustomView.cs +++ b/plugins/dali-swig/manual/csharp/CustomView.cs @@ -29,10 +29,10 @@ namespace Dali viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet); viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet); viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation); - viewWrapperImpl.OnTouchEvent = new ViewWrapperImpl.OnTouchEventDelegate(OnTouchEvent); + viewWrapperImpl.OnTouch = new ViewWrapperImpl.OnTouchDelegate(OnTouch); viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover); - viewWrapperImpl.OnKeyEvent = new ViewWrapperImpl.OnKeyEventDelegate(OnKeyEvent); - viewWrapperImpl.OnWheelEvent = new ViewWrapperImpl.OnWheelEventDelegate(OnWheelEvent); + viewWrapperImpl.OnKey = new ViewWrapperImpl.OnKeyDelegate(OnKey); + viewWrapperImpl.OnWheel = new ViewWrapperImpl.OnWheelDelegate(OnWheel); viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout); viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy); viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize); @@ -89,7 +89,7 @@ namespace Dali * @endcode * @param[in] type The gesture type(s) to enable. */ - public void EnableGestureDetection(Gesture.Type type) + public void EnableGestureDetection(Gesture.GestureType type) { viewWrapperImpl.EnableGestureDetection(type); } @@ -101,7 +101,7 @@ namespace Dali * @param[in] type The gesture type(s) to disable. * @see EnableGetureDetection */ - public void DisableGestureDetection(Gesture.Type type) + public void DisableGestureDetection(Gesture.GestureType type) { viewWrapperImpl.DisableGestureDetection(type); } @@ -171,12 +171,12 @@ namespace Dali /** * @brief Called by the KeyInputFocusManager to emit key event signals. * - * @param[in] keyEvent The key event. + * @param[in] key The key event. * @return True if the event was consumed. */ - public bool EmitKeyEventSignal(KeyEvent keyEvent) + public bool EmitKeyEventSignal(Key key) { - return viewWrapperImpl.EmitKeyEventSignal(keyEvent); + return viewWrapperImpl.EmitKeyEventSignal(key); } /** @@ -457,11 +457,11 @@ namespace Dali * * @brief Called after a touch-event is received by the owning actor. * - * @param[in] event The touch event + * @param[in] touch The touch event * @return True if the event should be consumed. * @note CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour). */ - public virtual bool OnTouchEvent(TouchEvent touchEvent) + public virtual bool OnTouch(Touch touch) { return false; // Do not consume } @@ -481,10 +481,10 @@ namespace Dali /** * @brief Called after a key-event is received by the actor that has had its focus set. * - * @param[in] event the Key Event + * @param[in] key the Key Event * @return True if the event should be consumed. */ - public virtual bool OnKeyEvent(KeyEvent keyEvent) + public virtual bool OnKey(Key key) { return false; // Do not consume } @@ -492,11 +492,11 @@ namespace Dali /** * @brief Called after a wheel-event is received by the owning actor. * - * @param[in] event The wheel event + * @param[in] wheel The wheel event * @return True if the event should be consumed. * @note CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour). */ - public virtual bool OnWheelEvent(WheelEvent wheelEvent) + public virtual bool OnWheel(Wheel wheel) { return false; // Do not consume } @@ -657,10 +657,10 @@ namespace Dali * @brief This method should be overridden by deriving classes when they wish to respond the accessibility * touch event. * - * @param[in] touchEvent The touch event. + * @param[in] touch The touch event. * @return true if the touch event has been consumed by this control */ - public virtual bool OnAccessibilityTouch(TouchEvent touchEvent) + public virtual bool OnAccessibilityTouch(Touch touch) { return false; } diff --git a/plugins/dali-swig/manual/csharp/ViewWrapperImpl.cs b/plugins/dali-swig/manual/csharp/ViewWrapperImpl.cs index 97e9cd3..45c0175 100644 --- a/plugins/dali-swig/manual/csharp/ViewWrapperImpl.cs +++ b/plugins/dali-swig/manual/csharp/ViewWrapperImpl.cs @@ -27,10 +27,10 @@ namespace Dali public delegate void OnPropertySetDelegate(int index, Property.Value propertyValue); public delegate void OnSizeSetDelegate(Vector3 targetSize); public delegate void OnSizeAnimationDelegate(Animation animation, Vector3 targetSize); - public delegate bool OnTouchEventDelegate(TouchEvent touchEvent); + public delegate bool OnTouchDelegate(Touch touch); public delegate bool OnHoverDelegate(Hover hover); - public delegate bool OnKeyEventDelegate(KeyEvent keyEvent); - public delegate bool OnWheelEventDelegate(WheelEvent wheelEvent); + public delegate bool OnKeyDelegate(Key key); + public delegate bool OnWheelDelegate(Wheel wheel); public delegate void OnRelayoutDelegate(Vector2 size, RelayoutContainer container); public delegate void OnSetResizePolicyDelegate(ResizePolicyType policy, DimensionType dimension); public delegate Vector3 GetNaturalSizeDelegate(); @@ -46,7 +46,7 @@ namespace Dali public delegate void OnStyleChangeDelegate(StyleManager styleManager, StyleChangeType change); public delegate bool OnAccessibilityActivatedDelegate(); public delegate bool OnAccessibilityPanDelegate(PanGesture gestures); - public delegate bool OnAccessibilityTouchDelegate(TouchEvent touchEvent); + public delegate bool OnAccessibilityTouchDelegate(Touch touch); public delegate bool OnAccessibilityValueChangeDelegate(bool isIncrease); public delegate bool OnAccessibilityZoomDelegate(); public delegate void OnKeyInputFocusGainedDelegate(); @@ -68,10 +68,10 @@ namespace Dali public OnPropertySetDelegate OnPropertySet; public OnSizeSetDelegate OnSizeSet; public OnSizeAnimationDelegate OnSizeAnimation; - public OnTouchEventDelegate OnTouchEvent; + public OnTouchDelegate OnTouch; public OnHoverDelegate OnHover; - public OnKeyEventDelegate OnKeyEvent; - public OnWheelEventDelegate OnWheelEvent; + public OnKeyDelegate OnKey; + public OnWheelDelegate OnWheel; public OnRelayoutDelegate OnRelayout; public OnSetResizePolicyDelegate OnSetResizePolicy; public GetNaturalSizeDelegate GetNaturalSize; @@ -255,10 +255,10 @@ namespace Dali Delegate4 = new DelegateViewWrapperImpl_4(DirectorOnPropertySet); Delegate5 = new DelegateViewWrapperImpl_5(DirectorOnSizeSet); Delegate6 = new DelegateViewWrapperImpl_6(DirectorOnSizeAnimation); - Delegate7 = new DelegateViewWrapperImpl_7(DirectorOnTouchEvent); + Delegate7 = new DelegateViewWrapperImpl_7(DirectorOnTouch); Delegate8 = new DelegateViewWrapperImpl_8(DirectorOnHover); - Delegate9 = new DelegateViewWrapperImpl_9(DirectorOnKeyEvent); - Delegate10 = new DelegateViewWrapperImpl_10(DirectorOnWheelEvent); + Delegate9 = new DelegateViewWrapperImpl_9(DirectorOnKey); + Delegate10 = new DelegateViewWrapperImpl_10(DirectorOnWheel); Delegate11 = new DelegateViewWrapperImpl_11(DirectorOnRelayout); Delegate12 = new DelegateViewWrapperImpl_12(DirectorOnSetResizePolicy); Delegate13 = new DelegateViewWrapperImpl_13(DirectorGetNaturalSize); @@ -325,9 +325,9 @@ namespace Dali OnSizeAnimation(new Animation(animation, false), new Vector3(targetSize, false)); } - private bool DirectorOnTouchEvent(global::System.IntPtr arg0) + private bool DirectorOnTouch(global::System.IntPtr arg0) { - return OnTouchEvent(new TouchEvent(arg0, false)); + return OnTouch(new Touch(arg0, false)); } private bool DirectorOnHover(global::System.IntPtr arg0) @@ -335,14 +335,14 @@ namespace Dali return OnHover(new Hover(arg0, false)); } - private bool DirectorOnKeyEvent(global::System.IntPtr arg0) + private bool DirectorOnKey(global::System.IntPtr arg0) { - return OnKeyEvent(new KeyEvent(arg0, false)); + return OnKey(new Key(arg0, false)); } - private bool DirectorOnWheelEvent(global::System.IntPtr arg0) + private bool DirectorOnWheel(global::System.IntPtr arg0) { - return OnWheelEvent(new WheelEvent(arg0, false)); + return OnWheel(new Wheel(arg0, false)); } private void DirectorOnRelayout(global::System.IntPtr size, global::System.IntPtr container) @@ -424,9 +424,9 @@ namespace Dali return OnAccessibilityPan(new PanGesture(gesture, false)); } - private bool DirectorOnAccessibilityTouch(global::System.IntPtr touchEvent) + private bool DirectorOnAccessibilityTouch(global::System.IntPtr touch) { - return OnAccessibilityTouch(new TouchEvent(touchEvent, false)); + return OnAccessibilityTouch(new Touch(touch, false)); } private bool DirectorOnAccessibilityValueChange(bool isIncrease) @@ -521,7 +521,7 @@ namespace Dali public delegate void DelegateViewWrapperImpl_24(global::System.IntPtr styleManager, int change); public delegate bool DelegateViewWrapperImpl_25(); public delegate bool DelegateViewWrapperImpl_26(global::System.IntPtr gesture); - public delegate bool DelegateViewWrapperImpl_27(global::System.IntPtr touchEvent); + public delegate bool DelegateViewWrapperImpl_27(global::System.IntPtr touch); public delegate bool DelegateViewWrapperImpl_28(bool isIncrease); public delegate bool DelegateViewWrapperImpl_29(); public delegate void DelegateViewWrapperImpl_30();