Functions | |
void | GrRegisterInput (int fd) |
Register an extra file descriptor to monitor in the main select() call. | |
void | GrUnregisterInput (int fd) |
Stop monitoring a file descriptor previously registered with GrRegisterInput(). | |
void | GrPrepareSelect (int *maxfd, void *rfdset) |
Prepare for the client to call select(). | |
void | GrServiceSelect (void *rfdset, GR_FNCALLBACKEVENT fncb) |
Handles events after the client has done a select() call. | |
void | GrMainLoop (GR_FNCALLBACKEVENT fncb) |
An infinite loop that dispatches events. | |
void | GrGetNextEvent (GR_EVENT *ep) |
Gets the next event from the event queue. | |
void | GrGetNextEventTimeout (GR_EVENT *ep, GR_TIMEOUT timeout) |
Gets the next event from the event queue, with a time limit. | |
int | GrPeekEvent (GR_EVENT *ep) |
Gets a copy of the next event on the queue, without actually removing it from the queue. | |
void | GrPeekWaitEvent (GR_EVENT *ep) |
Wait until an event is available for a client, and then peek at it. | |
void | GrCheckNextEvent (GR_EVENT *ep) |
Gets the next event from the event queue if there is one. | |
int | GrGetTypedEvent (GR_WINDOW_ID wid, GR_EVENT_MASK mask, GR_UPDATE_TYPE update, GR_EVENT *ep, GR_BOOL block) |
Fills in the specified event structure with a copy of the next event on the queue that matches the type parameters passed and removes it from the queue. | |
int | GrGetTypedEventPred (GR_WINDOW_ID wid, GR_EVENT_MASK mask, GR_UPDATE_TYPE update, GR_EVENT *ep, GR_BOOL block, GR_TYPED_EVENT_CALLBACK matchfn, void *arg) |
The specified callback function is called with the passed event type parameters for each event on the queue, until the callback function CheckFunction returns GR_TRUE. | |
void | GrSelectEvents (GR_WINDOW_ID wid, GR_EVENT_MASK eventmask) |
Select the event types which should be returned for the specified window. | |
int | GrQueueLength (void) |
Returns the current length of the client side queue. |
|
Gets the next event from the event queue if there is one. Returns immediately with an event type of GR_EVENT_TYPE_NONE if the queue is empty.
|
|
Gets the next event from the event queue. If the queue is currently empty, sleeps until the next event arrives from the server or input is read on a file descriptor previously specified by GrRegisterInput().
|
|
Gets the next event from the event queue, with a time limit. 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".
|
|
Fills in the specified event structure with a copy of the next event on the queue that matches the type parameters passed and removes it from the queue. If block is GR_TRUE, the call will block until a matching event is found. Otherwise, only the local queue is searched, and an event type of GR_EVENT_TYPE_NONE is returned if the a match is not found.
|
|
The specified callback function is called with the passed event type parameters for each event on the queue, until the callback function CheckFunction returns GR_TRUE. The event is then removed from the queue and returned. If block is GR_TRUE, the call will block until a matching event is found. Otherwise, only the local queue is searched, and an event type of GR_EVENT_TYPE_NONE is returned if the a match is not found.
|
|
An infinite loop that dispatches events. Calls the specified callback function whenever an event arrives or there is data to be read on a file descriptor registered with GrRegisterInput(). Never returns.
|
|
Gets a copy of the next event on the queue, without actually removing it from the queue. Does not block - an event type of GR_EVENT_TYPE_NONE is given if the queue is empty.
|
|
Wait until an event is available for a client, and then peek at it.
|
|
Prepare for the client to call select(). Asks the server to send the next event but does not wait around for it to arrive. Initializes the specified fd_set structure with the client/server socket descriptor and any previously registered external file descriptors. Also compares the current contents of maxfd, the client/server socket descriptor, and the previously registered external file descriptors, and returns the highest of them in maxfd. Usually used in conjunction with GrServiceSelect(). Note that in a multithreaded client, the application must ensure that no Nano-X calls are made between the calls to GrPrepareSelect() and GrServiceSelect(), else there will be race conditions.
|
|
Returns the current length of the client side queue.
|
|
Register an extra file descriptor to monitor in the main select() call. An event will be returned when the fd has data waiting to be read if that event has been selected for.
|
|
Select the event types which should be returned for the specified window.
|
|
Handles events after the client has done a select() call. Calls the specified callback function is an event has arrived, or if there is data waiting on an external fd specified by GrRegisterInput(). Used by GrMainLoop().
|
|
Stop monitoring a file descriptor previously registered with GrRegisterInput().
|