VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/mfb.h@ 81043

Last change on this file since 81043 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 26.7 KB
Line 
1/* $XFree86: xc/programs/Xserver/mfb/mfb.h,v 1.21 2003/07/16 03:35:16 dawes Exp $ */
2/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
3/***********************************************************
4
5Copyright 1987, 1998 The Open Group
6
7Permission to use, copy, modify, distribute, and sell this software and its
8documentation for any purpose is hereby granted without fee, provided that
9the above copyright notice appear in all copies and that both that
10copyright notice and this permission notice appear in supporting
11documentation.
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
19OPEN GROUP 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 Open Group 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 Open Group.
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/* $Xorg: mfb.h,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
50
51#if !defined(_MFB_H_) || defined(MFB_PROTOTYPES_ONLY)
52#ifndef MFB_PROTOTYPES_ONLY
53#define _MFB_H_
54#endif
55
56/* Monochrome Frame Buffer definitions
57 written by drewry, september 1986
58*/
59#include "pixmap.h"
60#include "region.h"
61#include "gc.h"
62#include "colormap.h"
63#include "miscstruct.h"
64#include "mibstore.h"
65
66extern int InverseAlu[];
67extern int mfbGetInverseAlu(int i);
68
69/* warning: PixelType definition duplicated in maskbits.h */
70#ifndef PixelType
71#define PixelType CARD32
72#endif /* PixelType */
73#ifndef MfbBits
74#define MfbBits CARD32
75#endif
76
77/* mfbbitblt.c */
78
79extern void mfbDoBitblt(
80 DrawablePtr /*pSrc*/,
81 DrawablePtr /*pDst*/,
82 int /*alu*/,
83 RegionPtr /*prgnDst*/,
84 DDXPointPtr /*pptSrc*/
85);
86
87extern RegionPtr mfbCopyArea(
88 DrawablePtr /*pSrcDrawable*/,
89 DrawablePtr /*pDstDrawable*/,
90 GCPtr/*pGC*/,
91 int /*srcx*/,
92 int /*srcy*/,
93 int /*width*/,
94 int /*height*/,
95 int /*dstx*/,
96 int /*dsty*/
97);
98
99extern Bool mfbRegisterCopyPlaneProc(
100 ScreenPtr /*pScreen*/,
101 RegionPtr (* /*proc*/)(
102 DrawablePtr /* pSrcDrawable */,
103 DrawablePtr /* pDstDrawable */,
104 GCPtr /* pGC */,
105 int /* srcx */,
106 int /* srcy */,
107 int /* width */,
108 int /* height */,
109 int /* dstx */,
110 int /* dsty */,
111 unsigned long /* bitPlane */
112 )
113);
114
115extern RegionPtr mfbCopyPlane(
116 DrawablePtr /*pSrcDrawable*/,
117 DrawablePtr /*pDstDrawable*/,
118 GCPtr/*pGC*/,
119 int /*srcx*/,
120 int /*srcy*/,
121 int /*width*/,
122 int /*height*/,
123 int /*dstx*/,
124 int /*dsty*/,
125 unsigned long /*plane*/
126);
127/* mfbbltC.c */
128
129extern void mfbDoBitbltCopy(
130 DrawablePtr /*pSrc*/,
131 DrawablePtr /*pDst*/,
132 int /*alu*/,
133 RegionPtr /*prgnDst*/,
134 DDXPointPtr /*pptSrc*/
135);
136/* mfbbltCI.c */
137
138extern void mfbDoBitbltCopyInverted(
139 DrawablePtr /*pSrc*/,
140 DrawablePtr /*pDst*/,
141 int /*alu*/,
142 RegionPtr /*prgnDst*/,
143 DDXPointPtr /*pptSrc*/
144);
145/* mfbbltG.c */
146
147extern void mfbDoBitbltGeneral(
148 DrawablePtr /*pSrc*/,
149 DrawablePtr /*pDst*/,
150 int /*alu*/,
151 RegionPtr /*prgnDst*/,
152 DDXPointPtr /*pptSrc*/
153);
154/* mfbbltO.c */
155
156extern void mfbDoBitbltOr(
157 DrawablePtr /*pSrc*/,
158 DrawablePtr /*pDst*/,
159 int /*alu*/,
160 RegionPtr /*prgnDst*/,
161 DDXPointPtr /*pptSrc*/
162);
163/* mfbbltX.c */
164
165extern void mfbDoBitbltXor(
166 DrawablePtr /*pSrc*/,
167 DrawablePtr /*pDst*/,
168 int /*alu*/,
169 RegionPtr /*prgnDst*/,
170 DDXPointPtr /*pptSrc*/
171);
172/* mfbbres.c */
173
174extern void mfbBresS(
175 int /*rop*/,
176 PixelType * /*addrl*/,
177 int /*nlwidth*/,
178 int /*signdx*/,
179 int /*signdy*/,
180 int /*axis*/,
181 int /*x1*/,
182 int /*y1*/,
183 int /*e*/,
184 int /*e1*/,
185 int /*e2*/,
186 int /*len*/
187);
188/* mfbbresd.c */
189
190extern void mfbBresD(
191 int /*fgrop*/,
192 int /*bgrop*/,
193 int * /*pdashIndex*/,
194 unsigned char * /*pDash*/,
195 int /*numInDashList*/,
196 int * /*pdashOffset*/,
197 int /*isDoubleDash*/,
198 PixelType * /*addrl*/,
199 int /*nlwidth*/,
200 int /*signdx*/,
201 int /*signdy*/,
202 int /*axis*/,
203 int /*x1*/,
204 int /*y1*/,
205 int /*e*/,
206 int /*e1*/,
207 int /*e2*/,
208 int /*len*/
209);
210/* mfbbstore.c */
211
212extern void mfbSaveAreas(
213 PixmapPtr /*pPixmap*/,
214 RegionPtr /*prgnSave*/,
215 int /*xorg*/,
216 int /*yorg*/,
217 WindowPtr /*pWin*/
218);
219
220extern void mfbRestoreAreas(
221 PixmapPtr /*pPixmap*/,
222 RegionPtr /*prgnRestore*/,
223 int /*xorg*/,
224 int /*yorg*/,
225 WindowPtr /*pWin*/
226);
227/* mfbclip.c */
228
229extern RegionPtr mfbPixmapToRegion(
230 PixmapPtr /*pPix*/
231);
232
233#ifndef MFB_PROTOTYPES_ONLY
234typedef RegionPtr (*mfbPixmapToRegionProc)(PixmapPtr);
235
236extern mfbPixmapToRegionProc *mfbPixmapToRegionWeak(void);
237#endif
238
239/* mfbcmap.c */
240
241extern int mfbListInstalledColormaps(
242 ScreenPtr /*pScreen*/,
243 Colormap * /*pmaps*/
244);
245
246extern void mfbInstallColormap(
247 ColormapPtr /*pmap*/
248);
249
250extern void mfbUninstallColormap(
251 ColormapPtr /*pmap*/
252);
253
254extern void mfbResolveColor(
255 unsigned short * /*pred*/,
256 unsigned short * /*pgreen*/,
257 unsigned short * /*pblue*/,
258 VisualPtr /*pVisual*/
259);
260
261extern Bool mfbCreateColormap(
262 ColormapPtr /*pMap*/
263);
264
265extern void mfbDestroyColormap(
266 ColormapPtr /*pMap*/
267);
268
269extern Bool mfbCreateDefColormap(
270 ScreenPtr /*pScreen*/
271);
272/* mfbfillarc.c */
273
274extern void mfbPolyFillArcSolid(
275 DrawablePtr /*pDraw*/,
276 GCPtr /*pGC*/,
277 int /*narcs*/,
278 xArc * /*parcs*/
279);
280/* mfbfillrct.c */
281
282extern void mfbPolyFillRect(
283 DrawablePtr /*pDrawable*/,
284 GCPtr /*pGC*/,
285 int /*nrectFill*/,
286 xRectangle * /*prectInit*/
287);
288/* mfbfillsp.c */
289
290extern void mfbBlackSolidFS(
291 DrawablePtr /*pDrawable*/,
292 GCPtr /*pGC*/,
293 int /*nInit*/,
294 DDXPointPtr /*pptInit*/,
295 int * /*pwidthInit*/,
296 int /*fSorted*/
297);
298
299extern void mfbWhiteSolidFS(
300 DrawablePtr /*pDrawable*/,
301 GCPtr /*pGC*/,
302 int /*nInit*/,
303 DDXPointPtr /*pptInit*/,
304 int * /*pwidthInit*/,
305 int /*fSorted*/
306);
307
308extern void mfbInvertSolidFS(
309 DrawablePtr /*pDrawable*/,
310 GCPtr /*pGC*/,
311 int /*nInit*/,
312 DDXPointPtr /*pptInit*/,
313 int * /*pwidthInit*/,
314 int /*fSorted*/
315);
316
317extern void mfbWhiteStippleFS(
318 DrawablePtr /*pDrawable*/,
319 GCPtr/*pGC*/,
320 int /*nInit*/,
321 DDXPointPtr /*pptInit*/,
322 int * /*pwidthInit*/,
323 int /*fSorted*/
324);
325
326extern void mfbBlackStippleFS(
327 DrawablePtr /*pDrawable*/,
328 GCPtr/*pGC*/,
329 int /*nInit*/,
330 DDXPointPtr /*pptInit*/,
331 int * /*pwidthInit*/,
332 int /*fSorted*/
333);
334
335extern void mfbInvertStippleFS(
336 DrawablePtr /*pDrawable*/,
337 GCPtr/*pGC*/,
338 int /*nInit*/,
339 DDXPointPtr /*pptInit*/,
340 int * /*pwidthInit*/,
341 int /*fSorted*/
342);
343
344extern void mfbTileFS(
345 DrawablePtr /*pDrawable*/,
346 GCPtr/*pGC*/,
347 int /*nInit*/,
348 DDXPointPtr /*pptInit*/,
349 int * /*pwidthInit*/,
350 int /*fSorted*/
351);
352
353extern void mfbUnnaturalTileFS(
354 DrawablePtr /*pDrawable*/,
355 GCPtr/*pGC*/,
356 int /*nInit*/,
357 DDXPointPtr /*pptInit*/,
358 int * /*pwidthInit*/,
359 int /*fSorted*/
360);
361
362extern void mfbUnnaturalStippleFS(
363 DrawablePtr /*pDrawable*/,
364 GCPtr/*pGC*/,
365 int /*nInit*/,
366 DDXPointPtr /*pptInit*/,
367 int * /*pwidthInit*/,
368 int /*fSorted*/
369);
370/* mfbfont.c */
371
372extern Bool mfbRealizeFont(
373 ScreenPtr /*pscr*/,
374 FontPtr /*pFont*/
375);
376
377extern Bool mfbUnrealizeFont(
378 ScreenPtr /*pscr*/,
379 FontPtr /*pFont*/
380);
381
382#ifndef MFB_PROTOTYPES_ONLY
383typedef void (*mfbRealizeFontProc)(ScreenPtr, FontPtr);
384typedef void (*mfbUnrealizeFontProc)(ScreenPtr, FontPtr);
385
386extern mfbRealizeFontProc *mfbRealizeFontWeak(void);
387extern mfbUnrealizeFontProc *mfbUnrealizeFontWeak(void);
388#endif
389
390/* mfbgc.c */
391
392extern Bool mfbCreateGC(
393 GCPtr /*pGC*/
394);
395
396extern void mfbValidateGC(
397 GCPtr /*pGC*/,
398 unsigned long /*changes*/,
399 DrawablePtr /*pDrawable*/
400);
401
402extern int mfbReduceRop(
403 int /*alu*/,
404 Pixel /*src*/
405);
406
407/* mfbgetsp.c */
408
409extern void mfbGetSpans(
410 DrawablePtr /*pDrawable*/,
411 int /*wMax*/,
412 DDXPointPtr /*ppt*/,
413 int * /*pwidth*/,
414 int /*nspans*/,
415 char * /*pdstStart*/
416);
417/* mfbhrzvert.c */
418
419extern void mfbHorzS(
420 int /*rop*/,
421 PixelType * /*addrl*/,
422 int /*nlwidth*/,
423 int /*x1*/,
424 int /*y1*/,
425 int /*len*/
426);
427
428extern void mfbVertS(
429 int /*rop*/,
430 PixelType * /*addrl*/,
431 int /*nlwidth*/,
432 int /*x1*/,
433 int /*y1*/,
434 int /*len*/
435);
436/* mfbigbblak.c */
437
438extern void mfbImageGlyphBltBlack(
439 DrawablePtr /*pDrawable*/,
440 GCPtr/*pGC*/,
441 int /*x*/,
442 int /*y*/,
443 unsigned int /*nglyph*/,
444 CharInfoPtr * /*ppci*/,
445 pointer /*pglyphBase*/
446);
447/* mfbigbwht.c */
448
449extern void mfbImageGlyphBltWhite(
450 DrawablePtr /*pDrawable*/,
451 GCPtr/*pGC*/,
452 int /*x*/,
453 int /*y*/,
454 unsigned int /*nglyph*/,
455 CharInfoPtr * /*ppci*/,
456 pointer /*pglyphBase*/
457);
458/* mfbimage.c */
459
460extern void mfbPutImage(
461 DrawablePtr /*dst*/,
462 GCPtr /*pGC*/,
463 int /*depth*/,
464 int /*x*/,
465 int /*y*/,
466 int /*w*/,
467 int /*h*/,
468 int /*leftPad*/,
469 int /*format*/,
470 char * /*pImage*/
471);
472
473extern void mfbGetImage(
474 DrawablePtr /*pDrawable*/,
475 int /*sx*/,
476 int /*sy*/,
477 int /*w*/,
478 int /*h*/,
479 unsigned int /*format*/,
480 unsigned long /*planeMask*/,
481 char * /*pdstLine*/
482);
483/* mfbline.c */
484
485extern void mfbLineSS(
486 DrawablePtr /*pDrawable*/,
487 GCPtr /*pGC*/,
488 int /*mode*/,
489 int /*npt*/,
490 DDXPointPtr /*pptInit*/
491);
492
493extern void mfbLineSD(
494 DrawablePtr /*pDrawable*/,
495 GCPtr /*pGC*/,
496 int /*mode*/,
497 int /*npt*/,
498 DDXPointPtr /*pptInit*/
499);
500
501/* mfbmisc.c */
502
503extern void mfbQueryBestSize(
504 int /*class*/,
505 unsigned short * /*pwidth*/,
506 unsigned short * /*pheight*/,
507 ScreenPtr /*pScreen*/
508);
509
510#ifndef MFB_PROTOTYPES_ONLY
511typedef void (*mfbQueryBestSizeProc)(int, unsigned short *, unsigned short *,
512 ScreenPtr);
513
514extern mfbQueryBestSizeProc *mfbQueryBestSizeWeak(void);
515#endif
516
517/* mfbpablack.c */
518
519extern void mfbSolidBlackArea(
520 DrawablePtr /*pDraw*/,
521 int /*nbox*/,
522 BoxPtr /*pbox*/,
523 int /*alu*/,
524 PixmapPtr /*nop*/
525);
526
527extern void mfbStippleBlackArea(
528 DrawablePtr /*pDraw*/,
529 int /*nbox*/,
530 BoxPtr /*pbox*/,
531 int /*alu*/,
532 PixmapPtr /*pstipple*/
533);
534/* mfbpainv.c */
535
536extern void mfbSolidInvertArea(
537 DrawablePtr /*pDraw*/,
538 int /*nbox*/,
539 BoxPtr /*pbox*/,
540 int /*alu*/,
541 PixmapPtr /*nop*/
542);
543
544extern void mfbStippleInvertArea(
545 DrawablePtr /*pDraw*/,
546 int /*nbox*/,
547 BoxPtr /*pbox*/,
548 int /*alu*/,
549 PixmapPtr /*pstipple*/
550);
551/* mfbpawhite.c */
552
553extern void mfbSolidWhiteArea(
554 DrawablePtr /*pDraw*/,
555 int /*nbox*/,
556 BoxPtr /*pbox*/,
557 int /*alu*/,
558 PixmapPtr /*nop*/
559);
560
561extern void mfbStippleWhiteArea(
562 DrawablePtr /*pDraw*/,
563 int /*nbox*/,
564 BoxPtr /*pbox*/,
565 int /*alu*/,
566 PixmapPtr /*pstipple*/
567);
568
569/* mfbpgbinv.c */
570
571extern void mfbPolyGlyphBltBlack(
572 DrawablePtr /*pDrawable*/,
573 GCPtr /*pGC*/,
574 int /*x*/,
575 int /*y*/,
576 unsigned int /*nglyph*/,
577 CharInfoPtr * /*ppci*/,
578 pointer /*pglyphBase*/
579);
580/* mfbpgbinv.c */
581
582extern void mfbPolyGlyphBltInvert(
583 DrawablePtr /*pDrawable*/,
584 GCPtr /*pGC*/,
585 int /*x*/,
586 int /*y*/,
587 unsigned int /*nglyph*/,
588 CharInfoPtr * /*ppci*/,
589 pointer /*pglyphBase*/
590);
591/* mfbpgbwht.c */
592
593extern void mfbPolyGlyphBltWhite(
594 DrawablePtr /*pDrawable*/,
595 GCPtr /*pGC*/,
596 int /*x*/,
597 int /*y*/,
598 unsigned int /*nglyph*/,
599 CharInfoPtr * /*ppci*/,
600 pointer /*pglyphBase*/
601);
602/* mfbpixmap.c */
603
604extern PixmapPtr mfbCreatePixmap(
605 ScreenPtr /*pScreen*/,
606 int /*width*/,
607 int /*height*/,
608 int /*depth*/
609);
610
611extern Bool mfbDestroyPixmap(
612 PixmapPtr /*pPixmap*/
613);
614
615extern PixmapPtr mfbCopyPixmap(
616 PixmapPtr /*pSrc*/
617);
618
619extern void mfbPadPixmap(
620 PixmapPtr /*pPixmap*/
621);
622
623extern void mfbXRotatePixmap(
624 PixmapPtr /*pPix*/,
625 int /*rw*/
626);
627
628extern void mfbYRotatePixmap(
629 PixmapPtr /*pPix*/,
630 int /*rh*/
631);
632
633extern void mfbCopyRotatePixmap(
634 PixmapPtr /*psrcPix*/,
635 PixmapPtr * /*ppdstPix*/,
636 int /*xrot*/,
637 int /*yrot*/
638);
639/* mfbplyblack.c */
640
641extern void mfbFillPolyBlack(
642 DrawablePtr /*pDrawable*/,
643 GCPtr /*pGC*/,
644 int /*shape*/,
645 int /*mode*/,
646 int /*count*/,
647 DDXPointPtr /*ptsIn*/
648);
649/* mfbplyinv.c */
650
651extern void mfbFillPolyInvert(
652 DrawablePtr /*pDrawable*/,
653 GCPtr /*pGC*/,
654 int /*shape*/,
655 int /*mode*/,
656 int /*count*/,
657 DDXPointPtr /*ptsIn*/
658);
659
660/* mfbpntwin.c */
661
662extern void mfbFillPolyWhite(
663 DrawablePtr /*pDrawable*/,
664 GCPtr /*pGC*/,
665 int /*shape*/,
666 int /*mode*/,
667 int /*count*/,
668 DDXPointPtr /*ptsIn*/
669);
670/* mfbpntwin.c */
671
672extern void mfbPaintWindow(
673 WindowPtr /*pWin*/,
674 RegionPtr /*pRegion*/,
675 int /*what*/
676);
677/* mfbpolypnt.c */
678
679extern void mfbPolyPoint(
680 DrawablePtr /*pDrawable*/,
681 GCPtr /*pGC*/,
682 int /*mode*/,
683 int /*npt*/,
684 xPoint * /*pptInit*/
685);
686/* mfbpushpxl.c */
687
688extern void mfbSolidPP(
689 GCPtr /*pGC*/,
690 PixmapPtr /*pBitMap*/,
691 DrawablePtr /*pDrawable*/,
692 int /*dx*/,
693 int /*dy*/,
694 int /*xOrg*/,
695 int /*yOrg*/
696);
697
698extern void mfbPushPixels(
699 GCPtr /*pGC*/,
700 PixmapPtr /*pBitMap*/,
701 DrawablePtr /*pDrawable*/,
702 int /*dx*/,
703 int /*dy*/,
704 int /*xOrg*/,
705 int /*yOrg*/
706);
707
708#ifndef MFB_PROTOTYPES_ONLY
709typedef void (*mfbPushPixelsProc)(GCPtr, PixmapPtr, DrawablePtr, int, int,
710 int, int);
711
712extern mfbPushPixelsProc *mfbPushPixelsWeak(void);
713#endif
714
715/* mfbscrclse.c */
716
717extern Bool mfbCloseScreen(
718 int /*index*/,
719 ScreenPtr /*pScreen*/
720);
721/* mfbscrinit.c */
722
723extern Bool mfbAllocatePrivates(
724 ScreenPtr /*pScreen*/,
725 int * /*pWinIndex*/,
726 int * /*pGCIndex*/
727);
728
729extern Bool mfbScreenInit(
730 ScreenPtr /*pScreen*/,
731 pointer /*pbits*/,
732 int /*xsize*/,
733 int /*ysize*/,
734 int /*dpix*/,
735 int /*dpiy*/,
736 int /*width*/
737);
738
739extern PixmapPtr mfbGetWindowPixmap(
740 WindowPtr /*pWin*/
741);
742
743extern void mfbSetWindowPixmap(
744 WindowPtr /*pWin*/,
745 PixmapPtr /*pPix*/
746);
747
748extern void mfbFillInScreen(ScreenPtr pScreen);
749
750/* mfbseg.c */
751
752extern void mfbSegmentSS(
753 DrawablePtr /*pDrawable*/,
754 GCPtr /*pGC*/,
755 int /*nseg*/,
756 xSegment * /*pSeg*/
757);
758
759extern void mfbSegmentSD(
760 DrawablePtr /*pDrawable*/,
761 GCPtr /*pGC*/,
762 int /*nseg*/,
763 xSegment * /*pSeg*/
764);
765/* mfbsetsp.c */
766
767extern void mfbSetScanline(
768 int /*y*/,
769 int /*xOrigin*/,
770 int /*xStart*/,
771 int /*xEnd*/,
772 PixelType * /*psrc*/,
773 int /*alu*/,
774 PixelType * /*pdstBase*/,
775 int /*widthDst*/
776);
777
778extern void mfbSetSpans(
779 DrawablePtr /*pDrawable*/,
780 GCPtr /*pGC*/,
781 char * /*psrc*/,
782 DDXPointPtr /*ppt*/,
783 int * /*pwidth*/,
784 int /*nspans*/,
785 int /*fSorted*/
786);
787/* mfbteblack.c */
788
789extern void mfbTEGlyphBltBlack(
790 DrawablePtr /*pDrawable*/,
791 GCPtr/*pGC*/,
792 int /*x*/,
793 int /*y*/,
794 unsigned int /*nglyph*/,
795 CharInfoPtr * /*ppci*/,
796 pointer /*pglyphBase*/
797);
798/* mfbtewhite.c */
799
800extern void mfbTEGlyphBltWhite(
801 DrawablePtr /*pDrawable*/,
802 GCPtr/*pGC*/,
803 int /*x*/,
804 int /*y*/,
805 unsigned int /*nglyph*/,
806 CharInfoPtr * /*ppci*/,
807 pointer /*pglyphBase*/
808);
809/* mfbtileC.c */
810
811extern void mfbTileAreaPPWCopy(
812 DrawablePtr /*pDraw*/,
813 int /*nbox*/,
814 BoxPtr /*pbox*/,
815 int /*alu*/,
816 PixmapPtr /*ptile*/
817);
818/* mfbtileG.c */
819
820extern void mfbTileAreaPPWGeneral(
821 DrawablePtr /*pDraw*/,
822 int /*nbox*/,
823 BoxPtr /*pbox*/,
824 int /*alu*/,
825 PixmapPtr /*ptile*/
826);
827
828extern void mfbTileAreaPPW(
829 DrawablePtr /*pDraw*/,
830 int /*nbox*/,
831 BoxPtr /*pbox*/,
832 int /*alu*/,
833 PixmapPtr /*ptile*/
834);
835/* mfbwindow.c */
836
837extern Bool mfbCreateWindow(
838 WindowPtr /*pWin*/
839);
840
841extern Bool mfbDestroyWindow(
842 WindowPtr /*pWin*/
843);
844
845extern Bool mfbMapWindow(
846 WindowPtr /*pWindow*/
847);
848
849extern Bool mfbPositionWindow(
850 WindowPtr /*pWin*/,
851 int /*x*/,
852 int /*y*/
853);
854
855extern Bool mfbUnmapWindow(
856 WindowPtr /*pWindow*/
857);
858
859extern void mfbCopyWindow(
860 WindowPtr /*pWin*/,
861 DDXPointRec /*ptOldOrg*/,
862 RegionPtr /*prgnSrc*/
863);
864
865extern Bool mfbChangeWindowAttributes(
866 WindowPtr /*pWin*/,
867 unsigned long /*mask*/
868);
869/* mfbzerarc.c */
870
871extern void mfbZeroPolyArcSS(
872 DrawablePtr /*pDraw*/,
873 GCPtr /*pGC*/,
874 int /*narcs*/,
875 xArc * /*parcs*/
876);
877
878#ifndef MFB_PROTOTYPES_ONLY
879/*
880 private filed of pixmap
881 pixmap.devPrivate = (PixelType *)pointer_to_bits
882 pixmap.devKind = width_of_pixmap_in_bytes
883
884 private field of screen
885 a pixmap, for which we allocate storage. devPrivate is a pointer to
886the bits in the hardware framebuffer. note that devKind can be poked to
887make the code work for framebuffers that are wider than their
888displayable screen (e.g. the early vsII, which displayed 960 pixels
889across, but was 1024 in the hardware.)
890
891 private field of GC
892*/
893typedef void (*mfbFillAreaProcPtr)(
894 DrawablePtr /*pDraw*/,
895 int /*nbox*/,
896 BoxPtr /*pbox*/,
897 int /*alu*/,
898 PixmapPtr /*nop*/
899 );
900
901typedef struct {
902 unsigned char rop; /* reduction of rasterop to 1 of 3 */
903 unsigned char ropOpStip; /* rop for opaque stipple */
904 unsigned char ropFillArea; /* == alu, rop, or ropOpStip */
905 unsigned char unused1[sizeof(long) - 3]; /* Alignment */
906 mfbFillAreaProcPtr FillArea; /* fills regions; look at the code */
907 } mfbPrivGC;
908typedef mfbPrivGC *mfbPrivGCPtr;
909#endif
910
911/* XXX these should be static, but it breaks the ABI */
912extern int mfbGCPrivateIndex; /* index into GC private array */
913extern int mfbGetGCPrivateIndex(void);
914extern int mfbWindowPrivateIndex; /* index into Window private array */
915extern int mfbGetWindowPrivateIndex(void);
916#ifdef PIXMAP_PER_WINDOW
917extern int frameWindowPrivateIndex; /* index into Window private array */
918extern int frameGetWindowPrivateIndex(void);
919#endif
920
921#ifndef MFB_PROTOTYPES_ONLY
922/* private field of window */
923typedef struct {
924 unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */
925 unsigned char fastBackground;
926 unsigned short unused; /* pad for alignment with Sun compiler */
927 DDXPointRec oldRotate;
928 PixmapPtr pRotatedBackground;
929 PixmapPtr pRotatedBorder;
930 } mfbPrivWin;
931
932/* Common macros for extracting drawing information */
933
934#define mfbGetTypedWidth(pDrawable,wtype) (\
935 (((pDrawable)->type == DRAWABLE_WINDOW) ? \
936 (int) (((PixmapPtr)((pDrawable)->pScreen->devPrivate))->devKind) : \
937 (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
938
939#define mfbGetByteWidth(pDrawable) mfbGetTypedWidth(pDrawable, unsigned char)
940
941#define mfbGetPixelWidth(pDrawable) mfbGetTypedWidth(pDrawable, PixelType)
942
943#define mfbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
944 PixmapPtr _pPix; \
945 if ((pDrawable)->type == DRAWABLE_WINDOW) \
946 _pPix = (PixmapPtr) (pDrawable)->pScreen->devPrivate; \
947 else \
948 _pPix = (PixmapPtr) (pDrawable); \
949 (pointer) = (ptype *) _pPix->devPrivate.ptr; \
950 (width) = ((int) _pPix->devKind) / sizeof (wtype); \
951}
952
953#define mfbGetByteWidthAndPointer(pDrawable, width, pointer) \
954 mfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
955
956#define mfbGetPixelWidthAndPointer(pDrawable, width, pointer) \
957 mfbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
958
959#define mfbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
960 PixmapPtr _pPix = (PixmapPtr) (pWin)->drawable.pScreen->devPrivate; \
961 (pointer) = (ptype *) _pPix->devPrivate.ptr; \
962 (width) = ((int) _pPix->devKind) / sizeof (wtype); \
963}
964
965#define mfbGetWindowPixelWidthAndPointer(pWin, width, pointer) \
966 mfbGetWindowTypedWidthAndPointer(pWin, width, pointer, PixelType, PixelType)
967
968#define mfbGetWindowByteWidthAndPointer(pWin, width, pointer) \
969 mfbGetWindowTypedWidthAndPointer(pWin, width, pointer, char, char)
970
971/* mfb uses the following macros to calculate addresses in drawables.
972 * To support banked framebuffers, the macros come in four flavors.
973 * All four collapse into the same definition on unbanked devices.
974 *
975 * mfbScanlineFoo - calculate address and do bank switching
976 * mfbScanlineFooNoBankSwitch - calculate address, don't bank switch
977 * mfbScanlineFooSrc - calculate address, switch source bank
978 * mfbScanlineFooDst - calculate address, switch destination bank
979 */
980
981/* The NoBankSwitch versions are the same for banked and unbanked cases */
982
983#define mfbScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
984#define mfbScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr) + (_off))
985#define mfbScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
986 mfbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w))
987#define mfbScanlineNoBankSwitch(_ptr, _x, _y, _w) \
988 mfbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
989
990#ifdef MFB_LINE_BANK
991
992#include "mfblinebank.h" /* get macro definitions from this file */
993
994#else /* !MFB_LINE_BANK - unbanked case */
995
996#define mfbScanlineInc(_ptr, _off) mfbScanlineIncNoBankSwitch(_ptr, _off)
997#define mfbScanlineIncSrc(_ptr, _off) mfbScanlineInc(_ptr, _off)
998#define mfbScanlineIncDst(_ptr, _off) mfbScanlineInc(_ptr, _off)
999
1000#define mfbScanlineOffset(_ptr, _off) mfbScanlineOffsetNoBankSwitch(_ptr, _off)
1001#define mfbScanlineOffsetSrc(_ptr, _off) mfbScanlineOffset(_ptr, _off)
1002#define mfbScanlineOffsetDst(_ptr, _off) mfbScanlineOffset(_ptr, _off)
1003
1004#define mfbScanlineSrc(_ptr, _x, _y, _w) mfbScanline(_ptr, _x, _y, _w)
1005#define mfbScanlineDst(_ptr, _x, _y, _w) mfbScanline(_ptr, _x, _y, _w)
1006
1007#define mfbScanlineDeltaSrc(_ptr, _y, _w) mfbScanlineDelta(_ptr, _y, _w)
1008#define mfbScanlineDeltaDst(_ptr, _y, _w) mfbScanlineDelta(_ptr, _y, _w)
1009
1010#endif /* MFB_LINE_BANK */
1011
1012#define mfbScanlineDelta(_ptr, _y, _w) \
1013 mfbScanlineOffset(_ptr, (_y) * (_w))
1014
1015#define mfbScanline(_ptr, _x, _y, _w) \
1016 mfbScanlineOffset(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
1017
1018
1019/* precomputed information about each glyph for GlyphBlt code.
1020 this saves recalculating the per glyph information for each box.
1021*/
1022typedef struct _pos{
1023 int xpos; /* xposition of glyph's origin */
1024 int xchar; /* x position mod 32 */
1025 int leftEdge;
1026 int rightEdge;
1027 int topEdge;
1028 int bottomEdge;
1029 PixelType *pdstBase; /* longword with character origin */
1030 int widthGlyph; /* width in bytes of this glyph */
1031} TEXTPOS;
1032
1033/* reduced raster ops for mfb */
1034#define RROP_BLACK GXclear
1035#define RROP_WHITE GXset
1036#define RROP_NOP GXnoop
1037#define RROP_INVERT GXinvert
1038
1039/* macros for mfbbitblt.c, mfbfillsp.c
1040 these let the code do one switch on the rop per call, rather
1041than a switch on the rop per item (span or rectangle.)
1042*/
1043
1044#define fnCLEAR(src, dst) (0)
1045#define fnAND(src, dst) (src & dst)
1046#define fnANDREVERSE(src, dst) (src & ~dst)
1047#define fnCOPY(src, dst) (src)
1048#define fnANDINVERTED(src, dst) (~src & dst)
1049#define fnNOOP(src, dst) (dst)
1050#define fnXOR(src, dst) (src ^ dst)
1051#define fnOR(src, dst) (src | dst)
1052#define fnNOR(src, dst) (~(src | dst))
1053#define fnEQUIV(src, dst) (~src ^ dst)
1054#define fnINVERT(src, dst) (~dst)
1055#define fnORREVERSE(src, dst) (src | ~dst)
1056#define fnCOPYINVERTED(src, dst)(~src)
1057#define fnORINVERTED(src, dst) (~src | dst)
1058#define fnNAND(src, dst) (~(src & dst))
1059#undef fnSET
1060#define fnSET(src, dst) (MfbBits)(~0)
1061
1062/* Using a "switch" statement is much faster in most cases
1063 * since the compiler can do a look-up table or multi-way branch
1064 * instruction, depending on the architecture. The result on
1065 * A Sun 3/50 is at least 2.5 times faster, assuming a uniform
1066 * distribution of RasterOp operation types.
1067 *
1068 * However, doing some profiling on a running system reveals
1069 * GXcopy is the operation over 99.5% of the time and
1070 * GXxor is the next most frequent (about .4%), so we make special
1071 * checks for those first.
1072 *
1073 * Note that this requires a change to the "calling sequence"
1074 * since we can't engineer a "switch" statement to have an lvalue.
1075 */
1076#undef DoRop
1077#define DoRop(result, alu, src, dst) \
1078{ \
1079 if (alu == GXcopy) \
1080 result = fnCOPY (src, dst); \
1081 else if (alu == GXxor) \
1082 result = fnXOR (src, dst); \
1083 else \
1084 switch (alu) \
1085 { \
1086 case GXclear: \
1087 result = fnCLEAR (src, dst); \
1088 break; \
1089 case GXand: \
1090 result = fnAND (src, dst); \
1091 break; \
1092 case GXandReverse: \
1093 result = fnANDREVERSE (src, dst); \
1094 break; \
1095 case GXandInverted: \
1096 result = fnANDINVERTED (src, dst); \
1097 break; \
1098 default: \
1099 case GXnoop: \
1100 result = fnNOOP (src, dst); \
1101 break; \
1102 case GXor: \
1103 result = fnOR (src, dst); \
1104 break; \
1105 case GXnor: \
1106 result = fnNOR (src, dst); \
1107 break; \
1108 case GXequiv: \
1109 result = fnEQUIV (src, dst); \
1110 break; \
1111 case GXinvert: \
1112 result = fnINVERT (src, dst); \
1113 break; \
1114 case GXorReverse: \
1115 result = fnORREVERSE (src, dst); \
1116 break; \
1117 case GXcopyInverted: \
1118 result = fnCOPYINVERTED (src, dst); \
1119 break; \
1120 case GXorInverted: \
1121 result = fnORINVERTED (src, dst); \
1122 break; \
1123 case GXnand: \
1124 result = fnNAND (src, dst); \
1125 break; \
1126 case GXset: \
1127 result = fnSET (src, dst); \
1128 break; \
1129 } \
1130}
1131
1132
1133/* C expression fragments for various operations. These get passed in
1134 * as -D's on the compile command line. See mfb/Imakefile. This
1135 * fixes XBUG 6319.
1136 *
1137 * This seems like a good place to point out that mfb's use of the
1138 * words black and white is an unfortunate misnomer. In mfb code, black
1139 * means zero, and white means one.
1140 */
1141#define MFB_OPEQ_WHITE |=
1142#define MFB_OPEQ_BLACK &=~
1143#define MFB_OPEQ_INVERT ^=
1144#define MFB_EQWHOLEWORD_WHITE =~0
1145#define MFB_EQWHOLEWORD_BLACK =0
1146#define MFB_EQWHOLEWORD_INVERT ^=~0
1147#define MFB_OP_WHITE /* nothing */
1148#define MFB_OP_BLACK ~
1149
1150#endif /* MFB_PROTOTYPES_ONLY */
1151#endif /* _MFB_H_ */
Note: See TracBrowser for help on using the repository browser.

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