Details
GrReqShmCmds ()
void GrReqShmCmds (long shmsize); |
Requests a shared memory area of the specified size to use for transferring
command arguments. This is faster but less portable than the standard BSD
sockets method of communication (and of course will only work if the client
and server are on the same machine). Apart from the initial allocation of
the area using this call, the use of shared memory is completely
transparent. Additionally, if the allocation fails we silently and
automatically fall back on socket communication. It is safe to call this
function even if shared memory support is not compiled in; it will simply
do nothing.
FIXME: how does the user decide what size of shared memory area to allocate?
GrInjectKeyboardEvent ()
void GrInjectKeyboardEvent (GR_WINDOW_ID wid,
GR_KEY keyvalue,
GR_KEYMOD modifier,
GR_SCANCODE scancode,
GR_BOOL pressed); |
Sends a keyboard event to the specified window, or to the window with the
current keyboard focus if 0 is used as the ID. The other arguments
correspond directly to the fields of the same names in the keyboard event
structure.
GrRegisterInput ()
void GrRegisterInput (int fd); |
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.
GrPrepareSelect ()
void GrPrepareSelect (int *maxfd,
void *rfdset); |
Prepare for a GrServiceSelect function by asking the server to send the next
event but not waiting around for it to arrive and initialising 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.
GrServiceSelect ()
void GrServiceSelect (void *rfdset,
GR_FNCALLBACKEVENT fncb); |
Used by GrMainLoop() to call the specified callback function when an
event arrives or there is data waiting on an external fd specified by
GrRegisterInput().
GrBell ()
Asks the server to ring the console bell on behalf of the client (intended
for terminal apps to be able to ring the bell on the server even if they
are running remotely).
GrSetScreenSaverTimeout ()
void GrSetScreenSaverTimeout (GR_TIMEOUT timeout); |
Sets the number of seconds of inactivity before a screen saver activate
event is sent to the root window ID. A value of 0 activates the
screen saver immediately, and a value of -1 disables the screen saver
function.
GrQueryTree ()
void GrQueryTree (GR_WINDOW_ID wid,
GR_WINDOW_ID *parentid,
GR_WINDOW_ID **children,
GR_COUNT *nchildren); |
Return the ID of the specified windows parent window and a list of the IDs
of all its child windows. It is the callers responsibility to free the
list of child windows when it is no longer required. On failure, the
children pointer will be set to NULL.
GrSetPortraitMode ()
void GrSetPortraitMode (int portraitmode); |
Changes the orientation of the screen. The four possible values are
GR_PORTRAIT_NONE (no rotation), GR_PORTRAIT_LEFT (rotate left),
GR_PORTRAIT_RIGHT (rotate right), and GR_PORTRAIT_DOWN (upside down).
The window is automatically redrawn after changing the portrait mode.
The current portrait mode can be discovered by retrieving the screeninfo
structure using the GrGetScreenInfo() call, and looking at the value of
the portrait member.
GrChangeProperty ()
void GrChangeProperty (GR_WINDOW_ID wid,
GR_CHAR *property,
GR_PROP *data,
GR_COUNT len); |
Changes the data stored in the specified property attached to the
specified window. If the property does not already exist, it will be
created. The property name should be a zero terminated string. To
create a global property, attach it the root window
(GR_ROOT_WINDOW_ID). If data is a null pointer but len is >= 1, the
property is created with no data block attached to it. If len is 0,
the property is deleted.
GrGetWindowProperty ()
GR_COUNT GrGetWindowProperty (GR_WINDOW_ID wid,
GR_CHAR *property,
GR_PROP **data); |
Searches for a property with the specified name in the list of
properties attached to the specified window and returns the data
block associated with the property. If no such property is found, the
length is zero and the a null pointer is stored in the data pointer.
If the property exists but no data block is associated with it, 1 is
returned for the length and the data pointer is set to NULL. The data
block is allocated with malloc() at call time, and it is the callers
responsibility to free it when no longer needed. If the malloc() call
fails the data pointer will be set to null.
GrCreateTimer ()
GR_TIMER_ID GrCreateTimer (GR_WINDOW_ID wid,
GR_TIMEOUT period,
GR_BOOL periodic); |
Creates a new timer which will generate a GR_EVENT_TYPE_TIMER event after
the specified period. The timer can be destroyed before it expires if
required using the GrDestroyTimer() call. If you want to make a timer which
will keep generating events every period ms instead of generating a single
event, set periodic to GR_TRUE instead of GR_FALSE.
GrDestroyTimer ()
void GrDestroyTimer (GR_TIMER_ID tid); |
Destroys the specified timer. Note that it is possible for there to be one
or more undelivered timer events already in the queue when GrDestroyTimer()
is called, and they will still be delivered anyway.