1706f2543Smrg/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.7 2000/12/07 20:26:02 dawes Exp $ */
2706f2543Smrg/**************************************************************************
3706f2543Smrg
4706f2543SmrgCopyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
5706f2543SmrgCopyright 2000 VA Linux Systems, Inc.
6706f2543SmrgCopyright (c) 2002, 2008, 2009 Apple Computer, Inc.
7706f2543SmrgAll Rights Reserved.
8706f2543Smrg
9706f2543SmrgPermission is hereby granted, free of charge, to any person obtaining a
10706f2543Smrgcopy of this software and associated documentation files (the
11706f2543Smrg"Software"), to deal in the Software without restriction, including
12706f2543Smrgwithout limitation the rights to use, copy, modify, merge, publish,
13706f2543Smrgdistribute, sub license, and/or sell copies of the Software, and to
14706f2543Smrgpermit persons to whom the Software is furnished to do so, subject to
15706f2543Smrgthe following conditions:
16706f2543Smrg
17706f2543SmrgThe above copyright notice and this permission notice (including the
18706f2543Smrgnext paragraph) shall be included in all copies or substantial portions
19706f2543Smrgof the Software.
20706f2543Smrg
21706f2543SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22706f2543SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23706f2543SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24706f2543SmrgIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25706f2543SmrgANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26706f2543SmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27706f2543SmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28706f2543Smrg
29706f2543Smrg**************************************************************************/
30706f2543Smrg
31706f2543Smrg/*
32706f2543Smrg * Authors:
33706f2543Smrg *   Kevin E. Martin <martin@valinux.com>
34706f2543Smrg *   Jens Owen <jens@valinux.com>
35706f2543Smrg *   Rickard E. (Rik) Faith <faith@valinux.com>
36706f2543Smrg *
37706f2543Smrg */
38706f2543Smrg
39706f2543Smrg#ifndef _APPLEDRI_H_
40706f2543Smrg#define _APPLEDRI_H_
41706f2543Smrg
42706f2543Smrg#include <X11/Xfuncproto.h>
43706f2543Smrg
44706f2543Smrg#define X_AppleDRIQueryVersion			0
45706f2543Smrg#define X_AppleDRIQueryDirectRenderingCapable	1
46706f2543Smrg#define X_AppleDRICreateSurface			2
47706f2543Smrg#define X_AppleDRIDestroySurface		3
48706f2543Smrg#define X_AppleDRIAuthConnection                4
49706f2543Smrg#define X_AppleDRICreateSharedBuffer            5
50706f2543Smrg#define X_AppleDRISwapBuffers                   6
51706f2543Smrg#define X_AppleDRICreatePixmap                  7
52706f2543Smrg#define X_AppleDRIDestroyPixmap                 8
53706f2543Smrg
54706f2543Smrg/* Requests up to and including 18 were used in a previous version */
55706f2543Smrg
56706f2543Smrg/* Events */
57706f2543Smrg#define AppleDRIObsoleteEvent1		0
58706f2543Smrg#define AppleDRIObsoleteEvent2		1
59706f2543Smrg#define AppleDRIObsoleteEvent3		2
60706f2543Smrg#define AppleDRISurfaceNotify		3
61706f2543Smrg#define AppleDRINumberEvents		4
62706f2543Smrg
63706f2543Smrg/* Errors */
64706f2543Smrg#define AppleDRIClientNotLocal		0
65706f2543Smrg#define AppleDRIOperationNotSupported	1
66706f2543Smrg#define AppleDRINumberErrors		(AppleDRIOperationNotSupported + 1)
67706f2543Smrg
68706f2543Smrg/* Kinds of SurfaceNotify events: */
69706f2543Smrg#define AppleDRISurfaceNotifyChanged	0
70706f2543Smrg#define AppleDRISurfaceNotifyDestroyed	1
71706f2543Smrg
72706f2543Smrg#ifndef _APPLEDRI_SERVER_
73706f2543Smrg
74706f2543Smrgtypedef struct {
75706f2543Smrg    int	type;		    /* of event */
76706f2543Smrg    unsigned long serial;   /* # of last request processed by server */
77706f2543Smrg    Bool send_event;	    /* true if this came frome a SendEvent request */
78706f2543Smrg    Display *display;	    /* Display the event was read from */
79706f2543Smrg    Window window;	    /* window of event */
80706f2543Smrg    Time time;		    /* server timestamp when event happened */
81706f2543Smrg    int kind;		    /* subtype of event */
82706f2543Smrg    int arg;
83706f2543Smrg} XAppleDRINotifyEvent;
84706f2543Smrg
85706f2543Smrg_XFUNCPROTOBEGIN
86706f2543Smrg
87706f2543SmrgBool XAppleDRIQueryExtension (Display *dpy, int *event_base, int *error_base);
88706f2543Smrg
89706f2543SmrgBool XAppleDRIQueryVersion (Display *dpy, int *majorVersion,
90706f2543Smrg			    int *minorVersion, int *patchVersion);
91706f2543Smrg
92706f2543SmrgBool XAppleDRIQueryDirectRenderingCapable (Display *dpy, int screen,
93706f2543Smrg					   Bool *isCapable);
94706f2543Smrg
95706f2543Smrgvoid *XAppleDRISetSurfaceNotifyHandler (void (*fun) (Display *dpy,
96706f2543Smrg						     unsigned uid, int kind));
97706f2543Smrg
98706f2543SmrgBool XAppleDRIAuthConnection (Display *dpy, int screen, unsigned int magic);
99706f2543Smrg
100706f2543SmrgBool XAppleDRICreateSurface (Display *dpy, int screen, Drawable drawable,
101706f2543Smrg			     unsigned int client_id, unsigned int key[2],
102706f2543Smrg			     unsigned int* uid);
103706f2543Smrg
104706f2543SmrgBool XAppleDRIDestroySurface (Display *dpy, int screen, Drawable drawable);
105706f2543Smrg
106706f2543SmrgBool XAppleDRISynchronizeSurfaces (Display *dpy);
107706f2543Smrg
108706f2543SmrgBool XAppleDRICreateSharedBuffer(Display *dpy, int screen, Drawable drawable,
109706f2543Smrg				 Bool doubleSwap, char *path, size_t pathlen,
110706f2543Smrg				 int *width, int *height);
111706f2543Smrg
112706f2543SmrgBool XAppleDRISwapBuffers(Display *dpy, int screen, Drawable drawable);
113706f2543Smrg
114706f2543SmrgBool XAppleDRICreatePixmap(Display *dpy, int screen, Drawable drawable,
115706f2543Smrg			   int *width, int *height, int *pitch, int *bpp,
116706f2543Smrg			   size_t *size, char *bufname, size_t bufnamesize);
117706f2543Smrg
118706f2543SmrgBool XAppleDRIDestroyPixmap(Display *dpy, Pixmap pixmap);
119706f2543Smrg
120706f2543Smrg_XFUNCPROTOEND
121706f2543Smrg
122706f2543Smrg#endif /* _APPLEDRI_SERVER_ */
123706f2543Smrg#endif /* _APPLEDRI_H_ */
124