efl/src/lib/ecore/efl_loop.eo

115 lines
4.4 KiB
Plaintext

import efl_types;
struct Efl.Loop.Arguments {
argv: const(array<const(stringshare)>);
initialization: bool; [[Set to true when the program should initialize its internal state. This happen once per process instance.]]
}
class Efl.Loop (Efl.Object)
{
[[The Efl Main Loop
Efl main loop provide a clean and tiny event loop library with many modules to
do lots of convenient things for a programmer, to save time and effort. It's
small and lean, designed to work from embedded systems all the way up to large
and powerful multi-cpu workstations. The main loop has a number of primitives to
be used with its main loop. It serializes all the primitives and allows for
great responsiveness without the need for threads (or any other concurrency), but
provide them if you need to.
]]
methods {
@property main @class {
[[Points to the main loop instance of the application.]]
get {}
values {
main_loop: Efl.Loop;
}
}
@property app_efl_version {
[[Indicates the version of EFL with which this application was compiled.
This might differ from @.efl_version.
]]
get {}
values {
version: const(Efl.Version)*;
}
}
@property efl_version {
[[Indicates the currently running version of EFL.
This might differ from @.app_efl_version.
]]
get {}
values {
version: const(Efl.Version)*;
}
}
iterate {
[[Runs a single iteration of the main loop to process everything on the
queue.]]
}
iterate_may_block {
[[Runs a single iteration of the main loop to process everything on the
queue with block/non-blocking status.]]
return: int;
params {
may_block: int; [[A flag if the main loop has a possibility of blocking.]]
}
}
begin {
[[Runs the application main loop.]]
return: ubyte; [[Value set by quit()]]
}
quit {
[[Quits the main loop once all the events currently on the queue have
been processed.]]
params {
@in exit_code: ubyte; [[Returned value by begin()]]
}
}
job {
[[Will execute that promise in the near future.]]
params {
@in data: const(void_ptr) @optional; [[The data to be given when the promise is done.]]
}
return: promise<void_ptr>; [[The promise that will be triggered.]]
}
timeout {
[[Will trigger this promise when the specified timeout occur.]]
params {
@in time: double; [[The time from now in second that the main loop will wait before triggering it.]]
@in data: const(void_ptr) @optional; [[The data to be given when the promise is done.]]
}
return: promise<void_ptr>; [[The promise that will be triggered.]]
}
register {
[[Will register a manager of a specific class to be answered by eo.provider_find.]]
params {
@in klass: const(Efl.Class); [[The class provided by the registered provider.]]
@in provider: const(Efl.Object); [[The provider for the newly registered class that has to provide that said Efl.Class.]]
}
return: bool; [[true if successfully register, false otherwise.]]
}
unregister {
[[Will unregister a manager of a specific class that was previously registered and answered by eo.provider_find.]]
params {
@in klass: const(Efl.Class); [[The class provided by the provider to unregister for.]]
@in provider: const(Efl.Object); [[The provider for the registered class to unregister.]]
}
return: bool; [[true if successfully unregistered, false otherwise.]]
}
}
events {
idle,enter @restart; [[Event occurs once the main loop enters the idle state.]]
idle,exit @restart; [[Event occurs once the main loop exits the idle state.]]
idle @restart; [[Event occurs once the main loop is idler. Be carefull, this will spin your CPU high if you keep listening on this event.]]
arguments: Efl.Loop.Arguments; [[Event happens when args are provided to the loop by args_add().]]
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.provider_find;
}
}