14642e01fSmrg/************************************************************************** 24642e01fSmrg 335c4bbdfSmrg Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. 435c4bbdfSmrg Copyright (c) 2002-2012 Apple Computer, Inc. 535c4bbdfSmrg All Rights Reserved. 635c4bbdfSmrg 735c4bbdfSmrg Permission is hereby granted, free of charge, to any person obtaining a 835c4bbdfSmrg copy of this software and associated documentation files (the 935c4bbdfSmrg "Software"), to deal in the Software without restriction, including 1035c4bbdfSmrg without limitation the rights to use, copy, modify, merge, publish, 1135c4bbdfSmrg distribute, sub license, and/or sell copies of the Software, and to 1235c4bbdfSmrg permit persons to whom the Software is furnished to do so, subject to 1335c4bbdfSmrg the following conditions: 1435c4bbdfSmrg 1535c4bbdfSmrg The above copyright notice and this permission notice (including the 1635c4bbdfSmrg next paragraph) shall be included in all copies or substantial portions 1735c4bbdfSmrg of the Software. 1835c4bbdfSmrg 1935c4bbdfSmrg THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 2035c4bbdfSmrg OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2135c4bbdfSmrg MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 2235c4bbdfSmrg IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR 2335c4bbdfSmrg ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 2435c4bbdfSmrg TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 2535c4bbdfSmrg SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 264642e01fSmrg 274642e01fSmrg**************************************************************************/ 284642e01fSmrg 294642e01fSmrg/* 304642e01fSmrg * Authors: 314642e01fSmrg * Jens Owen <jens@precisioninsight.com> 3235c4bbdfSmrg * Jeremy Huddleston <jeremyhu@apple.com> 334642e01fSmrg */ 344642e01fSmrg 354642e01fSmrg/* Prototypes for AppleDRI functions */ 364642e01fSmrg 374642e01fSmrg#ifndef _DRI_H_ 384642e01fSmrg#define _DRI_H_ 394642e01fSmrg 404642e01fSmrg#include <X11/Xdefs.h> 414642e01fSmrg#include "scrnintstr.h" 424642e01fSmrg#define _APPLEDRI_SERVER_ 434642e01fSmrg#include "appledri.h" 444642e01fSmrg#include <Xplugin.h> 454642e01fSmrg 4635c4bbdfSmrgtypedef void (*ClipNotifyPtr)(WindowPtr, int, int); 474642e01fSmrg 484642e01fSmrg/* 494642e01fSmrg * These functions can be wrapped by the DRI. Each of these have 504642e01fSmrg * generic default funcs (initialized in DRICreateInfoRec) and can be 514642e01fSmrg * overridden by the driver in its [driver]DRIScreenInit function. 524642e01fSmrg */ 534642e01fSmrgtypedef struct { 5435c4bbdfSmrg CopyWindowProcPtr CopyWindow; 5535c4bbdfSmrg ClipNotifyProcPtr ClipNotify; 564642e01fSmrg} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; 574642e01fSmrg 584642e01fSmrgtypedef struct { 594642e01fSmrg xp_surface_id id; 604642e01fSmrg int kind; 614642e01fSmrg} DRISurfaceNotifyArg; 624642e01fSmrg 6335c4bbdfSmrgextern Bool 6435c4bbdfSmrgDRIScreenInit(ScreenPtr pScreen); 654642e01fSmrg 6635c4bbdfSmrgextern Bool 6735c4bbdfSmrgDRIFinishScreenInit(ScreenPtr pScreen); 684642e01fSmrg 6935c4bbdfSmrgextern void 7035c4bbdfSmrgDRICloseScreen(ScreenPtr pScreen); 714642e01fSmrg 7235c4bbdfSmrgextern Bool 7335c4bbdfSmrgDRIExtensionInit(void); 744642e01fSmrg 7535c4bbdfSmrgextern void 7635c4bbdfSmrgDRIReset(void); 774642e01fSmrg 7835c4bbdfSmrgextern Bool 7935c4bbdfSmrgDRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool *isCapable); 804642e01fSmrg 8135c4bbdfSmrgextern Bool 8235c4bbdfSmrgDRIAuthConnection(ScreenPtr pScreen, unsigned int magic); 834642e01fSmrg 844642e01fSmrgextern Bool DRICreateSurface(ScreenPtr pScreen, 854642e01fSmrg Drawable id, 864642e01fSmrg DrawablePtr pDrawable, 874642e01fSmrg xp_client_id client_id, 8835c4bbdfSmrg xp_surface_id * surface_id, 894642e01fSmrg unsigned int key[2], 9035c4bbdfSmrg void (*notify)(void *arg, void *data), 914642e01fSmrg void *notify_data); 924642e01fSmrg 9335c4bbdfSmrgextern Bool 9435c4bbdfSmrgDRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, 9535c4bbdfSmrg void (*notify)(void *arg, 9635c4bbdfSmrg void *data), void *notify_data); 974642e01fSmrg 9835c4bbdfSmrgextern Bool 9935c4bbdfSmrgDRIDrawablePrivDelete(void *pResource, XID id); 1004642e01fSmrg 10135c4bbdfSmrgextern DRIWrappedFuncsRec * 10235c4bbdfSmrgDRIGetWrappedFuncs(ScreenPtr pScreen); 1034642e01fSmrg 10435c4bbdfSmrgextern void 10535c4bbdfSmrgDRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); 1064642e01fSmrg 10735c4bbdfSmrgextern void 10835c4bbdfSmrgDRIClipNotify(WindowPtr pWin, int dx, int dy); 1094642e01fSmrg 11035c4bbdfSmrgextern void 11135c4bbdfSmrgDRISurfaceNotify(xp_surface_id id, int kind); 1124642e01fSmrg 11335c4bbdfSmrgextern void 11435c4bbdfSmrgDRIQueryVersion(int *majorVersion, int *minorVersion, int *patchVersion); 1156747b715Smrg 11635c4bbdfSmrgextern Bool 11735c4bbdfSmrgDRICreatePixmap(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, 11835c4bbdfSmrg char *path, 11935c4bbdfSmrg size_t pathmax); 1206747b715Smrg 12135c4bbdfSmrgextern Bool 12235c4bbdfSmrgDRIGetPixmapData(DrawablePtr pDrawable, int *width, int *height, int *pitch, 12335c4bbdfSmrg int *bpp, 12435c4bbdfSmrg void **ptr); 1256747b715Smrg 12635c4bbdfSmrgextern void 12735c4bbdfSmrgDRIDestroyPixmap(DrawablePtr pDrawable); 1286747b715Smrg 1294642e01fSmrg#endif 130