1 /* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.7 2000/12/07 20:26:02 dawes Exp $ */
2 /**************************************************************************
4 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
5 Copyright 2000 VA Linux Systems, Inc.
6 Copyright (c) 2002, 2008, 2009 Apple Computer, Inc.
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sub license, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 **************************************************************************/
33 * Kevin E. Martin <martin@valinux.com>
34 * Jens Owen <jens@valinux.com>
35 * Rickard E. (Rik) Faith <faith@valinux.com>
43 #include <X11/Xfuncproto.h>
45 #define X_AppleDRIQueryVersion 0
46 #define X_AppleDRIQueryDirectRenderingCapable 1
47 #define X_AppleDRICreateSurface 2
48 #define X_AppleDRIDestroySurface 3
49 #define X_AppleDRIAuthConnection 4
50 #define X_AppleDRICreateSharedBuffer 5
51 #define X_AppleDRISwapBuffers 6
52 #define X_AppleDRICreatePixmap 7
53 #define X_AppleDRIDestroyPixmap 8
55 /* Requests up to and including 18 were used in a previous version */
58 #define AppleDRIObsoleteEvent1 0
59 #define AppleDRIObsoleteEvent2 1
60 #define AppleDRIObsoleteEvent3 2
61 #define AppleDRISurfaceNotify 3
62 #define AppleDRINumberEvents 4
65 #define AppleDRIClientNotLocal 0
66 #define AppleDRIOperationNotSupported 1
67 #define AppleDRINumberErrors (AppleDRIOperationNotSupported + 1)
69 /* Kinds of SurfaceNotify events: */
70 #define AppleDRISurfaceNotifyChanged 0
71 #define AppleDRISurfaceNotifyDestroyed 1
73 #ifndef _APPLEDRI_SERVER_
77 int type
; /* of event */
78 unsigned long serial
; /* # of last request processed by server */
79 Bool send_event
; /* true if this came frome a SendEvent request */
80 Display
*display
; /* Display the event was read from */
81 Window window
; /* window of event */
82 Time time
; /* server timestamp when event happened */
83 int kind
; /* subtype of event */
85 } XAppleDRINotifyEvent
;
88 Bool
XAppleDRIQueryExtension(Display
* dpy
, int *event_base
,
91 Bool
XAppleDRIQueryVersion(Display
* dpy
, int *majorVersion
,
92 int *minorVersion
, int *patchVersion
);
94 Bool
XAppleDRIQueryDirectRenderingCapable(Display
* dpy
, int screen
,
97 void *XAppleDRISetSurfaceNotifyHandler(void (*fun
) (Display
* dpy
,
98 unsigned uid
, int kind
));
100 Bool
XAppleDRIAuthConnection(Display
* dpy
, int screen
, unsigned int magic
);
102 Bool
XAppleDRICreateSurface(Display
* dpy
, int screen
, Drawable drawable
,
103 unsigned int client_id
, unsigned int key
[2],
106 Bool
XAppleDRIDestroySurface(Display
* dpy
, int screen
, Drawable drawable
);
108 Bool
XAppleDRISynchronizeSurfaces(Display
* dpy
);
110 Bool
XAppleDRICreateSharedBuffer(Display
* dpy
, int screen
, Drawable drawable
,
111 Bool doubleSwap
, char *path
, size_t pathlen
,
112 int *width
, int *height
);
114 Bool
XAppleDRISwapBuffers(Display
* dpy
, int screen
, Drawable drawable
);
116 Bool
XAppleDRICreatePixmap(Display
* dpy
, int screen
, Drawable drawable
,
117 int *width
, int *height
, int *pitch
, int *bpp
,
118 size_t * size
, char *bufname
, size_t bufnamesize
);
120 Bool
XAppleDRIDestroyPixmap(Display
* dpy
, Pixmap pixmap
);
123 #endif /* _APPLEDRI_SERVER_ */
124 #endif /* _APPLEDRI_H_ */