1/*
2 *
3 * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
4 *
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
9 * documentation, and that the name of Keith Packard not be used in
10 * advertising or publicity pertaining to distribution of the software without
11 * specific, written prior permission.  Keith Packard makes no
12 * representations about the suitability of this software for any purpose.  It
13 * is provided "as is" without express or implied warranty.
14 *
15 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21 * PERFORMANCE OF THIS SOFTWARE.
22 */
23
24#ifndef _XFIXESINT_H_
25#define _XFIXESINT_H_
26
27#include <stdio.h>
28#include <X11/Xlib.h>
29#include <X11/Xlibint.h>
30#include <X11/Xutil.h>
31#include "Xfixes.h"
32#include <X11/extensions/xfixesproto.h>
33
34typedef struct _XFixesExtDisplayInfo {
35    struct _XFixesExtDisplayInfo  *next;    /* keep a linked list */
36    Display                 *display;	    /* which display this is */
37    XExtCodes               *codes;	    /* the extension protocol codes */
38    int			    major_version;  /* -1 means we don't know */
39    int			    minor_version;  /* -1 means we don't know */
40} XFixesExtDisplayInfo;
41
42/* replaces XExtensionInfo */
43typedef struct _XFixesExtInfo {
44    XFixesExtDisplayInfo    *head;          /* start of the list */
45    XFixesExtDisplayInfo    *cur;           /* most recently used */
46    int                     ndisplays;      /* number of displays */
47} XFixesExtInfo;
48
49extern XFixesExtInfo XFixesExtensionInfo;
50extern char XFixesExtensionName[];
51
52XFixesExtDisplayInfo *
53XFixesFindDisplay (Display *dpy);
54
55#define XFixesHasExtension(i) ((i) && ((i)->codes))
56
57#define XFixesCheckExtension(dpy,i,val) \
58    do { if (!XFixesHasExtension(i)) { return val; } } while(0)
59
60#define XFixesSimpleCheckExtension(dpy,i) \
61    do { if (!XFixesHasExtension(i)) { return; } } while(0)
62
63#endif /* _XFIXESINT_H_ */
64