X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ftimer.h;h=aa26c986d77fd63bae866110eac68ef9666127f6;hb=952ca245714e334090ea6baced5eb75d06f99e18;hp=da6c86426c0c2b8ca70a3fe715e43d7da89ca5a0;hpb=f8a47de5ec444c452093371e3db16857eb39a490;p=chaz%2Fopenbox diff --git a/openbox/timer.h b/openbox/timer.h index da6c8642..aa26c986 100644 --- a/openbox/timer.h +++ b/openbox/timer.h @@ -3,14 +3,17 @@ #include +typedef struct _ObTimer ObTimer; + /*! Data type of Timer callback */ -typedef void (*TimeoutHandler)(void *data); +typedef void (*ObTimeoutHandler)(ObTimer *t, void *data); -typedef struct Timer { - /*! Milliseconds between timer firings */ +struct _ObTimer +{ + /*! Microseconds between timer firings */ long delay; /*! Callback for timer expiry */ - TimeoutHandler action; + ObTimeoutHandler action; /*! Data sent to callback */ void *data; /*! We overload the delete operator to just set this to true */ @@ -19,7 +22,7 @@ typedef struct Timer { GTimeVal last; /*! When this timer will next trigger */ GTimeVal timeout; -} Timer; +}; /*! Initializes the timer subsection */ void timer_startup(); @@ -27,9 +30,9 @@ void timer_startup(); void timer_shutdown(); /* Creates a new timer with a given delay */ -Timer *timer_start(long delay, TimeoutHandler cb, void *data); +ObTimer *timer_start(long delay, ObTimeoutHandler cb, void *data); /* Stops and frees a timer */ -void timer_stop(Timer *self); +void timer_stop(ObTimer *self); /*! Dispatch all pending timers. Sets wait to the amount of time to wait for the next timer, or NULL if there are no timers to wait for */