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>Event argument wrapper for event <see cref="Efl.Canvas.GestureLongTap.GestureLongTapEvt"/>.</summary>
13 public class GestureLongTapGestureLongTapEvt_Args : EventArgs {
14 ///<summary>Actual event payload.</summary>
15 public Efl.Canvas.Gesture arg { get; set; }
17 /// <summary>EFL Gesture Long Tap class</summary>
18 [Efl.Canvas.GestureLongTap.NativeMethods]
19 public class GestureLongTap : Efl.Canvas.Gesture, Efl.Eo.IWrapper
21 ///<summary>Pointer to the native class description.</summary>
22 public override System.IntPtr NativeClass
26 if (((object)this).GetType() == typeof(GestureLongTap))
28 return GetEflClassStatic();
32 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
37 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
38 efl_canvas_gesture_long_tap_class_get();
39 /// <summary>Initializes a new instance of the <see cref="GestureLongTap"/> class.</summary>
40 /// <param name="parent">Parent instance.</param>
41 public GestureLongTap(Efl.Object parent= null
42 ) : base(efl_canvas_gesture_long_tap_class_get(), typeof(GestureLongTap), parent)
44 FinishInstantiation();
47 /// <summary>Initializes a new instance of the <see cref="GestureLongTap"/> class.
48 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
49 /// <param name="raw">The native pointer to be wrapped.</param>
50 protected GestureLongTap(System.IntPtr raw) : base(raw)
54 /// <summary>Initializes a new instance of the <see cref="GestureLongTap"/> class.
55 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
56 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
57 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
58 /// <param name="parent">The Efl.Object parent of this instance.</param>
59 protected GestureLongTap(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
63 /// <summary>Verifies if the given object is equal to this one.</summary>
64 /// <param name="instance">The object to compare to.</param>
65 /// <returns>True if both objects point to the same native object.</returns>
66 public override bool Equals(object instance)
68 var other = instance as Efl.Object;
73 return this.NativeHandle == other.NativeHandle;
76 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
77 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
78 public override int GetHashCode()
80 return this.NativeHandle.ToInt32();
83 /// <summary>Turns the native pointer into a string representation.</summary>
84 /// <returns>A string with the type and the native pointer for this object.</returns>
85 public override String ToString()
87 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
90 /// <summary>Event for tap gesture</summary>
91 public event EventHandler<Efl.Canvas.GestureLongTapGestureLongTapEvt_Args> GestureLongTapEvt
97 var wRef = new WeakReference(this);
98 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
100 var obj = wRef.Target as Efl.Eo.IWrapper;
103 Efl.Canvas.GestureLongTapGestureLongTapEvt_Args args = new Efl.Canvas.GestureLongTapGestureLongTapEvt_Args();
104 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Canvas.Gesture);
107 value?.Invoke(obj, args);
111 Eina.Log.Error(e.ToString());
112 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
117 string key = "_EFL_EVENT_GESTURE_LONG_TAP";
118 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
126 string key = "_EFL_EVENT_GESTURE_LONG_TAP";
127 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
131 ///<summary>Method to raise event GestureLongTapEvt.</summary>
132 public void OnGestureLongTapEvt(Efl.Canvas.GestureLongTapGestureLongTapEvt_Args e)
134 var key = "_EFL_EVENT_GESTURE_LONG_TAP";
135 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
136 if (desc == IntPtr.Zero)
138 Eina.Log.Error($"Failed to get native event {key}");
142 IntPtr info = e.arg.NativeHandle;
143 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
145 private static IntPtr GetEflClassStatic()
147 return Efl.Canvas.GestureLongTap.efl_canvas_gesture_long_tap_class_get();
149 /// <summary>Wrapper for native methods and virtual method delegates.
150 /// For internal use by generated code only.</summary>
151 public new class NativeMethods : Efl.Canvas.Gesture.NativeMethods
153 /// <summary>Gets the list of Eo operations to override.</summary>
154 /// <returns>The list of Eo operations to be overload.</returns>
155 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
157 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
158 descs.AddRange(base.GetEoOps(type));
161 /// <summary>Returns the Eo class for the native methods of this class.</summary>
162 /// <returns>The native class pointer.</returns>
163 public override IntPtr GetEflClass()
165 return Efl.Canvas.GestureLongTap.efl_canvas_gesture_long_tap_class_get();
168 #pragma warning disable CA1707, SA1300, SA1600
170 #pragma warning restore CA1707, SA1300, SA1600