Commit | Line | Data |
---|---|---|
a09e091a JB |
1 | /************************************************************************** |
2 | ||
3 | Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. | |
4 | Copyright (c) 2002-2012 Apple Computer, Inc. | |
5 | All Rights Reserved. | |
6 | ||
7 | Permission is hereby granted, free of charge, to any person obtaining a | |
8 | copy of this software and associated documentation files (the | |
9 | "Software"), to deal in the Software without restriction, including | |
10 | without limitation the rights to use, copy, modify, merge, publish, | |
11 | distribute, sub license, and/or sell copies of the Software, and to | |
12 | permit persons to whom the Software is furnished to do so, subject to | |
13 | the following conditions: | |
14 | ||
15 | The above copyright notice and this permission notice (including the | |
16 | next paragraph) shall be included in all copies or substantial portions | |
17 | of the Software. | |
18 | ||
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
20 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. | |
22 | IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR | |
23 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
24 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
25 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
26 | ||
27 | **************************************************************************/ | |
28 | ||
29 | /* | |
30 | * Authors: | |
31 | * Jens Owen <jens@precisioninsight.com> | |
32 | * Jeremy Huddleston <jeremyhu@apple.com> | |
33 | */ | |
34 | ||
35 | /* Prototypes for AppleDRI functions */ | |
36 | ||
37 | #ifndef _DRI_H_ | |
38 | #define _DRI_H_ | |
39 | ||
40 | #include <X11/Xdefs.h> | |
41 | #include "scrnintstr.h" | |
42 | #define _APPLEDRI_SERVER_ | |
43 | #include "appledri.h" | |
44 | #include <Xplugin.h> | |
45 | ||
46 | typedef void (*ClipNotifyPtr)(WindowPtr, int, int); | |
47 | ||
48 | /* | |
49 | * These functions can be wrapped by the DRI. Each of these have | |
50 | * generic default funcs (initialized in DRICreateInfoRec) and can be | |
51 | * overridden by the driver in its [driver]DRIScreenInit function. | |
52 | */ | |
53 | typedef struct { | |
54 | WindowExposuresProcPtr WindowExposures; | |
55 | CopyWindowProcPtr CopyWindow; | |
56 | ValidateTreeProcPtr ValidateTree; | |
57 | PostValidateTreeProcPtr PostValidateTree; | |
58 | ClipNotifyProcPtr ClipNotify; | |
59 | } DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; | |
60 | ||
61 | typedef struct { | |
62 | xp_surface_id id; | |
63 | int kind; | |
64 | } DRISurfaceNotifyArg; | |
65 | ||
66 | extern Bool | |
67 | DRIScreenInit(ScreenPtr pScreen); | |
68 | ||
69 | extern Bool | |
70 | DRIFinishScreenInit(ScreenPtr pScreen); | |
71 | ||
72 | extern void | |
73 | DRICloseScreen(ScreenPtr pScreen); | |
74 | ||
75 | extern Bool | |
76 | DRIExtensionInit(void); | |
77 | ||
78 | extern void | |
79 | DRIReset(void); | |
80 | ||
81 | extern Bool | |
82 | DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool *isCapable); | |
83 | ||
84 | extern Bool | |
85 | DRIAuthConnection(ScreenPtr pScreen, unsigned int magic); | |
86 | ||
87 | extern Bool DRICreateSurface(ScreenPtr pScreen, | |
88 | Drawable id, | |
89 | DrawablePtr pDrawable, | |
90 | xp_client_id client_id, | |
91 | xp_surface_id * surface_id, | |
92 | unsigned int key[2], | |
93 | void (*notify)(void *arg, void *data), | |
94 | void *notify_data); | |
95 | ||
96 | extern Bool | |
97 | DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, | |
98 | void (*notify)(void *arg, | |
99 | void *data), void *notify_data); | |
100 | ||
101 | extern Bool | |
102 | DRIDrawablePrivDelete(pointer pResource, XID id); | |
103 | ||
104 | extern DRIWrappedFuncsRec * | |
105 | DRIGetWrappedFuncs(ScreenPtr pScreen); | |
106 | ||
107 | extern void | |
108 | DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); | |
109 | ||
110 | extern int | |
111 | DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind); | |
112 | ||
113 | extern void | |
114 | DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind); | |
115 | ||
116 | extern void | |
117 | DRIClipNotify(WindowPtr pWin, int dx, int dy); | |
118 | ||
119 | extern void | |
120 | DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg); | |
121 | ||
122 | extern void | |
123 | DRISurfaceNotify(xp_surface_id id, int kind); | |
124 | ||
125 | extern void | |
126 | DRIQueryVersion(int *majorVersion, int *minorVersion, int *patchVersion); | |
127 | ||
128 | extern Bool | |
129 | DRICreatePixmap(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, | |
130 | char *path, | |
131 | size_t pathmax); | |
132 | ||
133 | extern Bool | |
134 | DRIGetPixmapData(DrawablePtr pDrawable, int *width, int *height, int *pitch, | |
135 | int *bpp, | |
136 | void **ptr); | |
137 | ||
138 | extern void | |
139 | DRIDestroyPixmap(DrawablePtr pDrawable); | |
140 | ||
141 | #endif |