XmuDisplayQueue(Xmu) X Version 11 (Release 5) XmuDisplayQueue(Xmu)
6 January 1993
Name
XmuDisplayQueue - display queue functions
Syntax
cc . . . -lXmu
#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;
Arguments
q Specifies the queue to be acted on.
dpy Specifies the display to add, lookup or remove.
data Specifies private data for the function or free function.
docallbacks Specifies whether close functions should be called.
closefunc Specifies the close function.
freefunc Specifies the free function.
Description
The XmuDQCreate function creates and returns an empty XmuDisplayQueue
(which is really just a set of displays, but is called a queue for his-
torical reasons). The queue is initially empty, but displays can be
added using XmuAddDisplay. The data value is simply stored in the queue
for use by the closefunc and freefunc callbacks. Whenever a display in
the queue is closed using XCloseDisplay, the closefunc (if non-NULL) is
called with the queue and the display's XmuDisplayQueueEntry as follows:
(*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 deter-
mine 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 speci-
fied 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.
Structures
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;
See also
XOpenDisplay(XS)
Xlib - C Language X Interface