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
27/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
28
29#ifndef _XSHM_H_
30#define _XSHM_H_
31
32#include <X11/Xfuncproto.h>
33#include <X11/extensions/shm.h>
34
35#ifndef _XSHM_SERVER_
36typedef unsigned long ShmSeg;
37
38typedef struct {
39 int type; /* of event */
40 unsigned long serial; /* # of last request processed by server */
41 Bool send_event; /* true if this came frome a SendEvent request */
42 Display *display; /* Display the event was read from */
43 Drawable drawable; /* drawable of request */
44 int major_code; /* ShmReqCode */
45 int minor_code; /* X_ShmPutImage */
46 ShmSeg shmseg; /* the ShmSeg used in the request */
47 unsigned long offset; /* the offset into ShmSeg used in the request */
48} XShmCompletionEvent;
49
50typedef struct {
51 ShmSeg shmseg; /* resource id */
52 int shmid; /* kernel id */
53 char *shmaddr; /* address in client */
54 Bool readOnly; /* how the server should attach it */
55} XShmSegmentInfo;
56
57_XFUNCPROTOBEGIN
58
59Bool XShmQueryExtension(
60 Display* /* dpy */
61);
62
63int XShmGetEventBase(
64 Display* /* dpy */
65);
66
67Bool XShmQueryVersion(
68 Display* /* dpy */,
69 int* /* majorVersion */,
70 int* /* minorVersion */,
71 Bool* /* sharedPixmaps */
72);
73
74int XShmPixmapFormat(
75 Display* /* dpy */
76);
77
78Bool XShmAttach(
79 Display* /* dpy */,
80 XShmSegmentInfo* /* shminfo */
81);
82
83Bool XShmDetach(
84 Display* /* dpy */,
85 XShmSegmentInfo* /* shminfo */
86);
87
88Bool XShmPutImage(
89 Display* /* dpy */,
90 Drawable /* d */,
91 GC /* gc */,
92 XImage* /* image */,
93 int /* src_x */,
94 int /* src_y */,
95 int /* dst_x */,
96 int /* dst_y */,
97 unsigned int /* src_width */,
98 unsigned int /* src_height */,
99 Bool /* send_event */
100);
101
102Bool XShmGetImage(
103 Display* /* dpy */,
104 Drawable /* d */,
105 XImage* /* image */,
106 int /* x */,
107 int /* y */,
108 unsigned long /* plane_mask */
109);
110
111XImage *XShmCreateImage(
112 Display* /* dpy */,
113 Visual* /* visual */,
114 unsigned int /* depth */,
115 int /* format */,
116 char* /* data */,
117 XShmSegmentInfo* /* shminfo */,
118 unsigned int /* width */,
119 unsigned int /* height */
120);
121
122Pixmap XShmCreatePixmap(
123 Display* /* dpy */,
124 Drawable /* d */,
125 char* /* data */,
126 XShmSegmentInfo* /* shminfo */,
127 unsigned int /* width */,
128 unsigned int /* height */,
129 unsigned int /* depth */
130);
131
132_XFUNCPROTOEND
133#endif /* _XSHM_SERVER_ */
134
135#endif
136