X Version 11 (Release 6.1)

XmuDisplayQueue(X3xmu)


XmuDisplayQueue -- display queue functions

Synopsis

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 historical 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 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.

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;

References

XOpenDisplay(X3xlib)
Xlib - C Language X Interface


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004