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>An object implementing this interface can send pointer events.
13 /// Windows and canvas objects may send input events.
15 /// A "pointer" refers to the main pointing device, which could be a mouse, trackpad, finger, pen, etc... In other words, the finger id in any pointer event will always be 0.
17 /// A "finger" refers to a single point of input, usually in an absolute coordinates input device, and that can support more than one input position at at time (think multi-touch screens). The first finger (id 0) is sent along with a pointer event, so be careful to not handle those events twice. Note that if the input device can support "hovering", it is entirely possible to receive move events without down coming first.
19 /// A "key" is a key press from a keyboard or equivalent type of input device. Long, repeated, key presses will always happen like this: down...up,down...up,down...up (not down...up or down...down...down...up).</summary>
20 [Efl.Input.IInterfaceConcrete.NativeMethods]
21 [Efl.Eo.BindingEntity]
22 public interface IInterface :
23 Efl.Eo.IWrapper, IDisposable
25 /// <summary>Check if input events from a given seat is enabled.</summary>
26 /// <param name="seat">The seat to act on.</param>
27 /// <returns><c>true</c> to enable events for a seat or <c>false</c> otherwise.</returns>
28 bool GetSeatEventFilter(Efl.Input.Device seat);
29 /// <summary>Add or remove a given seat to the filter list. If the filter list is empty this object will report mouse, keyboard and focus events from any seat, otherwise those events will only be reported if the event comes from a seat that is in the list.</summary>
30 /// <param name="seat">The seat to act on.</param>
31 /// <param name="enable"><c>true</c> to enable events for a seat or <c>false</c> otherwise.</param>
32 void SetSeatEventFilter(Efl.Input.Device seat, bool enable);
33 /// <summary>Main pointer move (current and previous positions are known).</summary>
34 event EventHandler<Efl.Input.IInterfacePointerMoveEvt_Args> PointerMoveEvt;
35 /// <summary>Main pointer button pressed (button id is known).</summary>
36 event EventHandler<Efl.Input.IInterfacePointerDownEvt_Args> PointerDownEvt;
37 /// <summary>Main pointer button released (button id is known).</summary>
38 event EventHandler<Efl.Input.IInterfacePointerUpEvt_Args> PointerUpEvt;
39 /// <summary>Main pointer button press was cancelled (button id is known). This can happen in rare cases when the window manager passes the focus to a more urgent window, for instance. You probably don't need to listen to this event, as it will be accompanied by an up event.</summary>
40 event EventHandler<Efl.Input.IInterfacePointerCancelEvt_Args> PointerCancelEvt;
41 /// <summary>Pointer entered a window or a widget.</summary>
42 event EventHandler<Efl.Input.IInterfacePointerInEvt_Args> PointerInEvt;
43 /// <summary>Pointer left a window or a widget.</summary>
44 event EventHandler<Efl.Input.IInterfacePointerOutEvt_Args> PointerOutEvt;
45 /// <summary>Mouse wheel event.</summary>
46 event EventHandler<Efl.Input.IInterfacePointerWheelEvt_Args> PointerWheelEvt;
47 /// <summary>Pen or other axis event update.</summary>
48 event EventHandler<Efl.Input.IInterfacePointerAxisEvt_Args> PointerAxisEvt;
49 /// <summary>Finger moved (current and previous positions are known).</summary>
50 event EventHandler<Efl.Input.IInterfaceFingerMoveEvt_Args> FingerMoveEvt;
51 /// <summary>Finger pressed (finger id is known).</summary>
52 event EventHandler<Efl.Input.IInterfaceFingerDownEvt_Args> FingerDownEvt;
53 /// <summary>Finger released (finger id is known).</summary>
54 event EventHandler<Efl.Input.IInterfaceFingerUpEvt_Args> FingerUpEvt;
55 /// <summary>Keyboard key press.</summary>
56 event EventHandler<Efl.Input.IInterfaceKeyDownEvt_Args> KeyDownEvt;
57 /// <summary>Keyboard key release.</summary>
58 event EventHandler<Efl.Input.IInterfaceKeyUpEvt_Args> KeyUpEvt;
59 /// <summary>All input events are on hold or resumed.</summary>
60 event EventHandler<Efl.Input.IInterfaceHoldEvt_Args> HoldEvt;
61 /// <summary>A focus in event.</summary>
62 event EventHandler<Efl.Input.IInterfaceFocusInEvt_Args> FocusInEvt;
63 /// <summary>A focus out event.</summary>
64 event EventHandler<Efl.Input.IInterfaceFocusOutEvt_Args> FocusOutEvt;
66 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerMoveEvt"/>.</summary>
67 [Efl.Eo.BindingEntity]
68 public class IInterfacePointerMoveEvt_Args : EventArgs {
69 ///<summary>Actual event payload.</summary>
70 public Efl.Input.Pointer arg { get; set; }
72 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerDownEvt"/>.</summary>
73 [Efl.Eo.BindingEntity]
74 public class IInterfacePointerDownEvt_Args : EventArgs {
75 ///<summary>Actual event payload.</summary>
76 public Efl.Input.Pointer arg { get; set; }
78 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerUpEvt"/>.</summary>
79 [Efl.Eo.BindingEntity]
80 public class IInterfacePointerUpEvt_Args : EventArgs {
81 ///<summary>Actual event payload.</summary>
82 public Efl.Input.Pointer arg { get; set; }
84 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerCancelEvt"/>.</summary>
85 [Efl.Eo.BindingEntity]
86 public class IInterfacePointerCancelEvt_Args : EventArgs {
87 ///<summary>Actual event payload.</summary>
88 public Efl.Input.Pointer arg { get; set; }
90 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerInEvt"/>.</summary>
91 [Efl.Eo.BindingEntity]
92 public class IInterfacePointerInEvt_Args : EventArgs {
93 ///<summary>Actual event payload.</summary>
94 public Efl.Input.Pointer arg { get; set; }
96 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerOutEvt"/>.</summary>
97 [Efl.Eo.BindingEntity]
98 public class IInterfacePointerOutEvt_Args : EventArgs {
99 ///<summary>Actual event payload.</summary>
100 public Efl.Input.Pointer arg { get; set; }
102 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerWheelEvt"/>.</summary>
103 [Efl.Eo.BindingEntity]
104 public class IInterfacePointerWheelEvt_Args : EventArgs {
105 ///<summary>Actual event payload.</summary>
106 public Efl.Input.Pointer arg { get; set; }
108 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.PointerAxisEvt"/>.</summary>
109 [Efl.Eo.BindingEntity]
110 public class IInterfacePointerAxisEvt_Args : EventArgs {
111 ///<summary>Actual event payload.</summary>
112 public Efl.Input.Pointer arg { get; set; }
114 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.FingerMoveEvt"/>.</summary>
115 [Efl.Eo.BindingEntity]
116 public class IInterfaceFingerMoveEvt_Args : EventArgs {
117 ///<summary>Actual event payload.</summary>
118 public Efl.Input.Pointer arg { get; set; }
120 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.FingerDownEvt"/>.</summary>
121 [Efl.Eo.BindingEntity]
122 public class IInterfaceFingerDownEvt_Args : EventArgs {
123 ///<summary>Actual event payload.</summary>
124 public Efl.Input.Pointer arg { get; set; }
126 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.FingerUpEvt"/>.</summary>
127 [Efl.Eo.BindingEntity]
128 public class IInterfaceFingerUpEvt_Args : EventArgs {
129 ///<summary>Actual event payload.</summary>
130 public Efl.Input.Pointer arg { get; set; }
132 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.KeyDownEvt"/>.</summary>
133 [Efl.Eo.BindingEntity]
134 public class IInterfaceKeyDownEvt_Args : EventArgs {
135 ///<summary>Actual event payload.</summary>
136 public Efl.Input.Key arg { get; set; }
138 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.KeyUpEvt"/>.</summary>
139 [Efl.Eo.BindingEntity]
140 public class IInterfaceKeyUpEvt_Args : EventArgs {
141 ///<summary>Actual event payload.</summary>
142 public Efl.Input.Key arg { get; set; }
144 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.HoldEvt"/>.</summary>
145 [Efl.Eo.BindingEntity]
146 public class IInterfaceHoldEvt_Args : EventArgs {
147 ///<summary>Actual event payload.</summary>
148 public Efl.Input.Hold arg { get; set; }
150 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.FocusInEvt"/>.</summary>
151 [Efl.Eo.BindingEntity]
152 public class IInterfaceFocusInEvt_Args : EventArgs {
153 ///<summary>Actual event payload.</summary>
154 public Efl.Input.Focus arg { get; set; }
156 ///<summary>Event argument wrapper for event <see cref="Efl.Input.IInterface.FocusOutEvt"/>.</summary>
157 [Efl.Eo.BindingEntity]
158 public class IInterfaceFocusOutEvt_Args : EventArgs {
159 ///<summary>Actual event payload.</summary>
160 public Efl.Input.Focus arg { get; set; }
162 /// <summary>An object implementing this interface can send pointer events.
163 /// Windows and canvas objects may send input events.
165 /// A "pointer" refers to the main pointing device, which could be a mouse, trackpad, finger, pen, etc... In other words, the finger id in any pointer event will always be 0.
167 /// A "finger" refers to a single point of input, usually in an absolute coordinates input device, and that can support more than one input position at at time (think multi-touch screens). The first finger (id 0) is sent along with a pointer event, so be careful to not handle those events twice. Note that if the input device can support "hovering", it is entirely possible to receive move events without down coming first.
169 /// A "key" is a key press from a keyboard or equivalent type of input device. Long, repeated, key presses will always happen like this: down...up,down...up,down...up (not down...up or down...down...down...up).</summary>
170 sealed public class IInterfaceConcrete :
175 ///<summary>Pointer to the native class description.</summary>
176 public override System.IntPtr NativeClass
180 if (((object)this).GetType() == typeof(IInterfaceConcrete))
182 return GetEflClassStatic();
186 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
191 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
192 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
193 private IInterfaceConcrete(ConstructingHandle ch) : base(ch)
197 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
198 efl_input_interface_interface_get();
199 /// <summary>Initializes a new instance of the <see cref="IInterface"/> class.
200 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
201 /// <param name="wh">The native pointer to be wrapped.</param>
202 private IInterfaceConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
206 /// <summary>Main pointer move (current and previous positions are known).</summary>
207 public event EventHandler<Efl.Input.IInterfacePointerMoveEvt_Args> PointerMoveEvt
211 lock (eflBindingEventLock)
213 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
215 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
218 Efl.Input.IInterfacePointerMoveEvt_Args args = new Efl.Input.IInterfacePointerMoveEvt_Args();
219 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
222 value?.Invoke(obj, args);
226 Eina.Log.Error(e.ToString());
227 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
232 string key = "_EFL_EVENT_POINTER_MOVE";
233 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
239 lock (eflBindingEventLock)
241 string key = "_EFL_EVENT_POINTER_MOVE";
242 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
246 ///<summary>Method to raise event PointerMoveEvt.</summary>
247 public void OnPointerMoveEvt(Efl.Input.IInterfacePointerMoveEvt_Args e)
249 var key = "_EFL_EVENT_POINTER_MOVE";
250 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
251 if (desc == IntPtr.Zero)
253 Eina.Log.Error($"Failed to get native event {key}");
257 IntPtr info = e.arg.NativeHandle;
258 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
260 /// <summary>Main pointer button pressed (button id is known).</summary>
261 public event EventHandler<Efl.Input.IInterfacePointerDownEvt_Args> PointerDownEvt
265 lock (eflBindingEventLock)
267 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
269 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
272 Efl.Input.IInterfacePointerDownEvt_Args args = new Efl.Input.IInterfacePointerDownEvt_Args();
273 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
276 value?.Invoke(obj, args);
280 Eina.Log.Error(e.ToString());
281 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
286 string key = "_EFL_EVENT_POINTER_DOWN";
287 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
293 lock (eflBindingEventLock)
295 string key = "_EFL_EVENT_POINTER_DOWN";
296 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
300 ///<summary>Method to raise event PointerDownEvt.</summary>
301 public void OnPointerDownEvt(Efl.Input.IInterfacePointerDownEvt_Args e)
303 var key = "_EFL_EVENT_POINTER_DOWN";
304 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
305 if (desc == IntPtr.Zero)
307 Eina.Log.Error($"Failed to get native event {key}");
311 IntPtr info = e.arg.NativeHandle;
312 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
314 /// <summary>Main pointer button released (button id is known).</summary>
315 public event EventHandler<Efl.Input.IInterfacePointerUpEvt_Args> PointerUpEvt
319 lock (eflBindingEventLock)
321 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
323 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
326 Efl.Input.IInterfacePointerUpEvt_Args args = new Efl.Input.IInterfacePointerUpEvt_Args();
327 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
330 value?.Invoke(obj, args);
334 Eina.Log.Error(e.ToString());
335 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
340 string key = "_EFL_EVENT_POINTER_UP";
341 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
347 lock (eflBindingEventLock)
349 string key = "_EFL_EVENT_POINTER_UP";
350 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
354 ///<summary>Method to raise event PointerUpEvt.</summary>
355 public void OnPointerUpEvt(Efl.Input.IInterfacePointerUpEvt_Args e)
357 var key = "_EFL_EVENT_POINTER_UP";
358 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
359 if (desc == IntPtr.Zero)
361 Eina.Log.Error($"Failed to get native event {key}");
365 IntPtr info = e.arg.NativeHandle;
366 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
368 /// <summary>Main pointer button press was cancelled (button id is known). This can happen in rare cases when the window manager passes the focus to a more urgent window, for instance. You probably don't need to listen to this event, as it will be accompanied by an up event.</summary>
369 public event EventHandler<Efl.Input.IInterfacePointerCancelEvt_Args> PointerCancelEvt
373 lock (eflBindingEventLock)
375 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
377 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
380 Efl.Input.IInterfacePointerCancelEvt_Args args = new Efl.Input.IInterfacePointerCancelEvt_Args();
381 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
384 value?.Invoke(obj, args);
388 Eina.Log.Error(e.ToString());
389 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
394 string key = "_EFL_EVENT_POINTER_CANCEL";
395 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
401 lock (eflBindingEventLock)
403 string key = "_EFL_EVENT_POINTER_CANCEL";
404 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
408 ///<summary>Method to raise event PointerCancelEvt.</summary>
409 public void OnPointerCancelEvt(Efl.Input.IInterfacePointerCancelEvt_Args e)
411 var key = "_EFL_EVENT_POINTER_CANCEL";
412 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
413 if (desc == IntPtr.Zero)
415 Eina.Log.Error($"Failed to get native event {key}");
419 IntPtr info = e.arg.NativeHandle;
420 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
422 /// <summary>Pointer entered a window or a widget.</summary>
423 public event EventHandler<Efl.Input.IInterfacePointerInEvt_Args> PointerInEvt
427 lock (eflBindingEventLock)
429 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
431 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
434 Efl.Input.IInterfacePointerInEvt_Args args = new Efl.Input.IInterfacePointerInEvt_Args();
435 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
438 value?.Invoke(obj, args);
442 Eina.Log.Error(e.ToString());
443 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
448 string key = "_EFL_EVENT_POINTER_IN";
449 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
455 lock (eflBindingEventLock)
457 string key = "_EFL_EVENT_POINTER_IN";
458 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
462 ///<summary>Method to raise event PointerInEvt.</summary>
463 public void OnPointerInEvt(Efl.Input.IInterfacePointerInEvt_Args e)
465 var key = "_EFL_EVENT_POINTER_IN";
466 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
467 if (desc == IntPtr.Zero)
469 Eina.Log.Error($"Failed to get native event {key}");
473 IntPtr info = e.arg.NativeHandle;
474 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
476 /// <summary>Pointer left a window or a widget.</summary>
477 public event EventHandler<Efl.Input.IInterfacePointerOutEvt_Args> PointerOutEvt
481 lock (eflBindingEventLock)
483 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
485 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
488 Efl.Input.IInterfacePointerOutEvt_Args args = new Efl.Input.IInterfacePointerOutEvt_Args();
489 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
492 value?.Invoke(obj, args);
496 Eina.Log.Error(e.ToString());
497 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
502 string key = "_EFL_EVENT_POINTER_OUT";
503 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
509 lock (eflBindingEventLock)
511 string key = "_EFL_EVENT_POINTER_OUT";
512 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
516 ///<summary>Method to raise event PointerOutEvt.</summary>
517 public void OnPointerOutEvt(Efl.Input.IInterfacePointerOutEvt_Args e)
519 var key = "_EFL_EVENT_POINTER_OUT";
520 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
521 if (desc == IntPtr.Zero)
523 Eina.Log.Error($"Failed to get native event {key}");
527 IntPtr info = e.arg.NativeHandle;
528 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
530 /// <summary>Mouse wheel event.</summary>
531 public event EventHandler<Efl.Input.IInterfacePointerWheelEvt_Args> PointerWheelEvt
535 lock (eflBindingEventLock)
537 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
539 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
542 Efl.Input.IInterfacePointerWheelEvt_Args args = new Efl.Input.IInterfacePointerWheelEvt_Args();
543 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
546 value?.Invoke(obj, args);
550 Eina.Log.Error(e.ToString());
551 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
556 string key = "_EFL_EVENT_POINTER_WHEEL";
557 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
563 lock (eflBindingEventLock)
565 string key = "_EFL_EVENT_POINTER_WHEEL";
566 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
570 ///<summary>Method to raise event PointerWheelEvt.</summary>
571 public void OnPointerWheelEvt(Efl.Input.IInterfacePointerWheelEvt_Args e)
573 var key = "_EFL_EVENT_POINTER_WHEEL";
574 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
575 if (desc == IntPtr.Zero)
577 Eina.Log.Error($"Failed to get native event {key}");
581 IntPtr info = e.arg.NativeHandle;
582 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
584 /// <summary>Pen or other axis event update.</summary>
585 public event EventHandler<Efl.Input.IInterfacePointerAxisEvt_Args> PointerAxisEvt
589 lock (eflBindingEventLock)
591 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
593 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
596 Efl.Input.IInterfacePointerAxisEvt_Args args = new Efl.Input.IInterfacePointerAxisEvt_Args();
597 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
600 value?.Invoke(obj, args);
604 Eina.Log.Error(e.ToString());
605 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
610 string key = "_EFL_EVENT_POINTER_AXIS";
611 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
617 lock (eflBindingEventLock)
619 string key = "_EFL_EVENT_POINTER_AXIS";
620 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
624 ///<summary>Method to raise event PointerAxisEvt.</summary>
625 public void OnPointerAxisEvt(Efl.Input.IInterfacePointerAxisEvt_Args e)
627 var key = "_EFL_EVENT_POINTER_AXIS";
628 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
629 if (desc == IntPtr.Zero)
631 Eina.Log.Error($"Failed to get native event {key}");
635 IntPtr info = e.arg.NativeHandle;
636 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
638 /// <summary>Finger moved (current and previous positions are known).</summary>
639 public event EventHandler<Efl.Input.IInterfaceFingerMoveEvt_Args> FingerMoveEvt
643 lock (eflBindingEventLock)
645 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
647 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
650 Efl.Input.IInterfaceFingerMoveEvt_Args args = new Efl.Input.IInterfaceFingerMoveEvt_Args();
651 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
654 value?.Invoke(obj, args);
658 Eina.Log.Error(e.ToString());
659 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
664 string key = "_EFL_EVENT_FINGER_MOVE";
665 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
671 lock (eflBindingEventLock)
673 string key = "_EFL_EVENT_FINGER_MOVE";
674 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
678 ///<summary>Method to raise event FingerMoveEvt.</summary>
679 public void OnFingerMoveEvt(Efl.Input.IInterfaceFingerMoveEvt_Args e)
681 var key = "_EFL_EVENT_FINGER_MOVE";
682 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
683 if (desc == IntPtr.Zero)
685 Eina.Log.Error($"Failed to get native event {key}");
689 IntPtr info = e.arg.NativeHandle;
690 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
692 /// <summary>Finger pressed (finger id is known).</summary>
693 public event EventHandler<Efl.Input.IInterfaceFingerDownEvt_Args> FingerDownEvt
697 lock (eflBindingEventLock)
699 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
701 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
704 Efl.Input.IInterfaceFingerDownEvt_Args args = new Efl.Input.IInterfaceFingerDownEvt_Args();
705 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
708 value?.Invoke(obj, args);
712 Eina.Log.Error(e.ToString());
713 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
718 string key = "_EFL_EVENT_FINGER_DOWN";
719 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
725 lock (eflBindingEventLock)
727 string key = "_EFL_EVENT_FINGER_DOWN";
728 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
732 ///<summary>Method to raise event FingerDownEvt.</summary>
733 public void OnFingerDownEvt(Efl.Input.IInterfaceFingerDownEvt_Args e)
735 var key = "_EFL_EVENT_FINGER_DOWN";
736 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
737 if (desc == IntPtr.Zero)
739 Eina.Log.Error($"Failed to get native event {key}");
743 IntPtr info = e.arg.NativeHandle;
744 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
746 /// <summary>Finger released (finger id is known).</summary>
747 public event EventHandler<Efl.Input.IInterfaceFingerUpEvt_Args> FingerUpEvt
751 lock (eflBindingEventLock)
753 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
755 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
758 Efl.Input.IInterfaceFingerUpEvt_Args args = new Efl.Input.IInterfaceFingerUpEvt_Args();
759 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Pointer);
762 value?.Invoke(obj, args);
766 Eina.Log.Error(e.ToString());
767 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
772 string key = "_EFL_EVENT_FINGER_UP";
773 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
779 lock (eflBindingEventLock)
781 string key = "_EFL_EVENT_FINGER_UP";
782 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
786 ///<summary>Method to raise event FingerUpEvt.</summary>
787 public void OnFingerUpEvt(Efl.Input.IInterfaceFingerUpEvt_Args e)
789 var key = "_EFL_EVENT_FINGER_UP";
790 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
791 if (desc == IntPtr.Zero)
793 Eina.Log.Error($"Failed to get native event {key}");
797 IntPtr info = e.arg.NativeHandle;
798 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
800 /// <summary>Keyboard key press.</summary>
801 public event EventHandler<Efl.Input.IInterfaceKeyDownEvt_Args> KeyDownEvt
805 lock (eflBindingEventLock)
807 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
809 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
812 Efl.Input.IInterfaceKeyDownEvt_Args args = new Efl.Input.IInterfaceKeyDownEvt_Args();
813 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Key);
816 value?.Invoke(obj, args);
820 Eina.Log.Error(e.ToString());
821 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
826 string key = "_EFL_EVENT_KEY_DOWN";
827 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
833 lock (eflBindingEventLock)
835 string key = "_EFL_EVENT_KEY_DOWN";
836 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
840 ///<summary>Method to raise event KeyDownEvt.</summary>
841 public void OnKeyDownEvt(Efl.Input.IInterfaceKeyDownEvt_Args e)
843 var key = "_EFL_EVENT_KEY_DOWN";
844 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
845 if (desc == IntPtr.Zero)
847 Eina.Log.Error($"Failed to get native event {key}");
851 IntPtr info = e.arg.NativeHandle;
852 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
854 /// <summary>Keyboard key release.</summary>
855 public event EventHandler<Efl.Input.IInterfaceKeyUpEvt_Args> KeyUpEvt
859 lock (eflBindingEventLock)
861 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
863 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
866 Efl.Input.IInterfaceKeyUpEvt_Args args = new Efl.Input.IInterfaceKeyUpEvt_Args();
867 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Key);
870 value?.Invoke(obj, args);
874 Eina.Log.Error(e.ToString());
875 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
880 string key = "_EFL_EVENT_KEY_UP";
881 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
887 lock (eflBindingEventLock)
889 string key = "_EFL_EVENT_KEY_UP";
890 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
894 ///<summary>Method to raise event KeyUpEvt.</summary>
895 public void OnKeyUpEvt(Efl.Input.IInterfaceKeyUpEvt_Args e)
897 var key = "_EFL_EVENT_KEY_UP";
898 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
899 if (desc == IntPtr.Zero)
901 Eina.Log.Error($"Failed to get native event {key}");
905 IntPtr info = e.arg.NativeHandle;
906 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
908 /// <summary>All input events are on hold or resumed.</summary>
909 public event EventHandler<Efl.Input.IInterfaceHoldEvt_Args> HoldEvt
913 lock (eflBindingEventLock)
915 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
917 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
920 Efl.Input.IInterfaceHoldEvt_Args args = new Efl.Input.IInterfaceHoldEvt_Args();
921 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Hold);
924 value?.Invoke(obj, args);
928 Eina.Log.Error(e.ToString());
929 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
934 string key = "_EFL_EVENT_HOLD";
935 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
941 lock (eflBindingEventLock)
943 string key = "_EFL_EVENT_HOLD";
944 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
948 ///<summary>Method to raise event HoldEvt.</summary>
949 public void OnHoldEvt(Efl.Input.IInterfaceHoldEvt_Args e)
951 var key = "_EFL_EVENT_HOLD";
952 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
953 if (desc == IntPtr.Zero)
955 Eina.Log.Error($"Failed to get native event {key}");
959 IntPtr info = e.arg.NativeHandle;
960 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
962 /// <summary>A focus in event.</summary>
963 public event EventHandler<Efl.Input.IInterfaceFocusInEvt_Args> FocusInEvt
967 lock (eflBindingEventLock)
969 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
971 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
974 Efl.Input.IInterfaceFocusInEvt_Args args = new Efl.Input.IInterfaceFocusInEvt_Args();
975 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Focus);
978 value?.Invoke(obj, args);
982 Eina.Log.Error(e.ToString());
983 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
988 string key = "_EFL_EVENT_FOCUS_IN";
989 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
995 lock (eflBindingEventLock)
997 string key = "_EFL_EVENT_FOCUS_IN";
998 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
1002 ///<summary>Method to raise event FocusInEvt.</summary>
1003 public void OnFocusInEvt(Efl.Input.IInterfaceFocusInEvt_Args e)
1005 var key = "_EFL_EVENT_FOCUS_IN";
1006 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
1007 if (desc == IntPtr.Zero)
1009 Eina.Log.Error($"Failed to get native event {key}");
1013 IntPtr info = e.arg.NativeHandle;
1014 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
1016 /// <summary>A focus out event.</summary>
1017 public event EventHandler<Efl.Input.IInterfaceFocusOutEvt_Args> FocusOutEvt
1021 lock (eflBindingEventLock)
1023 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
1025 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
1028 Efl.Input.IInterfaceFocusOutEvt_Args args = new Efl.Input.IInterfaceFocusOutEvt_Args();
1029 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Input.Focus);
1032 value?.Invoke(obj, args);
1036 Eina.Log.Error(e.ToString());
1037 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1042 string key = "_EFL_EVENT_FOCUS_OUT";
1043 AddNativeEventHandler(efl.Libs.Evas, key, callerCb, value);
1049 lock (eflBindingEventLock)
1051 string key = "_EFL_EVENT_FOCUS_OUT";
1052 RemoveNativeEventHandler(efl.Libs.Evas, key, value);
1056 ///<summary>Method to raise event FocusOutEvt.</summary>
1057 public void OnFocusOutEvt(Efl.Input.IInterfaceFocusOutEvt_Args e)
1059 var key = "_EFL_EVENT_FOCUS_OUT";
1060 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Evas, key);
1061 if (desc == IntPtr.Zero)
1063 Eina.Log.Error($"Failed to get native event {key}");
1067 IntPtr info = e.arg.NativeHandle;
1068 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
1070 /// <summary>Check if input events from a given seat is enabled.</summary>
1071 /// <param name="seat">The seat to act on.</param>
1072 /// <returns><c>true</c> to enable events for a seat or <c>false</c> otherwise.</returns>
1073 public bool GetSeatEventFilter(Efl.Input.Device seat) {
1074 var _ret_var = Efl.Input.IInterfaceConcrete.NativeMethods.efl_input_seat_event_filter_get_ptr.Value.Delegate(this.NativeHandle,seat);
1075 Eina.Error.RaiseIfUnhandledException();
1078 /// <summary>Add or remove a given seat to the filter list. If the filter list is empty this object will report mouse, keyboard and focus events from any seat, otherwise those events will only be reported if the event comes from a seat that is in the list.</summary>
1079 /// <param name="seat">The seat to act on.</param>
1080 /// <param name="enable"><c>true</c> to enable events for a seat or <c>false</c> otherwise.</param>
1081 public void SetSeatEventFilter(Efl.Input.Device seat, bool enable) {
1082 Efl.Input.IInterfaceConcrete.NativeMethods.efl_input_seat_event_filter_set_ptr.Value.Delegate(this.NativeHandle,seat, enable);
1083 Eina.Error.RaiseIfUnhandledException();
1085 private static IntPtr GetEflClassStatic()
1087 return Efl.Input.IInterfaceConcrete.efl_input_interface_interface_get();
1089 /// <summary>Wrapper for native methods and virtual method delegates.
1090 /// For internal use by generated code only.</summary>
1091 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
1093 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
1094 /// <summary>Gets the list of Eo operations to override.</summary>
1095 /// <returns>The list of Eo operations to be overload.</returns>
1096 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
1098 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
1099 var methods = Efl.Eo.Globals.GetUserMethods(type);
1101 if (efl_input_seat_event_filter_get_static_delegate == null)
1103 efl_input_seat_event_filter_get_static_delegate = new efl_input_seat_event_filter_get_delegate(seat_event_filter_get);
1106 if (methods.FirstOrDefault(m => m.Name == "GetSeatEventFilter") != null)
1108 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_input_seat_event_filter_get"), func = Marshal.GetFunctionPointerForDelegate(efl_input_seat_event_filter_get_static_delegate) });
1111 if (efl_input_seat_event_filter_set_static_delegate == null)
1113 efl_input_seat_event_filter_set_static_delegate = new efl_input_seat_event_filter_set_delegate(seat_event_filter_set);
1116 if (methods.FirstOrDefault(m => m.Name == "SetSeatEventFilter") != null)
1118 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_input_seat_event_filter_set"), func = Marshal.GetFunctionPointerForDelegate(efl_input_seat_event_filter_set_static_delegate) });
1123 /// <summary>Returns the Eo class for the native methods of this class.</summary>
1124 /// <returns>The native class pointer.</returns>
1125 public override IntPtr GetEflClass()
1127 return Efl.Input.IInterfaceConcrete.efl_input_interface_interface_get();
1130 #pragma warning disable CA1707, CS1591, SA1300, SA1600
1132 [return: MarshalAs(UnmanagedType.U1)]
1133 private delegate bool efl_input_seat_event_filter_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
1135 [return: MarshalAs(UnmanagedType.U1)]
1136 public delegate bool efl_input_seat_event_filter_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
1138 public static Efl.Eo.FunctionWrapper<efl_input_seat_event_filter_get_api_delegate> efl_input_seat_event_filter_get_ptr = new Efl.Eo.FunctionWrapper<efl_input_seat_event_filter_get_api_delegate>(Module, "efl_input_seat_event_filter_get");
1140 private static bool seat_event_filter_get(System.IntPtr obj, System.IntPtr pd, Efl.Input.Device seat)
1142 Eina.Log.Debug("function efl_input_seat_event_filter_get was called");
1143 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
1146 bool _ret_var = default(bool);
1149 _ret_var = ((IInterface)ws.Target).GetSeatEventFilter(seat);
1153 Eina.Log.Warning($"Callback error: {e.ToString()}");
1154 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1162 return efl_input_seat_event_filter_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), seat);
1166 private static efl_input_seat_event_filter_get_delegate efl_input_seat_event_filter_get_static_delegate;
1169 private delegate void efl_input_seat_event_filter_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.Device seat, [MarshalAs(UnmanagedType.U1)] bool enable);
1172 public delegate void efl_input_seat_event_filter_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.Device seat, [MarshalAs(UnmanagedType.U1)] bool enable);
1174 public static Efl.Eo.FunctionWrapper<efl_input_seat_event_filter_set_api_delegate> efl_input_seat_event_filter_set_ptr = new Efl.Eo.FunctionWrapper<efl_input_seat_event_filter_set_api_delegate>(Module, "efl_input_seat_event_filter_set");
1176 private static void seat_event_filter_set(System.IntPtr obj, System.IntPtr pd, Efl.Input.Device seat, bool enable)
1178 Eina.Log.Debug("function efl_input_seat_event_filter_set was called");
1179 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
1185 ((IInterface)ws.Target).SetSeatEventFilter(seat, enable);
1189 Eina.Log.Warning($"Callback error: {e.ToString()}");
1190 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1197 efl_input_seat_event_filter_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), seat, enable);
1201 private static efl_input_seat_event_filter_set_delegate efl_input_seat_event_filter_set_static_delegate;
1203 #pragma warning restore CA1707, CS1591, SA1300, SA1600