2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <summary>EFL Gesture abstract class
14 /// A gesture class defines a method that spcific gesture event and privides information about the gesture's type, state, and associated pointer information.
16 /// For cetain gesture types, additional methods are defined to provide meaningful gesture information to the user.</summary>
17 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
18 [Efl.Canvas.Gesture.NativeMethods]
19 [Efl.Eo.BindingEntity]
20 public abstract class Gesture : Efl.Object
22 /// <summary>Pointer to the native class description.</summary>
23 public override System.IntPtr NativeClass
27 if (((object)this).GetType() == typeof(Gesture))
29 return GetEflClassStatic();
33 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
38 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
39 efl_canvas_gesture_class_get();
40 /// <summary>Initializes a new instance of the <see cref="Gesture"/> class.</summary>
41 /// <param name="parent">Parent instance.</param>
42 public Gesture(Efl.Object parent= null
43 ) : base(efl_canvas_gesture_class_get(), parent)
45 FinishInstantiation();
48 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
49 /// Do not call this constructor directly.</summary>
50 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
51 protected Gesture(ConstructingHandle ch) : base(ch)
55 /// <summary>Initializes a new instance of the <see cref="Gesture"/> class.
56 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
57 /// <param name="wh">The native pointer to be wrapped.</param>
58 protected Gesture(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
62 [Efl.Eo.PrivateNativeClass]
63 private class GestureRealized : Gesture
65 private GestureRealized(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
69 /// <summary>Initializes a new instance of the <see cref="Gesture"/> class.
70 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
71 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
72 /// <param name="parent">The Efl.Object parent of this instance.</param>
73 protected Gesture(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
77 /// <summary>This property holds the current state of the gesture.</summary>
78 /// <returns>gesture state</returns>
79 virtual public Efl.Canvas.GestureState GetState() {
80 var _ret_var = Efl.Canvas.Gesture.NativeMethods.efl_gesture_state_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
81 Eina.Error.RaiseIfUnhandledException();
84 /// <summary>This property holds the current state of the gesture.</summary>
85 /// <param name="state">gesture state</param>
86 virtual public void SetState(Efl.Canvas.GestureState state) {
87 Efl.Canvas.Gesture.NativeMethods.efl_gesture_state_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),state);
88 Eina.Error.RaiseIfUnhandledException();
90 /// <summary>This property holds the hotspot of the current gesture.</summary>
91 /// <returns>hotspot co-ordinate</returns>
92 virtual public Eina.Position2D GetHotspot() {
93 var _ret_var = Efl.Canvas.Gesture.NativeMethods.efl_gesture_hotspot_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
94 Eina.Error.RaiseIfUnhandledException();
97 /// <summary>This property holds the hotspot of the current gesture.</summary>
98 /// <param name="hotspot">hotspot co-ordinate</param>
99 virtual public void SetHotspot(Eina.Position2D hotspot) {
100 Eina.Position2D.NativeStruct _in_hotspot = hotspot;
101 Efl.Canvas.Gesture.NativeMethods.efl_gesture_hotspot_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),_in_hotspot);
102 Eina.Error.RaiseIfUnhandledException();
104 /// <summary>This property holds the timestamp of the current gesture.</summary>
105 /// <returns>The timestamp</returns>
106 virtual public uint GetTimestamp() {
107 var _ret_var = Efl.Canvas.Gesture.NativeMethods.efl_gesture_timestamp_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
108 Eina.Error.RaiseIfUnhandledException();
111 /// <summary>This property holds the timestamp of the current gesture.</summary>
112 /// <param name="timestamp">The timestamp</param>
113 virtual public void SetTimestamp(uint timestamp) {
114 Efl.Canvas.Gesture.NativeMethods.efl_gesture_timestamp_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),timestamp);
115 Eina.Error.RaiseIfUnhandledException();
117 /// <summary>This property holds the current state of the gesture.</summary>
118 /// <value>gesture state</value>
119 public Efl.Canvas.GestureState State {
120 get { return GetState(); }
121 set { SetState(value); }
123 /// <summary>This property holds the hotspot of the current gesture.</summary>
124 /// <value>hotspot co-ordinate</value>
125 public Eina.Position2D Hotspot {
126 get { return GetHotspot(); }
127 set { SetHotspot(value); }
129 /// <summary>This property holds the timestamp of the current gesture.</summary>
130 /// <value>The timestamp</value>
131 public uint Timestamp {
132 get { return GetTimestamp(); }
133 set { SetTimestamp(value); }
135 private static IntPtr GetEflClassStatic()
137 return Efl.Canvas.Gesture.efl_canvas_gesture_class_get();
139 /// <summary>Wrapper for native methods and virtual method delegates.
140 /// For internal use by generated code only.</summary>
141 public new class NativeMethods : Efl.Object.NativeMethods
143 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
144 /// <summary>Gets the list of Eo operations to override.</summary>
145 /// <returns>The list of Eo operations to be overload.</returns>
146 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
148 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
149 var methods = Efl.Eo.Globals.GetUserMethods(type);
151 if (efl_gesture_state_get_static_delegate == null)
153 efl_gesture_state_get_static_delegate = new efl_gesture_state_get_delegate(state_get);
156 if (methods.FirstOrDefault(m => m.Name == "GetState") != null)
158 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gesture_state_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_state_get_static_delegate) });
161 if (efl_gesture_state_set_static_delegate == null)
163 efl_gesture_state_set_static_delegate = new efl_gesture_state_set_delegate(state_set);
166 if (methods.FirstOrDefault(m => m.Name == "SetState") != null)
168 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gesture_state_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_state_set_static_delegate) });
171 if (efl_gesture_hotspot_get_static_delegate == null)
173 efl_gesture_hotspot_get_static_delegate = new efl_gesture_hotspot_get_delegate(hotspot_get);
176 if (methods.FirstOrDefault(m => m.Name == "GetHotspot") != null)
178 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gesture_hotspot_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_hotspot_get_static_delegate) });
181 if (efl_gesture_hotspot_set_static_delegate == null)
183 efl_gesture_hotspot_set_static_delegate = new efl_gesture_hotspot_set_delegate(hotspot_set);
186 if (methods.FirstOrDefault(m => m.Name == "SetHotspot") != null)
188 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gesture_hotspot_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_hotspot_set_static_delegate) });
191 if (efl_gesture_timestamp_get_static_delegate == null)
193 efl_gesture_timestamp_get_static_delegate = new efl_gesture_timestamp_get_delegate(timestamp_get);
196 if (methods.FirstOrDefault(m => m.Name == "GetTimestamp") != null)
198 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gesture_timestamp_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_timestamp_get_static_delegate) });
201 if (efl_gesture_timestamp_set_static_delegate == null)
203 efl_gesture_timestamp_set_static_delegate = new efl_gesture_timestamp_set_delegate(timestamp_set);
206 if (methods.FirstOrDefault(m => m.Name == "SetTimestamp") != null)
208 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gesture_timestamp_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gesture_timestamp_set_static_delegate) });
211 descs.AddRange(base.GetEoOps(type));
214 /// <summary>Returns the Eo class for the native methods of this class.</summary>
215 /// <returns>The native class pointer.</returns>
216 public override IntPtr GetEflClass()
218 return Efl.Canvas.Gesture.efl_canvas_gesture_class_get();
221 #pragma warning disable CA1707, CS1591, SA1300, SA1600
224 private delegate Efl.Canvas.GestureState efl_gesture_state_get_delegate(System.IntPtr obj, System.IntPtr pd);
227 public delegate Efl.Canvas.GestureState efl_gesture_state_get_api_delegate(System.IntPtr obj);
229 public static Efl.Eo.FunctionWrapper<efl_gesture_state_get_api_delegate> efl_gesture_state_get_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_state_get_api_delegate>(Module, "efl_gesture_state_get");
231 private static Efl.Canvas.GestureState state_get(System.IntPtr obj, System.IntPtr pd)
233 Eina.Log.Debug("function efl_gesture_state_get was called");
234 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
237 Efl.Canvas.GestureState _ret_var = default(Efl.Canvas.GestureState);
240 _ret_var = ((Gesture)ws.Target).GetState();
244 Eina.Log.Warning($"Callback error: {e.ToString()}");
245 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
253 return efl_gesture_state_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
257 private static efl_gesture_state_get_delegate efl_gesture_state_get_static_delegate;
260 private delegate void efl_gesture_state_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.GestureState state);
263 public delegate void efl_gesture_state_set_api_delegate(System.IntPtr obj, Efl.Canvas.GestureState state);
265 public static Efl.Eo.FunctionWrapper<efl_gesture_state_set_api_delegate> efl_gesture_state_set_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_state_set_api_delegate>(Module, "efl_gesture_state_set");
267 private static void state_set(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.GestureState state)
269 Eina.Log.Debug("function efl_gesture_state_set was called");
270 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
276 ((Gesture)ws.Target).SetState(state);
280 Eina.Log.Warning($"Callback error: {e.ToString()}");
281 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
288 efl_gesture_state_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), state);
292 private static efl_gesture_state_set_delegate efl_gesture_state_set_static_delegate;
295 private delegate Eina.Position2D.NativeStruct efl_gesture_hotspot_get_delegate(System.IntPtr obj, System.IntPtr pd);
298 public delegate Eina.Position2D.NativeStruct efl_gesture_hotspot_get_api_delegate(System.IntPtr obj);
300 public static Efl.Eo.FunctionWrapper<efl_gesture_hotspot_get_api_delegate> efl_gesture_hotspot_get_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_hotspot_get_api_delegate>(Module, "efl_gesture_hotspot_get");
302 private static Eina.Position2D.NativeStruct hotspot_get(System.IntPtr obj, System.IntPtr pd)
304 Eina.Log.Debug("function efl_gesture_hotspot_get was called");
305 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
308 Eina.Position2D _ret_var = default(Eina.Position2D);
311 _ret_var = ((Gesture)ws.Target).GetHotspot();
315 Eina.Log.Warning($"Callback error: {e.ToString()}");
316 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
324 return efl_gesture_hotspot_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
328 private static efl_gesture_hotspot_get_delegate efl_gesture_hotspot_get_static_delegate;
331 private delegate void efl_gesture_hotspot_set_delegate(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct hotspot);
334 public delegate void efl_gesture_hotspot_set_api_delegate(System.IntPtr obj, Eina.Position2D.NativeStruct hotspot);
336 public static Efl.Eo.FunctionWrapper<efl_gesture_hotspot_set_api_delegate> efl_gesture_hotspot_set_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_hotspot_set_api_delegate>(Module, "efl_gesture_hotspot_set");
338 private static void hotspot_set(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct hotspot)
340 Eina.Log.Debug("function efl_gesture_hotspot_set was called");
341 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
344 Eina.Position2D _in_hotspot = hotspot;
348 ((Gesture)ws.Target).SetHotspot(_in_hotspot);
352 Eina.Log.Warning($"Callback error: {e.ToString()}");
353 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
360 efl_gesture_hotspot_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), hotspot);
364 private static efl_gesture_hotspot_set_delegate efl_gesture_hotspot_set_static_delegate;
367 private delegate uint efl_gesture_timestamp_get_delegate(System.IntPtr obj, System.IntPtr pd);
370 public delegate uint efl_gesture_timestamp_get_api_delegate(System.IntPtr obj);
372 public static Efl.Eo.FunctionWrapper<efl_gesture_timestamp_get_api_delegate> efl_gesture_timestamp_get_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_timestamp_get_api_delegate>(Module, "efl_gesture_timestamp_get");
374 private static uint timestamp_get(System.IntPtr obj, System.IntPtr pd)
376 Eina.Log.Debug("function efl_gesture_timestamp_get was called");
377 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
380 uint _ret_var = default(uint);
383 _ret_var = ((Gesture)ws.Target).GetTimestamp();
387 Eina.Log.Warning($"Callback error: {e.ToString()}");
388 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
396 return efl_gesture_timestamp_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
400 private static efl_gesture_timestamp_get_delegate efl_gesture_timestamp_get_static_delegate;
403 private delegate void efl_gesture_timestamp_set_delegate(System.IntPtr obj, System.IntPtr pd, uint timestamp);
406 public delegate void efl_gesture_timestamp_set_api_delegate(System.IntPtr obj, uint timestamp);
408 public static Efl.Eo.FunctionWrapper<efl_gesture_timestamp_set_api_delegate> efl_gesture_timestamp_set_ptr = new Efl.Eo.FunctionWrapper<efl_gesture_timestamp_set_api_delegate>(Module, "efl_gesture_timestamp_set");
410 private static void timestamp_set(System.IntPtr obj, System.IntPtr pd, uint timestamp)
412 Eina.Log.Debug("function efl_gesture_timestamp_set was called");
413 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
419 ((Gesture)ws.Target).SetTimestamp(timestamp);
423 Eina.Log.Warning($"Callback error: {e.ToString()}");
424 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
431 efl_gesture_timestamp_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), timestamp);
435 private static efl_gesture_timestamp_set_delegate efl_gesture_timestamp_set_static_delegate;
437 #pragma warning restore CA1707, CS1591, SA1300, SA1600
446 #pragma warning disable CS1591
447 public static class Efl_CanvasGesture_ExtensionMethods {
448 public static Efl.BindableProperty<Efl.Canvas.GestureState> State<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Canvas.Gesture, T>magic = null) where T : Efl.Canvas.Gesture {
449 return new Efl.BindableProperty<Efl.Canvas.GestureState>("state", fac);
452 public static Efl.BindableProperty<Eina.Position2D> Hotspot<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Canvas.Gesture, T>magic = null) where T : Efl.Canvas.Gesture {
453 return new Efl.BindableProperty<Eina.Position2D>("hotspot", fac);
456 public static Efl.BindableProperty<uint> Timestamp<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Canvas.Gesture, T>magic = null) where T : Efl.Canvas.Gesture {
457 return new Efl.BindableProperty<uint>("timestamp", fac);
461 #pragma warning restore CS1591