1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Canvas {
8 /// <summary>EFL Gesture Touch class</summary>
9 [GestureTouchNativeInherit]
10 public class GestureTouch : Efl.Object, Efl.Eo.IWrapper
12 ///<summary>Pointer to the native class description.</summary>
13 public override System.IntPtr NativeClass {
15 if (((object)this).GetType() == typeof (GestureTouch))
16 return Efl.Canvas.GestureTouchNativeInherit.GetEflClassStatic();
18 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
21 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
22 efl_canvas_gesture_touch_class_get();
23 ///<summary>Creates a new instance.</summary>
24 ///<param name="parent">Parent instance.</param>
25 public GestureTouch(Efl.Object parent= null
27 base(efl_canvas_gesture_touch_class_get(), typeof(GestureTouch), parent)
29 FinishInstantiation();
31 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
32 protected GestureTouch(System.IntPtr raw) : base(raw)
34 RegisterEventProxies();
36 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
37 protected GestureTouch(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
38 ///<summary>Verifies if the given object is equal to this one.</summary>
39 public override bool Equals(object obj)
41 var other = obj as Efl.Object;
44 return this.NativeHandle == other.NativeHandle;
46 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
47 public override int GetHashCode()
49 return this.NativeHandle.ToInt32();
51 ///<summary>Turns the native pointer into a string representation.</summary>
52 public override String ToString()
54 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
56 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
57 protected override void RegisterEventProxies()
59 base.RegisterEventProxies();
61 /// <summary>Returns the first touch point.</summary>
62 /// <returns>The start position.</returns>
63 virtual public Eina.Vector2 GetStartPoint() {
64 var _ret_var = Efl.Canvas.GestureTouchNativeInherit.efl_gesture_touch_start_point_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
65 Eina.Error.RaiseIfUnhandledException();
68 /// <summary>This property tells if the event is multi touch.</summary>
69 /// <returns>returns <c>true</c> if its a multi touch</returns>
70 virtual public bool GetMultiTouch() {
71 var _ret_var = Efl.Canvas.GestureTouchNativeInherit.efl_gesture_touch_multi_touch_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
72 Eina.Error.RaiseIfUnhandledException();
75 /// <summary>This property holds the state of the touch event.</summary>
76 /// <returns>touch event state</returns>
77 virtual public Efl.Canvas.GestureTouchState GetState() {
78 var _ret_var = Efl.Canvas.GestureTouchNativeInherit.efl_gesture_touch_state_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
79 Eina.Error.RaiseIfUnhandledException();
82 /// <summary>Touch point record method</summary>
83 /// <param name="tool">The finger id</param>
84 /// <param name="pos">Position of the event</param>
85 /// <param name="timestamp">The timestamp of the event</param>
86 /// <param name="action">action of the event</param>
87 /// <returns></returns>
88 virtual public void PointRecord( int tool, Eina.Vector2 pos, double timestamp, Efl.Pointer.Action action) {
89 Eina.Vector2.NativeStruct _in_pos = pos;
90 Efl.Canvas.GestureTouchNativeInherit.efl_gesture_touch_point_record_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), tool, _in_pos, timestamp, action);
91 Eina.Error.RaiseIfUnhandledException();
93 /// <summary>Compute the distance between the last two events</summary>
94 /// <param name="tool">The finger id</param>
95 /// <returns>The distance vector.</returns>
96 virtual public Eina.Vector2 Delta( int tool) {
97 var _ret_var = Efl.Canvas.GestureTouchNativeInherit.efl_gesture_touch_delta_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), tool);
98 Eina.Error.RaiseIfUnhandledException();
101 /// <summary>Compute the distance between the first touch and the last event.</summary>
102 /// <param name="tool">The finger id</param>
103 /// <returns>The distance vector.</returns>
104 virtual public Eina.Vector2 Distance( int tool) {
105 var _ret_var = Efl.Canvas.GestureTouchNativeInherit.efl_gesture_touch_distance_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), tool);
106 Eina.Error.RaiseIfUnhandledException();
109 /// <summary>Returns the first touch point.</summary>
110 /// <value>The start position.</value>
111 public Eina.Vector2 StartPoint {
112 get { return GetStartPoint(); }
114 /// <summary>This property tells if the event is multi touch.</summary>
115 /// <value>returns <c>true</c> if its a multi touch</value>
116 public bool MultiTouch {
117 get { return GetMultiTouch(); }
119 /// <summary>This property holds the state of the touch event.</summary>
120 /// <value>touch event state</value>
121 public Efl.Canvas.GestureTouchState State {
122 get { return GetState(); }
124 private static IntPtr GetEflClassStatic()
126 return Efl.Canvas.GestureTouch.efl_canvas_gesture_touch_class_get();
129 public class GestureTouchNativeInherit : Efl.ObjectNativeInherit{
130 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Evas);
131 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
133 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
134 var methods = Efl.Eo.Globals.GetUserMethods(type);
135 if (efl_gesture_touch_start_point_get_static_delegate == null)
136 efl_gesture_touch_start_point_get_static_delegate = new efl_gesture_touch_start_point_get_delegate(start_point_get);
137 if (methods.FirstOrDefault(m => m.Name == "GetStartPoint") != null)
138 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gesture_touch_start_point_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_touch_start_point_get_static_delegate)});
139 if (efl_gesture_touch_multi_touch_get_static_delegate == null)
140 efl_gesture_touch_multi_touch_get_static_delegate = new efl_gesture_touch_multi_touch_get_delegate(multi_touch_get);
141 if (methods.FirstOrDefault(m => m.Name == "GetMultiTouch") != null)
142 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gesture_touch_multi_touch_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_touch_multi_touch_get_static_delegate)});
143 if (efl_gesture_touch_state_get_static_delegate == null)
144 efl_gesture_touch_state_get_static_delegate = new efl_gesture_touch_state_get_delegate(state_get);
145 if (methods.FirstOrDefault(m => m.Name == "GetState") != null)
146 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gesture_touch_state_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_touch_state_get_static_delegate)});
147 if (efl_gesture_touch_point_record_static_delegate == null)
148 efl_gesture_touch_point_record_static_delegate = new efl_gesture_touch_point_record_delegate(point_record);
149 if (methods.FirstOrDefault(m => m.Name == "PointRecord") != null)
150 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gesture_touch_point_record"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_touch_point_record_static_delegate)});
151 if (efl_gesture_touch_delta_static_delegate == null)
152 efl_gesture_touch_delta_static_delegate = new efl_gesture_touch_delta_delegate(delta);
153 if (methods.FirstOrDefault(m => m.Name == "Delta") != null)
154 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gesture_touch_delta"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_touch_delta_static_delegate)});
155 if (efl_gesture_touch_distance_static_delegate == null)
156 efl_gesture_touch_distance_static_delegate = new efl_gesture_touch_distance_delegate(distance);
157 if (methods.FirstOrDefault(m => m.Name == "Distance") != null)
158 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gesture_touch_distance"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_touch_distance_static_delegate)});
159 descs.AddRange(base.GetEoOps(type));
162 public override IntPtr GetEflClass()
164 return Efl.Canvas.GestureTouch.efl_canvas_gesture_touch_class_get();
166 public static new IntPtr GetEflClassStatic()
168 return Efl.Canvas.GestureTouch.efl_canvas_gesture_touch_class_get();
172 private delegate Eina.Vector2.NativeStruct efl_gesture_touch_start_point_get_delegate(System.IntPtr obj, System.IntPtr pd);
175 public delegate Eina.Vector2.NativeStruct efl_gesture_touch_start_point_get_api_delegate(System.IntPtr obj);
176 public static Efl.Eo.FunctionWrapper<efl_gesture_touch_start_point_get_api_delegate> efl_gesture_touch_start_point_get_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_touch_start_point_get_api_delegate>(_Module, "efl_gesture_touch_start_point_get");
177 private static Eina.Vector2.NativeStruct start_point_get(System.IntPtr obj, System.IntPtr pd)
179 Eina.Log.Debug("function efl_gesture_touch_start_point_get was called");
180 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
181 if(wrapper != null) {
182 Eina.Vector2 _ret_var = default(Eina.Vector2);
184 _ret_var = ((GestureTouch)wrapper).GetStartPoint();
185 } catch (Exception e) {
186 Eina.Log.Warning($"Callback error: {e.ToString()}");
187 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
191 return efl_gesture_touch_start_point_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
194 private static efl_gesture_touch_start_point_get_delegate efl_gesture_touch_start_point_get_static_delegate;
197 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_gesture_touch_multi_touch_get_delegate(System.IntPtr obj, System.IntPtr pd);
200 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_gesture_touch_multi_touch_get_api_delegate(System.IntPtr obj);
201 public static Efl.Eo.FunctionWrapper<efl_gesture_touch_multi_touch_get_api_delegate> efl_gesture_touch_multi_touch_get_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_touch_multi_touch_get_api_delegate>(_Module, "efl_gesture_touch_multi_touch_get");
202 private static bool multi_touch_get(System.IntPtr obj, System.IntPtr pd)
204 Eina.Log.Debug("function efl_gesture_touch_multi_touch_get was called");
205 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
206 if(wrapper != null) {
207 bool _ret_var = default(bool);
209 _ret_var = ((GestureTouch)wrapper).GetMultiTouch();
210 } catch (Exception e) {
211 Eina.Log.Warning($"Callback error: {e.ToString()}");
212 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
216 return efl_gesture_touch_multi_touch_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
219 private static efl_gesture_touch_multi_touch_get_delegate efl_gesture_touch_multi_touch_get_static_delegate;
222 private delegate Efl.Canvas.GestureTouchState efl_gesture_touch_state_get_delegate(System.IntPtr obj, System.IntPtr pd);
225 public delegate Efl.Canvas.GestureTouchState efl_gesture_touch_state_get_api_delegate(System.IntPtr obj);
226 public static Efl.Eo.FunctionWrapper<efl_gesture_touch_state_get_api_delegate> efl_gesture_touch_state_get_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_touch_state_get_api_delegate>(_Module, "efl_gesture_touch_state_get");
227 private static Efl.Canvas.GestureTouchState state_get(System.IntPtr obj, System.IntPtr pd)
229 Eina.Log.Debug("function efl_gesture_touch_state_get was called");
230 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
231 if(wrapper != null) {
232 Efl.Canvas.GestureTouchState _ret_var = default(Efl.Canvas.GestureTouchState);
234 _ret_var = ((GestureTouch)wrapper).GetState();
235 } catch (Exception e) {
236 Eina.Log.Warning($"Callback error: {e.ToString()}");
237 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
241 return efl_gesture_touch_state_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
244 private static efl_gesture_touch_state_get_delegate efl_gesture_touch_state_get_static_delegate;
247 private delegate void efl_gesture_touch_point_record_delegate(System.IntPtr obj, System.IntPtr pd, int tool, Eina.Vector2.NativeStruct pos, double timestamp, Efl.Pointer.Action action);
250 public delegate void efl_gesture_touch_point_record_api_delegate(System.IntPtr obj, int tool, Eina.Vector2.NativeStruct pos, double timestamp, Efl.Pointer.Action action);
251 public static Efl.Eo.FunctionWrapper<efl_gesture_touch_point_record_api_delegate> efl_gesture_touch_point_record_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_touch_point_record_api_delegate>(_Module, "efl_gesture_touch_point_record");
252 private static void point_record(System.IntPtr obj, System.IntPtr pd, int tool, Eina.Vector2.NativeStruct pos, double timestamp, Efl.Pointer.Action action)
254 Eina.Log.Debug("function efl_gesture_touch_point_record was called");
255 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
256 if(wrapper != null) {
257 Eina.Vector2 _in_pos = pos;
260 ((GestureTouch)wrapper).PointRecord( tool, _in_pos, timestamp, action);
261 } catch (Exception e) {
262 Eina.Log.Warning($"Callback error: {e.ToString()}");
263 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
266 efl_gesture_touch_point_record_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), tool, pos, timestamp, action);
269 private static efl_gesture_touch_point_record_delegate efl_gesture_touch_point_record_static_delegate;
272 private delegate Eina.Vector2.NativeStruct efl_gesture_touch_delta_delegate(System.IntPtr obj, System.IntPtr pd, int tool);
275 public delegate Eina.Vector2.NativeStruct efl_gesture_touch_delta_api_delegate(System.IntPtr obj, int tool);
276 public static Efl.Eo.FunctionWrapper<efl_gesture_touch_delta_api_delegate> efl_gesture_touch_delta_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_touch_delta_api_delegate>(_Module, "efl_gesture_touch_delta");
277 private static Eina.Vector2.NativeStruct delta(System.IntPtr obj, System.IntPtr pd, int tool)
279 Eina.Log.Debug("function efl_gesture_touch_delta was called");
280 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
281 if(wrapper != null) {
282 Eina.Vector2 _ret_var = default(Eina.Vector2);
284 _ret_var = ((GestureTouch)wrapper).Delta( tool);
285 } catch (Exception e) {
286 Eina.Log.Warning($"Callback error: {e.ToString()}");
287 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
291 return efl_gesture_touch_delta_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), tool);
294 private static efl_gesture_touch_delta_delegate efl_gesture_touch_delta_static_delegate;
297 private delegate Eina.Vector2.NativeStruct efl_gesture_touch_distance_delegate(System.IntPtr obj, System.IntPtr pd, int tool);
300 public delegate Eina.Vector2.NativeStruct efl_gesture_touch_distance_api_delegate(System.IntPtr obj, int tool);
301 public static Efl.Eo.FunctionWrapper<efl_gesture_touch_distance_api_delegate> efl_gesture_touch_distance_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_touch_distance_api_delegate>(_Module, "efl_gesture_touch_distance");
302 private static Eina.Vector2.NativeStruct distance(System.IntPtr obj, System.IntPtr pd, int tool)
304 Eina.Log.Debug("function efl_gesture_touch_distance was called");
305 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
306 if(wrapper != null) {
307 Eina.Vector2 _ret_var = default(Eina.Vector2);
309 _ret_var = ((GestureTouch)wrapper).Distance( tool);
310 } catch (Exception e) {
311 Eina.Log.Warning($"Callback error: {e.ToString()}");
312 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
316 return efl_gesture_touch_distance_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), tool);
319 private static efl_gesture_touch_distance_delegate efl_gesture_touch_distance_static_delegate;