|
|
#include <X11/Xmu/DisplayQue.h>XmuDisplayQueue *XmuDQCreate(closefunc, freefunc, data) int (*closefunc)(); int (*freefunc)(); caddr_t data;
XmuDisplayQueueEntry *XmuDQAddDisplay(q, dpy, data) XmuDisplayQueue *q; Display *dpy; caddr_t data;
XmuDisplayQueueEntry *XmuDQLookupDisplay(q, dpy) XmuDisplayQueue *q; Display *dpy;
Bool XmuDQRemoveDisplay(q, dpy) XmuDisplayQueue *q; Display *dpy;
Bool XmuDQDestroy(q, docallbacks) XmuDisplayQueue *q; Bool docallbacks;
(*closefunc) (queue,entry)The freeproc (if non-NULL) is called whenever the last display in the queue is closed, as follows:
(*freefunc) (queue)The application is responsible for actually freeing the queue, by calling XmuDQDestroy.
The XmuDQAddDisplay function adds the specified display to the queue. If successful, the queue entry is returned, otherwise NULL is returned. The data value is simply stored in the queue entry for use by the queue's freefunc callback. This function does not attempt to prevent duplicate entries in the queue; the caller should use XmuDQLookupDisplay to determine if a display has already been added to a queue.
The XmuDQLookupDisplay function returns the queue entry for the specified display, or NULL if the display is not in the queue.
This macro returns the number of displays in the specified queue.
XmuDQNDisplays(q)The XmuDQRemoveDisplay function removes the specified display from the specified queue. No callbacks are performed. If the display is not found in the queue, False is returned, otherwise True is returned.
The XmuDQDestroy
function releases all memory associated
with the specified queue.
If docallbacks is True,
then the queue's closefunc callback
(if non-NULL)
is first called for each display in the queue,
even though XCloseDisplay
is not called on the display.
typedef struct _XmuDisplayQueueEntry { struct _XmuDisplayQueueEntry *prev, *next; Display *display; CloseHook closehook; caddr_t data; } XmuDisplayQueueEntry;typedef struct _XmuDisplayQueue { int nentries; XmuDisplayQueueEntry *head, *tail; int (*closefunc)(); int (*freefunc)(); caddr_t data; } XmuDisplayQueue;