VirtualBox

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

Last change on this file since 99743 was 17471, checked in by vboxsync, 16 years ago

export to OSE

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