13464ebd5Sriastradh/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.7 2000/12/07 20:26:02 dawes Exp $ */ 23464ebd5Sriastradh/************************************************************************** 33464ebd5Sriastradh 43464ebd5SriastradhCopyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. 53464ebd5SriastradhCopyright 2000 VA Linux Systems, Inc. 63464ebd5SriastradhCopyright (c) 2002, 2008, 2009 Apple Computer, Inc. 73464ebd5SriastradhAll Rights Reserved. 83464ebd5Sriastradh 93464ebd5SriastradhPermission is hereby granted, free of charge, to any person obtaining a 103464ebd5Sriastradhcopy of this software and associated documentation files (the 113464ebd5Sriastradh"Software"), to deal in the Software without restriction, including 123464ebd5Sriastradhwithout limitation the rights to use, copy, modify, merge, publish, 133464ebd5Sriastradhdistribute, sub license, and/or sell copies of the Software, and to 143464ebd5Sriastradhpermit persons to whom the Software is furnished to do so, subject to 153464ebd5Sriastradhthe following conditions: 163464ebd5Sriastradh 173464ebd5SriastradhThe above copyright notice and this permission notice (including the 183464ebd5Sriastradhnext paragraph) shall be included in all copies or substantial portions 193464ebd5Sriastradhof the Software. 203464ebd5Sriastradh 213464ebd5SriastradhTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 223464ebd5SriastradhOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 233464ebd5SriastradhMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 243464ebd5SriastradhIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR 253464ebd5SriastradhANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 263464ebd5SriastradhTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 273464ebd5SriastradhSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 283464ebd5Sriastradh 293464ebd5Sriastradh**************************************************************************/ 303464ebd5Sriastradh 313464ebd5Sriastradh/* 323464ebd5Sriastradh * Authors: 333464ebd5Sriastradh * Kevin E. Martin <martin@valinux.com> 343464ebd5Sriastradh * Jens Owen <jens@valinux.com> 353464ebd5Sriastradh * Rickard E. (Rik) Faith <faith@valinux.com> 363464ebd5Sriastradh * 373464ebd5Sriastradh */ 383464ebd5Sriastradh 393464ebd5Sriastradh#ifndef _APPLEDRI_H_ 403464ebd5Sriastradh#define _APPLEDRI_H_ 413464ebd5Sriastradh 423464ebd5Sriastradh#include <X11/Xlib.h> 433464ebd5Sriastradh#include <X11/Xfuncproto.h> 443464ebd5Sriastradh 453464ebd5Sriastradh#define X_AppleDRIQueryVersion 0 463464ebd5Sriastradh#define X_AppleDRIQueryDirectRenderingCapable 1 473464ebd5Sriastradh#define X_AppleDRICreateSurface 2 483464ebd5Sriastradh#define X_AppleDRIDestroySurface 3 493464ebd5Sriastradh#define X_AppleDRIAuthConnection 4 503464ebd5Sriastradh#define X_AppleDRICreateSharedBuffer 5 513464ebd5Sriastradh#define X_AppleDRISwapBuffers 6 523464ebd5Sriastradh#define X_AppleDRICreatePixmap 7 533464ebd5Sriastradh#define X_AppleDRIDestroyPixmap 8 543464ebd5Sriastradh 553464ebd5Sriastradh/* Requests up to and including 18 were used in a previous version */ 563464ebd5Sriastradh 573464ebd5Sriastradh/* Events */ 583464ebd5Sriastradh#define AppleDRIObsoleteEvent1 0 593464ebd5Sriastradh#define AppleDRIObsoleteEvent2 1 603464ebd5Sriastradh#define AppleDRIObsoleteEvent3 2 613464ebd5Sriastradh#define AppleDRISurfaceNotify 3 623464ebd5Sriastradh#define AppleDRINumberEvents 4 633464ebd5Sriastradh 643464ebd5Sriastradh/* Errors */ 653464ebd5Sriastradh#define AppleDRIClientNotLocal 0 663464ebd5Sriastradh#define AppleDRIOperationNotSupported 1 673464ebd5Sriastradh#define AppleDRINumberErrors (AppleDRIOperationNotSupported + 1) 683464ebd5Sriastradh 693464ebd5Sriastradh/* Kinds of SurfaceNotify events: */ 703464ebd5Sriastradh#define AppleDRISurfaceNotifyChanged 0 713464ebd5Sriastradh#define AppleDRISurfaceNotifyDestroyed 1 723464ebd5Sriastradh 733464ebd5Sriastradh#ifndef _APPLEDRI_SERVER_ 743464ebd5Sriastradh 753464ebd5Sriastradhtypedef struct 763464ebd5Sriastradh{ 773464ebd5Sriastradh int type; /* of event */ 783464ebd5Sriastradh unsigned long serial; /* # of last request processed by server */ 793464ebd5Sriastradh Bool send_event; /* true if this came frome a SendEvent request */ 803464ebd5Sriastradh Display *display; /* Display the event was read from */ 813464ebd5Sriastradh Window window; /* window of event */ 823464ebd5Sriastradh Time time; /* server timestamp when event happened */ 833464ebd5Sriastradh int kind; /* subtype of event */ 843464ebd5Sriastradh int arg; 853464ebd5Sriastradh} XAppleDRINotifyEvent; 863464ebd5Sriastradh 873464ebd5Sriastradh_XFUNCPROTOBEGIN 883464ebd5Sriastradh Bool XAppleDRIQueryExtension(Display * dpy, int *event_base, 893464ebd5Sriastradh int *error_base); 903464ebd5Sriastradh 913464ebd5SriastradhBool XAppleDRIQueryVersion(Display * dpy, int *majorVersion, 923464ebd5Sriastradh int *minorVersion, int *patchVersion); 933464ebd5Sriastradh 943464ebd5SriastradhBool XAppleDRIQueryDirectRenderingCapable(Display * dpy, int screen, 953464ebd5Sriastradh Bool * isCapable); 963464ebd5Sriastradh 973464ebd5Sriastradhvoid *XAppleDRISetSurfaceNotifyHandler(void (*fun) (Display * dpy, 983464ebd5Sriastradh unsigned uid, int kind)); 993464ebd5Sriastradh 1003464ebd5SriastradhBool XAppleDRIAuthConnection(Display * dpy, int screen, unsigned int magic); 1013464ebd5Sriastradh 1023464ebd5SriastradhBool XAppleDRICreateSurface(Display * dpy, int screen, Drawable drawable, 1033464ebd5Sriastradh unsigned int client_id, unsigned int key[2], 1043464ebd5Sriastradh unsigned int *uid); 1053464ebd5Sriastradh 1063464ebd5SriastradhBool XAppleDRIDestroySurface(Display * dpy, int screen, Drawable drawable); 1073464ebd5Sriastradh 1083464ebd5SriastradhBool XAppleDRISynchronizeSurfaces(Display * dpy); 1093464ebd5Sriastradh 1103464ebd5SriastradhBool XAppleDRICreateSharedBuffer(Display * dpy, int screen, Drawable drawable, 1113464ebd5Sriastradh Bool doubleSwap, char *path, size_t pathlen, 1123464ebd5Sriastradh int *width, int *height); 1133464ebd5Sriastradh 1143464ebd5SriastradhBool XAppleDRISwapBuffers(Display * dpy, int screen, Drawable drawable); 1153464ebd5Sriastradh 1163464ebd5SriastradhBool XAppleDRICreatePixmap(Display * dpy, int screen, Drawable drawable, 1173464ebd5Sriastradh int *width, int *height, int *pitch, int *bpp, 1183464ebd5Sriastradh size_t * size, char *bufname, size_t bufnamesize); 1193464ebd5Sriastradh 1203464ebd5SriastradhBool XAppleDRIDestroyPixmap(Display * dpy, Pixmap pixmap); 1213464ebd5Sriastradh 1223464ebd5Sriastradh_XFUNCPROTOEND 1233464ebd5Sriastradh#endif /* _APPLEDRI_SERVER_ */ 1243464ebd5Sriastradh#endif /* _APPLEDRI_H_ */ 125