2016-06-03 16:01:08 -07:00
|
|
|
class Efl.Loop.Timer (Efl.Loop_User)
|
2014-03-23 22:47:52 -07:00
|
|
|
{
|
2015-06-08 09:36:23 -07:00
|
|
|
[[Timers are objects that will call a given callback at some point
|
2016-05-06 15:32:32 -07:00
|
|
|
in the future and repeat that tick at a given interval.
|
2015-06-08 09:36:23 -07:00
|
|
|
|
2016-05-06 15:32:32 -07:00
|
|
|
Timers require the ecore main loop to be running and functioning
|
|
|
|
properly. They do not guarantee exact timing, but try to work on a
|
|
|
|
"best effort" basis.
|
2015-06-08 09:36:23 -07:00
|
|
|
]]
|
2016-05-03 14:42:20 -07:00
|
|
|
legacy_prefix: ecore_timer;
|
2015-05-07 08:36:45 -07:00
|
|
|
methods {
|
|
|
|
@property interval {
|
2016-04-01 06:01:48 -07:00
|
|
|
[[Interval the timer ticks on.]]
|
2014-03-23 22:47:52 -07:00
|
|
|
set {
|
2016-04-01 06:40:01 -07:00
|
|
|
[[If set during a timer call, this will affect the next interval.]]
|
2014-03-23 22:47:52 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2016-12-14 08:28:50 -08:00
|
|
|
in: double(-1.0); [[The new interval in seconds]]
|
2014-03-23 22:47:52 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 08:36:45 -07:00
|
|
|
@property pending {
|
2016-04-01 06:01:48 -07:00
|
|
|
[[Pending time regarding a timer.]]
|
2014-03-23 22:47:52 -07:00
|
|
|
get {
|
2016-11-11 01:58:22 -08:00
|
|
|
return: double; [[Pending time]]
|
2014-03-23 22:47:52 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
reset {
|
2015-06-08 09:36:23 -07:00
|
|
|
/* FIXME-doc:
|
|
|
|
* @note This is equivalent to (but faster than)
|
2014-07-25 17:19:30 -07:00
|
|
|
* @code
|
|
|
|
* ecore_timer_delay(timer, ecore_timer_interval_get(timer) - ecore_timer_pending_get(timer));
|
|
|
|
* @endcode
|
|
|
|
*/
|
2015-06-08 09:36:23 -07:00
|
|
|
[[Reset a timer to its full interval. This effectively makes the
|
|
|
|
timer start ticking off from zero now.
|
|
|
|
|
|
|
|
@since 1.2
|
|
|
|
]]
|
2014-03-23 22:47:52 -07:00
|
|
|
}
|
2016-05-04 13:37:39 -07:00
|
|
|
loop_reset {
|
|
|
|
[[This effectively reset a timer, but based on the time when this iteration of the main loop started.
|
|
|
|
@since 1.18
|
|
|
|
]]
|
|
|
|
}
|
2014-03-23 22:47:52 -07:00
|
|
|
delay {
|
2015-06-08 09:36:23 -07:00
|
|
|
[[Add some delay for the next occurrence of a timer.
|
|
|
|
This doesn't affect the interval of a timer.
|
|
|
|
]]
|
2014-03-23 22:47:52 -07:00
|
|
|
params {
|
2015-06-08 09:36:23 -07:00
|
|
|
@in add: double; [[The amount of time to delay the timer by in seconds]]
|
2014-03-23 22:47:52 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-05-04 13:37:39 -07:00
|
|
|
events {
|
|
|
|
tick; [[Event triggered when the specified time as passed.]]
|
|
|
|
}
|
2014-03-23 22:47:52 -07:00
|
|
|
implements {
|
2016-08-10 07:23:04 -07:00
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.destructor;
|
|
|
|
Efl.Object.finalize;
|
|
|
|
Efl.Object.event_freeze;
|
2016-12-27 07:19:06 -08:00
|
|
|
Efl.Object.parent { set; }
|
2016-04-15 05:19:54 -07:00
|
|
|
/* XXX: can't document overridden methods
|
2014-07-25 17:19:30 -07:00
|
|
|
* Pauses a running timer.
|
|
|
|
*
|
|
|
|
* @param timer The timer to be paused.
|
|
|
|
*
|
|
|
|
* The timer callback won't be called while the timer is paused. The remaining
|
|
|
|
* time until the timer expires will be saved, so the timer can be resumed with
|
|
|
|
* that same remaining time to expire, instead of expiring instantly. Use
|
|
|
|
* ecore_timer_thaw() to resume it.
|
|
|
|
*
|
|
|
|
* @note Nothing happens if the timer was already paused.
|
|
|
|
*
|
|
|
|
* @see ecore_timer_thaw()
|
|
|
|
*/
|
2016-12-27 07:19:06 -08:00
|
|
|
Efl.Object.event_freeze_count { get; }
|
2016-08-10 07:23:04 -07:00
|
|
|
Efl.Object.event_thaw;
|
2016-04-15 05:19:54 -07:00
|
|
|
/* XXX: can't document overridden methods
|
2014-07-25 17:19:30 -07:00
|
|
|
* Resumes a frozen (paused) timer.
|
|
|
|
*
|
|
|
|
* @param timer The timer to be resumed.
|
|
|
|
*
|
|
|
|
* The timer will be resumed from its previous relative position in time. That
|
|
|
|
* means, if it had X seconds remaining until expire when it was paused, it will
|
|
|
|
* be started now with those same X seconds remaining to expire again. But
|
|
|
|
* notice that the interval time won't be touched by this call or by
|
|
|
|
* ecore_timer_freeze().
|
|
|
|
*
|
|
|
|
* @see ecore_timer_freeze()
|
|
|
|
*/
|
2014-09-01 07:53:35 -07:00
|
|
|
}
|
2014-05-12 03:11:14 -07:00
|
|
|
}
|