1 | /* $XFree86: xc/include/extensions/shmstr.h,v 3.3 2001/12/14 19:53:29 dawes Exp $ */
|
---|
2 | /************************************************************
|
---|
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 |
|
---|
28 | /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
|
---|
29 |
|
---|
30 | #ifndef _SHMSTR_H_
|
---|
31 | #define _SHMSTR_H_
|
---|
32 |
|
---|
33 | /* $Xorg: shmstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
|
---|
34 |
|
---|
35 | #include "XShm.h"
|
---|
36 |
|
---|
37 | #define ShmSeg CARD32
|
---|
38 | #define Drawable CARD32
|
---|
39 | #define VisualID CARD32
|
---|
40 | #define GContext CARD32
|
---|
41 | #define Pixmap CARD32
|
---|
42 |
|
---|
43 | #define SHMNAME "MIT-SHM"
|
---|
44 |
|
---|
45 | #define SHM_MAJOR_VERSION 1 /* current version numbers */
|
---|
46 | #define SHM_MINOR_VERSION 1
|
---|
47 |
|
---|
48 | #ifdef _XSHM_SERVER_
|
---|
49 | #define XSHM_PUT_IMAGE_ARGS \
|
---|
50 | DrawablePtr /* dst */, \
|
---|
51 | GCPtr /* pGC */, \
|
---|
52 | int /* depth */, \
|
---|
53 | unsigned int /* format */, \
|
---|
54 | int /* w */, \
|
---|
55 | int /* h */, \
|
---|
56 | int /* sx */, \
|
---|
57 | int /* sy */, \
|
---|
58 | int /* sw */, \
|
---|
59 | int /* sh */, \
|
---|
60 | int /* dx */, \
|
---|
61 | int /* dy */, \
|
---|
62 | char * /* data */
|
---|
63 |
|
---|
64 | #define XSHM_CREATE_PIXMAP_ARGS \
|
---|
65 | ScreenPtr /* pScreen */, \
|
---|
66 | int /* width */, \
|
---|
67 | int /* height */, \
|
---|
68 | int /* depth */, \
|
---|
69 | char * /* addr */
|
---|
70 |
|
---|
71 | typedef struct _ShmFuncs {
|
---|
72 | PixmapPtr (* CreatePixmap)(XSHM_CREATE_PIXMAP_ARGS);
|
---|
73 | void (* PutImage)(XSHM_PUT_IMAGE_ARGS);
|
---|
74 | } ShmFuncs, *ShmFuncsPtr;
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | typedef struct _ShmQueryVersion {
|
---|
78 | CARD8 reqType; /* always ShmReqCode */
|
---|
79 | CARD8 shmReqType; /* always X_ShmQueryVersion */
|
---|
80 | CARD16 length B16;
|
---|
81 | } xShmQueryVersionReq;
|
---|
82 | #define sz_xShmQueryVersionReq 4
|
---|
83 |
|
---|
84 | typedef struct {
|
---|
85 | BYTE type; /* X_Reply */
|
---|
86 | BOOL sharedPixmaps;
|
---|
87 | CARD16 sequenceNumber B16;
|
---|
88 | CARD32 length B32;
|
---|
89 | CARD16 majorVersion B16; /* major version of SHM protocol */
|
---|
90 | CARD16 minorVersion B16; /* minor version of SHM protocol */
|
---|
91 | CARD16 uid B16;
|
---|
92 | CARD16 gid B16;
|
---|
93 | CARD8 pixmapFormat;
|
---|
94 | CARD8 pad0;
|
---|
95 | CARD16 pad1 B16;
|
---|
96 | CARD32 pad2 B32;
|
---|
97 | CARD32 pad3 B32;
|
---|
98 | CARD32 pad4 B32;
|
---|
99 | } xShmQueryVersionReply;
|
---|
100 | #define sz_xShmQueryVersionReply 32
|
---|
101 |
|
---|
102 | typedef struct _ShmAttach {
|
---|
103 | CARD8 reqType; /* always ShmReqCode */
|
---|
104 | CARD8 shmReqType; /* always X_ShmAttach */
|
---|
105 | CARD16 length B16;
|
---|
106 | ShmSeg shmseg B32;
|
---|
107 | CARD32 shmid B32;
|
---|
108 | BOOL readOnly;
|
---|
109 | BYTE pad0;
|
---|
110 | CARD16 pad1 B16;
|
---|
111 | } xShmAttachReq;
|
---|
112 | #define sz_xShmAttachReq 16
|
---|
113 |
|
---|
114 | typedef struct _ShmDetach {
|
---|
115 | CARD8 reqType; /* always ShmReqCode */
|
---|
116 | CARD8 shmReqType; /* always X_ShmDetach */
|
---|
117 | CARD16 length B16;
|
---|
118 | ShmSeg shmseg B32;
|
---|
119 | } xShmDetachReq;
|
---|
120 | #define sz_xShmDetachReq 8
|
---|
121 |
|
---|
122 | typedef struct _ShmPutImage {
|
---|
123 | CARD8 reqType; /* always ShmReqCode */
|
---|
124 | CARD8 shmReqType; /* always X_ShmPutImage */
|
---|
125 | CARD16 length B16;
|
---|
126 | Drawable drawable B32;
|
---|
127 | GContext gc B32;
|
---|
128 | CARD16 totalWidth B16;
|
---|
129 | CARD16 totalHeight B16;
|
---|
130 | CARD16 srcX B16;
|
---|
131 | CARD16 srcY B16;
|
---|
132 | CARD16 srcWidth B16;
|
---|
133 | CARD16 srcHeight B16;
|
---|
134 | INT16 dstX B16;
|
---|
135 | INT16 dstY B16;
|
---|
136 | CARD8 depth;
|
---|
137 | CARD8 format;
|
---|
138 | CARD8 sendEvent;
|
---|
139 | CARD8 bpad;
|
---|
140 | ShmSeg shmseg B32;
|
---|
141 | CARD32 offset B32;
|
---|
142 | } xShmPutImageReq;
|
---|
143 | #define sz_xShmPutImageReq 40
|
---|
144 |
|
---|
145 | typedef struct _ShmGetImage {
|
---|
146 | CARD8 reqType; /* always ShmReqCode */
|
---|
147 | CARD8 shmReqType; /* always X_ShmGetImage */
|
---|
148 | CARD16 length B16;
|
---|
149 | Drawable drawable B32;
|
---|
150 | INT16 x B16;
|
---|
151 | INT16 y B16;
|
---|
152 | CARD16 width B16;
|
---|
153 | CARD16 height B16;
|
---|
154 | CARD32 planeMask B32;
|
---|
155 | CARD8 format;
|
---|
156 | CARD8 pad0;
|
---|
157 | CARD8 pad1;
|
---|
158 | CARD8 pad2;
|
---|
159 | ShmSeg shmseg B32;
|
---|
160 | CARD32 offset B32;
|
---|
161 | } xShmGetImageReq;
|
---|
162 | #define sz_xShmGetImageReq 32
|
---|
163 |
|
---|
164 | typedef struct _ShmGetImageReply {
|
---|
165 | BYTE type; /* X_Reply */
|
---|
166 | CARD8 depth;
|
---|
167 | CARD16 sequenceNumber B16;
|
---|
168 | CARD32 length B32;
|
---|
169 | VisualID visual B32;
|
---|
170 | CARD32 size B32;
|
---|
171 | CARD32 pad0 B32;
|
---|
172 | CARD32 pad1 B32;
|
---|
173 | CARD32 pad2 B32;
|
---|
174 | CARD32 pad3 B32;
|
---|
175 | } xShmGetImageReply;
|
---|
176 | #define sz_xShmGetImageReply 32
|
---|
177 |
|
---|
178 | typedef struct _ShmCreatePixmap {
|
---|
179 | CARD8 reqType; /* always ShmReqCode */
|
---|
180 | CARD8 shmReqType; /* always X_ShmCreatePixmap */
|
---|
181 | CARD16 length B16;
|
---|
182 | Pixmap pid B32;
|
---|
183 | Drawable drawable B32;
|
---|
184 | CARD16 width B16;
|
---|
185 | CARD16 height B16;
|
---|
186 | CARD8 depth;
|
---|
187 | CARD8 pad0;
|
---|
188 | CARD8 pad1;
|
---|
189 | CARD8 pad2;
|
---|
190 | ShmSeg shmseg B32;
|
---|
191 | CARD32 offset B32;
|
---|
192 | } xShmCreatePixmapReq;
|
---|
193 | #define sz_xShmCreatePixmapReq 28
|
---|
194 |
|
---|
195 | typedef struct _ShmCompletion {
|
---|
196 | BYTE type; /* always eventBase + ShmCompletion */
|
---|
197 | BYTE bpad0;
|
---|
198 | CARD16 sequenceNumber B16;
|
---|
199 | Drawable drawable B32;
|
---|
200 | CARD16 minorEvent B16;
|
---|
201 | BYTE majorEvent;
|
---|
202 | BYTE bpad1;
|
---|
203 | ShmSeg shmseg B32;
|
---|
204 | CARD32 offset B32;
|
---|
205 | CARD32 pad0 B32;
|
---|
206 | CARD32 pad1 B32;
|
---|
207 | CARD32 pad2 B32;
|
---|
208 | } xShmCompletionEvent;
|
---|
209 | #define sz_xShmCompletionEvent 32
|
---|
210 |
|
---|
211 | #undef ShmSeg
|
---|
212 | #undef Drawable
|
---|
213 | #undef VisualID
|
---|
214 | #undef GContext
|
---|
215 | #undef Pixmap
|
---|
216 |
|
---|
217 | #endif /* _SHMSTR_H_ */
|
---|