VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.3.0.0/afb.h@ 25078

最後變更 在這個檔案從25078是 25078,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: exported and set eol-style on new headers

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette