1 | /* $XFree86: xc/programs/Xserver/afb/afb.h,v 3.8 2001/10/28 03:32:57 tsi Exp $ */
|
---|
2 | /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
---|
3 | /***********************************************************
|
---|
4 |
|
---|
5 | Copyright (c) 1987 X Consortium
|
---|
6 |
|
---|
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
|
---|
8 | of this software and associated documentation files (the "Software"), to deal
|
---|
9 | in the Software without restriction, including without limitation the rights
|
---|
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
11 | copies of the Software, and to permit persons to whom the Software is
|
---|
12 | furnished to do so, subject to the following conditions:
|
---|
13 |
|
---|
14 | The above copyright notice and this permission notice shall be included in
|
---|
15 | all copies or substantial portions of the Software.
|
---|
16 |
|
---|
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
20 | X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
21 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
23 |
|
---|
24 | Except as contained in this notice, the name of the X Consortium shall not be
|
---|
25 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
26 | in this Software without prior written authorization from the X Consortium.
|
---|
27 |
|
---|
28 |
|
---|
29 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
30 |
|
---|
31 | All Rights Reserved
|
---|
32 |
|
---|
33 | Permission to use, copy, modify, and distribute this software and its
|
---|
34 | documentation for any purpose and without fee is hereby granted,
|
---|
35 | provided that the above copyright notice appear in all copies and that
|
---|
36 | both that copyright notice and this permission notice appear in
|
---|
37 | supporting documentation, and that the name of Digital not be
|
---|
38 | used in advertising or publicity pertaining to distribution of the
|
---|
39 | software without specific, written prior permission.
|
---|
40 |
|
---|
41 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
42 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
43 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
44 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
45 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
46 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
47 | SOFTWARE.
|
---|
48 |
|
---|
49 | ******************************************************************/
|
---|
50 | /* $XConsortium: afb.h,v 5.31 94/04/17 20:28:15 dpw Exp $ */
|
---|
51 | /* Monochrome Frame Buffer definitions
|
---|
52 | written by drewry, september 1986
|
---|
53 | */
|
---|
54 |
|
---|
55 | #include "pixmap.h"
|
---|
56 | #include "region.h"
|
---|
57 | #include "gc.h"
|
---|
58 | #include "colormap.h"
|
---|
59 | #include "miscstruct.h"
|
---|
60 | #include "mibstore.h"
|
---|
61 | #include "mfb.h"
|
---|
62 |
|
---|
63 | extern int afbInverseAlu[];
|
---|
64 | extern int afbScreenPrivateIndex;
|
---|
65 | /* warning: PixelType definition duplicated in maskbits.h */
|
---|
66 | #ifndef PixelType
|
---|
67 | #define PixelType CARD32
|
---|
68 | #endif /* PixelType */
|
---|
69 |
|
---|
70 | #define AFB_MAX_DEPTH 8
|
---|
71 |
|
---|
72 | /* afbbitblt.c */
|
---|
73 |
|
---|
74 | extern void afbDoBitblt(
|
---|
75 | #if NeedFunctionPrototypes
|
---|
76 | DrawablePtr /*pSrc*/,
|
---|
77 | DrawablePtr /*pDst*/,
|
---|
78 | int /*alu*/,
|
---|
79 | RegionPtr /*prgnDst*/,
|
---|
80 | DDXPointPtr /*pptSrc*/,
|
---|
81 | unsigned long /*planemask*/
|
---|
82 | #endif
|
---|
83 | );
|
---|
84 |
|
---|
85 | extern RegionPtr afbBitBlt(
|
---|
86 | #if NeedFunctionPrototypes
|
---|
87 | DrawablePtr /*pSrc*/,
|
---|
88 | DrawablePtr /*pDst*/,
|
---|
89 | GCPtr /*pGC*/,
|
---|
90 | int /*srcx*/,
|
---|
91 | int /*srcy*/,
|
---|
92 | int /*width*/,
|
---|
93 | int /*height*/,
|
---|
94 | int /*dstx*/,
|
---|
95 | int /*dsty*/,
|
---|
96 | void (*doBitBlt)(
|
---|
97 | #if NeedNestedPrototypes
|
---|
98 | DrawablePtr /*pSrc*/,
|
---|
99 | DrawablePtr /*pDst*/,
|
---|
100 | int /*alu*/,
|
---|
101 | RegionPtr /*prgnDst*/,
|
---|
102 | DDXPointPtr /*pptSrc*/,
|
---|
103 | unsigned long /*planemask*/
|
---|
104 | #endif
|
---|
105 | ),
|
---|
106 | unsigned long /*planemask*/
|
---|
107 | #endif
|
---|
108 | );
|
---|
109 |
|
---|
110 | extern RegionPtr afbCopyArea(
|
---|
111 | #if NeedFunctionPrototypes
|
---|
112 | DrawablePtr /*pSrcDrawable*/,
|
---|
113 | DrawablePtr /*pDstDrawable*/,
|
---|
114 | GCPtr/*pGC*/,
|
---|
115 | int /*srcx*/,
|
---|
116 | int /*srcy*/,
|
---|
117 | int /*width*/,
|
---|
118 | int /*height*/,
|
---|
119 | int /*dstx*/,
|
---|
120 | int /*dsty*/
|
---|
121 | #endif
|
---|
122 | );
|
---|
123 |
|
---|
124 | extern RegionPtr afbCopyPlane(
|
---|
125 | #if NeedFunctionPrototypes
|
---|
126 | DrawablePtr /*pSrcDrawable*/,
|
---|
127 | DrawablePtr /*pDstDrawable*/,
|
---|
128 | GCPtr/*pGC*/,
|
---|
129 | int /*srcx*/,
|
---|
130 | int /*srcy*/,
|
---|
131 | int /*width*/,
|
---|
132 | int /*height*/,
|
---|
133 | int /*dstx*/,
|
---|
134 | int /*dsty*/,
|
---|
135 | unsigned long /*plane*/
|
---|
136 | #endif
|
---|
137 | );
|
---|
138 |
|
---|
139 | extern void afbCopy1ToN(
|
---|
140 | #if NeedFunctionPrototypes
|
---|
141 | DrawablePtr /*pSrc*/,
|
---|
142 | DrawablePtr /*pDst*/,
|
---|
143 | int /*alu*/,
|
---|
144 | RegionPtr /*prgnDst*/,
|
---|
145 | DDXPointPtr /*pptSrc*/,
|
---|
146 | unsigned long /*planemask*/
|
---|
147 | #endif
|
---|
148 | );
|
---|
149 | /* afbbltC.c */
|
---|
150 |
|
---|
151 | extern void afbDoBitbltCopy(
|
---|
152 | #if NeedFunctionPrototypes
|
---|
153 | DrawablePtr /*pSrc*/,
|
---|
154 | DrawablePtr /*pDst*/,
|
---|
155 | int /*alu*/,
|
---|
156 | RegionPtr /*prgnDst*/,
|
---|
157 | DDXPointPtr /*pptSrc*/,
|
---|
158 | unsigned long /*planemask*/
|
---|
159 | #endif
|
---|
160 | );
|
---|
161 | /* afbbltCI.c */
|
---|
162 |
|
---|
163 | extern void afbDoBitbltCopyInverted(
|
---|
164 | #if NeedFunctionPrototypes
|
---|
165 | DrawablePtr /*pSrc*/,
|
---|
166 | DrawablePtr /*pDst*/,
|
---|
167 | int /*alu*/,
|
---|
168 | RegionPtr /*prgnDst*/,
|
---|
169 | DDXPointPtr /*pptSrc*/,
|
---|
170 | unsigned long /*planemask*/
|
---|
171 | #endif
|
---|
172 | );
|
---|
173 | /* afbbltG.c */
|
---|
174 |
|
---|
175 | extern void afbDoBitbltGeneral(
|
---|
176 | #if NeedFunctionPrototypes
|
---|
177 | DrawablePtr /*pSrc*/,
|
---|
178 | DrawablePtr /*pDst*/,
|
---|
179 | int /*alu*/,
|
---|
180 | RegionPtr /*prgnDst*/,
|
---|
181 | DDXPointPtr /*pptSrc*/,
|
---|
182 | unsigned long /*planemask*/
|
---|
183 | #endif
|
---|
184 | );
|
---|
185 | /* afbbltO.c */
|
---|
186 |
|
---|
187 | extern void afbDoBitbltOr(
|
---|
188 | #if NeedFunctionPrototypes
|
---|
189 | DrawablePtr /*pSrc*/,
|
---|
190 | DrawablePtr /*pDst*/,
|
---|
191 | int /*alu*/,
|
---|
192 | RegionPtr /*prgnDst*/,
|
---|
193 | DDXPointPtr /*pptSrc*/,
|
---|
194 | unsigned long /*planemask*/
|
---|
195 | #endif
|
---|
196 | );
|
---|
197 | /* afbbltX.c */
|
---|
198 |
|
---|
199 | extern void afbDoBitbltXor(
|
---|
200 | #if NeedFunctionPrototypes
|
---|
201 | DrawablePtr /*pSrc*/,
|
---|
202 | DrawablePtr /*pDst*/,
|
---|
203 | int /*alu*/,
|
---|
204 | RegionPtr /*prgnDst*/,
|
---|
205 | DDXPointPtr /*pptSrc*/,
|
---|
206 | unsigned long /*planemask*/
|
---|
207 | #endif
|
---|
208 | );
|
---|
209 | /* afbbres.c */
|
---|
210 |
|
---|
211 | extern void afbBresS(
|
---|
212 | #if NeedFunctionPrototypes
|
---|
213 | PixelType * /*addrl*/,
|
---|
214 | int /*nlwidth*/,
|
---|
215 | int /*sizeDst*/,
|
---|
216 | int /*depthDst*/,
|
---|
217 | int /*signdx*/,
|
---|
218 | int /*signdy*/,
|
---|
219 | int /*axis*/,
|
---|
220 | int /*x1*/,
|
---|
221 | int /*y1*/,
|
---|
222 | int /*e*/,
|
---|
223 | int /*e1*/,
|
---|
224 | int /*e2*/,
|
---|
225 | int /*len*/,
|
---|
226 | unsigned char * /*rrops*/
|
---|
227 | #endif
|
---|
228 | );
|
---|
229 | /* afbbresd.c */
|
---|
230 |
|
---|
231 | extern void afbBresD(
|
---|
232 | #if NeedFunctionPrototypes
|
---|
233 | int * /*pdashIndex*/,
|
---|
234 | unsigned char * /*pDash*/,
|
---|
235 | int /*numInDashList*/,
|
---|
236 | int * /*pdashOffset*/,
|
---|
237 | int /*isDoubleDash*/,
|
---|
238 | PixelType * /*addrl*/,
|
---|
239 | int /*nlwidth*/,
|
---|
240 | int /*sizeDst*/,
|
---|
241 | int /*depthDst*/,
|
---|
242 | int /*signdx*/,
|
---|
243 | int /*signdy*/,
|
---|
244 | int /*axis*/,
|
---|
245 | int /*x1*/,
|
---|
246 | int /*y1*/,
|
---|
247 | int /*e*/,
|
---|
248 | int /*e1*/,
|
---|
249 | int /*e2*/,
|
---|
250 | int /*len*/,
|
---|
251 | unsigned char * /*rrops*/,
|
---|
252 | unsigned char * /*bgrrops*/
|
---|
253 | #endif
|
---|
254 | );
|
---|
255 | /* afbbstore.c */
|
---|
256 |
|
---|
257 | extern void afbSaveAreas(
|
---|
258 | #if NeedFunctionPrototypes
|
---|
259 | PixmapPtr /*pPixmap*/,
|
---|
260 | RegionPtr /*prgnSave*/,
|
---|
261 | int /*xorg*/,
|
---|
262 | int /*yorg*/,
|
---|
263 | WindowPtr /*pWin*/
|
---|
264 | #endif
|
---|
265 | );
|
---|
266 |
|
---|
267 | extern void afbRestoreAreas(
|
---|
268 | #if NeedFunctionPrototypes
|
---|
269 | PixmapPtr /*pPixmap*/,
|
---|
270 | RegionPtr /*prgnRestore*/,
|
---|
271 | int /*xorg*/,
|
---|
272 | int /*yorg*/,
|
---|
273 | WindowPtr /*pWin*/
|
---|
274 | #endif
|
---|
275 | );
|
---|
276 | /* afbclip.c */
|
---|
277 |
|
---|
278 | extern RegionPtr afbPixmapToRegion(
|
---|
279 | #if NeedFunctionPrototypes
|
---|
280 | PixmapPtr /*pPix*/
|
---|
281 | #endif
|
---|
282 | );
|
---|
283 |
|
---|
284 | /* afbcmap.c */
|
---|
285 |
|
---|
286 | extern int afbListInstalledColormaps(
|
---|
287 | #if NeedFunctionPrototypes
|
---|
288 | ScreenPtr /*pScreen*/,
|
---|
289 | Colormap * /*pmaps*/
|
---|
290 | #endif
|
---|
291 | );
|
---|
292 |
|
---|
293 | extern void afbInstallColormap(
|
---|
294 | #if NeedFunctionPrototypes
|
---|
295 | ColormapPtr /*pmap*/
|
---|
296 | #endif
|
---|
297 | );
|
---|
298 |
|
---|
299 | extern void afbUninstallColormap(
|
---|
300 | #if NeedFunctionPrototypes
|
---|
301 | ColormapPtr /*pmap*/
|
---|
302 | #endif
|
---|
303 | );
|
---|
304 |
|
---|
305 | extern void afbResolveColor(
|
---|
306 | #if NeedFunctionPrototypes
|
---|
307 | unsigned short * /*pred*/,
|
---|
308 | unsigned short * /*pgreen*/,
|
---|
309 | unsigned short * /*pblue*/,
|
---|
310 | VisualPtr /*pVisual*/
|
---|
311 | #endif
|
---|
312 | );
|
---|
313 |
|
---|
314 | extern Bool afbInitializeColormap(
|
---|
315 | #if NeedFunctionPrototypes
|
---|
316 | ColormapPtr /*pmap*/
|
---|
317 | #endif
|
---|
318 | );
|
---|
319 |
|
---|
320 | extern int afbExpandDirectColors(
|
---|
321 | #if NeedFunctionPrototypes
|
---|
322 | ColormapPtr /*pmap*/,
|
---|
323 | int /*ndefs*/,
|
---|
324 | xColorItem * /*indefs*/,
|
---|
325 | xColorItem * /*outdefs*/
|
---|
326 | #endif
|
---|
327 | );
|
---|
328 |
|
---|
329 | extern Bool afbCreateDefColormap(
|
---|
330 | #if NeedFunctionPrototypes
|
---|
331 | ScreenPtr /*pScreen*/
|
---|
332 | #endif
|
---|
333 | );
|
---|
334 |
|
---|
335 | extern Bool afbSetVisualTypes(
|
---|
336 | #if NeedFunctionPrototypes
|
---|
337 | int /*depth*/,
|
---|
338 | int /*visuals*/,
|
---|
339 | int /*bitsPerRGB*/
|
---|
340 | #endif
|
---|
341 | );
|
---|
342 |
|
---|
343 | extern Bool afbInitVisuals(
|
---|
344 | #if NeedFunctionPrototypes
|
---|
345 | VisualPtr * /*visualp*/,
|
---|
346 | DepthPtr * /*depthp*/,
|
---|
347 | int * /*nvisualp*/,
|
---|
348 | int * /*ndepthp*/,
|
---|
349 | int * /*rootDepthp*/,
|
---|
350 | VisualID * /*defaultVisp*/,
|
---|
351 | unsigned long /*sizes*/,
|
---|
352 | int /*bitsPerRGB*/
|
---|
353 | #endif
|
---|
354 | );
|
---|
355 |
|
---|
356 | /* afbfillarc.c */
|
---|
357 |
|
---|
358 | extern void afbPolyFillArcSolid(
|
---|
359 | #if NeedFunctionPrototypes
|
---|
360 | DrawablePtr /*pDraw*/,
|
---|
361 | GCPtr /*pGC*/,
|
---|
362 | int /*narcs*/,
|
---|
363 | xArc * /*parcs*/
|
---|
364 | #endif
|
---|
365 | );
|
---|
366 | /* afbfillrct.c */
|
---|
367 |
|
---|
368 | extern void afbPolyFillRect(
|
---|
369 | #if NeedFunctionPrototypes
|
---|
370 | DrawablePtr /*pDrawable*/,
|
---|
371 | GCPtr /*pGC*/,
|
---|
372 | int /*nrectFill*/,
|
---|
373 | xRectangle * /*prectInit*/
|
---|
374 | #endif
|
---|
375 | );
|
---|
376 |
|
---|
377 | /* afbply1rct.c */
|
---|
378 | extern void afbFillPolygonSolid(
|
---|
379 | #if NeedFunctionPrototypes
|
---|
380 | DrawablePtr /*pDrawable*/,
|
---|
381 | GCPtr /*pGC*/,
|
---|
382 | int /*mode*/,
|
---|
383 | int /*shape*/,
|
---|
384 | int /*count*/,
|
---|
385 | DDXPointPtr /*ptsIn*/
|
---|
386 | #endif
|
---|
387 | );
|
---|
388 |
|
---|
389 | /* afbfillsp.c */
|
---|
390 |
|
---|
391 | extern void afbSolidFS(
|
---|
392 | #if NeedFunctionPrototypes
|
---|
393 | DrawablePtr /*pDrawable*/,
|
---|
394 | GCPtr /*pGC*/,
|
---|
395 | int /*nInit*/,
|
---|
396 | DDXPointPtr /*pptInit*/,
|
---|
397 | int * /*pwidthInit*/,
|
---|
398 | int /*fSorted*/
|
---|
399 | #endif
|
---|
400 | );
|
---|
401 |
|
---|
402 | extern void afbStippleFS(
|
---|
403 | #if NeedFunctionPrototypes
|
---|
404 | DrawablePtr /*pDrawable*/,
|
---|
405 | GCPtr/*pGC*/,
|
---|
406 | int /*nInit*/,
|
---|
407 | DDXPointPtr /*pptInit*/,
|
---|
408 | int * /*pwidthInit*/,
|
---|
409 | int /*fSorted*/
|
---|
410 | #endif
|
---|
411 | );
|
---|
412 |
|
---|
413 | extern void afbTileFS(
|
---|
414 | #if NeedFunctionPrototypes
|
---|
415 | DrawablePtr /*pDrawable*/,
|
---|
416 | GCPtr/*pGC*/,
|
---|
417 | int /*nInit*/,
|
---|
418 | DDXPointPtr /*pptInit*/,
|
---|
419 | int * /*pwidthInit*/,
|
---|
420 | int /*fSorted*/
|
---|
421 | #endif
|
---|
422 | );
|
---|
423 |
|
---|
424 | extern void afbUnnaturalTileFS(
|
---|
425 | #if NeedFunctionPrototypes
|
---|
426 | DrawablePtr /*pDrawable*/,
|
---|
427 | GCPtr/*pGC*/,
|
---|
428 | int /*nInit*/,
|
---|
429 | DDXPointPtr /*pptInit*/,
|
---|
430 | int * /*pwidthInit*/,
|
---|
431 | int /*fSorted*/
|
---|
432 | #endif
|
---|
433 | );
|
---|
434 |
|
---|
435 | extern void afbUnnaturalStippleFS(
|
---|
436 | #if NeedFunctionPrototypes
|
---|
437 | DrawablePtr /*pDrawable*/,
|
---|
438 | GCPtr/*pGC*/,
|
---|
439 | int /*nInit*/,
|
---|
440 | DDXPointPtr /*pptInit*/,
|
---|
441 | int * /*pwidthInit*/,
|
---|
442 | int /*fSorted*/
|
---|
443 | #endif
|
---|
444 | );
|
---|
445 |
|
---|
446 | extern void afbOpaqueStippleFS(
|
---|
447 | #if NeedFunctionPrototypes
|
---|
448 | DrawablePtr /*pDrawable*/,
|
---|
449 | GCPtr/*pGC*/,
|
---|
450 | int /*nInit*/,
|
---|
451 | DDXPointPtr /*pptInit*/,
|
---|
452 | int * /*pwidthInit*/,
|
---|
453 | int /*fSorted*/
|
---|
454 | #endif
|
---|
455 | );
|
---|
456 |
|
---|
457 | extern void afbUnnaturalOpaqueStippleFS(
|
---|
458 | #if NeedFunctionPrototypes
|
---|
459 | DrawablePtr /*pDrawable*/,
|
---|
460 | GCPtr/*pGC*/,
|
---|
461 | int /*nInit*/,
|
---|
462 | DDXPointPtr /*pptInit*/,
|
---|
463 | int * /*pwidthInit*/,
|
---|
464 | int /*fSorted*/
|
---|
465 | #endif
|
---|
466 | );
|
---|
467 |
|
---|
468 | /* afbfont.c */
|
---|
469 |
|
---|
470 | extern Bool afbRealizeFont(
|
---|
471 | #if NeedFunctionPrototypes
|
---|
472 | ScreenPtr /*pscr*/,
|
---|
473 | FontPtr /*pFont*/
|
---|
474 | #endif
|
---|
475 | );
|
---|
476 |
|
---|
477 | extern Bool afbUnrealizeFont(
|
---|
478 | #if NeedFunctionPrototypes
|
---|
479 | ScreenPtr /*pscr*/,
|
---|
480 | FontPtr /*pFont*/
|
---|
481 | #endif
|
---|
482 | );
|
---|
483 | /* afbgc.c */
|
---|
484 |
|
---|
485 | extern Bool afbCreateGC(
|
---|
486 | #if NeedFunctionPrototypes
|
---|
487 | GCPtr /*pGC*/
|
---|
488 | #endif
|
---|
489 | );
|
---|
490 |
|
---|
491 | extern void afbValidateGC(
|
---|
492 | #if NeedFunctionPrototypes
|
---|
493 | GCPtr /*pGC*/,
|
---|
494 | unsigned long /*changes*/,
|
---|
495 | DrawablePtr /*pDrawable*/
|
---|
496 | #endif
|
---|
497 | );
|
---|
498 |
|
---|
499 | extern void afbDestroyGC(
|
---|
500 | #if NeedFunctionPrototypes
|
---|
501 | GCPtr /*pGC*/
|
---|
502 | #endif
|
---|
503 | );
|
---|
504 |
|
---|
505 | extern void afbReduceRop(
|
---|
506 | #if NeedFunctionPrototypes
|
---|
507 | int /*alu*/,
|
---|
508 | Pixel /*src*/,
|
---|
509 | unsigned long /*planemask*/,
|
---|
510 | int /*depth*/,
|
---|
511 | unsigned char * /*rrops*/
|
---|
512 | #endif
|
---|
513 | );
|
---|
514 |
|
---|
515 | extern void afbReduceOpaqueStipple (
|
---|
516 | #if NeedFunctionPrototypes
|
---|
517 | Pixel /*fg*/,
|
---|
518 | Pixel /*bg*/,
|
---|
519 | unsigned long /*planemask*/,
|
---|
520 | int /*depth*/,
|
---|
521 | unsigned char * /*rrops*/
|
---|
522 | #endif
|
---|
523 | );
|
---|
524 |
|
---|
525 | extern void afbComputeCompositeClip(
|
---|
526 | #if NeedFunctionPrototypes
|
---|
527 | GCPtr /*pGC*/,
|
---|
528 | DrawablePtr /*pDrawable*/
|
---|
529 | #endif
|
---|
530 | );
|
---|
531 |
|
---|
532 | /* afbgetsp.c */
|
---|
533 |
|
---|
534 | extern void afbGetSpans(
|
---|
535 | #if NeedFunctionPrototypes
|
---|
536 | DrawablePtr /*pDrawable*/,
|
---|
537 | int /*wMax*/,
|
---|
538 | DDXPointPtr /*ppt*/,
|
---|
539 | int * /*pwidth*/,
|
---|
540 | int /*nspans*/,
|
---|
541 | char * /*pdstStart*/
|
---|
542 | #endif
|
---|
543 | );
|
---|
544 | /* afbhrzvert.c */
|
---|
545 |
|
---|
546 | extern void afbHorzS(
|
---|
547 | #if NeedFunctionPrototypes
|
---|
548 | PixelType * /*addrl*/,
|
---|
549 | int /*nlwidth*/,
|
---|
550 | int /*sizeDst*/,
|
---|
551 | int /*depthDst*/,
|
---|
552 | int /*x1*/,
|
---|
553 | int /*y1*/,
|
---|
554 | int /*len*/,
|
---|
555 | unsigned char * /*rrops*/
|
---|
556 | #endif
|
---|
557 | );
|
---|
558 |
|
---|
559 | extern void afbVertS(
|
---|
560 | #if NeedFunctionPrototypes
|
---|
561 | PixelType * /*addrl*/,
|
---|
562 | int /*nlwidth*/,
|
---|
563 | int /*sizeDst*/,
|
---|
564 | int /*depthDst*/,
|
---|
565 | int /*x1*/,
|
---|
566 | int /*y1*/,
|
---|
567 | int /*len*/,
|
---|
568 | unsigned char * /*rrops*/
|
---|
569 | #endif
|
---|
570 | );
|
---|
571 | /* afbigbblak.c */
|
---|
572 |
|
---|
573 | extern void afbImageGlyphBlt (
|
---|
574 | #if NeedFunctionPrototypes
|
---|
575 | DrawablePtr /*pDrawable*/,
|
---|
576 | GCPtr/*pGC*/,
|
---|
577 | int /*x*/,
|
---|
578 | int /*y*/,
|
---|
579 | unsigned int /*nglyph*/,
|
---|
580 | CharInfoPtr * /*ppci*/,
|
---|
581 | pointer /*pglyphBase*/
|
---|
582 | #endif
|
---|
583 | );
|
---|
584 | /* afbigbwht.c */
|
---|
585 |
|
---|
586 | /* afbimage.c */
|
---|
587 |
|
---|
588 | extern void afbPutImage(
|
---|
589 | #if NeedFunctionPrototypes
|
---|
590 | DrawablePtr /*dst*/,
|
---|
591 | GCPtr /*pGC*/,
|
---|
592 | int /*depth*/,
|
---|
593 | int /*x*/,
|
---|
594 | int /*y*/,
|
---|
595 | int /*w*/,
|
---|
596 | int /*h*/,
|
---|
597 | int /*leftPad*/,
|
---|
598 | int /*format*/,
|
---|
599 | char * /*pImage*/
|
---|
600 | #endif
|
---|
601 | );
|
---|
602 |
|
---|
603 | extern void afbGetImage(
|
---|
604 | #if NeedFunctionPrototypes
|
---|
605 | DrawablePtr /*pDrawable*/,
|
---|
606 | int /*sx*/,
|
---|
607 | int /*sy*/,
|
---|
608 | int /*w*/,
|
---|
609 | int /*h*/,
|
---|
610 | unsigned int /*format*/,
|
---|
611 | unsigned long /*planeMask*/,
|
---|
612 | char * /*pdstLine*/
|
---|
613 | #endif
|
---|
614 | );
|
---|
615 | /* afbline.c */
|
---|
616 |
|
---|
617 | extern void afbLineSS(
|
---|
618 | #if NeedFunctionPrototypes
|
---|
619 | DrawablePtr /*pDrawable*/,
|
---|
620 | GCPtr /*pGC*/,
|
---|
621 | int /*mode*/,
|
---|
622 | int /*npt*/,
|
---|
623 | DDXPointPtr /*pptInit*/
|
---|
624 | #endif
|
---|
625 | );
|
---|
626 |
|
---|
627 | extern void afbLineSD(
|
---|
628 | #if NeedFunctionPrototypes
|
---|
629 | DrawablePtr /*pDrawable*/,
|
---|
630 | GCPtr /*pGC*/,
|
---|
631 | int /*mode*/,
|
---|
632 | int /*npt*/,
|
---|
633 | DDXPointPtr /*pptInit*/
|
---|
634 | #endif
|
---|
635 | );
|
---|
636 |
|
---|
637 | /* afbmisc.c */
|
---|
638 |
|
---|
639 | extern void afbQueryBestSize(
|
---|
640 | #if NeedFunctionPrototypes
|
---|
641 | int /*class*/,
|
---|
642 | unsigned short * /*pwidth*/,
|
---|
643 | unsigned short * /*pheight*/,
|
---|
644 | ScreenPtr /*pScreen*/
|
---|
645 | #endif
|
---|
646 | );
|
---|
647 | /* afbpntarea.c */
|
---|
648 |
|
---|
649 | extern void afbSolidFillArea(
|
---|
650 | #if NeedFunctionPrototypes
|
---|
651 | DrawablePtr /*pDraw*/,
|
---|
652 | int /*nbox*/,
|
---|
653 | BoxPtr /*pbox*/,
|
---|
654 | unsigned char * /*rrops*/
|
---|
655 | #endif
|
---|
656 | );
|
---|
657 |
|
---|
658 | extern void afbStippleAreaPPW(
|
---|
659 | #if NeedFunctionPrototypes
|
---|
660 | DrawablePtr /*pDraw*/,
|
---|
661 | int /*nbox*/,
|
---|
662 | BoxPtr /*pbox*/,
|
---|
663 | PixmapPtr /*pstipple*/,
|
---|
664 | unsigned char * /*rrops*/
|
---|
665 | #endif
|
---|
666 | );
|
---|
667 | extern void afbStippleArea(
|
---|
668 | #if NeedFunctionPrototypes
|
---|
669 | DrawablePtr /*pDraw*/,
|
---|
670 | int /*nbox*/,
|
---|
671 | BoxPtr /*pbox*/,
|
---|
672 | PixmapPtr /*pstipple*/,
|
---|
673 | int /*xOff*/,
|
---|
674 | int /*yOff*/,
|
---|
675 | unsigned char * /*rrops*/
|
---|
676 | #endif
|
---|
677 | );
|
---|
678 | /* afbplygblt.c */
|
---|
679 |
|
---|
680 | extern void afbPolyGlyphBlt(
|
---|
681 | #if NeedFunctionPrototypes
|
---|
682 | DrawablePtr /*pDrawable*/,
|
---|
683 | GCPtr /*pGC*/,
|
---|
684 | int /*x*/,
|
---|
685 | int /*y*/,
|
---|
686 | unsigned int /*nglyph*/,
|
---|
687 | CharInfoPtr * /*ppci*/,
|
---|
688 | pointer /*pglyphBase*/
|
---|
689 | #endif
|
---|
690 | );
|
---|
691 |
|
---|
692 | /* afbpixmap.c */
|
---|
693 |
|
---|
694 | extern PixmapPtr afbCreatePixmap(
|
---|
695 | #if NeedFunctionPrototypes
|
---|
696 | ScreenPtr /*pScreen*/,
|
---|
697 | int /*width*/,
|
---|
698 | int /*height*/,
|
---|
699 | int /*depth*/
|
---|
700 | #endif
|
---|
701 | );
|
---|
702 |
|
---|
703 | extern Bool afbDestroyPixmap(
|
---|
704 | #if NeedFunctionPrototypes
|
---|
705 | PixmapPtr /*pPixmap*/
|
---|
706 | #endif
|
---|
707 | );
|
---|
708 |
|
---|
709 | extern PixmapPtr afbCopyPixmap(
|
---|
710 | #if NeedFunctionPrototypes
|
---|
711 | PixmapPtr /*pSrc*/
|
---|
712 | #endif
|
---|
713 | );
|
---|
714 |
|
---|
715 | extern void afbPadPixmap(
|
---|
716 | #if NeedFunctionPrototypes
|
---|
717 | PixmapPtr /*pPixmap*/
|
---|
718 | #endif
|
---|
719 | );
|
---|
720 |
|
---|
721 | extern void afbXRotatePixmap(
|
---|
722 | #if NeedFunctionPrototypes
|
---|
723 | PixmapPtr /*pPix*/,
|
---|
724 | int /*rw*/
|
---|
725 | #endif
|
---|
726 | );
|
---|
727 |
|
---|
728 | extern void afbYRotatePixmap(
|
---|
729 | #if NeedFunctionPrototypes
|
---|
730 | PixmapPtr /*pPix*/,
|
---|
731 | int /*rh*/
|
---|
732 | #endif
|
---|
733 | );
|
---|
734 |
|
---|
735 | extern void afbCopyRotatePixmap(
|
---|
736 | #if NeedFunctionPrototypes
|
---|
737 | PixmapPtr /*psrcPix*/,
|
---|
738 | PixmapPtr * /*ppdstPix*/,
|
---|
739 | int /*xrot*/,
|
---|
740 | int /*yrot*/
|
---|
741 | #endif
|
---|
742 | );
|
---|
743 | extern void afbPaintWindow(
|
---|
744 | #if NeedFunctionPrototypes
|
---|
745 | WindowPtr /*pWin*/,
|
---|
746 | RegionPtr /*pRegion*/,
|
---|
747 | int /*what*/
|
---|
748 | #endif
|
---|
749 | );
|
---|
750 | /* afbpolypnt.c */
|
---|
751 |
|
---|
752 | extern void afbPolyPoint(
|
---|
753 | #if NeedFunctionPrototypes
|
---|
754 | DrawablePtr /*pDrawable*/,
|
---|
755 | GCPtr /*pGC*/,
|
---|
756 | int /*mode*/,
|
---|
757 | int /*npt*/,
|
---|
758 | xPoint * /*pptInit*/
|
---|
759 | #endif
|
---|
760 | );
|
---|
761 | /* afbpushpxl.c */
|
---|
762 |
|
---|
763 | extern void afbPushPixels(
|
---|
764 | #if NeedFunctionPrototypes
|
---|
765 | GCPtr /*pGC*/,
|
---|
766 | PixmapPtr /*pBitMap*/,
|
---|
767 | DrawablePtr /*pDrawable*/,
|
---|
768 | int /*dx*/,
|
---|
769 | int /*dy*/,
|
---|
770 | int /*xOrg*/,
|
---|
771 | int /*yOrg*/
|
---|
772 | #endif
|
---|
773 | );
|
---|
774 | /* afbscrclse.c */
|
---|
775 |
|
---|
776 | extern Bool afbCloseScreen(
|
---|
777 | #if NeedFunctionPrototypes
|
---|
778 | int /*index*/,
|
---|
779 | ScreenPtr /*pScreen*/
|
---|
780 | #endif
|
---|
781 | );
|
---|
782 | /* afbscrinit.c */
|
---|
783 |
|
---|
784 | extern Bool afbAllocatePrivates(
|
---|
785 | #if NeedFunctionPrototypes
|
---|
786 | ScreenPtr /*pScreen*/,
|
---|
787 | int * /*pWinIndex*/,
|
---|
788 | int * /*pGCIndex*/
|
---|
789 | #endif
|
---|
790 | );
|
---|
791 |
|
---|
792 | extern Bool afbScreenInit(
|
---|
793 | #if NeedFunctionPrototypes
|
---|
794 | ScreenPtr /*pScreen*/,
|
---|
795 | pointer /*pbits*/,
|
---|
796 | int /*xsize*/,
|
---|
797 | int /*ysize*/,
|
---|
798 | int /*dpix*/,
|
---|
799 | int /*dpiy*/,
|
---|
800 | int /*width*/
|
---|
801 | #endif
|
---|
802 | );
|
---|
803 |
|
---|
804 | extern PixmapPtr afbGetWindowPixmap(
|
---|
805 | #if NeedFunctionPrototypes
|
---|
806 | WindowPtr /*pWin*/
|
---|
807 | #endif
|
---|
808 | );
|
---|
809 |
|
---|
810 | extern void afbSetWindowPixmap(
|
---|
811 | #if NeedFunctionPrototypes
|
---|
812 | WindowPtr /*pWin*/,
|
---|
813 | PixmapPtr /*pPix*/
|
---|
814 | #endif
|
---|
815 | );
|
---|
816 |
|
---|
817 | /* afbseg.c */
|
---|
818 |
|
---|
819 | extern void afbSegmentSS(
|
---|
820 | #if NeedFunctionPrototypes
|
---|
821 | DrawablePtr /*pDrawable*/,
|
---|
822 | GCPtr /*pGC*/,
|
---|
823 | int /*nseg*/,
|
---|
824 | xSegment * /*pSeg*/
|
---|
825 | #endif
|
---|
826 | );
|
---|
827 |
|
---|
828 | extern void afbSegmentSD(
|
---|
829 | #if NeedFunctionPrototypes
|
---|
830 | DrawablePtr /*pDrawable*/,
|
---|
831 | GCPtr /*pGC*/,
|
---|
832 | int /*nseg*/,
|
---|
833 | xSegment * /*pSeg*/
|
---|
834 | #endif
|
---|
835 | );
|
---|
836 | /* afbsetsp.c */
|
---|
837 |
|
---|
838 | extern void afbSetScanline(
|
---|
839 | #if NeedFunctionPrototypes
|
---|
840 | int /*y*/,
|
---|
841 | int /*xOrigin*/,
|
---|
842 | int /*xStart*/,
|
---|
843 | int /*xEnd*/,
|
---|
844 | PixelType * /*psrc*/,
|
---|
845 | int /*alu*/,
|
---|
846 | PixelType * /*pdstBase*/,
|
---|
847 | int /*widthDst*/,
|
---|
848 | int /*sizeDst*/,
|
---|
849 | int /*depthDst*/,
|
---|
850 | int /*sizeSrc*/
|
---|
851 | #endif
|
---|
852 | );
|
---|
853 |
|
---|
854 | extern void afbSetSpans(
|
---|
855 | #if NeedFunctionPrototypes
|
---|
856 | DrawablePtr /*pDrawable*/,
|
---|
857 | GCPtr /*pGC*/,
|
---|
858 | char * /*psrc*/,
|
---|
859 | DDXPointPtr /*ppt*/,
|
---|
860 | int * /*pwidth*/,
|
---|
861 | int /*nspans*/,
|
---|
862 | int /*fSorted*/
|
---|
863 | #endif
|
---|
864 | );
|
---|
865 | /* afbtegblt.c */
|
---|
866 |
|
---|
867 | extern void afbTEGlyphBlt(
|
---|
868 | #if NeedFunctionPrototypes
|
---|
869 | DrawablePtr /*pDrawable*/,
|
---|
870 | GCPtr/*pGC*/,
|
---|
871 | int /*x*/,
|
---|
872 | int /*y*/,
|
---|
873 | unsigned int /*nglyph*/,
|
---|
874 | CharInfoPtr * /*ppci*/,
|
---|
875 | pointer /*pglyphBase*/
|
---|
876 | #endif
|
---|
877 | );
|
---|
878 | /* afbtileC.c */
|
---|
879 |
|
---|
880 | extern void afbTileAreaPPWCopy(
|
---|
881 | #if NeedFunctionPrototypes
|
---|
882 | DrawablePtr /*pDraw*/,
|
---|
883 | int /*nbox*/,
|
---|
884 | BoxPtr /*pbox*/,
|
---|
885 | int /*alu*/,
|
---|
886 | PixmapPtr /*ptile*/,
|
---|
887 | unsigned long /*planemask*/
|
---|
888 | #endif
|
---|
889 | );
|
---|
890 | /* afbtileG.c */
|
---|
891 |
|
---|
892 | extern void afbTileAreaPPWGeneral(
|
---|
893 | #if NeedFunctionPrototypes
|
---|
894 | DrawablePtr /*pDraw*/,
|
---|
895 | int /*nbox*/,
|
---|
896 | BoxPtr /*pbox*/,
|
---|
897 | int /*alu*/,
|
---|
898 | PixmapPtr /*ptile*/,
|
---|
899 | unsigned long /*planemask*/
|
---|
900 | #endif
|
---|
901 | );
|
---|
902 |
|
---|
903 | extern void afbTileAreaCopy(
|
---|
904 | #if NeedFunctionPrototypes
|
---|
905 | DrawablePtr /*pDraw*/,
|
---|
906 | int /*nbox*/,
|
---|
907 | BoxPtr /*pbox*/,
|
---|
908 | int /*alu*/,
|
---|
909 | PixmapPtr /*ptile*/,
|
---|
910 | int /*xOff*/,
|
---|
911 | int /*yOff*/,
|
---|
912 | unsigned long /*planemask*/
|
---|
913 | #endif
|
---|
914 | );
|
---|
915 | /* afbtileG.c */
|
---|
916 |
|
---|
917 | extern void afbTileAreaGeneral(
|
---|
918 | #if NeedFunctionPrototypes
|
---|
919 | DrawablePtr /*pDraw*/,
|
---|
920 | int /*nbox*/,
|
---|
921 | BoxPtr /*pbox*/,
|
---|
922 | int /*alu*/,
|
---|
923 | PixmapPtr /*ptile*/,
|
---|
924 | int /*xOff*/,
|
---|
925 | int /*yOff*/,
|
---|
926 | unsigned long /*planemask*/
|
---|
927 | #endif
|
---|
928 | );
|
---|
929 |
|
---|
930 | extern void afbOpaqueStippleAreaPPWCopy(
|
---|
931 | #if NeedFunctionPrototypes
|
---|
932 | DrawablePtr /*pDraw*/,
|
---|
933 | int /*nbox*/,
|
---|
934 | BoxPtr /*pbox*/,
|
---|
935 | int /*alu*/,
|
---|
936 | PixmapPtr /*ptile*/,
|
---|
937 | unsigned char */*rropsOS*/,
|
---|
938 | unsigned long /*planemask*/
|
---|
939 | #endif
|
---|
940 | );
|
---|
941 | /* afbtileG.c */
|
---|
942 |
|
---|
943 | extern void afbOpaqueStippleAreaPPWGeneral(
|
---|
944 | #if NeedFunctionPrototypes
|
---|
945 | DrawablePtr /*pDraw*/,
|
---|
946 | int /*nbox*/,
|
---|
947 | BoxPtr /*pbox*/,
|
---|
948 | int /*alu*/,
|
---|
949 | PixmapPtr /*ptile*/,
|
---|
950 | unsigned char */*rropsOS*/,
|
---|
951 | unsigned long /*planemask*/
|
---|
952 | #endif
|
---|
953 | );
|
---|
954 |
|
---|
955 | extern void afbOpaqueStippleAreaCopy(
|
---|
956 | #if NeedFunctionPrototypes
|
---|
957 | DrawablePtr /*pDraw*/,
|
---|
958 | int /*nbox*/,
|
---|
959 | BoxPtr /*pbox*/,
|
---|
960 | int /*alu*/,
|
---|
961 | PixmapPtr /*ptile*/,
|
---|
962 | int /*xOff*/,
|
---|
963 | int /*yOff*/,
|
---|
964 | unsigned char */*rropsOS*/,
|
---|
965 | unsigned long /*planemask*/
|
---|
966 | #endif
|
---|
967 | );
|
---|
968 | /* afbtileG.c */
|
---|
969 |
|
---|
970 | extern void afbOpaqueStippleAreaGeneral(
|
---|
971 | #if NeedFunctionPrototypes
|
---|
972 | DrawablePtr /*pDraw*/,
|
---|
973 | int /*nbox*/,
|
---|
974 | BoxPtr /*pbox*/,
|
---|
975 | int /*alu*/,
|
---|
976 | PixmapPtr /*ptile*/,
|
---|
977 | int /*xOff*/,
|
---|
978 | int /*yOff*/,
|
---|
979 | unsigned char */*rropsOS*/,
|
---|
980 | unsigned long /*planemask*/
|
---|
981 | #endif
|
---|
982 | );
|
---|
983 |
|
---|
984 | /* afbwindow.c */
|
---|
985 |
|
---|
986 | extern Bool afbCreateWindow(
|
---|
987 | #if NeedFunctionPrototypes
|
---|
988 | WindowPtr /*pWin*/
|
---|
989 | #endif
|
---|
990 | );
|
---|
991 |
|
---|
992 | extern Bool afbDestroyWindow(
|
---|
993 | #if NeedFunctionPrototypes
|
---|
994 | WindowPtr /*pWin*/
|
---|
995 | #endif
|
---|
996 | );
|
---|
997 |
|
---|
998 | extern Bool afbMapWindow(
|
---|
999 | #if NeedFunctionPrototypes
|
---|
1000 | WindowPtr /*pWindow*/
|
---|
1001 | #endif
|
---|
1002 | );
|
---|
1003 |
|
---|
1004 | extern Bool afbPositionWindow(
|
---|
1005 | #if NeedFunctionPrototypes
|
---|
1006 | WindowPtr /*pWin*/,
|
---|
1007 | int /*x*/,
|
---|
1008 | int /*y*/
|
---|
1009 | #endif
|
---|
1010 | );
|
---|
1011 |
|
---|
1012 | extern Bool afbUnmapWindow(
|
---|
1013 | #if NeedFunctionPrototypes
|
---|
1014 | WindowPtr /*pWindow*/
|
---|
1015 | #endif
|
---|
1016 | );
|
---|
1017 |
|
---|
1018 | extern void afbCopyWindow(
|
---|
1019 | #if NeedFunctionPrototypes
|
---|
1020 | WindowPtr /*pWin*/,
|
---|
1021 | DDXPointRec /*ptOldOrg*/,
|
---|
1022 | RegionPtr /*prgnSrc*/
|
---|
1023 | #endif
|
---|
1024 | );
|
---|
1025 |
|
---|
1026 | extern Bool afbChangeWindowAttributes(
|
---|
1027 | #if NeedFunctionPrototypes
|
---|
1028 | WindowPtr /*pWin*/,
|
---|
1029 | unsigned long /*mask*/
|
---|
1030 | #endif
|
---|
1031 | );
|
---|
1032 | /* afbzerarc.c */
|
---|
1033 |
|
---|
1034 | extern void afbZeroPolyArcSS(
|
---|
1035 | #if NeedFunctionPrototypes
|
---|
1036 | DrawablePtr /*pDraw*/,
|
---|
1037 | GCPtr /*pGC*/,
|
---|
1038 | int /*narcs*/,
|
---|
1039 | xArc * /*parcs*/
|
---|
1040 | #endif
|
---|
1041 | );
|
---|
1042 |
|
---|
1043 | /*
|
---|
1044 | private field of pixmap
|
---|
1045 | pixmap.devPrivate = (PixelType *)pointer_to_bits
|
---|
1046 | pixmap.devKind = width_of_pixmap_in_bytes
|
---|
1047 |
|
---|
1048 | private field of screen
|
---|
1049 | a pixmap, for which we allocate storage. devPrivate is a pointer to
|
---|
1050 | the bits in the hardware framebuffer. note that devKind can be poked to
|
---|
1051 | make the code work for framebuffers that are wider than their
|
---|
1052 | displayable screen (e.g. the early vsII, which displayed 960 pixels
|
---|
1053 | across, but was 1024 in the hardware.)
|
---|
1054 |
|
---|
1055 | private field of GC
|
---|
1056 | */
|
---|
1057 |
|
---|
1058 | typedef struct {
|
---|
1059 | unsigned char rrops[AFB_MAX_DEPTH]; /* reduction of rasterop to 1 of 3 */
|
---|
1060 | unsigned char rropOS[AFB_MAX_DEPTH]; /* rop for opaque stipple */
|
---|
1061 | } afbPrivGC;
|
---|
1062 | typedef afbPrivGC *afbPrivGCPtr;
|
---|
1063 |
|
---|
1064 | extern int afbGCPrivateIndex; /* index into GC private array */
|
---|
1065 | extern int afbWindowPrivateIndex; /* index into Window private array */
|
---|
1066 | #ifdef PIXMAP_PER_WINDOW
|
---|
1067 | extern int frameWindowPrivateIndex; /* index into Window private array */
|
---|
1068 | #endif
|
---|
1069 |
|
---|
1070 | #define afbGetGCPrivate(pGC) \
|
---|
1071 | ((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr))
|
---|
1072 |
|
---|
1073 | /* private field of window */
|
---|
1074 | typedef struct {
|
---|
1075 | unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */
|
---|
1076 | unsigned char fastBackground;
|
---|
1077 | unsigned short unused; /* pad for alignment with Sun compiler */
|
---|
1078 | DDXPointRec oldRotate;
|
---|
1079 | PixmapPtr pRotatedBackground;
|
---|
1080 | PixmapPtr pRotatedBorder;
|
---|
1081 | } afbPrivWin;
|
---|
1082 |
|
---|
1083 | /* Common macros for extracting drawing information */
|
---|
1084 |
|
---|
1085 | #define afbGetTypedWidth(pDrawable,wtype)( \
|
---|
1086 | (((pDrawable)->type == DRAWABLE_WINDOW) ? \
|
---|
1087 | (int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \
|
---|
1088 | (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
|
---|
1089 |
|
---|
1090 | #define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
|
---|
1091 |
|
---|
1092 | #define afbGetPixelWidth(pDrawable) afbGetTypedWidth(pDrawable, PixelType)
|
---|
1093 |
|
---|
1094 | #define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
|
---|
1095 | PixmapPtr _pPix; \
|
---|
1096 | if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
---|
1097 | _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
---|
1098 | else \
|
---|
1099 | _pPix = (PixmapPtr)(pDrawable); \
|
---|
1100 | (pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
---|
1101 | (width) = ((int) _pPix->devKind) / sizeof (wtype); \
|
---|
1102 | }
|
---|
1103 |
|
---|
1104 | #define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
|
---|
1105 | PixmapPtr _pPix; \
|
---|
1106 | if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
---|
1107 | _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
---|
1108 | else \
|
---|
1109 | _pPix = (PixmapPtr)(pDrawable); \
|
---|
1110 | (pointer) = (PixelType *)_pPix->devPrivate.ptr; \
|
---|
1111 | (width) = ((int)_pPix->devKind) / sizeof (PixelType); \
|
---|
1112 | (size) = (width) * _pPix->drawable.height; \
|
---|
1113 | (dep) = _pPix->drawable.depth; \
|
---|
1114 | }
|
---|
1115 |
|
---|
1116 | #define afbGetByteWidthAndPointer(pDrawable, width, pointer) \
|
---|
1117 | afbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
|
---|
1118 |
|
---|
1119 | #define afbGetPixelWidthAndPointer(pDrawable, width, pointer) \
|
---|
1120 | afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
|
---|
1121 |
|
---|
1122 | #define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
|
---|
1123 | PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
---|
1124 | (pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
---|
1125 | (width) = ((int) _pPix->devKind) / sizeof (wtype); \
|
---|
1126 | }
|
---|
1127 |
|
---|
1128 | #define afbGetWindowPixelWidthAndPointer(pWin, width, pointer) \
|
---|
1129 | afbGetWindowTypedWidthAndPointer(pWin, width, pointer, PixelType, PixelType)
|
---|
1130 |
|
---|
1131 | #define afbGetWindowByteWidthAndPointer(pWin, width, pointer) \
|
---|
1132 | afbGetWindowTypedWidthAndPointer(pWin, width, pointer, char, char)
|
---|
1133 |
|
---|
1134 | /* afb uses the following macros to calculate addresses in drawables.
|
---|
1135 | * To support banked framebuffers, the macros come in four flavors.
|
---|
1136 | * All four collapse into the same definition on unbanked devices.
|
---|
1137 | *
|
---|
1138 | * afbScanlineFoo - calculate address and do bank switching
|
---|
1139 | * afbScanlineFooNoBankSwitch - calculate address, don't bank switch
|
---|
1140 | * afbScanlineFooSrc - calculate address, switch source bank
|
---|
1141 | * afbScanlineFooDst - calculate address, switch destination bank
|
---|
1142 | */
|
---|
1143 |
|
---|
1144 | /* The NoBankSwitch versions are the same for banked and unbanked cases */
|
---|
1145 |
|
---|
1146 | #define afbScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
|
---|
1147 | #define afbScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr) + (_off))
|
---|
1148 | #define afbScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
|
---|
1149 | afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w))
|
---|
1150 | #define afbScanlineNoBankSwitch(_ptr, _x, _y, _w) \
|
---|
1151 | afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
|
---|
1152 |
|
---|
1153 | #ifdef MFB_LINE_BANK
|
---|
1154 |
|
---|
1155 | #include "afblinebank.h" /* get macro definitions from this file */
|
---|
1156 |
|
---|
1157 | #else /* !MFB_LINE_BANK - unbanked case */
|
---|
1158 |
|
---|
1159 | #define afbScanlineInc(_ptr, _off) afbScanlineIncNoBankSwitch(_ptr, _off)
|
---|
1160 | #define afbScanlineIncSrc(_ptr, _off) afbScanlineInc(_ptr, _off)
|
---|
1161 | #define afbScanlineIncDst(_ptr, _off) afbScanlineInc(_ptr, _off)
|
---|
1162 |
|
---|
1163 | #define afbScanlineOffset(_ptr, _off) afbScanlineOffsetNoBankSwitch(_ptr, _off)
|
---|
1164 | #define afbScanlineOffsetSrc(_ptr, _off) afbScanlineOffset(_ptr, _off)
|
---|
1165 | #define afbScanlineOffsetDst(_ptr, _off) afbScanlineOffset(_ptr, _off)
|
---|
1166 |
|
---|
1167 | #define afbScanlineSrc(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
|
---|
1168 | #define afbScanlineDst(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
|
---|
1169 |
|
---|
1170 | #define afbScanlineDeltaSrc(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
|
---|
1171 | #define afbScanlineDeltaDst(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
|
---|
1172 |
|
---|
1173 | #endif /* MFB_LINE_BANK */
|
---|
1174 |
|
---|
1175 | #define afbScanlineDelta(_ptr, _y, _w) \
|
---|
1176 | afbScanlineOffset(_ptr, (_y) * (_w))
|
---|
1177 |
|
---|
1178 | #define afbScanline(_ptr, _x, _y, _w) \
|
---|
1179 | afbScanlineOffset(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
|
---|
1180 |
|
---|
1181 | /* precomputed information about each glyph for GlyphBlt code.
|
---|
1182 | this saves recalculating the per glyph information for each box.
|
---|
1183 | */
|
---|
1184 |
|
---|
1185 | typedef struct _afbpos{
|
---|
1186 | int xpos; /* xposition of glyph's origin */
|
---|
1187 | int xchar; /* x position mod 32 */
|
---|
1188 | int leftEdge;
|
---|
1189 | int rightEdge;
|
---|
1190 | int topEdge;
|
---|
1191 | int bottomEdge;
|
---|
1192 | PixelType *pdstBase; /* longword with character origin */
|
---|
1193 | int widthGlyph; /* width in bytes of this glyph */
|
---|
1194 | } afbTEXTPOS;
|
---|
1195 |
|
---|
1196 | /* reduced raster ops for afb */
|
---|
1197 | #define RROP_BLACK GXclear
|
---|
1198 | #define RROP_WHITE GXset
|
---|
1199 | #define RROP_NOP GXnoop
|
---|
1200 | #define RROP_INVERT GXinvert
|
---|
1201 | #define RROP_COPY GXcopy
|
---|
1202 |
|
---|
1203 | /* macros for afbbitblt.c, afbfillsp.c
|
---|
1204 | these let the code do one switch on the rop per call, rather
|
---|
1205 | than a switch on the rop per item (span or rectangle.)
|
---|
1206 | */
|
---|
1207 |
|
---|
1208 | #define fnCLEAR(src, dst) (0)
|
---|
1209 | #define fnAND(src, dst) (src & dst)
|
---|
1210 | #define fnANDREVERSE(src, dst) (src & ~dst)
|
---|
1211 | #define fnCOPY(src, dst) (src)
|
---|
1212 | #define fnANDINVERTED(src, dst) (~src & dst)
|
---|
1213 | #define fnNOOP(src, dst) (dst)
|
---|
1214 | #define fnXOR(src, dst) (src ^ dst)
|
---|
1215 | #define fnOR(src, dst) (src | dst)
|
---|
1216 | #define fnNOR(src, dst) (~(src | dst))
|
---|
1217 | #define fnEQUIV(src, dst) (~src ^ dst)
|
---|
1218 | #define fnINVERT(src, dst) (~dst)
|
---|
1219 | #define fnORREVERSE(src, dst) (src | ~dst)
|
---|
1220 | #define fnCOPYINVERTED(src, dst) (~src)
|
---|
1221 | #define fnORINVERTED(src, dst) (~src | dst)
|
---|
1222 | #define fnNAND(src, dst) (~(src & dst))
|
---|
1223 | #undef fnSET
|
---|
1224 | #define fnSET(src, dst) (~0)
|
---|
1225 |
|
---|
1226 | /* Using a "switch" statement is much faster in most cases
|
---|
1227 | * since the compiler can do a look-up table or multi-way branch
|
---|
1228 | * instruction, depending on the architecture. The result on
|
---|
1229 | * A Sun 3/50 is at least 2.5 times faster, assuming a uniform
|
---|
1230 | * distribution of RasterOp operation types.
|
---|
1231 | *
|
---|
1232 | * However, doing some profiling on a running system reveals
|
---|
1233 | * GXcopy is the operation over 99.5% of the time and
|
---|
1234 | * GXxor is the next most frequent (about .4%), so we make special
|
---|
1235 | * checks for those first.
|
---|
1236 | *
|
---|
1237 | * Note that this requires a change to the "calling sequence"
|
---|
1238 | * since we can't engineer a "switch" statement to have an lvalue.
|
---|
1239 | */
|
---|
1240 | #undef DoRop
|
---|
1241 | #define DoRop(result, alu, src, dst) \
|
---|
1242 | { \
|
---|
1243 | if (alu == GXcopy) \
|
---|
1244 | result = fnCOPY (src, dst); \
|
---|
1245 | else if (alu == GXxor) \
|
---|
1246 | result = fnXOR (src, dst); \
|
---|
1247 | else \
|
---|
1248 | switch (alu) { \
|
---|
1249 | case GXclear: \
|
---|
1250 | result = fnCLEAR (src, dst); \
|
---|
1251 | break; \
|
---|
1252 | case GXand: \
|
---|
1253 | result = fnAND (src, dst); \
|
---|
1254 | break; \
|
---|
1255 | case GXandReverse: \
|
---|
1256 | result = fnANDREVERSE (src, dst); \
|
---|
1257 | break; \
|
---|
1258 | case GXandInverted: \
|
---|
1259 | result = fnANDINVERTED (src, dst); \
|
---|
1260 | break; \
|
---|
1261 | default: \
|
---|
1262 | case GXnoop: \
|
---|
1263 | result = fnNOOP (src, dst); \
|
---|
1264 | break; \
|
---|
1265 | case GXor: \
|
---|
1266 | result = fnOR (src, dst); \
|
---|
1267 | break; \
|
---|
1268 | case GXnor: \
|
---|
1269 | result = fnNOR (src, dst); \
|
---|
1270 | break; \
|
---|
1271 | case GXequiv: \
|
---|
1272 | result = fnEQUIV (src, dst); \
|
---|
1273 | break; \
|
---|
1274 | case GXinvert: \
|
---|
1275 | result = fnINVERT (src, dst); \
|
---|
1276 | break; \
|
---|
1277 | case GXorReverse: \
|
---|
1278 | result = fnORREVERSE (src, dst); \
|
---|
1279 | break; \
|
---|
1280 | case GXcopyInverted: \
|
---|
1281 | result = fnCOPYINVERTED (src, dst); \
|
---|
1282 | break; \
|
---|
1283 | case GXorInverted: \
|
---|
1284 | result = fnORINVERTED (src, dst); \
|
---|
1285 | break; \
|
---|
1286 | case GXnand: \
|
---|
1287 | result = fnNAND (src, dst); \
|
---|
1288 | break; \
|
---|
1289 | case GXset: \
|
---|
1290 | result = fnSET (src, dst); \
|
---|
1291 | break; \
|
---|
1292 | } \
|
---|
1293 | }
|
---|
1294 |
|
---|
1295 |
|
---|
1296 | /* C expression fragments for various operations. These get passed in
|
---|
1297 | * as -D's on the compile command line. See afb/Imakefile. This
|
---|
1298 | * fixes XBUG 6319.
|
---|
1299 | *
|
---|
1300 | * This seems like a good place to point out that afb's use of the
|
---|
1301 | * words black and white is an unfortunate misnomer. In afb code, black
|
---|
1302 | * means zero, and white means one.
|
---|
1303 | */
|
---|
1304 | #define MFB_OPEQ_WHITE |=
|
---|
1305 | #define MFB_OPEQ_BLACK &=~
|
---|
1306 | #define MFB_OPEQ_INVERT ^=
|
---|
1307 | #define MFB_EQWHOLEWORD_WHITE =~0
|
---|
1308 | #define MFB_EQWHOLEWORD_BLACK =0
|
---|
1309 | #define MFB_EQWHOLEWORD_INVERT ^=~0
|
---|
1310 | #define MFB_OP_WHITE /* nothing */
|
---|
1311 | #define MFB_OP_BLACK ~
|
---|
1312 |
|
---|
1313 | #ifdef XFree86LOADER
|
---|
1314 | #include "xf86_ansic.h"
|
---|
1315 | #endif
|
---|
1316 |
|
---|