xdamageint.h revision af7c02bd
1/*
2 * $Id: xdamageint.h,v 1.1.1.1 2008/07/30 02:46:45 mrg Exp $
3 *
4 * Copyright © 2003 Keith Packard
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission.  Keith Packard makes no
13 * representations about the suitability of this software for any purpose.  It
14 * is provided "as is" without express or implied warranty.
15 *
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
23 */
24
25#ifndef _XDAMAGEINT_H_
26#define _XDAMAGEINT_H_
27
28#define NEED_EVENTS
29#define NEED_REPLIES
30#include <stdio.h>
31#include <X11/Xlib.h>
32#include <X11/Xlibint.h>
33#include <X11/Xutil.h>
34#include <X11/extensions/damageproto.h>
35#include "Xdamage.h"
36
37typedef struct _XDamageExtDisplayInfo {
38    struct _XDamageExtDisplayInfo  *next;    /* keep a linked list */
39    Display                 *display;	    /* which display this is */
40    XExtCodes               *codes;	    /* the extension protocol codes */
41    int			    major_version;  /* -1 means we don't know */
42    int			    minor_version;  /* -1 means we don't know */
43} XDamageExtDisplayInfo;
44
45/* replaces XExtensionInfo */
46typedef struct _XDamageExtInfo {
47    XDamageExtDisplayInfo    *head;          /* start of the list */
48    XDamageExtDisplayInfo    *cur;           /* most recently used */
49    int                     ndisplays;      /* number of displays */
50} XDamageExtInfo;
51
52extern XDamageExtInfo XDamageExtensionInfo;
53extern const char XDamageExtensionName[];
54
55XDamageExtDisplayInfo *
56XDamageFindDisplay (Display *dpy);
57
58#define XDamageHasExtension(i) ((i) && ((i)->codes))
59
60#define XDamageCheckExtension(dpy,i,val) \
61  if (!XDamageHasExtension(i)) { return val; }
62
63#define XDamageSimpleCheckExtension(dpy,i) \
64  if (!XDamageHasExtension(i)) { return; }
65
66#endif /* _XDAMAGEINT_H_ */
67