1 /************************************************************
2 
3 Copyright 1989, 1998  The Open Group
4 
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
9 documentation.
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in 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_
36 typedef unsigned long ShmSeg;
37 
38 typedef 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 
50 typedef 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 
59 Bool XShmQueryExtension(
60     Display*		/* dpy */
61 );
62 
63 int XShmGetEventBase(
64     Display* 		/* dpy */
65 );
66 
67 Bool XShmQueryVersion(
68     Display*		/* dpy */,
69     int*		/* majorVersion */,
70     int*		/* minorVersion */,
71     Bool*		/* sharedPixmaps */
72 );
73 
74 int XShmPixmapFormat(
75     Display*		/* dpy */
76 );
77 
78 Bool XShmAttach(
79     Display*		/* dpy */,
80     XShmSegmentInfo*	/* shminfo */
81 );
82 
83 Bool XShmDetach(
84     Display*		/* dpy */,
85     XShmSegmentInfo*	/* shminfo */
86 );
87 
88 Bool 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 
102 Bool XShmGetImage(
103     Display*		/* dpy */,
104     Drawable		/* d */,
105     XImage*		/* image */,
106     int			/* x */,
107     int			/* y */,
108     unsigned long	/* plane_mask */
109 );
110 
111 XImage *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 
122 Pixmap 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