1 module ws.bindings.Xdbe;
2 
3 
4 /******************************************************************************
5  *
6  * Copyright (c) 1994, 1995  Hewlett-Packard Company
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
23  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
25  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name of the Hewlett-Packard
28  * Company shall not be used in advertising or otherwise to promote the
29  * sale, use or other dealings in this Software without prior written
30  * authorization from the Hewlett-Packard Company.
31  *
32  *     Header file for Xlib-related DBE
33  *
34  *****************************************************************************/
35 
36 
37 version(Posix):
38 
39 
40 extern(C):
41 
42 
43 public import x11.X, x11.Xlib;
44 
45 
46 /* Values for swap_action field of XdbeSwapInfo structure */
47 enum XdbeUndefined =    0;
48 enum XdbeBackground =   1;
49 enum XdbeUntouched =    2;
50 enum XdbeCopied =       3;
51 
52 /* Errors */
53 enum XdbeBadBuffer =    0;
54 
55 enum DBE_PROTOCOL_NAME = "DOUBLE-BUFFER";
56 
57 /* Current version numbers */
58 enum DBE_MAJOR_VERSION =       1;
59 enum DBE_MINOR_VERSION =       0;
60 
61 /* Used when adding extension; also used in Xdbe macros */
62 enum DbeNumberEvents =         0;
63 enum DbeBadBuffer =            0;
64 enum DbeNumberErrors =         (DbeBadBuffer + 1);
65 
66 
67 struct XdbeVisualInfo {
68     VisualID    visual;    /* one visual ID that supports double-buffering */
69     int         depth;     /* depth of visual in bits                      */
70     int         perflevel; /* performance level of visual                  */
71 }
72 
73 struct XdbeScreenVisualInfo {
74     int                 count;          /* number of items in visual_depth   */
75     XdbeVisualInfo      *visinfo;       /* list of visuals & depths for scrn */
76 }
77 
78 alias XdbeBackBuffer = Drawable;
79 
80 alias XdbeSwapAction = ubyte;
81 
82 struct XdbeSwapInfo {
83     Window      swap_window;    /* window for which to swap buffers   */
84     XdbeSwapAction  swap_action;    /* swap action to use for swap_window */
85 }
86 
87 struct XdbeBackBufferAttributes {
88     Window  window;         /* window that buffer belongs to */
89 }
90 
91 struct XdbeBufferError {
92     int         type;
93     Display     *display;   /* display the event was read from */
94     XdbeBackBuffer  buffer;     /* resource id                     */
95     ulong   serial;     /* serial number of failed request */
96     ubyte   error_code; /* error base + XdbeBadBuffer      */
97     ubyte   request_code;   /* major opcode of failed request  */
98     ubyte   minor_code; /* minor opcode of failed request  */
99 }
100 
101 
102 Status XdbeQueryExtension(
103     Display*        /* dpy                  */,
104     int*        /* major_version_return */,
105     int*        /* minor_version_return */
106 );
107 
108 XdbeBackBuffer XdbeAllocateBackBufferName(
109     Display*        /* dpy         */,
110     Window      /* window      */,
111     XdbeSwapAction  /* swap_action */
112 );
113 
114 Status XdbeDeallocateBackBufferName(
115     Display*        /* dpy    */,
116     XdbeBackBuffer  /* buffer */
117 );
118 
119 Status XdbeSwapBuffers(
120     Display*        /* dpy         */,
121     XdbeSwapInfo*   /* swap_info   */,
122     int         /* num_windows */
123 );
124 
125 Status XdbeBeginIdiom(
126     Display*        /* dpy */
127 );
128 
129 Status XdbeEndIdiom(
130     Display*        /* dpy */
131 );
132 
133 XdbeScreenVisualInfo *XdbeGetVisualInfo(
134     Display*        /* dpy               */,
135     Drawable*       /* screen_specifiers */,
136     int*        /* num_screens       */
137 );
138 
139 void XdbeFreeVisualInfo(
140     XdbeScreenVisualInfo*   /* visual_info */
141 );
142 
143 XdbeBackBufferAttributes *XdbeGetBackBufferAttributes(
144     Display*        /* dpy    */,
145     XdbeBackBuffer  /* buffer */
146 );