blob: b58ca63732f94e4c4e3cd2b3e5407eb8b42b83c5 [file] [log] [blame]
David 'Digit' Turner1b0544d2014-03-27 13:51:24 +01001/* $XFree86: xc/include/extensions/XShm.h,v 1.11 2003/04/03 15:11:07 dawes Exp $ */
2/************************************************************
3
4Copyright 1989, 1998 The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall not be
23used in advertising or otherwise to promote the sale, use or other dealings
24in 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#include <X11/extensions/shm.h>
37
38typedef unsigned long ShmSeg;
39
40typedef struct {
41 int type; /* of event */
42 unsigned long serial; /* # of last request processed by server */
43 Bool send_event; /* true if this came frome a SendEvent request */
44 Display *display; /* Display the event was read from */
45 Drawable drawable; /* drawable of request */
46 int major_code; /* ShmReqCode */
47 int minor_code; /* X_ShmPutImage */
48 ShmSeg shmseg; /* the ShmSeg used in the request */
49 unsigned long offset; /* the offset into ShmSeg used in the request */
50} XShmCompletionEvent;
51
52typedef struct {
53 ShmSeg shmseg; /* resource id */
54 int shmid; /* kernel id */
55 char *shmaddr; /* address in client */
56 Bool readOnly; /* how the server should attach it */
57} XShmSegmentInfo;
58
59_XFUNCPROTOBEGIN
60
61Bool XShmQueryExtension(
62 Display* /* dpy */
63);
64
65int XShmGetEventBase(
66 Display* /* dpy */
67);
68
69Bool XShmQueryVersion(
70 Display* /* dpy */,
71 int* /* majorVersion */,
72 int* /* minorVersion */,
73 Bool* /* sharedPixmaps */
74);
75
76int XShmPixmapFormat(
77 Display* /* dpy */
78);
79
80Status XShmAttach(
81 Display* /* dpy */,
82 XShmSegmentInfo* /* shminfo */
83);
84
85Status XShmDetach(
86 Display* /* dpy */,
87 XShmSegmentInfo* /* shminfo */
88);
89
90Status XShmPutImage(
91 Display* /* dpy */,
92 Drawable /* d */,
93 GC /* gc */,
94 XImage* /* image */,
95 int /* src_x */,
96 int /* src_y */,
97 int /* dst_x */,
98 int /* dst_y */,
99 unsigned int /* src_width */,
100 unsigned int /* src_height */,
101 Bool /* send_event */
102);
103
104Status XShmGetImage(
105 Display* /* dpy */,
106 Drawable /* d */,
107 XImage* /* image */,
108 int /* x */,
109 int /* y */,
110 unsigned long /* plane_mask */
111);
112
113XImage *XShmCreateImage(
114 Display* /* dpy */,
115 Visual* /* visual */,
116 unsigned int /* depth */,
117 int /* format */,
118 char* /* data */,
119 XShmSegmentInfo* /* shminfo */,
120 unsigned int /* width */,
121 unsigned int /* height */
122);
123
124Pixmap XShmCreatePixmap(
125 Display* /* dpy */,
126 Drawable /* d */,
127 char* /* data */,
128 XShmSegmentInfo* /* shminfo */,
129 unsigned int /* width */,
130 unsigned int /* height */,
131 unsigned int /* depth */
132);
133
134_XFUNCPROTOEND
135
136#endif