This patch add the possibility to delay a timer and to know the
pending time before the next wake up. They should not affect any current code using the timer. -- Cedric BAIL SVN revision: 34250
This commit is contained in:
parent
0afa61a56a
commit
57ecfa2b1f
|
@ -606,7 +606,7 @@ if test "x$have_ecore_fb" = "xyes" -a "x$have_ecore_evas" = "xyes"; then
|
||||||
AC_MSG_RESULT($want_ecore_evas_fb)
|
AC_MSG_RESULT($want_ecore_evas_fb)
|
||||||
|
|
||||||
if test "x$want_ecore_evas_fb" = "xyes"; then
|
if test "x$want_ecore_evas_fb" = "xyes"; then
|
||||||
PKG_CHECK_MODULES(EVAS_FRAMEBUFFER, evas-framebuffer,
|
PKG_CHECK_MODULES(EVAS_FB, evas-fb,
|
||||||
[
|
[
|
||||||
AC_DEFINE(BUILD_ECORE_EVAS_FB, 1, [Support for Linux FB in Ecore_Evas])
|
AC_DEFINE(BUILD_ECORE_EVAS_FB, 1, [Support for Linux FB in Ecore_Evas])
|
||||||
have_ecore_evas_fb="yes"
|
have_ecore_evas_fb="yes"
|
||||||
|
|
|
@ -96,6 +96,60 @@ ecore_timer_interval_set(Ecore_Timer *timer, double in)
|
||||||
timer->in = in;
|
timer->in = in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add some delay for the next occurence of a timer.
|
||||||
|
* This doesn't affect the interval of a timer.
|
||||||
|
*
|
||||||
|
* @param timer The timer to change.
|
||||||
|
* @param add The dalay to add to the next iteration.
|
||||||
|
* @ingroup Ecore_Time_Group
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_timer_delay(Ecore_Timer *timer, double add)
|
||||||
|
{
|
||||||
|
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
|
||||||
|
{
|
||||||
|
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
|
||||||
|
"ecore_timer_delay");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timer->frozen)
|
||||||
|
{
|
||||||
|
timer->pending += add;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
timers = _ecore_list2_remove(timers, timer);
|
||||||
|
_ecore_timer_set(timer, timer->at + add, timer->in, timer->func, timer->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the pending time regarding a timer.
|
||||||
|
*
|
||||||
|
* @param timer The timer to learn from.
|
||||||
|
* @ingroup Ecore_Time_Group
|
||||||
|
*/
|
||||||
|
EAPI double
|
||||||
|
ecore_timer_pending_get(Ecore_Timer *timer)
|
||||||
|
{
|
||||||
|
double now;
|
||||||
|
|
||||||
|
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
|
||||||
|
{
|
||||||
|
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
|
||||||
|
"ecore_timer_pending_get");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
now = ecore_time_get();
|
||||||
|
|
||||||
|
if (timer->frozen)
|
||||||
|
return timer->pending;
|
||||||
|
return timer->at - now;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue