1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
8 /// <summary>An object that describes an low-level source of I/O to listen to for available data to be read or written, depending on the OS and data source type. When I/O becomes available various events are produced and the callbacks attached to them will be called.</summary>
9 [LoopHandlerNativeInherit]
10 public class LoopHandler : 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 (LoopHandler))
16 return Efl.LoopHandlerNativeInherit.GetEflClassStatic();
18 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
21 [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
22 efl_loop_handler_class_get();
23 ///<summary>Creates a new instance.</summary>
24 ///<param name="parent">Parent instance.</param>
25 public LoopHandler(Efl.Object parent= null
27 base(efl_loop_handler_class_get(), typeof(LoopHandler), 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 LoopHandler(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 LoopHandler(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 private static object ReadEvtKey = new object();
57 /// <summary>Called when a read occurs on the descriptor.</summary>
58 public event EventHandler ReadEvt
62 string key = "_EFL_LOOP_HANDLER_EVENT_READ";
63 if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_ReadEvt_delegate)) {
64 eventHandlers.AddHandler(ReadEvtKey , value);
66 Eina.Log.Error($"Error adding proxy for event {key}");
71 string key = "_EFL_LOOP_HANDLER_EVENT_READ";
72 if (RemoveNativeEventHandler(key, this.evt_ReadEvt_delegate)) {
73 eventHandlers.RemoveHandler(ReadEvtKey , value);
75 Eina.Log.Error($"Error removing proxy for event {key}");
79 ///<summary>Method to raise event ReadEvt.</summary>
80 public void On_ReadEvt(EventArgs e)
84 evt = (EventHandler)eventHandlers[ReadEvtKey];
88 Efl.EventCb evt_ReadEvt_delegate;
89 private void on_ReadEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
91 EventArgs args = EventArgs.Empty;
94 } catch (Exception e) {
95 Eina.Log.Error(e.ToString());
96 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
100 private static object WriteEvtKey = new object();
101 /// <summary>Called when a write occurs on the descriptor.</summary>
102 public event EventHandler WriteEvt
106 string key = "_EFL_LOOP_HANDLER_EVENT_WRITE";
107 if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_WriteEvt_delegate)) {
108 eventHandlers.AddHandler(WriteEvtKey , value);
110 Eina.Log.Error($"Error adding proxy for event {key}");
115 string key = "_EFL_LOOP_HANDLER_EVENT_WRITE";
116 if (RemoveNativeEventHandler(key, this.evt_WriteEvt_delegate)) {
117 eventHandlers.RemoveHandler(WriteEvtKey , value);
119 Eina.Log.Error($"Error removing proxy for event {key}");
123 ///<summary>Method to raise event WriteEvt.</summary>
124 public void On_WriteEvt(EventArgs e)
128 evt = (EventHandler)eventHandlers[WriteEvtKey];
130 evt?.Invoke(this, e);
132 Efl.EventCb evt_WriteEvt_delegate;
133 private void on_WriteEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
135 EventArgs args = EventArgs.Empty;
138 } catch (Exception e) {
139 Eina.Log.Error(e.ToString());
140 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
144 private static object ErrorEvtKey = new object();
145 /// <summary>Called when a error occurrs on the descriptor.</summary>
146 public event EventHandler ErrorEvt
150 string key = "_EFL_LOOP_HANDLER_EVENT_ERROR";
151 if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_ErrorEvt_delegate)) {
152 eventHandlers.AddHandler(ErrorEvtKey , value);
154 Eina.Log.Error($"Error adding proxy for event {key}");
159 string key = "_EFL_LOOP_HANDLER_EVENT_ERROR";
160 if (RemoveNativeEventHandler(key, this.evt_ErrorEvt_delegate)) {
161 eventHandlers.RemoveHandler(ErrorEvtKey , value);
163 Eina.Log.Error($"Error removing proxy for event {key}");
167 ///<summary>Method to raise event ErrorEvt.</summary>
168 public void On_ErrorEvt(EventArgs e)
172 evt = (EventHandler)eventHandlers[ErrorEvtKey];
174 evt?.Invoke(this, e);
176 Efl.EventCb evt_ErrorEvt_delegate;
177 private void on_ErrorEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
179 EventArgs args = EventArgs.Empty;
182 } catch (Exception e) {
183 Eina.Log.Error(e.ToString());
184 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
188 private static object BufferEvtKey = new object();
189 /// <summary>Called when buffered data already read from the descriptor should be processed.</summary>
190 public event EventHandler BufferEvt
194 string key = "_EFL_LOOP_HANDLER_EVENT_BUFFER";
195 if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_BufferEvt_delegate)) {
196 eventHandlers.AddHandler(BufferEvtKey , value);
198 Eina.Log.Error($"Error adding proxy for event {key}");
203 string key = "_EFL_LOOP_HANDLER_EVENT_BUFFER";
204 if (RemoveNativeEventHandler(key, this.evt_BufferEvt_delegate)) {
205 eventHandlers.RemoveHandler(BufferEvtKey , value);
207 Eina.Log.Error($"Error removing proxy for event {key}");
211 ///<summary>Method to raise event BufferEvt.</summary>
212 public void On_BufferEvt(EventArgs e)
216 evt = (EventHandler)eventHandlers[BufferEvtKey];
218 evt?.Invoke(this, e);
220 Efl.EventCb evt_BufferEvt_delegate;
221 private void on_BufferEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
223 EventArgs args = EventArgs.Empty;
226 } catch (Exception e) {
227 Eina.Log.Error(e.ToString());
228 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
232 private static object PrepareEvtKey = new object();
233 /// <summary>Called when preparing a descriptor for listening.</summary>
234 public event EventHandler PrepareEvt
238 string key = "_EFL_LOOP_HANDLER_EVENT_PREPARE";
239 if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_PrepareEvt_delegate)) {
240 eventHandlers.AddHandler(PrepareEvtKey , value);
242 Eina.Log.Error($"Error adding proxy for event {key}");
247 string key = "_EFL_LOOP_HANDLER_EVENT_PREPARE";
248 if (RemoveNativeEventHandler(key, this.evt_PrepareEvt_delegate)) {
249 eventHandlers.RemoveHandler(PrepareEvtKey , value);
251 Eina.Log.Error($"Error removing proxy for event {key}");
255 ///<summary>Method to raise event PrepareEvt.</summary>
256 public void On_PrepareEvt(EventArgs e)
260 evt = (EventHandler)eventHandlers[PrepareEvtKey];
262 evt?.Invoke(this, e);
264 Efl.EventCb evt_PrepareEvt_delegate;
265 private void on_PrepareEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
267 EventArgs args = EventArgs.Empty;
270 } catch (Exception e) {
271 Eina.Log.Error(e.ToString());
272 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
276 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
277 protected override void RegisterEventProxies()
279 base.RegisterEventProxies();
280 evt_ReadEvt_delegate = new Efl.EventCb(on_ReadEvt_NativeCallback);
281 evt_WriteEvt_delegate = new Efl.EventCb(on_WriteEvt_NativeCallback);
282 evt_ErrorEvt_delegate = new Efl.EventCb(on_ErrorEvt_NativeCallback);
283 evt_BufferEvt_delegate = new Efl.EventCb(on_BufferEvt_NativeCallback);
284 evt_PrepareEvt_delegate = new Efl.EventCb(on_PrepareEvt_NativeCallback);
286 /// <summary>This sets what kind of I/O should be listened to only when using a fd or fd_file for the handler</summary>
287 /// <returns>The flags that indicate what kind of I/O should be listened for like read, write or error channels.</returns>
288 virtual public Efl.LoopHandlerFlags GetActive() {
289 var _ret_var = Efl.LoopHandlerNativeInherit.efl_loop_handler_active_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
290 Eina.Error.RaiseIfUnhandledException();
293 /// <summary>This sets what kind of I/O should be listened to only when using a fd or fd_file for the handler</summary>
294 /// <param name="flags">The flags that indicate what kind of I/O should be listened for like read, write or error channels.</param>
295 /// <returns></returns>
296 virtual public void SetActive( Efl.LoopHandlerFlags flags) {
297 Efl.LoopHandlerNativeInherit.efl_loop_handler_active_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), flags);
298 Eina.Error.RaiseIfUnhandledException();
300 /// <summary>Controls a file descriptor to listen to for I/O, which points to a data pipe such as a device, socket or pipe etc.</summary>
301 /// <returns>The file descriptor</returns>
302 virtual public int GetFd() {
303 var _ret_var = Efl.LoopHandlerNativeInherit.efl_loop_handler_fd_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
304 Eina.Error.RaiseIfUnhandledException();
307 /// <summary>Controls a file descriptor to listen to for I/O, which points to a data pipe such as a device, socket or pipe etc.</summary>
308 /// <param name="fd">The file descriptor</param>
309 /// <returns></returns>
310 virtual public void SetFd( int fd) {
311 Efl.LoopHandlerNativeInherit.efl_loop_handler_fd_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), fd);
312 Eina.Error.RaiseIfUnhandledException();
314 /// <summary>Controls a file descriptor to listen to for I/O that specifically points to a file in storage and not a device, socket or pipe etc.</summary>
315 /// <returns>The file descriptor</returns>
316 virtual public int GetFdFile() {
317 var _ret_var = Efl.LoopHandlerNativeInherit.efl_loop_handler_fd_file_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
318 Eina.Error.RaiseIfUnhandledException();
321 /// <summary>Controls a file descriptor to listen to for I/O that specifically points to a file in storage and not a device, socket or pipe etc.</summary>
322 /// <param name="fd">The file descriptor</param>
323 /// <returns></returns>
324 virtual public void SetFdFile( int fd) {
325 Efl.LoopHandlerNativeInherit.efl_loop_handler_fd_file_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), fd);
326 Eina.Error.RaiseIfUnhandledException();
328 /// <summary>Controls a windows win32 object handle to listen to for I/O. When it becomes available for any data the read event will be produced.</summary>
329 /// <returns>A win32 object handle</returns>
330 virtual public System.IntPtr GetWin32() {
331 var _ret_var = Efl.LoopHandlerNativeInherit.efl_loop_handler_win32_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
332 Eina.Error.RaiseIfUnhandledException();
335 /// <summary>Controls a windows win32 object handle to listen to for I/O. When it becomes available for any data the read event will be produced.</summary>
336 /// <param name="handle">A win32 object handle</param>
337 /// <returns></returns>
338 virtual public void SetWin32( System.IntPtr handle) {
339 Efl.LoopHandlerNativeInherit.efl_loop_handler_win32_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), handle);
340 Eina.Error.RaiseIfUnhandledException();
342 /// <summary>This sets what kind of I/O should be listened to only when using a fd or fd_file for the handler</summary>
343 /// <value>The flags that indicate what kind of I/O should be listened for like read, write or error channels.</value>
344 public Efl.LoopHandlerFlags Active {
345 get { return GetActive(); }
346 set { SetActive( value); }
348 /// <summary>Controls a file descriptor to listen to for I/O, which points to a data pipe such as a device, socket or pipe etc.</summary>
349 /// <value>The file descriptor</value>
351 get { return GetFd(); }
352 set { SetFd( value); }
354 /// <summary>Controls a file descriptor to listen to for I/O that specifically points to a file in storage and not a device, socket or pipe etc.</summary>
355 /// <value>The file descriptor</value>
357 get { return GetFdFile(); }
358 set { SetFdFile( value); }
360 /// <summary>Controls a windows win32 object handle to listen to for I/O. When it becomes available for any data the read event will be produced.</summary>
361 /// <value>A win32 object handle</value>
362 public System.IntPtr Win32 {
363 get { return GetWin32(); }
364 set { SetWin32( value); }
366 private static IntPtr GetEflClassStatic()
368 return Efl.LoopHandler.efl_loop_handler_class_get();
371 public class LoopHandlerNativeInherit : Efl.ObjectNativeInherit{
372 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Ecore);
373 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
375 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
376 var methods = Efl.Eo.Globals.GetUserMethods(type);
377 if (efl_loop_handler_active_get_static_delegate == null)
378 efl_loop_handler_active_get_static_delegate = new efl_loop_handler_active_get_delegate(active_get);
379 if (methods.FirstOrDefault(m => m.Name == "GetActive") != null)
380 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_active_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_active_get_static_delegate)});
381 if (efl_loop_handler_active_set_static_delegate == null)
382 efl_loop_handler_active_set_static_delegate = new efl_loop_handler_active_set_delegate(active_set);
383 if (methods.FirstOrDefault(m => m.Name == "SetActive") != null)
384 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_active_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_active_set_static_delegate)});
385 if (efl_loop_handler_fd_get_static_delegate == null)
386 efl_loop_handler_fd_get_static_delegate = new efl_loop_handler_fd_get_delegate(fd_get);
387 if (methods.FirstOrDefault(m => m.Name == "GetFd") != null)
388 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_fd_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_fd_get_static_delegate)});
389 if (efl_loop_handler_fd_set_static_delegate == null)
390 efl_loop_handler_fd_set_static_delegate = new efl_loop_handler_fd_set_delegate(fd_set);
391 if (methods.FirstOrDefault(m => m.Name == "SetFd") != null)
392 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_fd_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_fd_set_static_delegate)});
393 if (efl_loop_handler_fd_file_get_static_delegate == null)
394 efl_loop_handler_fd_file_get_static_delegate = new efl_loop_handler_fd_file_get_delegate(fd_file_get);
395 if (methods.FirstOrDefault(m => m.Name == "GetFdFile") != null)
396 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_fd_file_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_fd_file_get_static_delegate)});
397 if (efl_loop_handler_fd_file_set_static_delegate == null)
398 efl_loop_handler_fd_file_set_static_delegate = new efl_loop_handler_fd_file_set_delegate(fd_file_set);
399 if (methods.FirstOrDefault(m => m.Name == "SetFdFile") != null)
400 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_fd_file_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_fd_file_set_static_delegate)});
401 if (efl_loop_handler_win32_get_static_delegate == null)
402 efl_loop_handler_win32_get_static_delegate = new efl_loop_handler_win32_get_delegate(win32_get);
403 if (methods.FirstOrDefault(m => m.Name == "GetWin32") != null)
404 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_win32_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_win32_get_static_delegate)});
405 if (efl_loop_handler_win32_set_static_delegate == null)
406 efl_loop_handler_win32_set_static_delegate = new efl_loop_handler_win32_set_delegate(win32_set);
407 if (methods.FirstOrDefault(m => m.Name == "SetWin32") != null)
408 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_handler_win32_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_handler_win32_set_static_delegate)});
409 descs.AddRange(base.GetEoOps(type));
412 public override IntPtr GetEflClass()
414 return Efl.LoopHandler.efl_loop_handler_class_get();
416 public static new IntPtr GetEflClassStatic()
418 return Efl.LoopHandler.efl_loop_handler_class_get();
422 private delegate Efl.LoopHandlerFlags efl_loop_handler_active_get_delegate(System.IntPtr obj, System.IntPtr pd);
425 public delegate Efl.LoopHandlerFlags efl_loop_handler_active_get_api_delegate(System.IntPtr obj);
426 public static Efl.Eo.FunctionWrapper<efl_loop_handler_active_get_api_delegate> efl_loop_handler_active_get_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_active_get_api_delegate>(_Module, "efl_loop_handler_active_get");
427 private static Efl.LoopHandlerFlags active_get(System.IntPtr obj, System.IntPtr pd)
429 Eina.Log.Debug("function efl_loop_handler_active_get was called");
430 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
431 if(wrapper != null) {
432 Efl.LoopHandlerFlags _ret_var = default(Efl.LoopHandlerFlags);
434 _ret_var = ((LoopHandler)wrapper).GetActive();
435 } catch (Exception e) {
436 Eina.Log.Warning($"Callback error: {e.ToString()}");
437 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
441 return efl_loop_handler_active_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
444 private static efl_loop_handler_active_get_delegate efl_loop_handler_active_get_static_delegate;
447 private delegate void efl_loop_handler_active_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.LoopHandlerFlags flags);
450 public delegate void efl_loop_handler_active_set_api_delegate(System.IntPtr obj, Efl.LoopHandlerFlags flags);
451 public static Efl.Eo.FunctionWrapper<efl_loop_handler_active_set_api_delegate> efl_loop_handler_active_set_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_active_set_api_delegate>(_Module, "efl_loop_handler_active_set");
452 private static void active_set(System.IntPtr obj, System.IntPtr pd, Efl.LoopHandlerFlags flags)
454 Eina.Log.Debug("function efl_loop_handler_active_set was called");
455 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
456 if(wrapper != null) {
459 ((LoopHandler)wrapper).SetActive( flags);
460 } catch (Exception e) {
461 Eina.Log.Warning($"Callback error: {e.ToString()}");
462 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
465 efl_loop_handler_active_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), flags);
468 private static efl_loop_handler_active_set_delegate efl_loop_handler_active_set_static_delegate;
471 private delegate int efl_loop_handler_fd_get_delegate(System.IntPtr obj, System.IntPtr pd);
474 public delegate int efl_loop_handler_fd_get_api_delegate(System.IntPtr obj);
475 public static Efl.Eo.FunctionWrapper<efl_loop_handler_fd_get_api_delegate> efl_loop_handler_fd_get_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_fd_get_api_delegate>(_Module, "efl_loop_handler_fd_get");
476 private static int fd_get(System.IntPtr obj, System.IntPtr pd)
478 Eina.Log.Debug("function efl_loop_handler_fd_get was called");
479 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
480 if(wrapper != null) {
481 int _ret_var = default(int);
483 _ret_var = ((LoopHandler)wrapper).GetFd();
484 } catch (Exception e) {
485 Eina.Log.Warning($"Callback error: {e.ToString()}");
486 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
490 return efl_loop_handler_fd_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
493 private static efl_loop_handler_fd_get_delegate efl_loop_handler_fd_get_static_delegate;
496 private delegate void efl_loop_handler_fd_set_delegate(System.IntPtr obj, System.IntPtr pd, int fd);
499 public delegate void efl_loop_handler_fd_set_api_delegate(System.IntPtr obj, int fd);
500 public static Efl.Eo.FunctionWrapper<efl_loop_handler_fd_set_api_delegate> efl_loop_handler_fd_set_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_fd_set_api_delegate>(_Module, "efl_loop_handler_fd_set");
501 private static void fd_set(System.IntPtr obj, System.IntPtr pd, int fd)
503 Eina.Log.Debug("function efl_loop_handler_fd_set was called");
504 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
505 if(wrapper != null) {
508 ((LoopHandler)wrapper).SetFd( fd);
509 } catch (Exception e) {
510 Eina.Log.Warning($"Callback error: {e.ToString()}");
511 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
514 efl_loop_handler_fd_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), fd);
517 private static efl_loop_handler_fd_set_delegate efl_loop_handler_fd_set_static_delegate;
520 private delegate int efl_loop_handler_fd_file_get_delegate(System.IntPtr obj, System.IntPtr pd);
523 public delegate int efl_loop_handler_fd_file_get_api_delegate(System.IntPtr obj);
524 public static Efl.Eo.FunctionWrapper<efl_loop_handler_fd_file_get_api_delegate> efl_loop_handler_fd_file_get_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_fd_file_get_api_delegate>(_Module, "efl_loop_handler_fd_file_get");
525 private static int fd_file_get(System.IntPtr obj, System.IntPtr pd)
527 Eina.Log.Debug("function efl_loop_handler_fd_file_get was called");
528 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
529 if(wrapper != null) {
530 int _ret_var = default(int);
532 _ret_var = ((LoopHandler)wrapper).GetFdFile();
533 } catch (Exception e) {
534 Eina.Log.Warning($"Callback error: {e.ToString()}");
535 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
539 return efl_loop_handler_fd_file_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
542 private static efl_loop_handler_fd_file_get_delegate efl_loop_handler_fd_file_get_static_delegate;
545 private delegate void efl_loop_handler_fd_file_set_delegate(System.IntPtr obj, System.IntPtr pd, int fd);
548 public delegate void efl_loop_handler_fd_file_set_api_delegate(System.IntPtr obj, int fd);
549 public static Efl.Eo.FunctionWrapper<efl_loop_handler_fd_file_set_api_delegate> efl_loop_handler_fd_file_set_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_fd_file_set_api_delegate>(_Module, "efl_loop_handler_fd_file_set");
550 private static void fd_file_set(System.IntPtr obj, System.IntPtr pd, int fd)
552 Eina.Log.Debug("function efl_loop_handler_fd_file_set was called");
553 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
554 if(wrapper != null) {
557 ((LoopHandler)wrapper).SetFdFile( fd);
558 } catch (Exception e) {
559 Eina.Log.Warning($"Callback error: {e.ToString()}");
560 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
563 efl_loop_handler_fd_file_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), fd);
566 private static efl_loop_handler_fd_file_set_delegate efl_loop_handler_fd_file_set_static_delegate;
569 private delegate System.IntPtr efl_loop_handler_win32_get_delegate(System.IntPtr obj, System.IntPtr pd);
572 public delegate System.IntPtr efl_loop_handler_win32_get_api_delegate(System.IntPtr obj);
573 public static Efl.Eo.FunctionWrapper<efl_loop_handler_win32_get_api_delegate> efl_loop_handler_win32_get_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_win32_get_api_delegate>(_Module, "efl_loop_handler_win32_get");
574 private static System.IntPtr win32_get(System.IntPtr obj, System.IntPtr pd)
576 Eina.Log.Debug("function efl_loop_handler_win32_get was called");
577 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
578 if(wrapper != null) {
579 System.IntPtr _ret_var = default(System.IntPtr);
581 _ret_var = ((LoopHandler)wrapper).GetWin32();
582 } catch (Exception e) {
583 Eina.Log.Warning($"Callback error: {e.ToString()}");
584 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
588 return efl_loop_handler_win32_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
591 private static efl_loop_handler_win32_get_delegate efl_loop_handler_win32_get_static_delegate;
594 private delegate void efl_loop_handler_win32_set_delegate(System.IntPtr obj, System.IntPtr pd, System.IntPtr handle);
597 public delegate void efl_loop_handler_win32_set_api_delegate(System.IntPtr obj, System.IntPtr handle);
598 public static Efl.Eo.FunctionWrapper<efl_loop_handler_win32_set_api_delegate> efl_loop_handler_win32_set_ptr = new Efl.Eo.FunctionWrapper<efl_loop_handler_win32_set_api_delegate>(_Module, "efl_loop_handler_win32_set");
599 private static void win32_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr handle)
601 Eina.Log.Debug("function efl_loop_handler_win32_set was called");
602 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
603 if(wrapper != null) {
606 ((LoopHandler)wrapper).SetWin32( handle);
607 } catch (Exception e) {
608 Eina.Log.Warning($"Callback error: {e.ToString()}");
609 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
612 efl_loop_handler_win32_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), handle);
615 private static efl_loop_handler_win32_set_delegate efl_loop_handler_win32_set_static_delegate;
619 /// <summary>A set of flags that can be OR'd together to indicate which are desired</summary>
620 public enum LoopHandlerFlags
622 /// <summary>No I/O is desired (generally useless)</summary>
624 /// <summary>Reading is desired</summary>
626 /// <summary>Writing is desired</summary>
628 /// <summary>Error channel input is desired</summary>