VirtualBox

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

Last change on this file since 33428 was 25078, checked in by vboxsync, 15 years ago

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

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