3 Copyright 1994, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
27 #ifndef _XMU_DISPLAYQUE_H_
28 #define _XMU_DISPLAYQUE_H_
30 #include <X11/Xmu/CloseHook.h>
31 #include <X11/Xfuncproto.h>
37 * XmuDisplayQueue *XmuDQCreate (closefunc, freefunc, data)
38 * XmuCloseDisplayQueueProc closefunc;
39 * XmuFreeDisplayQueueProc freefunc;
42 * Creates and returns a queue into which displays may be placed. When
43 * the display is closed, the closefunc (if non-NULL) is upcalled with
46 * (*closefunc) (queue, entry)
48 * The freeproc, if non-NULL, is called whenever the last display is
49 * closed, notifying the creator that display queue may be released
53 * Bool XmuDQDestroy (q, docallbacks)
57 * Releases all memory for the indicated display queue. If docallbacks
58 * is true, then the closefunc (if non-NULL) is called for each
62 * XmuDisplayQueueEntry *XmuDQLookupDisplay (q, dpy)
66 * Returns the queue entry for the specified display or NULL if the
67 * display is not in the queue.
70 * XmuDisplayQueueEntry *XmuDQAddDisplay (q, dpy, data)
75 * Adds the indicated display to the end of the queue or NULL if it
76 * is unable to allocate memory. The data field may be used by the
77 * caller to attach arbitrary data to this display in this queue. The
78 * caller should use XmuDQLookupDisplay to make sure that the display
79 * hasn't already been added.
82 * Bool XmuDQRemoveDisplay (q, dpy)
86 * Removes the specified display from the given queue. If the
87 * indicated display is not found on this queue, False is returned,
88 * otherwise True is returned.
91 typedef struct _XmuDisplayQueue XmuDisplayQueue;
92 typedef struct _XmuDisplayQueueEntry XmuDisplayQueueEntry;
94 typedef int (*XmuCloseDisplayQueueProc)(XmuDisplayQueue *queue,
95 XmuDisplayQueueEntry *entry);
97 typedef int (*XmuFreeDisplayQueueProc)(XmuDisplayQueue *queue);
99 struct _XmuDisplayQueueEntry {
100 struct _XmuDisplayQueueEntry *prev, *next;
106 struct _XmuDisplayQueue {
108 XmuDisplayQueueEntry *head, *tail;
109 XmuCloseDisplayQueueProc closefunc;
110 XmuFreeDisplayQueueProc freefunc;
116 XmuDisplayQueue *XmuDQCreate
118 XmuCloseDisplayQueueProc closefunc,
119 XmuFreeDisplayQueueProc freefunc,
129 XmuDisplayQueueEntry *XmuDQLookupDisplay
135 XmuDisplayQueueEntry *XmuDQAddDisplay
142 Bool XmuDQRemoveDisplay
150 #define XmuDQNDisplays(q) ((q)->nentries)
152 #endif /* _XMU_DISPLAYQUE_H_ */