upload tizen2.0 source
[framework/uifw/xorg/lib/libxcomposite.git] / src / xcompositeint.h
1 /*
2  * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 /*
24  * Copyright © 2003 Keith Packard
25  *
26  * Permission to use, copy, modify, distribute, and sell this software and its
27  * documentation for any purpose is hereby granted without fee, provided that
28  * the above copyright notice appear in all copies and that both that
29  * copyright notice and this permission notice appear in supporting
30  * documentation, and that the name of Keith Packard not be used in
31  * advertising or publicity pertaining to distribution of the software without
32  * specific, written prior permission.  Keith Packard makes no
33  * representations about the suitability of this software for any purpose.  It
34  * is provided "as is" without express or implied warranty.
35  *
36  * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
37  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
38  * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
39  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
40  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
41  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42  * PERFORMANCE OF THIS SOFTWARE.
43  */
44
45 #ifndef _XCOMPOSITEINT_H_
46 #define _XCOMPOSITEINT_H_
47
48 #include <stdio.h>
49 #include <X11/Xlib.h>
50 #include <X11/Xlibint.h>
51 #include <X11/Xutil.h>
52 #include <X11/extensions/compositeproto.h>
53 #include <X11/extensions/Xcomposite.h>
54
55 typedef struct _XCompositeExtDisplayInfo {
56     struct _XCompositeExtDisplayInfo  *next;    /* keep a linked list */
57     Display                 *display;       /* which display this is */
58     XExtCodes               *codes;         /* the extension protocol codes */
59     int                     major_version;  /* -1 means we don't know */
60     int                     minor_version;  /* -1 means we don't know */
61 } XCompositeExtDisplayInfo;
62
63 /* replaces XExtensionInfo */
64 typedef struct _XCompositeExtInfo {
65     XCompositeExtDisplayInfo    *head;          /* start of the list */
66     XCompositeExtDisplayInfo    *cur;           /* most recently used */
67     int                     ndisplays;      /* number of displays */
68 } XCompositeExtInfo;
69
70 extern XCompositeExtInfo XCompositeExtensionInfo;
71 extern const char XCompositeExtensionName[];
72
73 XCompositeExtDisplayInfo *
74 XCompositeFindDisplay (Display *dpy);
75
76 #define XCompositeHasExtension(i) ((i) && ((i)->codes))
77
78 #define XCompositeCheckExtension(dpy,i,val) \
79   if (!XCompositeHasExtension(i)) { return val; }
80
81 #define XCompositeSimpleCheckExtension(dpy,i) \
82   if (!XCompositeHasExtension(i)) { return; }
83
84 #endif /* _XCOMPOSITEINT_H_ */