efl/src/lib/ecore/ecore_poller.eo

63 lines
2.2 KiB
Plaintext

import ecore_types;
enum Ecore.Poller_Type
{
[[Defines the frequency of ticks for the poller.]]
legacy: ecore_poller;
core = 0 [[The core poller interval]]
}
class Ecore.Poller (Efl.Object)
{
[[Ecore poller provides infrastructure for the creation of pollers.
Pollers are, in essence, callbacks that share a single timer per type. Because
not all pollers need to be called at the same frequency the user may specify
the frequency in ticks(each expiration of the shared timer is called a tick,
in ecore poller parlance) for each added poller. Ecore pollers should only be
used when the poller doesn't have specific requirements on the exact times to
poll.
This architecture means that the main loop is only woken up once to handle
all pollers of that type, this will save power as the CPU has more of a
chance to go into a low power state the longer it is asleep for, so this
should be used in situations where power usage is a concern.
For now only 1 core poller type is supported: ECORE_POLLER_CORE, the default
interval for ECORE_POLLER_CORE is 0.125(or 1/8th) second.
]]
methods {
constructor {
[[Constructor with parameters for Ecore Poller.]]
legacy: null;
params {
@in type: Ecore.Poller_Type; [[Ecore poller type which defines the frequency of ticks
for the poller.]]
@in interval: int; [[The tick interval; must be a power of 2 and <= 32768.]]
@in func: Ecore_Task_Cb; [[Ecore poller callback function.]]
@in data: const(void_ptr); [[Private data passed to callback function.]]
}
}
@property interval {
[[Polling interval rate of the poller.]]
set {
legacy: ecore_poller_poller_interval_set;
return: bool; [[true on success, false on failure.]]
}
get {
legacy: ecore_poller_poller_interval_get;
}
values {
interval: int; [[The tick interval; must be a power of 2 and <= 32768.]]
}
}
}
implements {
Efl.Object.destructor;
Efl.Object.finalize;
}
constructors {
.constructor;
}
}