events

Name

events —

Synopsis



void        GrSelectEvents                  (GR_WINDOW_ID wid,
                                             GR_EVENT_MASK eventmask);
void        GrGetNextEvent                  (GR_EVENT *ep);
void        GrGetNextEventTimeout           (GR_EVENT *ep,
                                             GR_TIMEOUT timeout);
void        GrCheckNextEvent                (GR_EVENT *ep);
int         GrPeekEvent                     (GR_EVENT *ep);

Description

Details

GrSelectEvents ()

void        GrSelectEvents                  (GR_WINDOW_ID wid,
                                             GR_EVENT_MASK eventmask);

Select the event types which should be returned for the specified window.

wid : the ID of the window to set the event mask of
eventmask : a bit field specifying the desired event mask


GrGetNextEvent ()

void        GrGetNextEvent                  (GR_EVENT *ep);

Gets the next event from the event queue and places it in the specified GR_EVENT structure. If the queue is currently empty, we sleep until the next event arrives from the server or input is read on a file descriptor previously specified by GrRegisterInput().

ep : pointer to the GR_EVENT structure to return the event in


GrGetNextEventTimeout ()

void        GrGetNextEventTimeout           (GR_EVENT *ep,
                                             GR_TIMEOUT timeout);

Gets the next event from the event queue and places it in the specified GR_EVENT structure. If the queue is currently empty, we sleep until the next event arrives from the server, input is read on a file descriptor previously specified by GrRegisterInput(), or a timeout occurs. Note that a value of 0 for the timeout parameter doesn't mean "timeout after 0 milliseconds" but is in fact a magic number meaning "never time out".

ep : pointer to the GR_EVENT structure to return the event in
timeout : the number of milliseconds to wait before timing out


GrCheckNextEvent ()

void        GrCheckNextEvent                (GR_EVENT *ep);

Gets the next event from the event queue if there is one, or returns immediately with an event type of GR_EVENT_TYPE_NONE if it is empty.

ep : pointer to the GR_EVENT structure to return the event in


GrPeekEvent ()

int         GrPeekEvent                     (GR_EVENT *ep);

Fills in the specified event structure with a copy of the next event on the queue, without actually removing it from the queue. An event type of GR_EVENT_TYPE_NONE is given if the queue is empty.

ep : pointer to the GR_EVENT structure to return the event in
Returns : 1 if an event was returned, or 0 if the queue was empty