1 // -*- mode: C; indent-tabs-mode: nil; c-basic-offset: 2; -*-
8 #ifdef TIME_WITH_SYS_TIME
11 #else // !TIME_WITH_SYS_TIME
12 # ifdef HAVE_SYS_TIME_H
13 # include <sys/time.h>
14 # else // !HAVE_SYS_TIME_H
16 # endif // HAVE_SYS_TIME_H
17 #endif // TIME_WITH_SYS_TIME
19 extern PyTypeObject OtkTimer_Type
;
21 //! The data passed to the OtkTimeoutHandler function.
23 Note: this is a very useful place to put an object instance, and set the
24 event handler to a static function in the same class.
26 typedef void *OtkTimeoutData
;
27 //! The type of function which can be set as the callback for an OtkTimer
29 typedef void (*OtkTimeoutHandler
)(OtkTimeoutData
);
31 typedef struct OtkTimer
{
33 OtkTimeoutHandler handler
;
44 PyObject
*OtkTimer_New(OtkTimeoutHandler handler
, OtkTimeoutData data
);
46 //! Causes the timer to begin
47 void OtkTimer_Start(OtkTimer
*self
);
49 //! Causes the timer to stop
50 void OtkTimer_Stop(OtkTimer
*self
);