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