1 .\" Copyright (c) 1991 X Consortium
3 .\" Permission is hereby granted, free of charge, to any person obtaining a
4 .\" copy of this software and associated documentation files (the "Software"),
5 .\" to deal in the Software without restriction, including without limitation
6 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 .\" and/or sell copies of the Software, and to permit persons to whom the
8 .\" Software furnished to do so, subject to the following conditions:
10 .\" The above copyright notice and this permission notice shall be included in
11 .\" all copies or substantial portions of the Software.
13 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 .\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17 .\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
18 .\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 .\" Except as contained in this notice, the name of the X Consortium shall not
22 .\" be used in advertising or otherwise to promote the sale, use or other
23 .\" dealing in this Software without prior written authorization from the
26 .\" Copyright 2006 Sun Microsystems, Inc. All rights reserved.
28 .\" Permission is hereby granted, free of charge, to any person obtaining a
29 .\" copy of this software and associated documentation files (the "Software"),
30 .\" to deal in the Software without restriction, including without limitation
31 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
32 .\" and/or sell copies of the Software, and to permit persons to whom the
33 .\" Software is furnished to do so, subject to the following conditions:
35 .\" The above copyright notice and this permission notice (including the next
36 .\" paragraph) shall be included in all copies or substantial portions of the
39 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
42 .\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43 .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44 .\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
45 .\" DEALINGS IN THE SOFTWARE.
47 .\" X Window System is a trademark of The Open Group.
50 .ie t \fB\^\\$1\^\fR\\$2
51 .el \fI\^\\$1\^\fP\\$2
53 .TH XShm __libmansuffix__ __xorgversion__ "X FUNCTIONS"
55 XShmQueryExtension, XShmQueryVersion, XShmPixmapFormat, XShmAttach, XShmDetach
56 XShmCreateImage, XShmPutImage, XShmGetImage, XShmCreatePixmap, XShmGetEventBase - X Shared Memory extension functions
60 \&#include <X11/Xlib.h>
61 \&#include <sys/ipc.h>
62 \&#include <sys/shm.h>
63 \&#include <X11/extensions/XShm.h>
65 Bool XShmQueryExtension(
68 Bool XShmQueryVersion(
73 Status XShmPixmapFormat(
78 XShmSegmentInfo *shminfo);
82 XShmSegmentInfo *shminfo);
85 XImage *XShmCreateImage (
91 XShmSegmentInfo *shminfo;
92 unsigned int width, height);
99 int src_x, src_y, dest_x, dest_y;
100 unsigned int width, height;
103 Status XShmGetImage (
108 unsigned long plane_mask);
110 Pixmap XShmCreatePixmap(
114 XShmSegmentInfo *shminfo;
115 unsigned int width, height, depth);
117 Status XShmGetEventBase(
127 int type; /\&* of event */
128 unsigned long serial; /\&* # of last request processed by server*/
129 Bool send_event; /\&* true if this came from a SendEvent request*/
130 Display *display; /\&* Display the event was read from */
131 Drawable drawable; /\&* drawable of request */
132 int major_code; /\&* ShmReqCode */
133 int minor_code; /\&* X_ShmPutImage */
134 ShmSeg shmseg; /\&* the ShmSeg used in the request*/
135 unsigned long offset; /\&* the offset into ShmSeg used in the request*/
136 } XShmCompletionEvent;
138 \fIa structure of type XShmSegmentInfo :\fP
141 ShmSeg shmseg; /\&* resource id */
142 int shmid; /\&* kernel id */
143 char *shmaddr; /\&* address in client */
144 Bool readOnly; /\&* how the server should attach it */
150 .ZN XShmQueryExtension
151 checks to see if the shared memory extensions are available for the
155 returns the version numbers of the extension implementation. Shared
156 memory pixmaps are supported if the pixmaps argument returns true.
159 tells the server to attach to your shared memory segment. If all goes
160 well, you will get a non-zero status, back and your XImage is ready
164 tells the server to detach from your shared memory segment.
167 combines an image in memory with a shape of the specified drawable. If
168 XYBitmap format is used, the depth must be one, or a ``BadMatch''
169 error results. The foreground pixel in the GC defines the source for
170 the one bits in the image, and the background pixel defines the source
171 for the zero bits. For XYPixmap and ZPixmap, the depth must match the
172 depth of the drawable, or a ``BadMatch'' error results.
175 reads image data into a shared memory XImage where display is the
176 display of interest, drawable is the source drawable, image is the
177 destination XImage, x and y are offsets within the drawable, and
178 plane_mask defines which planes are to be read.
181 allocates the memory needed for an XImage structure for the specified
182 display but does not allocate space for the image itself.
185 gets the format for the server. If your application can deal with the
186 server pixmap data format, a shared memory segment and shminfo
187 structure are created.
190 points to a pixmap which you can manipulate in all of the usual ways,
191 with the added bonus of being able to edit its contents directly
192 through the shared memory segment.
195 gets the completion event value.
198 \fIMIT-SHM - The MIT Shared Memory Extension \fP