1 /**************************************************************************
3 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
4 Copyright 2000 VA Linux Systems, Inc.
5 Copyright (c) 2002, 2008, 2009 Apple Computer, Inc.
8 Permission is hereby granted, free of charge, to any person obtaining a
9 copy of this software and associated documentation files (the
10 "Software"), to deal in the Software without restriction, including
11 without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sub license, and/or sell copies of the Software, and to
13 permit persons to whom the Software is furnished to do so, subject to
14 the following conditions:
16 The above copyright notice and this permission notice (including the
17 next paragraph) shall be included in all copies or substantial portions
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
23 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
24 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 **************************************************************************/
32 * Kevin E. Martin <martin@valinux.com>
33 * Jens Owen <jens@valinux.com>
34 * Rickard E. (Rik) Fiath <faith@valinux.com>
38 #ifndef _APPLEDRISTR_H_
39 #define _APPLEDRISTR_H_
43 #define APPLEDRINAME "Apple-DRI"
45 #define APPLE_DRI_MAJOR_VERSION 1 /* current version numbers */
46 #define APPLE_DRI_MINOR_VERSION 0
47 #define APPLE_DRI_PATCH_VERSION 0
49 typedef struct _AppleDRIQueryVersion
51 CARD8 reqType
; /* always DRIReqCode */
52 CARD8 driReqType
; /* always X_DRIQueryVersion */
54 } xAppleDRIQueryVersionReq
;
55 #define sz_xAppleDRIQueryVersionReq 4
59 BYTE type
; /* X_Reply */
61 CARD16 sequenceNumber B16
;
63 CARD16 majorVersion B16
; /* major version of DRI protocol */
64 CARD16 minorVersion B16
; /* minor version of DRI protocol */
65 CARD32 patchVersion B32
; /* patch version of DRI protocol */
70 } xAppleDRIQueryVersionReply
;
71 #define sz_xAppleDRIQueryVersionReply 32
73 typedef struct _AppleDRIQueryDirectRenderingCapable
75 CARD8 reqType
; /* always DRIReqCode */
76 CARD8 driReqType
; /* X_DRIQueryDirectRenderingCapable */
79 } xAppleDRIQueryDirectRenderingCapableReq
;
80 #define sz_xAppleDRIQueryDirectRenderingCapableReq 8
84 BYTE type
; /* X_Reply */
86 CARD16 sequenceNumber B16
;
97 } xAppleDRIQueryDirectRenderingCapableReply
;
98 #define sz_xAppleDRIQueryDirectRenderingCapableReply 32
100 typedef struct _AppleDRIAuthConnection
102 CARD8 reqType
; /* always DRIReqCode */
103 CARD8 driReqType
; /* always X_DRICloseConnection */
107 } xAppleDRIAuthConnectionReq
;
108 #define sz_xAppleDRIAuthConnectionReq 12
114 CARD16 sequenceNumber B16
;
116 CARD32 authenticated B32
;
122 } xAppleDRIAuthConnectionReply
;
123 #define zx_xAppleDRIAuthConnectionReply 32
125 typedef struct _AppleDRICreateSurface
127 CARD8 reqType
; /* always DRIReqCode */
128 CARD8 driReqType
; /* always X_DRICreateSurface */
132 CARD32 client_id B32
;
133 } xAppleDRICreateSurfaceReq
;
134 #define sz_xAppleDRICreateSurfaceReq 16
138 BYTE type
; /* X_Reply */
140 CARD16 sequenceNumber B16
;
148 } xAppleDRICreateSurfaceReply
;
149 #define sz_xAppleDRICreateSurfaceReply 32
151 typedef struct _AppleDRIDestroySurface
153 CARD8 reqType
; /* always DRIReqCode */
154 CARD8 driReqType
; /* always X_DRIDestroySurface */
158 } xAppleDRIDestroySurfaceReq
;
159 #define sz_xAppleDRIDestroySurfaceReq 12
161 typedef struct _AppleDRINotify
163 BYTE type
; /* always eventBase + event type */
165 CARD16 sequenceNumber B16
;
166 CARD32 time B32
; /* time of change */
173 } xAppleDRINotifyEvent
;
174 #define sz_xAppleDRINotifyEvent 32
185 CARD8 pad1
, pad2
, pad3
;
186 } xAppleDRICreateSharedBufferReq
;
188 #define sz_xAppleDRICreateSharedBufferReq 16
194 CARD16 sequenceNumber B16
;
196 CARD32 stringLength B32
; /* 0 on error */
202 } xAppleDRICreateSharedBufferReply
;
204 #define sz_xAppleDRICreateSharedBufferReply 32
213 } xAppleDRISwapBuffersReq
;
215 #define sz_xAppleDRISwapBuffersReq 12
219 CARD8 reqType
; /*1 */
220 CARD8 driReqType
; /*2 */
221 CARD16 length B16
; /*4 */
222 CARD32 screen B32
; /*8 */
223 CARD32 drawable B32
; /*12 */
224 } xAppleDRICreatePixmapReq
;
226 #define sz_xAppleDRICreatePixmapReq 12
232 CARD16 sequenceNumber B16
; /*4 */
233 CARD32 length B32
; /*8 */
234 CARD32 width B32
; /*12 */
235 CARD32 height B32
; /*16 */
236 CARD32 pitch B32
; /*20 */
237 CARD32 bpp B32
; /*24 */
238 CARD32 size B32
; /*28 */
239 CARD32 stringLength B32
; /*32 */
240 } xAppleDRICreatePixmapReply
;
242 #define sz_xAppleDRICreatePixmapReply 32
246 CARD8 reqType
; /*1 */
247 CARD8 driReqType
; /*2 */
248 CARD16 length B16
; /*4 */
249 CARD32 drawable B32
; /*8 */
250 } xAppleDRIDestroyPixmapReq
;
252 #define sz_xAppleDRIDestroyPixmapReq 8
254 #ifdef _APPLEDRI_SERVER_
256 void AppleDRISendEvent(
257 #if NeedFunctionPrototypes
259 unsigned int /* mask */ ,
265 #endif /* _APPLEDRI_SERVER_ */
266 #endif /* _APPLEDRISTR_H_ */