1 | /* $XFree86: xc/include/extensions/XShm.h,v 1.10 2002/11/08 00:46:27 alanh 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 | /* $Xorg: XShm.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
|
---|
31 |
|
---|
32 | #ifndef _XSHM_H_
|
---|
33 | #define _XSHM_H_
|
---|
34 |
|
---|
35 | #include <X11/Xfuncproto.h>
|
---|
36 |
|
---|
37 | #define X_ShmQueryVersion 0
|
---|
38 | #define X_ShmAttach 1
|
---|
39 | #define X_ShmDetach 2
|
---|
40 | #define X_ShmPutImage 3
|
---|
41 | #define X_ShmGetImage 4
|
---|
42 | #define X_ShmCreatePixmap 5
|
---|
43 |
|
---|
44 | #define ShmCompletion 0
|
---|
45 | #define ShmNumberEvents (ShmCompletion + 1)
|
---|
46 |
|
---|
47 | #define BadShmSeg 0
|
---|
48 | #define ShmNumberErrors (BadShmSeg + 1)
|
---|
49 |
|
---|
50 | typedef unsigned long ShmSeg;
|
---|
51 |
|
---|
52 | #ifndef _XSHM_SERVER_
|
---|
53 | typedef struct {
|
---|
54 | int type; /* of event */
|
---|
55 | unsigned long serial; /* # of last request processed by server */
|
---|
56 | Bool send_event; /* true if this came frome a SendEvent request */
|
---|
57 | Display *display; /* Display the event was read from */
|
---|
58 | Drawable drawable; /* drawable of request */
|
---|
59 | int major_code; /* ShmReqCode */
|
---|
60 | int minor_code; /* X_ShmPutImage */
|
---|
61 | ShmSeg shmseg; /* the ShmSeg used in the request */
|
---|
62 | unsigned long offset; /* the offset into ShmSeg used in the request */
|
---|
63 | } XShmCompletionEvent;
|
---|
64 |
|
---|
65 | typedef struct {
|
---|
66 | ShmSeg shmseg; /* resource id */
|
---|
67 | int shmid; /* kernel id */
|
---|
68 | char *shmaddr; /* address in client */
|
---|
69 | Bool readOnly; /* how the server should attach it */
|
---|
70 | } XShmSegmentInfo;
|
---|
71 |
|
---|
72 | _XFUNCPROTOBEGIN
|
---|
73 |
|
---|
74 | Bool XShmQueryExtension(
|
---|
75 | #if NeedFunctionPrototypes
|
---|
76 | Display* /* dpy */
|
---|
77 | #endif
|
---|
78 | );
|
---|
79 |
|
---|
80 | int XShmGetEventBase(
|
---|
81 | #if NeedFunctionPrototypes
|
---|
82 | Display* /* dpy */
|
---|
83 | #endif
|
---|
84 | );
|
---|
85 |
|
---|
86 | int XShmGetEventBase(
|
---|
87 | #if NeedFunctionPrototypes
|
---|
88 | Display* /* dpy */
|
---|
89 | #endif
|
---|
90 | );
|
---|
91 |
|
---|
92 | Bool XShmQueryVersion(
|
---|
93 | #if NeedFunctionPrototypes
|
---|
94 | Display* /* dpy */,
|
---|
95 | int* /* majorVersion */,
|
---|
96 | int* /* minorVersion */,
|
---|
97 | Bool* /* sharedPixmaps */
|
---|
98 | #endif
|
---|
99 | );
|
---|
100 |
|
---|
101 | int XShmPixmapFormat(
|
---|
102 | #if NeedFunctionPrototypes
|
---|
103 | Display* /* dpy */
|
---|
104 | #endif
|
---|
105 | );
|
---|
106 |
|
---|
107 | Status XShmAttach(
|
---|
108 | #if NeedFunctionPrototypes
|
---|
109 | Display* /* dpy */,
|
---|
110 | XShmSegmentInfo* /* shminfo */
|
---|
111 | #endif
|
---|
112 | );
|
---|
113 |
|
---|
114 | Status XShmDetach(
|
---|
115 | #if NeedFunctionPrototypes
|
---|
116 | Display* /* dpy */,
|
---|
117 | XShmSegmentInfo* /* shminfo */
|
---|
118 | #endif
|
---|
119 | );
|
---|
120 |
|
---|
121 | Status XShmPutImage(
|
---|
122 | #if NeedFunctionPrototypes
|
---|
123 | Display* /* dpy */,
|
---|
124 | Drawable /* d */,
|
---|
125 | GC /* gc */,
|
---|
126 | XImage* /* image */,
|
---|
127 | int /* src_x */,
|
---|
128 | int /* src_y */,
|
---|
129 | int /* dst_x */,
|
---|
130 | int /* dst_y */,
|
---|
131 | unsigned int /* src_width */,
|
---|
132 | unsigned int /* src_height */,
|
---|
133 | Bool /* send_event */
|
---|
134 | #endif
|
---|
135 | );
|
---|
136 |
|
---|
137 | Status XShmGetImage(
|
---|
138 | #if NeedFunctionPrototypes
|
---|
139 | Display* /* dpy */,
|
---|
140 | Drawable /* d */,
|
---|
141 | XImage* /* image */,
|
---|
142 | int /* x */,
|
---|
143 | int /* y */,
|
---|
144 | unsigned long /* plane_mask */
|
---|
145 | #endif
|
---|
146 | );
|
---|
147 |
|
---|
148 | XImage *XShmCreateImage(
|
---|
149 | #if NeedFunctionPrototypes
|
---|
150 | Display* /* dpy */,
|
---|
151 | Visual* /* visual */,
|
---|
152 | unsigned int /* depth */,
|
---|
153 | int /* format */,
|
---|
154 | char* /* data */,
|
---|
155 | XShmSegmentInfo* /* shminfo */,
|
---|
156 | unsigned int /* width */,
|
---|
157 | unsigned int /* height */
|
---|
158 | #endif
|
---|
159 | );
|
---|
160 |
|
---|
161 | Pixmap XShmCreatePixmap(
|
---|
162 | #if NeedFunctionPrototypes
|
---|
163 | Display* /* dpy */,
|
---|
164 | Drawable /* d */,
|
---|
165 | char* /* data */,
|
---|
166 | XShmSegmentInfo* /* shminfo */,
|
---|
167 | unsigned int /* width */,
|
---|
168 | unsigned int /* height */,
|
---|
169 | unsigned int /* depth */
|
---|
170 | #endif
|
---|
171 | );
|
---|
172 |
|
---|
173 | _XFUNCPROTOEND
|
---|
174 |
|
---|
175 | #else /* _XSHM_SERVER_ */
|
---|
176 |
|
---|
177 | #include "screenint.h"
|
---|
178 | #include "pixmap.h"
|
---|
179 | #include "gc.h"
|
---|
180 |
|
---|
181 | extern void ShmRegisterFbFuncs(
|
---|
182 | #if NeedFunctionPrototypes
|
---|
183 | ScreenPtr /* pScreen */
|
---|
184 | #endif
|
---|
185 | );
|
---|
186 |
|
---|
187 | #endif
|
---|
188 |
|
---|
189 | #endif
|
---|