2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
11 /// <summary>Event argument wrapper for event <see cref="Efl.Loop.ArgumentsEvt"/>.</summary>
12 [Efl.Eo.BindingEntity]
13 public class LoopArgumentsEvt_Args : EventArgs {
14 /// <summary>Actual event payload.</summary>
15 /// <value>Event happens when args are provided to the loop by args_add().</value>
16 public Efl.LoopArguments arg { get; set; }
18 /// <summary>The Efl Main Loop
19 /// The Efl main loop provides a clean and tiny event loop library with many modules to do lots of convenient things for a programmer, saving time and effort. It's lean and designed to work on anything from embedded systems all the way up to large and powerful multi-cpu workstations. The main loop has a number of primitives you can use. It serializes these and allows for greater responsiveness without the need for threads (or any other concurrency). However you can provide these if you need to.
20 /// (Since EFL 1.22)</summary>
21 [Efl.Loop.NativeMethods]
22 [Efl.Eo.BindingEntity]
23 public abstract class Loop : Efl.Task
25 /// <summary>Pointer to the native class description.</summary>
26 public override System.IntPtr NativeClass
30 if (((object)this).GetType() == typeof(Loop))
32 return GetEflClassStatic();
36 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
41 [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
43 /// <summary>Initializes a new instance of the <see cref="Loop"/> class.</summary>
44 /// <param name="parent">Parent instance.</param>
45 public Loop(Efl.Object parent= null
46 ) : base(efl_loop_class_get(), parent)
48 FinishInstantiation();
51 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
52 /// Do not call this constructor directly.</summary>
53 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
54 protected Loop(ConstructingHandle ch) : base(ch)
58 /// <summary>Initializes a new instance of the <see cref="Loop"/> class.
59 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
60 /// <param name="wh">The native pointer to be wrapped.</param>
61 protected Loop(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
65 [Efl.Eo.PrivateNativeClass]
66 private class LoopRealized : Loop
68 private LoopRealized(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
72 /// <summary>Initializes a new instance of the <see cref="Loop"/> class.
73 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
74 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
75 /// <param name="parent">The Efl.Object parent of this instance.</param>
76 protected Loop(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
80 /// <summary>Event occurs once the main loop enters the idle state.
81 /// (Since EFL 1.22)</summary>
82 public event EventHandler IdleEnterEvt
86 lock (eflBindingEventLock)
88 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
90 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
93 EventArgs args = EventArgs.Empty;
96 value?.Invoke(obj, args);
100 Eina.Log.Error(e.ToString());
101 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
106 string key = "_EFL_LOOP_EVENT_IDLE_ENTER";
107 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
113 lock (eflBindingEventLock)
115 string key = "_EFL_LOOP_EVENT_IDLE_ENTER";
116 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
120 /// <summary>Method to raise event IdleEnterEvt.</summary>
121 public void OnIdleEnterEvt(EventArgs e)
123 var key = "_EFL_LOOP_EVENT_IDLE_ENTER";
124 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
125 if (desc == IntPtr.Zero)
127 Eina.Log.Error($"Failed to get native event {key}");
131 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
133 /// <summary>Event occurs once the main loop exits the idle state.
134 /// (Since EFL 1.22)</summary>
135 public event EventHandler IdleExitEvt
139 lock (eflBindingEventLock)
141 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
143 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
146 EventArgs args = EventArgs.Empty;
149 value?.Invoke(obj, args);
153 Eina.Log.Error(e.ToString());
154 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
159 string key = "_EFL_LOOP_EVENT_IDLE_EXIT";
160 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
166 lock (eflBindingEventLock)
168 string key = "_EFL_LOOP_EVENT_IDLE_EXIT";
169 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
173 /// <summary>Method to raise event IdleExitEvt.</summary>
174 public void OnIdleExitEvt(EventArgs e)
176 var key = "_EFL_LOOP_EVENT_IDLE_EXIT";
177 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
178 if (desc == IntPtr.Zero)
180 Eina.Log.Error($"Failed to get native event {key}");
184 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
186 /// <summary>Event occurs once the main loop is idle. If you keep listening on this event it may increase the burden on your CPU.
187 /// (Since EFL 1.22)</summary>
188 public event EventHandler IdleEvt
192 lock (eflBindingEventLock)
194 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
196 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
199 EventArgs args = EventArgs.Empty;
202 value?.Invoke(obj, args);
206 Eina.Log.Error(e.ToString());
207 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
212 string key = "_EFL_LOOP_EVENT_IDLE";
213 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
219 lock (eflBindingEventLock)
221 string key = "_EFL_LOOP_EVENT_IDLE";
222 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
226 /// <summary>Method to raise event IdleEvt.</summary>
227 public void OnIdleEvt(EventArgs e)
229 var key = "_EFL_LOOP_EVENT_IDLE";
230 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
231 if (desc == IntPtr.Zero)
233 Eina.Log.Error($"Failed to get native event {key}");
237 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
239 /// <summary>Event happens when args are provided to the loop by args_add().
240 /// (Since EFL 1.22)</summary>
241 /// <value><see cref="Efl.LoopArgumentsEvt_Args"/></value>
242 public event EventHandler<Efl.LoopArgumentsEvt_Args> ArgumentsEvt
246 lock (eflBindingEventLock)
248 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
250 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
253 Efl.LoopArgumentsEvt_Args args = new Efl.LoopArgumentsEvt_Args();
257 value?.Invoke(obj, args);
261 Eina.Log.Error(e.ToString());
262 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
267 string key = "_EFL_LOOP_EVENT_ARGUMENTS";
268 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
274 lock (eflBindingEventLock)
276 string key = "_EFL_LOOP_EVENT_ARGUMENTS";
277 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
281 /// <summary>Method to raise event ArgumentsEvt.</summary>
282 public void OnArgumentsEvt(Efl.LoopArgumentsEvt_Args e)
284 var key = "_EFL_LOOP_EVENT_ARGUMENTS";
285 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
286 if (desc == IntPtr.Zero)
288 Eina.Log.Error($"Failed to get native event {key}");
292 IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
295 Marshal.StructureToPtr(e.arg, info, false);
296 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
300 Marshal.FreeHGlobal(info);
303 /// <summary>Event occurs multiple times per second. The exact tick is undefined and can be adjusted system wide.
304 /// (Since EFL 1.22)</summary>
305 public event EventHandler PollHighEvt
309 lock (eflBindingEventLock)
311 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
313 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
316 EventArgs args = EventArgs.Empty;
319 value?.Invoke(obj, args);
323 Eina.Log.Error(e.ToString());
324 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
329 string key = "_EFL_LOOP_EVENT_POLL_HIGH";
330 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
336 lock (eflBindingEventLock)
338 string key = "_EFL_LOOP_EVENT_POLL_HIGH";
339 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
343 /// <summary>Method to raise event PollHighEvt.</summary>
344 public void OnPollHighEvt(EventArgs e)
346 var key = "_EFL_LOOP_EVENT_POLL_HIGH";
347 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
348 if (desc == IntPtr.Zero)
350 Eina.Log.Error($"Failed to get native event {key}");
354 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
356 /// <summary>Event occurs multiple times per minute. The exact tick is undefined and can be adjusted system wide.
357 /// (Since EFL 1.22)</summary>
358 public event EventHandler PollMediumEvt
362 lock (eflBindingEventLock)
364 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
366 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
369 EventArgs args = EventArgs.Empty;
372 value?.Invoke(obj, args);
376 Eina.Log.Error(e.ToString());
377 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
382 string key = "_EFL_LOOP_EVENT_POLL_MEDIUM";
383 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
389 lock (eflBindingEventLock)
391 string key = "_EFL_LOOP_EVENT_POLL_MEDIUM";
392 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
396 /// <summary>Method to raise event PollMediumEvt.</summary>
397 public void OnPollMediumEvt(EventArgs e)
399 var key = "_EFL_LOOP_EVENT_POLL_MEDIUM";
400 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
401 if (desc == IntPtr.Zero)
403 Eina.Log.Error($"Failed to get native event {key}");
407 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
409 /// <summary>Event occurs multiple times every 15 minutes. The exact tick is undefined and can be adjusted system wide.
410 /// (Since EFL 1.22)</summary>
411 public event EventHandler PollLowEvt
415 lock (eflBindingEventLock)
417 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
419 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
422 EventArgs args = EventArgs.Empty;
425 value?.Invoke(obj, args);
429 Eina.Log.Error(e.ToString());
430 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
435 string key = "_EFL_LOOP_EVENT_POLL_LOW";
436 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
442 lock (eflBindingEventLock)
444 string key = "_EFL_LOOP_EVENT_POLL_LOW";
445 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
449 /// <summary>Method to raise event PollLowEvt.</summary>
450 public void OnPollLowEvt(EventArgs e)
452 var key = "_EFL_LOOP_EVENT_POLL_LOW";
453 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
454 if (desc == IntPtr.Zero)
456 Eina.Log.Error($"Failed to get native event {key}");
460 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
462 /// <summary>Event occurs when the loop was requested to quit externally e.g. by a ctrl+c signal or a request from a parent loop/thread to have the child exit.
463 /// (Since EFL 1.22)</summary>
464 public event EventHandler QuitEvt
468 lock (eflBindingEventLock)
470 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
472 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
475 EventArgs args = EventArgs.Empty;
478 value?.Invoke(obj, args);
482 Eina.Log.Error(e.ToString());
483 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
488 string key = "_EFL_LOOP_EVENT_QUIT";
489 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
495 lock (eflBindingEventLock)
497 string key = "_EFL_LOOP_EVENT_QUIT";
498 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
502 /// <summary>Method to raise event QuitEvt.</summary>
503 public void OnQuitEvt(EventArgs e)
505 var key = "_EFL_LOOP_EVENT_QUIT";
506 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
507 if (desc == IntPtr.Zero)
509 Eina.Log.Error($"Failed to get native event {key}");
513 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
515 /// <summary>Slow down the loop execution by forcing sleep for a small period of time every time the loop iterates/loops.
516 /// (Since EFL 1.22)</summary>
517 /// <returns>Time to sleep for each "loop iteration"</returns>
518 virtual public double GetThrottle() {
519 var _ret_var = Efl.Loop.NativeMethods.efl_loop_throttle_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
520 Eina.Error.RaiseIfUnhandledException();
523 /// <summary>Slow down the loop execution by forcing sleep for a small period of time every time the loop iterates/loops.
524 /// (Since EFL 1.22)</summary>
525 /// <param name="amount">Time to sleep for each "loop iteration"</param>
526 virtual public void SetThrottle(double amount) {
527 Efl.Loop.NativeMethods.efl_loop_throttle_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),amount);
528 Eina.Error.RaiseIfUnhandledException();
530 /// <summary>This gets the time that the main loop ceased waiting for timouts and/or events to come in or for signals or any other interrupt source. This should be considered a reference point for all time based activity that should calculate its timepoint from the return of ecore_loop_time_get(). Note that this time is meant to be used as relative to other times obtained on this run. If you need absolute time references, use a unix timestamp instead.
531 /// (Since EFL 1.22)</summary>
532 /// <returns>Time in seconds</returns>
533 virtual public double GetTime() {
534 var _ret_var = Efl.Loop.NativeMethods.efl_loop_time_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
535 Eina.Error.RaiseIfUnhandledException();
538 /// <summary>You should never need/call this, unless you are implementing a custom tick source for an animator.
539 /// Note: The time point must match whatever zero time you get from ecore_time_get() and <see cref="Efl.Loop.GetTime"/> (same 0 point). What this point is is undefined, so unless your source uses the same 0 time, then you may have to adjust and do some guessing.
540 /// (Since EFL 1.22)</summary>
541 /// <param name="timepoint">Time in seconds</param>
542 virtual protected void SetTime(double timepoint) {
543 Efl.Loop.NativeMethods.efl_loop_time_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),timepoint);
544 Eina.Error.RaiseIfUnhandledException();
546 /// <summary>Runs a single iteration of the main loop to process everything on the queue.
547 /// (Since EFL 1.22)</summary>
548 virtual public void Iterate() {
549 Efl.Loop.NativeMethods.efl_loop_iterate_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
550 Eina.Error.RaiseIfUnhandledException();
552 /// <summary>Runs a single iteration of the main loop to process everything on the queue with block/non-blocking status.
553 /// (Since EFL 1.22)</summary>
554 /// <param name="may_block">A flag if the main loop has a possibility of blocking.</param>
555 /// <returns>Return from single iteration run</returns>
556 virtual public int IterateMayBlock(int may_block) {
557 var _ret_var = Efl.Loop.NativeMethods.efl_loop_iterate_may_block_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),may_block);
558 Eina.Error.RaiseIfUnhandledException();
561 /// <summary>Runs the application main loop.
562 /// (Since EFL 1.22)</summary>
563 /// <returns>Value set by quit()</returns>
564 virtual public Eina.Value Begin() {
565 var _ret_var = Efl.Loop.NativeMethods.efl_loop_begin_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
566 Eina.Error.RaiseIfUnhandledException();
569 /// <summary>Quits the main loop once all the events currently on the queue have been processed.
570 /// (Since EFL 1.22)</summary>
571 /// <param name="exit_code">Returned value by begin()</param>
572 virtual public void Quit(Eina.Value exit_code) {
573 var _in_exit_code = exit_code.GetNative();
574 Efl.Loop.NativeMethods.efl_loop_quit_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),_in_exit_code);
575 Eina.Error.RaiseIfUnhandledException();
577 /// <summary>A future promise that will be resolved from a clean main loop context as soon as possible.
578 /// This has higher priority, for low priority use <see cref="Efl.Loop.Idle"/>
579 /// (Since EFL 1.22)</summary>
580 /// <returns>The future handle.</returns>
581 virtual public Eina.Future Job() {
582 var _ret_var = Efl.Loop.NativeMethods.efl_loop_job_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
583 Eina.Error.RaiseIfUnhandledException();
586 /// <summary>A future promise that will be resolved from a clean main loop context as soon as the main loop is idle.
587 /// This is a low priority version of <see cref="Efl.Loop.Job"/>
588 /// (Since EFL 1.22)</summary>
589 /// <returns>The future handle.</returns>
590 virtual public Eina.Future Idle() {
591 var _ret_var = Efl.Loop.NativeMethods.efl_loop_idle_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
592 Eina.Error.RaiseIfUnhandledException();
595 /// <summary>A future promise that will be resolved from a clean main loop context after <c>time</c> seconds.
596 /// (Since EFL 1.22)</summary>
597 /// <param name="time">The time from now in second that the main loop will wait before triggering it.</param>
598 /// <returns>The future handle.</returns>
599 virtual public Eina.Future Timeout(double time) {
600 var _ret_var = Efl.Loop.NativeMethods.efl_loop_timeout_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),time);
601 Eina.Error.RaiseIfUnhandledException();
604 /// <summary>Async wrapper for <see cref="Job" />.</summary>
605 /// <param name="token">Token to notify the async operation of external request to cancel.</param>
606 /// <returns>An async task wrapping the result of the operation.</returns>
607 public System.Threading.Tasks.Task<Eina.Value> JobAsync( System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
609 Eina.Future future = Job();
610 return Efl.Eo.Globals.WrapAsync(future, token);
613 /// <summary>Async wrapper for <see cref="Idle" />.</summary>
614 /// <param name="token">Token to notify the async operation of external request to cancel.</param>
615 /// <returns>An async task wrapping the result of the operation.</returns>
616 public System.Threading.Tasks.Task<Eina.Value> IdleAsync( System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
618 Eina.Future future = Idle();
619 return Efl.Eo.Globals.WrapAsync(future, token);
622 /// <summary>Async wrapper for <see cref="Timeout" />.</summary>
623 /// <param name="time">The time from now in second that the main loop will wait before triggering it.</param>
624 /// <param name="token">Token to notify the async operation of external request to cancel.</param>
625 /// <returns>An async task wrapping the result of the operation.</returns>
626 public System.Threading.Tasks.Task<Eina.Value> TimeoutAsync(double time, System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
628 Eina.Future future = Timeout( time);
629 return Efl.Eo.Globals.WrapAsync(future, token);
632 /// <summary>Slow down the loop execution by forcing sleep for a small period of time every time the loop iterates/loops.
633 /// (Since EFL 1.22)</summary>
634 /// <value>Time to sleep for each "loop iteration"</value>
635 public double Throttle {
636 get { return GetThrottle(); }
637 set { SetThrottle(value); }
639 /// <summary>Retrieves the time at which the last loop stopped waiting for timeouts or events.
640 /// (Since EFL 1.22)</summary>
641 /// <value>Time in seconds</value>
643 get { return GetTime(); }
644 protected set { SetTime(value); }
646 private static IntPtr GetEflClassStatic()
648 return Efl.Loop.efl_loop_class_get();
650 /// <summary>Wrapper for native methods and virtual method delegates.
651 /// For internal use by generated code only.</summary>
652 public new class NativeMethods : Efl.Task.NativeMethods
654 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Ecore);
655 /// <summary>Gets the list of Eo operations to override.</summary>
656 /// <returns>The list of Eo operations to be overload.</returns>
657 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
659 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
660 var methods = Efl.Eo.Globals.GetUserMethods(type);
662 if (efl_loop_throttle_get_static_delegate == null)
664 efl_loop_throttle_get_static_delegate = new efl_loop_throttle_get_delegate(throttle_get);
667 if (methods.FirstOrDefault(m => m.Name == "GetThrottle") != null)
669 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_throttle_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_throttle_get_static_delegate) });
672 if (efl_loop_throttle_set_static_delegate == null)
674 efl_loop_throttle_set_static_delegate = new efl_loop_throttle_set_delegate(throttle_set);
677 if (methods.FirstOrDefault(m => m.Name == "SetThrottle") != null)
679 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_throttle_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_throttle_set_static_delegate) });
682 if (efl_loop_time_get_static_delegate == null)
684 efl_loop_time_get_static_delegate = new efl_loop_time_get_delegate(time_get);
687 if (methods.FirstOrDefault(m => m.Name == "GetTime") != null)
689 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_time_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_time_get_static_delegate) });
692 if (efl_loop_time_set_static_delegate == null)
694 efl_loop_time_set_static_delegate = new efl_loop_time_set_delegate(time_set);
697 if (methods.FirstOrDefault(m => m.Name == "SetTime") != null)
699 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_time_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_time_set_static_delegate) });
702 if (efl_loop_iterate_static_delegate == null)
704 efl_loop_iterate_static_delegate = new efl_loop_iterate_delegate(iterate);
707 if (methods.FirstOrDefault(m => m.Name == "Iterate") != null)
709 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_iterate"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_iterate_static_delegate) });
712 if (efl_loop_iterate_may_block_static_delegate == null)
714 efl_loop_iterate_may_block_static_delegate = new efl_loop_iterate_may_block_delegate(iterate_may_block);
717 if (methods.FirstOrDefault(m => m.Name == "IterateMayBlock") != null)
719 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_iterate_may_block"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_iterate_may_block_static_delegate) });
722 if (efl_loop_begin_static_delegate == null)
724 efl_loop_begin_static_delegate = new efl_loop_begin_delegate(begin);
727 if (methods.FirstOrDefault(m => m.Name == "Begin") != null)
729 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_begin"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_begin_static_delegate) });
732 if (efl_loop_quit_static_delegate == null)
734 efl_loop_quit_static_delegate = new efl_loop_quit_delegate(quit);
737 if (methods.FirstOrDefault(m => m.Name == "Quit") != null)
739 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_quit"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_quit_static_delegate) });
742 if (efl_loop_job_static_delegate == null)
744 efl_loop_job_static_delegate = new efl_loop_job_delegate(job);
747 if (methods.FirstOrDefault(m => m.Name == "Job") != null)
749 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_job"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_job_static_delegate) });
752 if (efl_loop_idle_static_delegate == null)
754 efl_loop_idle_static_delegate = new efl_loop_idle_delegate(idle);
757 if (methods.FirstOrDefault(m => m.Name == "Idle") != null)
759 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_idle"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_idle_static_delegate) });
762 if (efl_loop_timeout_static_delegate == null)
764 efl_loop_timeout_static_delegate = new efl_loop_timeout_delegate(timeout);
767 if (methods.FirstOrDefault(m => m.Name == "Timeout") != null)
769 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_timeout"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_timeout_static_delegate) });
772 descs.AddRange(base.GetEoOps(type));
775 /// <summary>Returns the Eo class for the native methods of this class.</summary>
776 /// <returns>The native class pointer.</returns>
777 public override IntPtr GetEflClass()
779 return Efl.Loop.efl_loop_class_get();
782 #pragma warning disable CA1707, CS1591, SA1300, SA1600
785 private delegate double efl_loop_throttle_get_delegate(System.IntPtr obj, System.IntPtr pd);
788 public delegate double efl_loop_throttle_get_api_delegate(System.IntPtr obj);
790 public static Efl.Eo.FunctionWrapper<efl_loop_throttle_get_api_delegate> efl_loop_throttle_get_ptr = new Efl.Eo.FunctionWrapper<efl_loop_throttle_get_api_delegate>(Module, "efl_loop_throttle_get");
792 private static double throttle_get(System.IntPtr obj, System.IntPtr pd)
794 Eina.Log.Debug("function efl_loop_throttle_get was called");
795 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
798 double _ret_var = default(double);
801 _ret_var = ((Loop)ws.Target).GetThrottle();
805 Eina.Log.Warning($"Callback error: {e.ToString()}");
806 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
814 return efl_loop_throttle_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
818 private static efl_loop_throttle_get_delegate efl_loop_throttle_get_static_delegate;
821 private delegate void efl_loop_throttle_set_delegate(System.IntPtr obj, System.IntPtr pd, double amount);
824 public delegate void efl_loop_throttle_set_api_delegate(System.IntPtr obj, double amount);
826 public static Efl.Eo.FunctionWrapper<efl_loop_throttle_set_api_delegate> efl_loop_throttle_set_ptr = new Efl.Eo.FunctionWrapper<efl_loop_throttle_set_api_delegate>(Module, "efl_loop_throttle_set");
828 private static void throttle_set(System.IntPtr obj, System.IntPtr pd, double amount)
830 Eina.Log.Debug("function efl_loop_throttle_set was called");
831 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
837 ((Loop)ws.Target).SetThrottle(amount);
841 Eina.Log.Warning($"Callback error: {e.ToString()}");
842 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
849 efl_loop_throttle_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), amount);
853 private static efl_loop_throttle_set_delegate efl_loop_throttle_set_static_delegate;
856 private delegate double efl_loop_time_get_delegate(System.IntPtr obj, System.IntPtr pd);
859 public delegate double efl_loop_time_get_api_delegate(System.IntPtr obj);
861 public static Efl.Eo.FunctionWrapper<efl_loop_time_get_api_delegate> efl_loop_time_get_ptr = new Efl.Eo.FunctionWrapper<efl_loop_time_get_api_delegate>(Module, "efl_loop_time_get");
863 private static double time_get(System.IntPtr obj, System.IntPtr pd)
865 Eina.Log.Debug("function efl_loop_time_get was called");
866 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
869 double _ret_var = default(double);
872 _ret_var = ((Loop)ws.Target).GetTime();
876 Eina.Log.Warning($"Callback error: {e.ToString()}");
877 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
885 return efl_loop_time_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
889 private static efl_loop_time_get_delegate efl_loop_time_get_static_delegate;
892 private delegate void efl_loop_time_set_delegate(System.IntPtr obj, System.IntPtr pd, double timepoint);
895 public delegate void efl_loop_time_set_api_delegate(System.IntPtr obj, double timepoint);
897 public static Efl.Eo.FunctionWrapper<efl_loop_time_set_api_delegate> efl_loop_time_set_ptr = new Efl.Eo.FunctionWrapper<efl_loop_time_set_api_delegate>(Module, "efl_loop_time_set");
899 private static void time_set(System.IntPtr obj, System.IntPtr pd, double timepoint)
901 Eina.Log.Debug("function efl_loop_time_set was called");
902 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
908 ((Loop)ws.Target).SetTime(timepoint);
912 Eina.Log.Warning($"Callback error: {e.ToString()}");
913 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
920 efl_loop_time_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), timepoint);
924 private static efl_loop_time_set_delegate efl_loop_time_set_static_delegate;
927 private delegate void efl_loop_iterate_delegate(System.IntPtr obj, System.IntPtr pd);
930 public delegate void efl_loop_iterate_api_delegate(System.IntPtr obj);
932 public static Efl.Eo.FunctionWrapper<efl_loop_iterate_api_delegate> efl_loop_iterate_ptr = new Efl.Eo.FunctionWrapper<efl_loop_iterate_api_delegate>(Module, "efl_loop_iterate");
934 private static void iterate(System.IntPtr obj, System.IntPtr pd)
936 Eina.Log.Debug("function efl_loop_iterate was called");
937 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
943 ((Loop)ws.Target).Iterate();
947 Eina.Log.Warning($"Callback error: {e.ToString()}");
948 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
955 efl_loop_iterate_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
959 private static efl_loop_iterate_delegate efl_loop_iterate_static_delegate;
962 private delegate int efl_loop_iterate_may_block_delegate(System.IntPtr obj, System.IntPtr pd, int may_block);
965 public delegate int efl_loop_iterate_may_block_api_delegate(System.IntPtr obj, int may_block);
967 public static Efl.Eo.FunctionWrapper<efl_loop_iterate_may_block_api_delegate> efl_loop_iterate_may_block_ptr = new Efl.Eo.FunctionWrapper<efl_loop_iterate_may_block_api_delegate>(Module, "efl_loop_iterate_may_block");
969 private static int iterate_may_block(System.IntPtr obj, System.IntPtr pd, int may_block)
971 Eina.Log.Debug("function efl_loop_iterate_may_block was called");
972 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
975 int _ret_var = default(int);
978 _ret_var = ((Loop)ws.Target).IterateMayBlock(may_block);
982 Eina.Log.Warning($"Callback error: {e.ToString()}");
983 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
991 return efl_loop_iterate_may_block_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), may_block);
995 private static efl_loop_iterate_may_block_delegate efl_loop_iterate_may_block_static_delegate;
997 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]
998 private delegate Eina.Value efl_loop_begin_delegate(System.IntPtr obj, System.IntPtr pd);
1000 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]
1001 public delegate Eina.Value efl_loop_begin_api_delegate(System.IntPtr obj);
1003 public static Efl.Eo.FunctionWrapper<efl_loop_begin_api_delegate> efl_loop_begin_ptr = new Efl.Eo.FunctionWrapper<efl_loop_begin_api_delegate>(Module, "efl_loop_begin");
1005 private static Eina.Value begin(System.IntPtr obj, System.IntPtr pd)
1007 Eina.Log.Debug("function efl_loop_begin was called");
1008 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
1011 Eina.Value _ret_var = default(Eina.Value);
1014 _ret_var = ((Loop)ws.Target).Begin();
1018 Eina.Log.Warning($"Callback error: {e.ToString()}");
1019 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1027 return efl_loop_begin_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1031 private static efl_loop_begin_delegate efl_loop_begin_static_delegate;
1034 private delegate void efl_loop_quit_delegate(System.IntPtr obj, System.IntPtr pd, Eina.ValueNative exit_code);
1037 public delegate void efl_loop_quit_api_delegate(System.IntPtr obj, Eina.ValueNative exit_code);
1039 public static Efl.Eo.FunctionWrapper<efl_loop_quit_api_delegate> efl_loop_quit_ptr = new Efl.Eo.FunctionWrapper<efl_loop_quit_api_delegate>(Module, "efl_loop_quit");
1041 private static void quit(System.IntPtr obj, System.IntPtr pd, Eina.ValueNative exit_code)
1043 Eina.Log.Debug("function efl_loop_quit was called");
1044 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
1047 var _in_exit_code = new Eina.Value(exit_code);
1051 ((Loop)ws.Target).Quit(_in_exit_code);
1055 Eina.Log.Warning($"Callback error: {e.ToString()}");
1056 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1063 efl_loop_quit_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), exit_code);
1067 private static efl_loop_quit_delegate efl_loop_quit_static_delegate;
1069 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
1070 private delegate Eina.Future efl_loop_job_delegate(System.IntPtr obj, System.IntPtr pd);
1072 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
1073 public delegate Eina.Future efl_loop_job_api_delegate(System.IntPtr obj);
1075 public static Efl.Eo.FunctionWrapper<efl_loop_job_api_delegate> efl_loop_job_ptr = new Efl.Eo.FunctionWrapper<efl_loop_job_api_delegate>(Module, "efl_loop_job");
1077 private static Eina.Future job(System.IntPtr obj, System.IntPtr pd)
1079 Eina.Log.Debug("function efl_loop_job was called");
1080 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
1083 Eina.Future _ret_var = default( Eina.Future);
1086 _ret_var = ((Loop)ws.Target).Job();
1090 Eina.Log.Warning($"Callback error: {e.ToString()}");
1091 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1099 return efl_loop_job_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1103 private static efl_loop_job_delegate efl_loop_job_static_delegate;
1105 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
1106 private delegate Eina.Future efl_loop_idle_delegate(System.IntPtr obj, System.IntPtr pd);
1108 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
1109 public delegate Eina.Future efl_loop_idle_api_delegate(System.IntPtr obj);
1111 public static Efl.Eo.FunctionWrapper<efl_loop_idle_api_delegate> efl_loop_idle_ptr = new Efl.Eo.FunctionWrapper<efl_loop_idle_api_delegate>(Module, "efl_loop_idle");
1113 private static Eina.Future idle(System.IntPtr obj, System.IntPtr pd)
1115 Eina.Log.Debug("function efl_loop_idle was called");
1116 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
1119 Eina.Future _ret_var = default( Eina.Future);
1122 _ret_var = ((Loop)ws.Target).Idle();
1126 Eina.Log.Warning($"Callback error: {e.ToString()}");
1127 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1135 return efl_loop_idle_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1139 private static efl_loop_idle_delegate efl_loop_idle_static_delegate;
1141 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
1142 private delegate Eina.Future efl_loop_timeout_delegate(System.IntPtr obj, System.IntPtr pd, double time);
1144 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
1145 public delegate Eina.Future efl_loop_timeout_api_delegate(System.IntPtr obj, double time);
1147 public static Efl.Eo.FunctionWrapper<efl_loop_timeout_api_delegate> efl_loop_timeout_ptr = new Efl.Eo.FunctionWrapper<efl_loop_timeout_api_delegate>(Module, "efl_loop_timeout");
1149 private static Eina.Future timeout(System.IntPtr obj, System.IntPtr pd, double time)
1151 Eina.Log.Debug("function efl_loop_timeout was called");
1152 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
1155 Eina.Future _ret_var = default( Eina.Future);
1158 _ret_var = ((Loop)ws.Target).Timeout(time);
1162 Eina.Log.Warning($"Callback error: {e.ToString()}");
1163 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1171 return efl_loop_timeout_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), time);
1175 private static efl_loop_timeout_delegate efl_loop_timeout_static_delegate;
1177 #pragma warning restore CA1707, CS1591, SA1300, SA1600
1184 #pragma warning disable CS1591
1185 public static class EflLoop_ExtensionMethods {
1186 public static Efl.BindableProperty<double> Throttle<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Loop, T>magic = null) where T : Efl.Loop {
1187 return new Efl.BindableProperty<double>("throttle", fac);
1190 public static Efl.BindableProperty<double> Time<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Loop, T>magic = null) where T : Efl.Loop {
1191 return new Efl.BindableProperty<double>("time", fac);
1195 #pragma warning restore CS1591
1199 /// <summary>EFL loop arguments data structure
1200 /// (Since EFL 1.22)</summary>
1201 [StructLayout(LayoutKind.Sequential)]
1202 [Efl.Eo.BindingEntity]
1203 public struct LoopArguments
1205 /// <summary>Array with loop arguments</summary>
1206 public Eina.Array<Eina.Stringshare> Argv;
1207 /// <summary>Set to <c>true</c> when the program should initialize its internal state. This happen once per process instance.</summary>
1208 public bool Initialization;
1209 /// <summary>Constructor for LoopArguments.</summary>
1210 /// <param name="Argv">Array with loop arguments</param>;
1211 /// <param name="Initialization">Set to <c>true</c> when the program should initialize its internal state. This happen once per process instance.</param>;
1212 public LoopArguments(
1213 Eina.Array<Eina.Stringshare> Argv = default(Eina.Array<Eina.Stringshare>),
1214 bool Initialization = default(bool) )
1217 this.Initialization = Initialization;
1220 /// <summary>Implicit conversion to the managed representation from a native pointer.</summary>
1221 /// <param name="ptr">Native pointer to be converted.</param>
1222 public static implicit operator LoopArguments(IntPtr ptr)
1224 var tmp = (LoopArguments.NativeStruct)Marshal.PtrToStructure(ptr, typeof(LoopArguments.NativeStruct));
1228 #pragma warning disable CS1591
1230 /// <summary>Internal wrapper for struct LoopArguments.</summary>
1231 [StructLayout(LayoutKind.Sequential)]
1232 public struct NativeStruct
1235 public System.IntPtr Argv;
1236 /// <summary>Internal wrapper for field Initialization</summary>
1237 public System.Byte Initialization;
1238 /// <summary>Implicit conversion to the internal/marshalling representation.</summary>
1239 public static implicit operator LoopArguments.NativeStruct(LoopArguments _external_struct)
1241 var _internal_struct = new LoopArguments.NativeStruct();
1242 _internal_struct.Argv = _external_struct.Argv.Handle;
1243 _internal_struct.Initialization = _external_struct.Initialization ? (byte)1 : (byte)0;
1244 return _internal_struct;
1247 /// <summary>Implicit conversion to the managed representation.</summary>
1248 public static implicit operator LoopArguments(LoopArguments.NativeStruct _internal_struct)
1250 var _external_struct = new LoopArguments();
1251 _external_struct.Argv = new Eina.Array<Eina.Stringshare>(_internal_struct.Argv, false, false);
1252 _external_struct.Initialization = _internal_struct.Initialization != 0;
1253 return _external_struct;
1258 #pragma warning restore CS1591