David 'Digit' Turner | 1b0544d | 2014-03-27 13:51:24 +0100 | [diff] [blame] | 1 | /* |
| 2 | * $Xorg: multibuf.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ |
| 3 | * |
| 4 | Copyright 1989, 1998 The Open Group |
| 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. |
| 11 | |
| 12 | The above copyright notice and this permission notice shall be included in |
| 13 | all copies or substantial portions of the 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 THE |
| 18 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 19 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 21 | |
| 22 | Except as contained in this notice, the name of The Open Group shall not be |
| 23 | used in advertising or otherwise to promote the sale, use or other dealings |
| 24 | in this Software without prior written authorization from The Open Group. |
| 25 | */ |
| 26 | |
| 27 | /* $XFree86: xc/include/extensions/multibuf.h,v 3.4 2001/12/14 19:53:28 dawes Exp $ */ |
| 28 | |
| 29 | #ifndef _MULTIBUF_H_ |
| 30 | #define _MULTIBUF_H_ |
| 31 | |
| 32 | #include <X11/Xfuncproto.h> |
| 33 | |
| 34 | #include <X11/extensions/multibufconst.h> |
| 35 | |
| 36 | #if !defined(UNIXCPP) || defined(ANSICPP) |
| 37 | #define MbufGetReq(name,req,info) GetReq (name, req); \ |
| 38 | req->reqType = info->codes->major_opcode; \ |
| 39 | req->mbufReqType = X_##name; |
| 40 | #else |
| 41 | #define MbufGetReq(name,req,info) GetReq (name, req); \ |
| 42 | req->reqType = info->codes->major_opcode; \ |
| 43 | req->mbufReqType = X_/**/name; |
| 44 | #endif |
| 45 | |
| 46 | /* |
| 47 | * Extra definitions that will only be needed in the client |
| 48 | */ |
| 49 | typedef XID Multibuffer; |
| 50 | |
| 51 | typedef struct { |
| 52 | int type; /* of event */ |
| 53 | unsigned long serial; /* # of last request processed by server */ |
| 54 | int send_event; /* true if this came frome a SendEvent request */ |
| 55 | Display *display; /* Display the event was read from */ |
| 56 | Multibuffer buffer; /* buffer of event */ |
| 57 | int state; /* see Clobbered constants above */ |
| 58 | } XmbufClobberNotifyEvent; |
| 59 | |
| 60 | typedef struct { |
| 61 | int type; /* of event */ |
| 62 | unsigned long serial; /* # of last request processed by server */ |
| 63 | int send_event; /* true if this came frome a SendEvent request */ |
| 64 | Display *display; /* Display the event was read from */ |
| 65 | Multibuffer buffer; /* buffer of event */ |
| 66 | } XmbufUpdateNotifyEvent; |
| 67 | |
| 68 | |
| 69 | /* |
| 70 | * per-window attributes that can be got |
| 71 | */ |
| 72 | typedef struct { |
| 73 | int displayed_index; /* which buffer is being displayed */ |
| 74 | int update_action; /* Undefined, Background, Untouched, Copied */ |
| 75 | int update_hint; /* Frequent, Intermittent, Static */ |
| 76 | int window_mode; /* Mono, Stereo */ |
| 77 | int nbuffers; /* Number of buffers */ |
| 78 | Multibuffer *buffers; /* Buffers */ |
| 79 | } XmbufWindowAttributes; |
| 80 | |
| 81 | /* |
| 82 | * per-window attributes that can be set |
| 83 | */ |
| 84 | typedef struct { |
| 85 | int update_hint; /* Frequent, Intermittent, Static */ |
| 86 | } XmbufSetWindowAttributes; |
| 87 | |
| 88 | |
| 89 | /* |
| 90 | * per-buffer attributes that can be got |
| 91 | */ |
| 92 | typedef struct { |
| 93 | Window window; /* which window this belongs to */ |
| 94 | unsigned long event_mask; /* events that have been selected */ |
| 95 | int buffer_index; /* which buffer is this */ |
| 96 | int side; /* Mono, Left, Right */ |
| 97 | } XmbufBufferAttributes; |
| 98 | |
| 99 | /* |
| 100 | * per-buffer attributes that can be set |
| 101 | */ |
| 102 | typedef struct { |
| 103 | unsigned long event_mask; /* events that have been selected */ |
| 104 | } XmbufSetBufferAttributes; |
| 105 | |
| 106 | |
| 107 | /* |
| 108 | * per-screen buffer info (there will be lists of them) |
| 109 | */ |
| 110 | typedef struct { |
| 111 | VisualID visualid; /* visual usuable at this depth */ |
| 112 | int max_buffers; /* most buffers for this visual */ |
| 113 | int depth; /* depth of buffers to be created */ |
| 114 | } XmbufBufferInfo; |
| 115 | |
| 116 | _XFUNCPROTOBEGIN |
| 117 | |
| 118 | extern Bool XmbufQueryExtension( |
| 119 | Display* /* dpy */, |
| 120 | int* /* event_base_return */, |
| 121 | int* /* error_base_return */ |
| 122 | ); |
| 123 | |
| 124 | extern Status XmbufGetVersion( |
| 125 | Display* /* dpy */, |
| 126 | int* /* major_version_return */, |
| 127 | int* /* minor_version_return */ |
| 128 | ); |
| 129 | |
| 130 | extern int XmbufCreateBuffers( |
| 131 | Display* /* dpy */, |
| 132 | Window /* w */, |
| 133 | int /* count */, |
| 134 | int /* update_action */, |
| 135 | int /* update_hint */, |
| 136 | Multibuffer* /* buffers */ |
| 137 | ); |
| 138 | |
| 139 | extern void XmbufDestroyBuffers( |
| 140 | Display* /* dpy */, |
| 141 | Window /* window */ |
| 142 | ); |
| 143 | |
| 144 | extern void XmbufDisplayBuffers( |
| 145 | Display* /* dpy */, |
| 146 | int /* count */, |
| 147 | Multibuffer* /* buffers */, |
| 148 | int /* min_delay */, |
| 149 | int /* max_delay */ |
| 150 | ); |
| 151 | |
| 152 | extern Status XmbufGetWindowAttributes( |
| 153 | Display* /* dpy */, |
| 154 | Window /* w */, |
| 155 | XmbufWindowAttributes* /* attr */ |
| 156 | ); |
| 157 | |
| 158 | extern void XmbufChangeWindowAttributes( |
| 159 | Display* /* dpy */, |
| 160 | Window /* w */, |
| 161 | unsigned long /* valuemask */, |
| 162 | XmbufSetWindowAttributes* /* attr */ |
| 163 | ); |
| 164 | |
| 165 | extern Status XmbufGetBufferAttributes( |
| 166 | Display* /* dpy */, |
| 167 | Multibuffer /* b */, |
| 168 | XmbufBufferAttributes* /* attr */ |
| 169 | ); |
| 170 | |
| 171 | extern void XmbufChangeBufferAttributes( |
| 172 | Display* /* dpy */, |
| 173 | Multibuffer /* b */, |
| 174 | unsigned long /* valuemask */, |
| 175 | XmbufSetBufferAttributes* /* attr */ |
| 176 | ); |
| 177 | |
| 178 | extern Status XmbufGetScreenInfo( |
| 179 | Display* /* dpy */, |
| 180 | Drawable /* d */, |
| 181 | int* /* nmono_return */, |
| 182 | XmbufBufferInfo** /* mono_info_return */, |
| 183 | int* /* nstereo_return */, |
| 184 | XmbufBufferInfo** /* stereo_info_return */ |
| 185 | ); |
| 186 | |
| 187 | extern Window XmbufCreateStereoWindow( |
| 188 | Display* /* dpy */, |
| 189 | Window /* parent */, |
| 190 | int /* x */, |
| 191 | int /* y */, |
| 192 | unsigned int /* width */, |
| 193 | unsigned int /* height */, |
| 194 | unsigned int /* border_width */, |
| 195 | int /* depth */, |
| 196 | unsigned int /* class */, |
| 197 | Visual* /* visual */, |
| 198 | unsigned long /* valuemask */, |
| 199 | XSetWindowAttributes* /* attr */, |
| 200 | Multibuffer* /* leftp */, |
| 201 | Multibuffer* /* rightp */ |
| 202 | ); |
| 203 | |
| 204 | extern void XmbufClearBufferArea( |
| 205 | Display* /* dpy */, |
| 206 | Multibuffer /* buffer */, |
| 207 | int /* x */, |
| 208 | int /* y */, |
| 209 | unsigned int /* width */, |
| 210 | unsigned int /* height */, |
| 211 | Bool /* exposures */ |
| 212 | ); |
| 213 | |
| 214 | _XFUNCPROTOEND |
| 215 | |
| 216 | #endif /* _MULTIBUF_H_ */ |