efl/src/lib/ecore/efl_loop.eo

161 lines
6.5 KiB
Plaintext
Raw Normal View History

import efl_types;
import eina_types;
struct Efl.Loop.Arguments {
2016-10-27 07:43:11 -07:00
[[EFL loop arguments data structure]]
argv: const(array<const(stringshare)>); [[Array with loop arguments]]
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; [[Application main loop]]
}
}
@property app_efl_version {
[[Indicates the version of EFL with which this application was compiled.
This might differ from @.efl_version.
]]
get {}
values {
2017-11-02 08:40:42 -07:00
@cref version: Efl.Version; [[Efl version]]
}
}
@property efl_version {
[[Indicates the currently running version of EFL.
This might differ from @.app_efl_version.
]]
get {}
values {
2017-11-02 08:40:42 -07:00
@cref version: Efl.Version; [[Efl version]]
}
}
iterate {
[[Runs a single iteration of the main loop to process everything on the
queue.]]
}
iterate_may_block {
2016-06-27 01:26:32 -07:00
[[Runs a single iteration of the main loop to process everything on the
queue with block/non-blocking status.]]
return: int; [[Return from single iteration run]]
params {
may_block: int; [[A flag if the main loop has a possibility of blocking.]]
}
}
begin {
[[Runs the application main loop.]]
return: any_value_ptr; [[Value set by quit()]]
}
quit {
[[Quits the main loop once all the events currently on the queue have
been processed.]]
2016-06-27 01:26:32 -07:00
params {
@in exit_code: any_value; [[Returned value by begin()]]
2016-06-27 01:26:32 -07:00
}
}
job {
[[A future promise that will be resolved from a clean main
loop context as soon as possible.
This has higher priority, for low priority use
@.idle
]]
return: ptr(Eina.Future) @owned /* TODO: future<void> */; [[The future handle.]]
}
@property throttle {
[[Slow down the loop execution by forcing a sleep for a small
period of time every time the loop iterates/loops.]]
set {}
get {}
values {
amount : double; [[Time to sleep for each "loop iteration"]]
}
}
@property time {
[[The time point when the loop was logically woken up.]]
set {}
get {}
values {
timepoint: double; [[Time in seconds since process specfic start point]]
}
}
idle {
[[A future promise that will be resolved from a clean main
loop context as soon as the main loop is idle.
This is a low priority version of @.job
]]
return: ptr(Eina.Future) @owned /* TODO: future<void> */; [[The future handle.]]
}
timeout {
[[A future promise that will be resolved from a clean main
loop context after $time seconds.]]
params {
@in time: double; [[The time from now in second that the main loop will wait before triggering it.]]
}
return: ptr(Eina.Future) @owned /* future<void> */; [[The future handle.]]
}
register {
[[Will register a manager of a specific class to be answered by eo.provider_find.]]
2016-06-27 01:26:32 -07:00
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.]]
2016-06-27 01:26:32 -07:00
}
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.]]
2016-06-27 01:26:32 -07:00
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.]]
2016-06-27 01:26:32 -07:00
}
return: bool; [[$true if successfully unregistered, $false otherwise.]]
}
message_handler_get @class {
[[Get a message handler object that is created by and owned by
the Efl.Loop object, so you can listen to this message type by
listening to message events on the handler as well as send
objects as events.]]
params {
@in loop: Efl.Loop; [[The loop to get the object from.]]
@in klass: const(Efl.Class); [[The class of the message object.]]
}
return: Efl.Loop.Message.Handler; [[The message handler to use.]]
}
}
2014-07-31 22:38:40 -07:00
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().]]
poll,high; [[Event occurs multiple time per second. The exact tick is undefined and could be adjusted system wide.]]
poll,medium; [[Event occurs multiple time per minute. The exact tick is undefined and could be adjusted system wide.]]
poll,low; [[Event occurs multiple time every 15 minutes. The exact tick is undefined and could be adjusted system wide.]]
pause; [[Called when the window is going not be displayed for some time]]
resume; [[Called before a window get rendered after a pause event]]
terminate; [[Called before starting the shutdown of elementary]]
2014-07-31 22:38:40 -07:00
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.provider_find;
}
}