X11workbench Toolkit
1.0
|
Functions | |
int | CreateTimer (Display *pDisplay, Window wID, unsigned long lInterval, long lID, int iPeriodic) |
Creates a one-shot or periodic timer. More... | |
void | DeleteTimer (Display *pDisplay, Window wID, long lID) |
Deletes an existing timer's resources. More... | |
Variables | |
Atom | aWB_TIMER |
timer notifications generated by API More... | |
The X11workbench Toolkit API has support for one-shot and periodic timer events that are generated via XClientEvent using aWB_TIMER.
These timer events are NOT hyper-accurate, although the timer event time is expressed in microseconds (for math efficiency and convenience). The message loop will check for 'crossing an event time' and generate events whenever a limit has been crossed. This means that event processing time can easily affect timer accuracy. Additionally, if a timer's period is less than the processing time of an event, a timer may be 'missed' as a a result. For this reason you should use a worker thread for timing that requires precise accuracy.
int CreateTimer | ( | Display * | pDisplay, |
Window | wID, | ||
unsigned long | lInterval, | ||
long | lID, | ||
int | iPeriodic | ||
) |
Creates a one-shot or periodic timer.
pDisplay | The display associated with the specified window |
wID | The window that receives the aWB_TIMER XClientEvent (None == application) |
lInterval | The timer interval in microseconds |
lID | The unique timer identifier |
iPeriodic | Non-zero for a recurring timer, zero for a 'one-shot' timer. |
Timers can either be periodic (recurring), or one-shot. Use this function to create them. A timer created by this function must be subsequently deleted via DeleteTimer()
Header File: window_helper.h
Definition at line 3347 of file window_helper.c.
void DeleteTimer | ( | Display * | pDisplay, |
Window | wID, | ||
long | lID | ||
) |
Deletes an existing timer's resources.
pDisplay | The display associated with the specified window |
wID | The window associated with the timer |
lID | The unique ID associated with the timer |
Timers created via CreateTimer() must be subsequently deleted using this function by passing the same Display, Window, and Timer 'unique' ID that were used to create it.
Header File: window_helper.h
Definition at line 3444 of file window_helper.c.
Atom aWB_TIMER |
timer notifications generated by API
Mid-level timer handling generates WB_TIMER notifications via ClientMessage passed to the appropriate window, either periodic or 'one-shot'
See CreateTimer() for more information.
WB_TIMER message format (relative to XEvent.xclient)
type == ClientMessage
message_type == aWB_TIMER
format == 32 (always)
data.l[0] is the unique identifier associated with the timer
see also: CreateTimer(), DeleteTimer()timer notifications (generated by API)
Definition at line 423 of file window_helper.c.