1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>EFL Gesture Touch class</summary>
13 [Efl.Canvas.GestureTouch.NativeMethods]
14 public class GestureTouch : Efl.Object, Efl.Eo.IWrapper
16 ///<summary>Pointer to the native class description.</summary>
17 public override System.IntPtr NativeClass
21 if (((object)this).GetType() == typeof(GestureTouch))
23 return GetEflClassStatic();
27 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
32 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
33 efl_canvas_gesture_touch_class_get();
34 /// <summary>Initializes a new instance of the <see cref="GestureTouch"/> class.</summary>
35 /// <param name="parent">Parent instance.</param>
36 public GestureTouch(Efl.Object parent= null
37 ) : base(efl_canvas_gesture_touch_class_get(), typeof(GestureTouch), parent)
39 FinishInstantiation();
42 /// <summary>Initializes a new instance of the <see cref="GestureTouch"/> class.
43 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
44 /// <param name="raw">The native pointer to be wrapped.</param>
45 protected GestureTouch(System.IntPtr raw) : base(raw)
49 /// <summary>Initializes a new instance of the <see cref="GestureTouch"/> class.
50 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
51 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
52 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
53 /// <param name="parent">The Efl.Object parent of this instance.</param>
54 protected GestureTouch(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
58 /// <summary>Verifies if the given object is equal to this one.</summary>
59 /// <param name="instance">The object to compare to.</param>
60 /// <returns>True if both objects point to the same native object.</returns>
61 public override bool Equals(object instance)
63 var other = instance as Efl.Object;
68 return this.NativeHandle == other.NativeHandle;
71 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
72 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
73 public override int GetHashCode()
75 return this.NativeHandle.ToInt32();
78 /// <summary>Turns the native pointer into a string representation.</summary>
79 /// <returns>A string with the type and the native pointer for this object.</returns>
80 public override String ToString()
82 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
85 /// <summary>Returns the first touch point.</summary>
86 /// <returns>The start position.</returns>
87 virtual public Eina.Vector2 GetStartPoint() {
88 var _ret_var = Efl.Canvas.GestureTouch.NativeMethods.efl_gesture_touch_start_point_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
89 Eina.Error.RaiseIfUnhandledException();
92 /// <summary>This property tells if the event is multi touch.</summary>
93 /// <returns>returns <c>true</c> if its a multi touch</returns>
94 virtual public bool GetMultiTouch() {
95 var _ret_var = Efl.Canvas.GestureTouch.NativeMethods.efl_gesture_touch_multi_touch_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
96 Eina.Error.RaiseIfUnhandledException();
99 /// <summary>This property holds the state of the touch event.</summary>
100 /// <returns>touch event state</returns>
101 virtual public Efl.Canvas.GestureTouchState GetState() {
102 var _ret_var = Efl.Canvas.GestureTouch.NativeMethods.efl_gesture_touch_state_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
103 Eina.Error.RaiseIfUnhandledException();
106 /// <summary>Touch point record method</summary>
107 /// <param name="tool">The finger id</param>
108 /// <param name="pos">Position of the event</param>
109 /// <param name="timestamp">The timestamp of the event</param>
110 /// <param name="action">action of the event</param>
111 virtual public void PointRecord(int tool, Eina.Vector2 pos, double timestamp, Efl.Pointer.Action action) {
112 Eina.Vector2.NativeStruct _in_pos = pos;
113 Efl.Canvas.GestureTouch.NativeMethods.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);
114 Eina.Error.RaiseIfUnhandledException();
116 /// <summary>Compute the distance between the last two events</summary>
117 /// <param name="tool">The finger id</param>
118 /// <returns>The distance vector.</returns>
119 virtual public Eina.Vector2 Delta(int tool) {
120 var _ret_var = Efl.Canvas.GestureTouch.NativeMethods.efl_gesture_touch_delta_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),tool);
121 Eina.Error.RaiseIfUnhandledException();
124 /// <summary>Compute the distance between the first touch and the last event.</summary>
125 /// <param name="tool">The finger id</param>
126 /// <returns>The distance vector.</returns>
127 virtual public Eina.Vector2 Distance(int tool) {
128 var _ret_var = Efl.Canvas.GestureTouch.NativeMethods.efl_gesture_touch_distance_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),tool);
129 Eina.Error.RaiseIfUnhandledException();
132 /// <summary>Returns the first touch point.</summary>
133 /// <value>The start position.</value>
134 public Eina.Vector2 StartPoint {
135 get { return GetStartPoint(); }
137 /// <summary>This property tells if the event is multi touch.</summary>
138 /// <value>returns <c>true</c> if its a multi touch</value>
139 public bool MultiTouch {
140 get { return GetMultiTouch(); }
142 /// <summary>This property holds the state of the touch event.</summary>
143 /// <value>touch event state</value>
144 public Efl.Canvas.GestureTouchState State {
145 get { return GetState(); }
147 private static IntPtr GetEflClassStatic()
149 return Efl.Canvas.GestureTouch.efl_canvas_gesture_touch_class_get();
151 /// <summary>Wrapper for native methods and virtual method delegates.
152 /// For internal use by generated code only.</summary>
153 public new class NativeMethods : Efl.Object.NativeMethods
155 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
156 /// <summary>Gets the list of Eo operations to override.</summary>
157 /// <returns>The list of Eo operations to be overload.</returns>
158 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
160 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
161 var methods = Efl.Eo.Globals.GetUserMethods(type);
163 if (efl_gesture_touch_start_point_get_static_delegate == null)
165 efl_gesture_touch_start_point_get_static_delegate = new efl_gesture_touch_start_point_get_delegate(start_point_get);
168 if (methods.FirstOrDefault(m => m.Name == "GetStartPoint") != null)
170 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) });
173 if (efl_gesture_touch_multi_touch_get_static_delegate == null)
175 efl_gesture_touch_multi_touch_get_static_delegate = new efl_gesture_touch_multi_touch_get_delegate(multi_touch_get);
178 if (methods.FirstOrDefault(m => m.Name == "GetMultiTouch") != null)
180 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) });
183 if (efl_gesture_touch_state_get_static_delegate == null)
185 efl_gesture_touch_state_get_static_delegate = new efl_gesture_touch_state_get_delegate(state_get);
188 if (methods.FirstOrDefault(m => m.Name == "GetState") != null)
190 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) });
193 if (efl_gesture_touch_point_record_static_delegate == null)
195 efl_gesture_touch_point_record_static_delegate = new efl_gesture_touch_point_record_delegate(point_record);
198 if (methods.FirstOrDefault(m => m.Name == "PointRecord") != null)
200 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) });
203 if (efl_gesture_touch_delta_static_delegate == null)
205 efl_gesture_touch_delta_static_delegate = new efl_gesture_touch_delta_delegate(delta);
208 if (methods.FirstOrDefault(m => m.Name == "Delta") != null)
210 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) });
213 if (efl_gesture_touch_distance_static_delegate == null)
215 efl_gesture_touch_distance_static_delegate = new efl_gesture_touch_distance_delegate(distance);
218 if (methods.FirstOrDefault(m => m.Name == "Distance") != null)
220 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) });
223 descs.AddRange(base.GetEoOps(type));
226 /// <summary>Returns the Eo class for the native methods of this class.</summary>
227 /// <returns>The native class pointer.</returns>
228 public override IntPtr GetEflClass()
230 return Efl.Canvas.GestureTouch.efl_canvas_gesture_touch_class_get();
233 #pragma warning disable CA1707, SA1300, SA1600
236 private delegate Eina.Vector2.NativeStruct efl_gesture_touch_start_point_get_delegate(System.IntPtr obj, System.IntPtr pd);
239 public delegate Eina.Vector2.NativeStruct efl_gesture_touch_start_point_get_api_delegate(System.IntPtr obj);
241 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");
243 private static Eina.Vector2.NativeStruct start_point_get(System.IntPtr obj, System.IntPtr pd)
245 Eina.Log.Debug("function efl_gesture_touch_start_point_get was called");
246 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
249 Eina.Vector2 _ret_var = default(Eina.Vector2);
252 _ret_var = ((GestureTouch)wrapper).GetStartPoint();
256 Eina.Log.Warning($"Callback error: {e.ToString()}");
257 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
265 return efl_gesture_touch_start_point_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
269 private static efl_gesture_touch_start_point_get_delegate efl_gesture_touch_start_point_get_static_delegate;
271 [return: MarshalAs(UnmanagedType.U1)]
272 private delegate bool efl_gesture_touch_multi_touch_get_delegate(System.IntPtr obj, System.IntPtr pd);
274 [return: MarshalAs(UnmanagedType.U1)]
275 public delegate bool efl_gesture_touch_multi_touch_get_api_delegate(System.IntPtr obj);
277 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");
279 private static bool multi_touch_get(System.IntPtr obj, System.IntPtr pd)
281 Eina.Log.Debug("function efl_gesture_touch_multi_touch_get was called");
282 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
285 bool _ret_var = default(bool);
288 _ret_var = ((GestureTouch)wrapper).GetMultiTouch();
292 Eina.Log.Warning($"Callback error: {e.ToString()}");
293 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
301 return efl_gesture_touch_multi_touch_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
305 private static efl_gesture_touch_multi_touch_get_delegate efl_gesture_touch_multi_touch_get_static_delegate;
308 private delegate Efl.Canvas.GestureTouchState efl_gesture_touch_state_get_delegate(System.IntPtr obj, System.IntPtr pd);
311 public delegate Efl.Canvas.GestureTouchState efl_gesture_touch_state_get_api_delegate(System.IntPtr obj);
313 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");
315 private static Efl.Canvas.GestureTouchState state_get(System.IntPtr obj, System.IntPtr pd)
317 Eina.Log.Debug("function efl_gesture_touch_state_get was called");
318 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
321 Efl.Canvas.GestureTouchState _ret_var = default(Efl.Canvas.GestureTouchState);
324 _ret_var = ((GestureTouch)wrapper).GetState();
328 Eina.Log.Warning($"Callback error: {e.ToString()}");
329 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
337 return efl_gesture_touch_state_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
341 private static efl_gesture_touch_state_get_delegate efl_gesture_touch_state_get_static_delegate;
344 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);
347 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);
349 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");
351 private static void point_record(System.IntPtr obj, System.IntPtr pd, int tool, Eina.Vector2.NativeStruct pos, double timestamp, Efl.Pointer.Action action)
353 Eina.Log.Debug("function efl_gesture_touch_point_record was called");
354 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
357 Eina.Vector2 _in_pos = pos;
361 ((GestureTouch)wrapper).PointRecord(tool, _in_pos, timestamp, action);
365 Eina.Log.Warning($"Callback error: {e.ToString()}");
366 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
373 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);
377 private static efl_gesture_touch_point_record_delegate efl_gesture_touch_point_record_static_delegate;
380 private delegate Eina.Vector2.NativeStruct efl_gesture_touch_delta_delegate(System.IntPtr obj, System.IntPtr pd, int tool);
383 public delegate Eina.Vector2.NativeStruct efl_gesture_touch_delta_api_delegate(System.IntPtr obj, int tool);
385 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");
387 private static Eina.Vector2.NativeStruct delta(System.IntPtr obj, System.IntPtr pd, int tool)
389 Eina.Log.Debug("function efl_gesture_touch_delta was called");
390 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
393 Eina.Vector2 _ret_var = default(Eina.Vector2);
396 _ret_var = ((GestureTouch)wrapper).Delta(tool);
400 Eina.Log.Warning($"Callback error: {e.ToString()}");
401 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
409 return efl_gesture_touch_delta_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), tool);
413 private static efl_gesture_touch_delta_delegate efl_gesture_touch_delta_static_delegate;
416 private delegate Eina.Vector2.NativeStruct efl_gesture_touch_distance_delegate(System.IntPtr obj, System.IntPtr pd, int tool);
419 public delegate Eina.Vector2.NativeStruct efl_gesture_touch_distance_api_delegate(System.IntPtr obj, int tool);
421 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");
423 private static Eina.Vector2.NativeStruct distance(System.IntPtr obj, System.IntPtr pd, int tool)
425 Eina.Log.Debug("function efl_gesture_touch_distance was called");
426 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
429 Eina.Vector2 _ret_var = default(Eina.Vector2);
432 _ret_var = ((GestureTouch)wrapper).Distance(tool);
436 Eina.Log.Warning($"Callback error: {e.ToString()}");
437 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
445 return efl_gesture_touch_distance_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), tool);
449 private static efl_gesture_touch_distance_delegate efl_gesture_touch_distance_static_delegate;
451 #pragma warning restore CA1707, SA1300, SA1600