blob: 390738d782e466f3d75f5233477099945154a52b [file] [log] [blame]
David 'Digit' Turner1b0544d2014-03-27 13:51:24 +01001/* $Xorg: Xdbe.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
2/******************************************************************************
3 *
4 * Copyright (c) 1994, 1995 Hewlett-Packard Company
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 * Except as contained in this notice, the name of the Hewlett-Packard
26 * Company shall not be used in advertising or otherwise to promote the
27 * sale, use or other dealings in this Software without prior written
28 * authorization from the Hewlett-Packard Company.
29 *
30 * Header file for Xlib-related DBE
31 *
32 *****************************************************************************/
33/* $XFree86: xc/include/extensions/Xdbe.h,v 3.2 2001/08/01 00:44:35 tsi Exp $ */
34
35#ifndef XDBE_H
36#define XDBE_H
37
38#include <X11/Xfuncproto.h>
39#include <X11/extensions/dbe.h>
40
41typedef struct
42{
43 VisualID visual; /* one visual ID that supports double-buffering */
44 int depth; /* depth of visual in bits */
45 int perflevel; /* performance level of visual */
46}
47XdbeVisualInfo;
48
49typedef struct
50{
51 int count; /* number of items in visual_depth */
52 XdbeVisualInfo *visinfo; /* list of visuals & depths for scrn */
53}
54XdbeScreenVisualInfo;
55
56
57typedef Drawable XdbeBackBuffer;
58
59typedef unsigned char XdbeSwapAction;
60
61typedef struct
62{
63 Window swap_window; /* window for which to swap buffers */
64 XdbeSwapAction swap_action; /* swap action to use for swap_window */
65}
66XdbeSwapInfo;
67
68typedef struct
69{
70 Window window; /* window that buffer belongs to */
71}
72XdbeBackBufferAttributes;
73
74typedef struct
75{
76 int type;
77 Display *display; /* display the event was read from */
78 XdbeBackBuffer buffer; /* resource id */
79 unsigned long serial; /* serial number of failed request */
80 unsigned char error_code; /* error base + XdbeBadBuffer */
81 unsigned char request_code; /* major opcode of failed request */
82 unsigned char minor_code; /* minor opcode of failed request */
83}
84XdbeBufferError;
85
86/* _XFUNCPROTOBEGIN and _XFUNCPROTOEND are defined as noops
87 * (for non-C++ builds) in X11/Xfuncproto.h.
88 */
89_XFUNCPROTOBEGIN
90
91extern Status XdbeQueryExtension(
92 Display* /* dpy */,
93 int* /* major_version_return */,
94 int* /* minor_version_return */
95);
96
97extern XdbeBackBuffer XdbeAllocateBackBufferName(
98 Display* /* dpy */,
99 Window /* window */,
100 XdbeSwapAction /* swap_action */
101);
102
103extern Status XdbeDeallocateBackBufferName(
104 Display* /* dpy */,
105 XdbeBackBuffer /* buffer */
106);
107
108extern Status XdbeSwapBuffers(
109 Display* /* dpy */,
110 XdbeSwapInfo* /* swap_info */,
111 int /* num_windows */
112);
113
114extern Status XdbeBeginIdiom(
115 Display* /* dpy */
116);
117
118extern Status XdbeEndIdiom(
119 Display* /* dpy */
120);
121
122extern XdbeScreenVisualInfo *XdbeGetVisualInfo(
123 Display* /* dpy */,
124 Drawable* /* screen_specifiers */,
125 int* /* num_screens */
126);
127
128extern void XdbeFreeVisualInfo(
129 XdbeScreenVisualInfo* /* visual_info */
130);
131
132extern XdbeBackBufferAttributes *XdbeGetBackBufferAttributes(
133 Display* /* dpy */,
134 XdbeBackBuffer /* buffer */
135);
136
137_XFUNCPROTOEND
138
139#endif /* XDBE_H */
140