]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/cfb/cfb.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / programs / Xserver / cfb / cfb.h
1 /* $XConsortium: cfb.h,v 5.37 94/04/17 20:28:38 dpw Exp $ */
2 /* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.3.2.2 1997/05/30 13:50:37 hohndel Exp $ */
3 /************************************************************
4 Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
5
6                     All Rights Reserved
7
8 Permission  to  use,  copy,  modify,  and  distribute   this
9 software  and  its documentation for any purpose and without
10 fee is hereby granted, provided that the above copyright no-
11 tice  appear  in all copies and that both that copyright no-
12 tice and this permission notice appear in  supporting  docu-
13 mentation,  and  that the names of Sun or X Consortium
14 not be used in advertising or publicity pertaining to 
15 distribution  of  the software  without specific prior 
16 written permission. Sun and X Consortium make no 
17 representations about the suitability of this software for 
18 any purpose. It is provided "as is" without any express or 
19 implied warranty.
20
21 SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
22 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
23 NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
24 ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
25 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
26 PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
27 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
28 THE USE OR PERFORMANCE OF THIS SOFTWARE.
29
30 ********************************************************/
31
32 #include "X.h"
33 #include "pixmap.h"
34 #include "region.h"
35 #include "gc.h"
36 #include "colormap.h"
37 #include "miscstruct.h"
38 #include "servermd.h"
39 #include "windowstr.h"
40 #include "mfb.h"
41 #undef PixelType
42
43 #include "cfbmap.h"
44
45 /*
46    private filed of pixmap
47    pixmap.devPrivate = (unsigned int *)pointer_to_bits
48    pixmap.devKind = width_of_pixmap_in_bytes
49 */
50
51 extern int  cfbGCPrivateIndex;
52 extern int  cfbWindowPrivateIndex;
53
54 /* private field of GC */
55 typedef struct {
56     unsigned char       rop;            /* special case rop values */
57     /* next two values unused in cfb, included for compatibility with mfb */
58     unsigned char       ropOpStip;      /* rop for opaque stipple */
59     /* this value is ropFillArea in mfb, usurped for cfb */
60     unsigned char       oneRect;        /*  drawable has one clip rect */
61     unsigned            fExpose:1;      /* callexposure handling ? */
62     unsigned            freeCompClip:1;
63     PixmapPtr           pRotatedPixmap;
64     RegionPtr           pCompositeClip; /* FREE_CC or REPLACE_CC */
65     unsigned long       xor, and;       /* reduced rop values */
66     } cfbPrivGC;
67
68 typedef cfbPrivGC       *cfbPrivGCPtr;
69
70 #define cfbGetGCPrivate(pGC)    ((cfbPrivGCPtr)\
71         (pGC)->devPrivates[cfbGCPrivateIndex].ptr)
72
73 #define cfbGetCompositeClip(pGC) (((cfbPrivGCPtr)\
74         (pGC)->devPrivates[cfbGCPrivateIndex].ptr)->pCompositeClip)
75
76 /* way to carry RROP info around */
77 typedef struct {
78     unsigned char       rop;
79     unsigned long       xor, and;
80 } cfbRRopRec, *cfbRRopPtr;
81
82 /* private field of window */
83 typedef struct {
84     unsigned    char fastBorder; /* non-zero if border is 32 bits wide */
85     unsigned    char fastBackground;
86     unsigned short unused; /* pad for alignment with Sun compiler */
87     DDXPointRec oldRotate;
88     PixmapPtr   pRotatedBackground;
89     PixmapPtr   pRotatedBorder;
90     } cfbPrivWin;
91
92 #define cfbGetWindowPrivate(_pWin) ((cfbPrivWin *)\
93         (_pWin)->devPrivates[cfbWindowPrivateIndex].ptr)
94
95
96 /* cfb8bit.c */
97
98 extern int cfbSetStipple(
99 #if NeedFunctionPrototypes
100     int /*alu*/,
101     unsigned long /*fg*/,
102     unsigned long /*planemask*/
103 #endif
104 );
105
106 extern int cfbSetOpaqueStipple(
107 #if NeedFunctionPrototypes
108     int /*alu*/,
109     unsigned long /*fg*/,
110     unsigned long /*bg*/,
111     unsigned long /*planemask*/
112 #endif
113 );
114
115 extern int cfbComputeClipMasks32(
116 #if NeedFunctionPrototypes
117     BoxPtr /*pBox*/,
118     int /*numRects*/,
119     int /*x*/,
120     int /*y*/,
121     int /*w*/,
122     int /*h*/,
123     CARD32 * /*clips*/
124 #endif
125 );
126 /* cfb8cppl.c */
127
128 extern void cfbCopyImagePlane(
129 #if NeedFunctionPrototypes
130     DrawablePtr /*pSrcDrawable*/,
131     DrawablePtr /*pDstDrawable*/,
132     int /*rop*/,
133     RegionPtr /*prgnDst*/,
134     DDXPointPtr /*pptSrc*/,
135     unsigned long /*planemask*/
136 #endif
137 );
138
139 extern void cfbCopyPlane8to1(
140 #if NeedFunctionPrototypes
141     DrawablePtr /*pSrcDrawable*/,
142     DrawablePtr /*pDstDrawable*/,
143     int /*rop*/,
144     RegionPtr /*prgnDst*/,
145     DDXPointPtr /*pptSrc*/,
146     unsigned long /*planemask*/,
147     unsigned long /*bitPlane*/
148 #endif
149 );
150 /* cfb8lineCO.c */
151
152 extern int cfb8LineSS1RectCopy(
153 #if NeedFunctionPrototypes
154     DrawablePtr /*pDrawable*/,
155     GCPtr /*pGC*/,
156     int /*mode*/,
157     int /*npt*/,
158     DDXPointPtr /*pptInit*/,
159     DDXPointPtr /*pptInitOrig*/,
160     int * /*x1p*/,
161     int * /*y1p*/,
162     int * /*x2p*/,
163     int * /*y2p*/
164 #endif
165 );
166
167 extern void cfb8LineSS1Rect(
168 #if NeedFunctionPrototypes
169     DrawablePtr /*pDrawable*/,
170     GCPtr /*pGC*/,
171     int /*mode*/,
172     int /*npt*/,
173     DDXPointPtr /*pptInit*/
174 #endif
175 );
176
177 extern void cfb8ClippedLineCopy(
178 #if NeedFunctionPrototypes
179     DrawablePtr /*pDrawable*/,
180     GCPtr /*pGC*/,
181     int /*x1*/,
182     int /*y1*/,
183     int /*x2*/,
184     int /*y2*/,
185     BoxPtr /*boxp*/,
186     Bool /*shorten*/
187 #endif
188 );
189 /* cfb8lineCP.c */
190
191 extern int cfb8LineSS1RectPreviousCopy(
192 #if NeedFunctionPrototypes
193     DrawablePtr /*pDrawable*/,
194     GCPtr /*pGC*/,
195     int /*mode*/,
196     int /*npt*/,
197     DDXPointPtr /*pptInit*/,
198     DDXPointPtr /*pptInitOrig*/,
199     int * /*x1p*/,
200     int * /*y1p*/,
201     int * /*x2p*/,
202     int * /*y2p*/
203
204 #endif
205 );
206 /* cfb8lineG.c */
207
208 extern int cfb8LineSS1RectGeneral(
209 #if NeedFunctionPrototypes
210     DrawablePtr /*pDrawable*/,
211     GCPtr /*pGC*/,
212     int /*mode*/,
213     int /*npt*/,
214     DDXPointPtr /*pptInit*/,
215     DDXPointPtr /*pptInitOrig*/,
216     int * /*x1p*/,
217     int * /*y1p*/,
218     int * /*x2p*/,
219     int * /*y2p*/
220 #endif
221 );
222
223 extern void cfb8ClippedLineGeneral(
224 #if NeedFunctionPrototypes
225     DrawablePtr /*pDrawable*/,
226     GCPtr /*pGC*/,
227     int /*x1*/,
228     int /*y1*/,
229     int /*x2*/,
230     int /*y2*/,
231     BoxPtr /*boxp*/,
232     Bool /*shorten*/
233 #endif
234 );
235 /* cfb8lineX.c */
236
237 extern int cfb8LineSS1RectXor(
238 #if NeedFunctionPrototypes
239     DrawablePtr /*pDrawable*/,
240     GCPtr /*pGC*/,
241     int /*mode*/,
242     int /*npt*/,
243     DDXPointPtr /*pptInit*/,
244     DDXPointPtr /*pptInitOrig*/,
245     int * /*x1p*/,
246     int * /*y1p*/,
247     int * /*x2p*/,
248     int * /*y2p*/
249 #endif
250 );
251
252 extern void cfb8ClippedLineXor(
253 #if NeedFunctionPrototypes
254     DrawablePtr /*pDrawable*/,
255     GCPtr /*pGC*/,
256     int /*x1*/,
257     int /*y1*/,
258     int /*x2*/,
259     int /*y2*/,
260     BoxPtr /*boxp*/,
261     Bool /*shorten*/
262 #endif
263 );
264 /* cfb8segC.c */
265
266 extern int cfb8SegmentSS1RectCopy(
267 #if NeedFunctionPrototypes
268     DrawablePtr /*pDrawable*/,
269     GCPtr /*pGC*/,
270     int /*nseg*/,
271     xSegment * /*pSegInit*/
272 #endif
273 );
274 /* cfb8segCS.c */
275
276 extern int cfb8SegmentSS1RectShiftCopy(
277 #if NeedFunctionPrototypes
278     DrawablePtr /*pDrawable*/,
279     GCPtr /*pGC*/,
280     int /*nseg*/,
281     xSegment * /*pSegInit*/
282 #endif
283 );
284
285 extern void cfb8SegmentSS1Rect(
286 #if NeedFunctionPrototypes
287     DrawablePtr /*pDrawable*/,
288     GCPtr /*pGC*/,
289     int /*nseg*/,
290     xSegment * /*pSegInit*/
291 #endif
292 );
293 /* cfb8segG.c */
294
295 extern int cfb8SegmentSS1RectGeneral(
296 #if NeedFunctionPrototypes
297     DrawablePtr /*pDrawable*/,
298     GCPtr /*pGC*/,
299     int /*nseg*/,
300     xSegment * /*pSegInit*/
301 #endif
302 );
303 /* cfbsegX.c */
304
305 extern int cfb8SegmentSS1RectXor(
306 #if NeedFunctionPrototypes
307     DrawablePtr /*pDrawable*/,
308     GCPtr /*pGC*/,
309     int /*nseg*/,
310     xSegment * /*pSegInit*/
311 #endif
312 );
313 /* cfballpriv.c */
314
315 extern Bool cfbAllocatePrivates(
316 #if NeedFunctionPrototypes
317     ScreenPtr /*pScreen*/,
318     int * /*window_index*/,
319     int * /*gc_index*/
320 #endif
321 );
322 /* cfbbitblt.c */
323
324 extern RegionPtr cfbBitBlt(
325 #if NeedFunctionPrototypes
326     DrawablePtr /*pSrcDrawable*/,
327     DrawablePtr /*pDstDrawable*/,
328     GCPtr/*pGC*/,
329     int /*srcx*/,
330     int /*srcy*/,
331     int /*width*/,
332     int /*height*/,
333     int /*dstx*/,
334     int /*dsty*/,
335     void (* /*doBitBlt*/)(
336 #if NeedNestedPrototypes
337         DrawablePtr /*pSrc*/,
338         DrawablePtr /*pDst*/,
339         int /*alu*/,
340         RegionPtr /*prgnDst*/,
341         DDXPointPtr /*pptSrc*/,
342         unsigned long /*planemask*/,
343         unsigned long /*bitPlane*/
344 #endif
345         ),
346     unsigned long /*bitPlane*/
347 #endif
348 );
349
350 extern void cfbDoBitblt(
351 #if NeedFunctionPrototypes
352     DrawablePtr /*pSrc*/,
353     DrawablePtr /*pDst*/,
354     int /*alu*/,
355     RegionPtr /*prgnDst*/,
356     DDXPointPtr /*pptSrc*/,
357     unsigned long /*planemask*/
358 #endif
359 );
360
361 extern RegionPtr cfbCopyArea(
362 #if NeedFunctionPrototypes
363     DrawablePtr /*pSrcDrawable*/,
364     DrawablePtr /*pDstDrawable*/,
365     GCPtr/*pGC*/,
366     int /*srcx*/,
367     int /*srcy*/,
368     int /*width*/,
369     int /*height*/,
370     int /*dstx*/,
371     int /*dsty*/
372 #endif
373 );
374
375 extern void cfbCopyPlane1to8(
376 #if NeedFunctionPrototypes
377     DrawablePtr /*pSrcDrawable*/,
378     DrawablePtr /*pDstDrawable*/,
379     int /*rop*/,
380     RegionPtr /*prgnDst*/,
381     DDXPointPtr /*pptSrc*/,
382     unsigned long /*planemask*/,
383     unsigned long /*bitPlane*/
384 #endif
385 );
386
387 extern RegionPtr cfbCopyPlane(
388 #if NeedFunctionPrototypes
389     DrawablePtr /*pSrcDrawable*/,
390     DrawablePtr /*pDstDrawable*/,
391     GCPtr /*pGC*/,
392     int /*srcx*/,
393     int /*srcy*/,
394     int /*width*/,
395     int /*height*/,
396     int /*dstx*/,
397     int /*dsty*/,
398     unsigned long /*bitPlane*/
399 #endif
400 );
401 /* cfbbltC.c */
402
403 extern void cfbDoBitbltCopy(
404 #if NeedFunctionPrototypes
405     DrawablePtr /*pSrc*/,
406     DrawablePtr /*pDst*/,
407     int /*alu*/,
408     RegionPtr /*prgnDst*/,
409     DDXPointPtr /*pptSrc*/,
410     unsigned long /*planemask*/
411 #endif
412 );
413 /* cfbbltG.c */
414
415 extern void cfbDoBitbltGeneral(
416 #if NeedFunctionPrototypes
417     DrawablePtr /*pSrc*/,
418     DrawablePtr /*pDst*/,
419     int /*alu*/,
420     RegionPtr /*prgnDst*/,
421     DDXPointPtr /*pptSrc*/,
422     unsigned long /*planemask*/
423 #endif
424 );
425 /* cfbbltO.c */
426
427 extern void cfbDoBitbltOr(
428 #if NeedFunctionPrototypes
429     DrawablePtr /*pSrc*/,
430     DrawablePtr /*pDst*/,
431     int /*alu*/,
432     RegionPtr /*prgnDst*/,
433     DDXPointPtr /*pptSrc*/,
434     unsigned long /*planemask*/
435 #endif
436 );
437 /* cfbbltX.c */
438
439 extern void cfbDoBitbltXor(
440 #if NeedFunctionPrototypes
441     DrawablePtr /*pSrc*/,
442     DrawablePtr /*pDst*/,
443     int /*alu*/,
444     RegionPtr /*prgnDst*/,
445     DDXPointPtr /*pptSrc*/,
446     unsigned long /*planemask*/
447 #endif
448 );
449 /* cfbbres.c */
450
451 extern void cfbBresS(
452 #if NeedFunctionPrototypes
453     int /*rop*/,
454     unsigned long /*and*/,
455     unsigned long /*xor*/,
456     unsigned long * /*addrl*/,
457     int /*nlwidth*/,
458     int /*signdx*/,
459     int /*signdy*/,
460     int /*axis*/,
461     int /*x1*/,
462     int /*y1*/,
463     int /*e*/,
464     int /*e1*/,
465     int /*e2*/,
466     int /*len*/
467 #endif
468 );
469 /* cfbbresd.c */
470
471 extern void cfbBresD(
472 #if NeedFunctionPrototypes
473     cfbRRopPtr /*rrops*/,
474     int * /*pdashIndex*/,
475     unsigned char * /*pDash*/,
476     int /*numInDashList*/,
477     int * /*pdashOffset*/,
478     int /*isDoubleDash*/,
479     unsigned long * /*addrl*/,
480     int /*nlwidth*/,
481     int /*signdx*/,
482     int /*signdy*/,
483     int /*axis*/,
484     int /*x1*/,
485     int /*y1*/,
486     int /*e*/,
487     int /*e1*/,
488     int /*e2*/,
489     int /*len*/
490 #endif
491 );
492 /* cfbbstore.c */
493
494 extern void cfbSaveAreas(
495 #if NeedFunctionPrototypes
496     PixmapPtr /*pPixmap*/,
497     RegionPtr /*prgnSave*/,
498     int /*xorg*/,
499     int /*yorg*/,
500     WindowPtr /*pWin*/
501 #endif
502 );
503
504 extern void cfbRestoreAreas(
505 #if NeedFunctionPrototypes
506     PixmapPtr /*pPixmap*/,
507     RegionPtr /*prgnRestore*/,
508     int /*xorg*/,
509     int /*yorg*/,
510     WindowPtr /*pWin*/
511 #endif
512 );
513 /* cfbcmap.c */
514
515 extern int cfbListInstalledColormaps(
516 #if NeedFunctionPrototypes
517     ScreenPtr   /*pScreen*/,
518     Colormap    * /*pmaps*/
519 #endif
520 );
521
522 extern void cfbInstallColormap(
523 #if NeedFunctionPrototypes
524     ColormapPtr /*pmap*/
525 #endif
526 );
527
528 extern void cfbUninstallColormap(
529 #if NeedFunctionPrototypes
530     ColormapPtr /*pmap*/
531 #endif
532 );
533
534 extern void cfbResolveColor(
535 #if NeedFunctionPrototypes
536     unsigned short * /*pred*/,
537     unsigned short * /*pgreen*/,
538     unsigned short * /*pblue*/,
539     VisualPtr /*pVisual*/
540 #endif
541 );
542
543 extern Bool cfbInitializeColormap(
544 #if NeedFunctionPrototypes
545     ColormapPtr /*pmap*/
546 #endif
547 );
548
549 extern int cfbExpandDirectColors(
550 #if NeedFunctionPrototypes
551     ColormapPtr /*pmap*/,
552     int /*ndef*/,
553     xColorItem * /*indefs*/,
554     xColorItem * /*outdefs*/
555 #endif
556 );
557
558 extern Bool cfbCreateDefColormap(
559 #if NeedFunctionPrototypes
560     ScreenPtr /*pScreen*/
561 #endif
562 );
563
564 extern Bool cfbSetVisualTypes(
565 #if NeedFunctionPrototypes
566     int /*depth*/,
567     int /*visuals*/,
568     int /*bitsPerRGB*/
569 #endif
570 );
571
572 extern Bool cfbInitVisuals(
573 #if NeedFunctionPrototypes
574     VisualPtr * /*visualp*/,
575     DepthPtr * /*depthp*/,
576     int * /*nvisualp*/,
577     int * /*ndepthp*/,
578     int * /*rootDepthp*/,
579     VisualID * /*defaultVisp*/,
580     unsigned long /*sizes*/,
581     int /*bitsPerRGB*/
582 #endif
583 );
584 /* cfbfillarcC.c */
585
586 extern void cfbPolyFillArcSolidCopy(
587 #if NeedFunctionPrototypes
588     DrawablePtr /*pDraw*/,
589     GCPtr /*pGC*/,
590     int /*narcs*/,
591     xArc * /*parcs*/
592 #endif
593 );
594 /* cfbfillarcG.c */
595
596 extern void cfbPolyFillArcSolidGeneral(
597 #if NeedFunctionPrototypes
598     DrawablePtr /*pDraw*/,
599     GCPtr /*pGC*/,
600     int /*narcs*/,
601     xArc * /*parcs*/
602 #endif
603 );
604 /* cfbfillrct.c */
605
606 extern void cfbFillBoxTileOdd(
607 #if NeedFunctionPrototypes
608     DrawablePtr /*pDrawable*/,
609     int /*n*/,
610     BoxPtr /*rects*/,
611     PixmapPtr /*tile*/,
612     int /*xrot*/,
613     int /*yrot*/
614 #endif
615 );
616
617 extern void cfbFillRectTileOdd(
618 #if NeedFunctionPrototypes
619     DrawablePtr /*pDrawable*/,
620     GCPtr /*pGC*/,
621     int /*nBox*/,
622     BoxPtr /*pBox*/
623 #endif
624 );
625
626 extern void cfbPolyFillRect(
627 #if NeedFunctionPrototypes
628     DrawablePtr /*pDrawable*/,
629     GCPtr /*pGC*/,
630     int /*nrectFill*/,
631     xRectangle * /*prectInit*/
632 #endif
633 );
634 /* cfbfillsp.c */
635
636 extern void cfbUnnaturalTileFS(
637 #if NeedFunctionPrototypes
638     DrawablePtr /*pDrawable*/,
639     GCPtr/*pGC*/,
640     int /*nInit*/,
641     DDXPointPtr /*pptInit*/,
642     int * /*pwidthInit*/,
643     int /*fSorted*/
644 #endif
645 );
646
647 extern void cfbUnnaturalStippleFS(
648 #if NeedFunctionPrototypes
649     DrawablePtr /*pDrawable*/,
650     GCPtr/*pGC*/,
651     int /*nInit*/,
652     DDXPointPtr /*pptInit*/,
653     int * /*pwidthInit*/,
654     int /*fSorted*/
655 #endif
656 );
657
658 extern void cfb8Stipple32FS(
659 #if NeedFunctionPrototypes
660     DrawablePtr /*pDrawable*/,
661     GCPtr /*pGC*/,
662     int /*nInit*/,
663     DDXPointPtr /*pptInit*/,
664     int * /*pwidthInit*/,
665     int /*fSorted*/
666 #endif
667 );
668
669 extern void cfb8OpaqueStipple32FS(
670 #if NeedFunctionPrototypes
671     DrawablePtr /*pDrawable*/,
672     GCPtr /*pGC*/,
673     int /*nInit*/,
674     DDXPointPtr /*pptInit*/,
675     int * /*pwidthInit*/,
676     int /*fSorted*/
677 #endif
678 );
679 /* cfbgc.c */
680
681 extern GCOpsPtr cfbMatchCommon(
682 #if NeedFunctionPrototypes
683     GCPtr /*pGC*/,
684     cfbPrivGCPtr /*devPriv*/
685 #endif
686 );
687
688 extern Bool cfbCreateGC(
689 #if NeedFunctionPrototypes
690     GCPtr /*pGC*/
691 #endif
692 );
693
694 extern void cfbValidateGC(
695 #if NeedFunctionPrototypes
696     GCPtr /*pGC*/,
697     unsigned long /*changes*/,
698     DrawablePtr /*pDrawable*/
699 #endif
700 );
701
702 /* cfbgetsp.c */
703
704 extern void cfbGetSpans(
705 #if NeedFunctionPrototypes
706     DrawablePtr /*pDrawable*/,
707     int /*wMax*/,
708     DDXPointPtr /*ppt*/,
709     int * /*pwidth*/,
710     int /*nspans*/,
711     char * /*pdstStart*/
712 #endif
713 );
714 /* cfbglblt8.c */
715
716 extern void cfbPolyGlyphBlt8(
717 #if NeedFunctionPrototypes
718     DrawablePtr /*pDrawable*/,
719     GCPtr /*pGC*/,
720     int /*x*/,
721     int /*y*/,
722     unsigned int /*nglyph*/,
723     CharInfoPtr * /*ppci*/,
724     pointer /*pglyphBase*/
725 #endif
726 );
727 /* cfbglrop8.c */
728
729 extern void cfbPolyGlyphRop8(
730 #if NeedFunctionPrototypes
731     DrawablePtr /*pDrawable*/,
732     GCPtr /*pGC*/,
733     int /*x*/,
734     int /*y*/,
735     unsigned int /*nglyph*/,
736     CharInfoPtr * /*ppci*/,
737     pointer /*pglyphBase*/
738 #endif
739 );
740 /* cfbhrzvert.c */
741
742 extern int cfbHorzS(
743 #if NeedFunctionPrototypes
744     int /*rop*/,
745     unsigned long /*and*/,
746     unsigned long /*xor*/,
747     unsigned long * /*addrl*/,
748     int /*nlwidth*/,
749     int /*x1*/,
750     int /*y1*/,
751     int /*len*/
752 #endif
753 );
754
755 extern void cfbVertS(
756 #if NeedFunctionPrototypes
757     int /*rop*/,
758     unsigned long /*and*/,
759     unsigned long /*xor*/,
760     unsigned long * /*addrl*/,
761     int /*nlwidth*/,
762     int /*x1*/,
763     int /*y1*/,
764     int /*len*/
765 #endif
766 );
767 /* cfbigblt8.c */
768
769 extern void cfbImageGlyphBlt8(
770 #if NeedFunctionPrototypes
771     DrawablePtr /*pDrawable*/,
772     GCPtr /*pGC*/,
773     int /*x*/,
774     int /*y*/,
775     unsigned int /*nglyph*/,
776     CharInfoPtr * /*ppci*/,
777     pointer /*pglyphBase*/
778 #endif
779 );
780 /* cfbimage.c */
781
782 extern void cfbPutImage(
783 #if NeedFunctionPrototypes
784     DrawablePtr /*pDraw*/,
785     GCPtr /*pGC*/,
786     int /*depth*/,
787     int /*x*/,
788     int /*y*/,
789     int /*w*/,
790     int /*h*/,
791     int /*leftPad*/,
792     int /*format*/,
793     char * /*pImage*/
794 #endif
795 );
796
797 extern void cfbGetImage(
798 #if NeedFunctionPrototypes
799     DrawablePtr /*pDrawable*/,
800     int /*sx*/,
801     int /*sy*/,
802     int /*w*/,
803     int /*h*/,
804     unsigned int /*format*/,
805     unsigned long /*planeMask*/,
806     char * /*pdstLine*/
807 #endif
808 );
809 /* cfbline.c */
810
811 extern void cfbLineSS(
812 #if NeedFunctionPrototypes
813     DrawablePtr /*pDrawable*/,
814     GCPtr /*pGC*/,
815     int /*mode*/,
816     int /*npt*/,
817     DDXPointPtr /*pptInit*/
818 #endif
819 );
820
821 extern void cfbLineSD(
822 #if NeedFunctionPrototypes
823     DrawablePtr /*pDrawable*/,
824     GCPtr /*pGC*/,
825     int /*mode*/,
826     int /*npt*/,
827     DDXPointPtr /*pptInit*/
828 #endif
829 );
830 /* cfbmskbits.c */
831 /* cfbpixmap.c */
832
833 extern PixmapPtr cfbCreatePixmap(
834 #if NeedFunctionPrototypes
835     ScreenPtr /*pScreen*/,
836     int /*width*/,
837     int /*height*/,
838     int /*depth*/
839 #endif
840 );
841
842 extern Bool cfbDestroyPixmap(
843 #if NeedFunctionPrototypes
844     PixmapPtr /*pPixmap*/
845 #endif
846 );
847
848 extern PixmapPtr cfbCopyPixmap(
849 #if NeedFunctionPrototypes
850     PixmapPtr /*pSrc*/
851 #endif
852 );
853
854 extern void cfbPadPixmap(
855 #if NeedFunctionPrototypes
856     PixmapPtr /*pPixmap*/
857 #endif
858 );
859
860 extern void cfbXRotatePixmap(
861 #if NeedFunctionPrototypes
862     PixmapPtr /*pPix*/,
863     int /*rw*/
864 #endif
865 );
866
867 extern void cfbYRotatePixmap(
868 #if NeedFunctionPrototypes
869     PixmapPtr /*pPix*/,
870     int /*rh*/
871 #endif
872 );
873
874 extern void cfbCopyRotatePixmap(
875 #if NeedFunctionPrototypes
876     PixmapPtr /*psrcPix*/,
877     PixmapPtr * /*ppdstPix*/,
878     int /*xrot*/,
879     int /*yrot*/
880 #endif
881 );
882 /* cfbply1rctC.c */
883
884 extern void cfbFillPoly1RectCopy(
885 #if NeedFunctionPrototypes
886     DrawablePtr /*pDrawable*/,
887     GCPtr /*pGC*/,
888     int /*shape*/,
889     int /*mode*/,
890     int /*count*/,
891     DDXPointPtr /*ptsIn*/
892 #endif
893 );
894 /* cfbply1rctG.c */
895
896 extern void cfbFillPoly1RectGeneral(
897 #if NeedFunctionPrototypes
898     DrawablePtr /*pDrawable*/,
899     GCPtr /*pGC*/,
900     int /*shape*/,
901     int /*mode*/,
902     int /*count*/,
903     DDXPointPtr /*ptsIn*/
904 #endif
905 );
906 /* cfbpntwin.c */
907
908 extern void cfbPaintWindow(
909 #if NeedFunctionPrototypes
910     WindowPtr /*pWin*/,
911     RegionPtr /*pRegion*/,
912     int /*what*/
913 #endif
914 );
915
916 extern void cfbFillBoxSolid(
917 #if NeedFunctionPrototypes
918     DrawablePtr /*pDrawable*/,
919     int /*nBox*/,
920     BoxPtr /*pBox*/,
921     unsigned long /*pixel*/
922 #endif
923 );
924
925 extern void cfbFillBoxTile32(
926 #if NeedFunctionPrototypes
927     DrawablePtr /*pDrawable*/,
928     int /*nBox*/,
929     BoxPtr /*pBox*/,
930     PixmapPtr /*tile*/
931 #endif
932 );
933 /* cfbpolypnt.c */
934
935 extern void cfbPolyPoint(
936 #if NeedFunctionPrototypes
937     DrawablePtr /*pDrawable*/,
938     GCPtr /*pGC*/,
939     int /*mode*/,
940     int /*npt*/,
941     xPoint * /*pptInit*/
942 #endif
943 );
944 /* cfbpush8.c */
945
946 extern void cfbPushPixels8(
947 #if NeedFunctionPrototypes
948     GCPtr /*pGC*/,
949     PixmapPtr /*pBitmap*/,
950     DrawablePtr /*pDrawable*/,
951     int /*dx*/,
952     int /*dy*/,
953     int /*xOrg*/,
954     int /*yOrg*/
955 #endif
956 );
957 /* cfbrctstp8.c */
958
959 extern void cfb8FillRectOpaqueStippled32(
960 #if NeedFunctionPrototypes
961     DrawablePtr /*pDrawable*/,
962     GCPtr /*pGC*/,
963     int /*nBox*/,
964     BoxPtr /*pBox*/
965 #endif
966 );
967
968 extern void cfb8FillRectTransparentStippled32(
969 #if NeedFunctionPrototypes
970     DrawablePtr /*pDrawable*/,
971     GCPtr /*pGC*/,
972     int /*nBox*/,
973     BoxPtr /*pBox*/
974 #endif
975 );
976
977 extern void cfb8FillRectStippledUnnatural(
978 #if NeedFunctionPrototypes
979     DrawablePtr /*pDrawable*/,
980     GCPtr /*pGC*/,
981     int /*nBox*/,
982     BoxPtr /*pBox*/
983 #endif
984 );
985 /* cfbrrop.c */
986
987 extern int cfbReduceRasterOp(
988 #if NeedFunctionPrototypes
989     int /*rop*/,
990     unsigned long /*fg*/,
991     unsigned long /*pm*/,
992     unsigned long * /*andp*/,
993     unsigned long * /*xorp*/
994 #endif
995 );
996 /* cfbscrinit.c */
997
998 extern Bool cfbCloseScreen(
999 #if NeedFunctionPrototypes
1000     int /*index*/,
1001     ScreenPtr /*pScreen*/
1002 #endif
1003 );
1004
1005 extern Bool cfbSetupScreen(
1006 #if NeedFunctionPrototypes
1007     ScreenPtr /*pScreen*/,
1008     pointer /*pbits*/,
1009     int /*xsize*/,
1010     int /*ysize*/,
1011     int /*dpix*/,
1012     int /*dpiy*/,
1013     int /*width*/
1014 #endif
1015 );
1016
1017 extern int cfbFinishScreenInit(
1018 #if NeedFunctionPrototypes
1019     ScreenPtr /*pScreen*/,
1020     pointer /*pbits*/,
1021     int /*xsize*/,
1022     int /*ysize*/,
1023     int /*dpix*/,
1024     int /*dpiy*/,
1025     int /*width*/
1026 #endif
1027 );
1028
1029 extern Bool cfbScreenInit(
1030 #if NeedFunctionPrototypes
1031     ScreenPtr /*pScreen*/,
1032     pointer /*pbits*/,
1033     int /*xsize*/,
1034     int /*ysize*/,
1035     int /*dpix*/,
1036     int /*dpiy*/,
1037     int /*width*/
1038 #endif
1039 );
1040 /* cfbseg.c */
1041
1042 extern void cfbSegmentSS(
1043 #if NeedFunctionPrototypes
1044     DrawablePtr /*pDrawable*/,
1045     GCPtr /*pGC*/,
1046     int /*nseg*/,
1047     xSegment * /*pSeg*/
1048 #endif
1049 );
1050
1051 extern void cfbSegmentSD(
1052 #if NeedFunctionPrototypes
1053     DrawablePtr /*pDrawable*/,
1054     GCPtr /*pGC*/,
1055     int /*nseg*/,
1056     xSegment * /*pSeg*/
1057 #endif
1058 );
1059 /* cfbsetsp.c */
1060
1061 extern int cfbSetScanline(
1062 #if NeedFunctionPrototypes
1063     int /*y*/,
1064     int /*xOrigin*/,
1065     int /*xStart*/,
1066     int /*xEnd*/,
1067     unsigned int * /*psrc*/,
1068     int /*alu*/,
1069     int * /*pdstBase*/,
1070     int /*widthDst*/,
1071     unsigned long /*planemask*/
1072 #endif
1073 );
1074
1075 extern void cfbSetSpans(
1076 #if NeedFunctionPrototypes
1077     DrawablePtr /*pDrawable*/,
1078     GCPtr /*pGC*/,
1079     char * /*psrc*/,
1080     DDXPointPtr /*ppt*/,
1081     int * /*pwidth*/,
1082     int /*nspans*/,
1083     int /*fSorted*/
1084 #endif
1085 );
1086 /* cfbsolidC.c */
1087
1088 extern void cfbFillRectSolidCopy(
1089 #if NeedFunctionPrototypes
1090     DrawablePtr /*pDrawable*/,
1091     GCPtr /*pGC*/,
1092     int /*nBox*/,
1093     BoxPtr /*pBox*/
1094 #endif
1095 );
1096
1097 extern void cfbSolidSpansCopy(
1098 #if NeedFunctionPrototypes
1099     DrawablePtr /*pDrawable*/,
1100     GCPtr /*pGC*/,
1101     int /*nInit*/,
1102     DDXPointPtr /*pptInit*/,
1103     int * /*pwidthInit*/,
1104     int /*fSorted*/
1105 #endif
1106 );
1107 /* cfbsolidG.c */
1108
1109 extern void cfbFillRectSolidGeneral(
1110 #if NeedFunctionPrototypes
1111     DrawablePtr /*pDrawable*/,
1112     GCPtr /*pGC*/,
1113     int /*nBox*/,
1114     BoxPtr /*pBox*/
1115 #endif
1116 );
1117
1118 extern void cfbSolidSpansGeneral(
1119 #if NeedFunctionPrototypes
1120     DrawablePtr /*pDrawable*/,
1121     GCPtr /*pGC*/,
1122     int /*nInit*/,
1123     DDXPointPtr /*pptInit*/,
1124     int * /*pwidthInit*/,
1125     int /*fSorted*/
1126 #endif
1127 );
1128 /* cfbsolidX.c */
1129
1130 extern void cfbFillRectSolidXor(
1131 #if NeedFunctionPrototypes
1132     DrawablePtr /*pDrawable*/,
1133     GCPtr /*pGC*/,
1134     int /*nBox*/,
1135     BoxPtr /*pBox*/
1136 #endif
1137 );
1138
1139 extern void cfbSolidSpansXor(
1140 #if NeedFunctionPrototypes
1141     DrawablePtr /*pDrawable*/,
1142     GCPtr /*pGC*/,
1143     int /*nInit*/,
1144     DDXPointPtr /*pptInit*/,
1145     int * /*pwidthInit*/,
1146     int /*fSorted*/
1147 #endif
1148 );
1149 /* cfbteblt8.c */
1150
1151 extern void cfbTEGlyphBlt8(
1152 #if NeedFunctionPrototypes
1153     DrawablePtr /*pDrawable*/,
1154     GCPtr/*pGC*/,
1155     int /*xInit*/,
1156     int /*yInit*/,
1157     unsigned int /*nglyph*/,
1158     CharInfoPtr * /*ppci*/,
1159     pointer /*pglyphBase*/
1160 #endif
1161 );
1162 /* cfbtegblt.c */
1163
1164 extern void cfbTEGlyphBlt(
1165 #if NeedFunctionPrototypes
1166     DrawablePtr /*pDrawable*/,
1167     GCPtr/*pGC*/,
1168     int /*x*/,
1169     int /*y*/,
1170     unsigned int /*nglyph*/,
1171     CharInfoPtr * /*ppci*/,
1172     pointer /*pglyphBase*/
1173 #endif
1174 );
1175 /* cfbtile32C.c */
1176
1177 extern void cfbFillRectTile32Copy(
1178 #if NeedFunctionPrototypes
1179     DrawablePtr /*pDrawable*/,
1180     GCPtr /*pGC*/,
1181     int /*nBox*/,
1182     BoxPtr /*pBox*/
1183 #endif
1184 );
1185
1186 extern void cfbTile32FSCopy(
1187 #if NeedFunctionPrototypes
1188     DrawablePtr /*pDrawable*/,
1189     GCPtr /*pGC*/,
1190     int /*nInit*/,
1191     DDXPointPtr /*pptInit*/,
1192     int * /*pwidthInit*/,
1193     int /*fSorted*/
1194 #endif
1195 );
1196 /* cfbtile32G.c */
1197
1198 extern void cfbFillRectTile32General(
1199 #if NeedFunctionPrototypes
1200     DrawablePtr /*pDrawable*/,
1201     GCPtr /*pGC*/,
1202     int /*nBox*/,
1203     BoxPtr /*pBox*/
1204 #endif
1205 );
1206
1207 extern void cfbTile32FSGeneral(
1208 #if NeedFunctionPrototypes
1209     DrawablePtr /*pDrawable*/,
1210     GCPtr /*pGC*/,
1211     int /*nInit*/,
1212     DDXPointPtr /*pptInit*/,
1213     int * /*pwidthInit*/,
1214     int /*fSorted*/
1215 #endif
1216 );
1217 /* cfbtileoddC.c */
1218
1219 extern void cfbFillBoxTileOddCopy(
1220 #if NeedFunctionPrototypes
1221     DrawablePtr /*pDrawable*/,
1222     int /*nBox*/,
1223     BoxPtr /*pBox*/,
1224     PixmapPtr /*tile*/,
1225     int /*xrot*/,
1226     int /*yrot*/,
1227     int /*alu*/,
1228     unsigned long /*planemask*/
1229 #endif
1230 );
1231
1232 extern void cfbFillSpanTileOddCopy(
1233 #if NeedFunctionPrototypes
1234     DrawablePtr /*pDrawable*/,
1235     int /*n*/,
1236     DDXPointPtr /*ppt*/,
1237     int * /*pwidth*/,
1238     PixmapPtr /*tile*/,
1239     int /*xrot*/,
1240     int /*yrot*/,
1241     int /*alu*/,
1242     unsigned long /*planemask*/
1243 #endif
1244 );
1245
1246 extern void cfbFillBoxTile32sCopy(
1247 #if NeedFunctionPrototypes
1248     DrawablePtr /*pDrawable*/,
1249     int /*nBox*/,
1250     BoxPtr /*pBox*/,
1251     PixmapPtr /*tile*/,
1252     int /*xrot*/,
1253     int /*yrot*/,
1254     int /*alu*/,
1255     unsigned long /*planemask*/
1256 #endif
1257 );
1258
1259 extern void cfbFillSpanTile32sCopy(
1260 #if NeedFunctionPrototypes
1261     DrawablePtr /*pDrawable*/,
1262     int /*n*/,
1263     DDXPointPtr /*ppt*/,
1264     int * /*pwidth*/,
1265     PixmapPtr /*tile*/,
1266     int /*xrot*/,
1267     int /*yrot*/,
1268     int /*alu*/,
1269     unsigned long /*planemask*/
1270 #endif
1271 );
1272 /* cfbtileoddG.c */
1273
1274 extern void cfbFillBoxTileOddGeneral(
1275 #if NeedFunctionPrototypes
1276     DrawablePtr /*pDrawable*/,
1277     int /*nBox*/,
1278     BoxPtr /*pBox*/,
1279     PixmapPtr /*tile*/,
1280     int /*xrot*/,
1281     int /*yrot*/,
1282     int /*alu*/,
1283     unsigned long /*planemask*/
1284 #endif
1285 );
1286
1287 extern void cfbFillSpanTileOddGeneral(
1288 #if NeedFunctionPrototypes
1289     DrawablePtr /*pDrawable*/,
1290     int /*n*/,
1291     DDXPointPtr /*ppt*/,
1292     int * /*pwidth*/,
1293     PixmapPtr /*tile*/,
1294     int /*xrot*/,
1295     int /*yrot*/,
1296     int /*alu*/,
1297     unsigned long /*planemask*/
1298 #endif
1299 );
1300
1301 extern void cfbFillBoxTile32sGeneral(
1302 #if NeedFunctionPrototypes
1303     DrawablePtr /*pDrawable*/,
1304     int /*nBox*/,
1305     BoxPtr /*pBox*/,
1306     PixmapPtr /*tile*/,
1307     int /*xrot*/,
1308     int /*yrot*/,
1309     int /*alu*/,
1310     unsigned long /*planemask*/
1311 #endif
1312 );
1313
1314 extern void cfbFillSpanTile32sGeneral(
1315 #if NeedFunctionPrototypes
1316     DrawablePtr /*pDrawable*/,
1317     int /*n*/,
1318     DDXPointPtr /*ppt*/,
1319     int * /*pwidth*/,
1320     PixmapPtr /*tile*/,
1321     int /*xrot*/,
1322     int /*yrot*/,
1323     int /*alu*/,
1324     unsigned long /*planemask*/
1325 #endif
1326 );
1327 /* cfbwindow.c */
1328
1329 extern Bool cfbCreateWindow(
1330 #if NeedFunctionPrototypes
1331     WindowPtr /*pWin*/
1332 #endif
1333 );
1334
1335 extern Bool cfbDestroyWindow(
1336 #if NeedFunctionPrototypes
1337     WindowPtr /*pWin*/
1338 #endif
1339 );
1340
1341 extern Bool cfbMapWindow(
1342 #if NeedFunctionPrototypes
1343     WindowPtr /*pWindow*/
1344 #endif
1345 );
1346
1347 extern Bool cfbPositionWindow(
1348 #if NeedFunctionPrototypes
1349     WindowPtr /*pWin*/,
1350     int /*x*/,
1351     int /*y*/
1352 #endif
1353 );
1354
1355 extern Bool cfbUnmapWindow(
1356 #if NeedFunctionPrototypes
1357     WindowPtr /*pWindow*/
1358 #endif
1359 );
1360
1361 extern void cfbCopyWindow(
1362 #if NeedFunctionPrototypes
1363     WindowPtr /*pWin*/,
1364     DDXPointRec /*ptOldOrg*/,
1365     RegionPtr /*prgnSrc*/
1366 #endif
1367 );
1368
1369 extern Bool cfbChangeWindowAttributes(
1370 #if NeedFunctionPrototypes
1371     WindowPtr /*pWin*/,
1372     unsigned long /*mask*/
1373 #endif
1374 );
1375 /* cfbzerarcC.c */
1376
1377 extern void cfbZeroPolyArcSS8Copy(
1378 #if NeedFunctionPrototypes
1379     DrawablePtr /*pDraw*/,
1380     GCPtr /*pGC*/,
1381     int /*narcs*/,
1382     xArc * /*parcs*/
1383 #endif
1384 );
1385 /* cfbzerarcG.c */
1386
1387 extern void cfbZeroPolyArcSS8General(
1388 #if NeedFunctionPrototypes
1389     DrawablePtr /*pDraw*/,
1390     GCPtr /*pGC*/,
1391     int /*narcs*/,
1392     xArc * /*parcs*/
1393 #endif
1394 );
1395 /* cfbzerarcX.c */
1396
1397 extern void cfbZeroPolyArcSS8Xor(
1398 #if NeedFunctionPrototypes
1399     DrawablePtr /*pDraw*/,
1400     GCPtr /*pGC*/,
1401     int /*narcs*/,
1402     xArc * /*parcs*/
1403 #endif
1404 );
1405
1406 /*
1407  * This is the only completely portable way to
1408  * compute this info
1409  */
1410
1411 #define BitsPerPixel(d) (\
1412     PixmapWidthPaddingInfo[d].notPower2 ? \
1413     (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \
1414     ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
1415     (PixmapWidthPaddingInfo[d].padRoundUp+1)))
1416
1417 /* Common macros for extracting drawing information */
1418
1419 #if !defined(SINGLEDEPTH) && PSZ != 8 || defined(FORCE_SEPARATE_PRIVATE)
1420
1421 #define CFB_NEED_SCREEN_PRIVATE
1422
1423 extern int cfbScreenPrivateIndex;
1424 #define cfbGetScreenPixmap(s)   ((PixmapPtr) (s)->devPrivates[cfbScreenPrivateIndex].ptr)
1425 #else
1426 #define cfbGetScreenPixmap(s)   ((PixmapPtr) (s)->devPrivate)
1427 #endif
1428
1429 #ifdef PIXMAP_PER_WINDOW
1430 #define cfbGetWindowPixmap(d)   ((PixmapPtr) ((WindowPtr) d)->devPrivates[frameWindowPrivateIndex].ptr)
1431 #else
1432 #define cfbGetWindowPixmap(d) cfbGetScreenPixmap((d)->pScreen)
1433 #endif
1434
1435 #define cfbGetTypedWidth(pDrawable,wtype) (\
1436     (((pDrawable)->type != DRAWABLE_PIXMAP) ? \
1437      (int) (cfbGetWindowPixmap(pDrawable)->devKind) : \
1438      (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
1439
1440 #define cfbGetByteWidth(pDrawable) cfbGetTypedWidth(pDrawable, unsigned char)
1441
1442 #define cfbGetPixelWidth(pDrawable) cfbGetTypedWidth(pDrawable, PixelType)
1443
1444 #define cfbGetLongWidth(pDrawable) cfbGetTypedWidth(pDrawable, unsigned long)
1445     
1446 #define cfbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
1447     PixmapPtr   _pPix; \
1448     if ((pDrawable)->type != DRAWABLE_PIXMAP) \
1449         _pPix = cfbGetWindowPixmap(pDrawable); \
1450     else \
1451         _pPix = (PixmapPtr) (pDrawable); \
1452     (pointer) = (ptype *) _pPix->devPrivate.ptr; \
1453     (width) = ((int) _pPix->devKind) / sizeof (wtype); \
1454 }
1455
1456 #define cfbGetByteWidthAndPointer(pDrawable, width, pointer) \
1457     cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
1458
1459 #define cfbGetLongWidthAndPointer(pDrawable, width, pointer) \
1460     cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned long, unsigned long)
1461
1462 #define cfbGetPixelWidthAndPointer(pDrawable, width, pointer) \
1463     cfbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
1464
1465 #define cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
1466     PixmapPtr   _pPix = cfbGetWindowPixmap((DrawablePtr) (pWin)); \
1467     (pointer) = (ptype *) _pPix->devPrivate.ptr; \
1468     (width) = ((int) _pPix->devKind) / sizeof (wtype); \
1469 }
1470
1471 #define cfbGetWindowLongWidthAndPointer(pWin, width, pointer) \
1472     cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned long, unsigned long)
1473
1474 #define cfbGetWindowByteWidthAndPointer(pWin, width, pointer) \
1475     cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned char, unsigned char)
1476
1477 #define cfbGetWindowPixelWidthAndPointer(pDrawable, width, pointer) \
1478     cfbGetWindowTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
1479
1480 /* Macros which handle a coordinate in a single register */
1481
1482 /* Most compilers will convert divide by 65536 into a shift, if signed
1483  * shifts exist.  If your machine does arithmetic shifts and your compiler
1484  * can't get it right, add to this line.
1485  */
1486
1487 /* mips compiler - what a joke - it CSEs the 65536 constant into a reg
1488  * forcing as to use div instead of shift.  Let's be explicit.
1489  */
1490
1491 #if defined(mips) || defined(sparc) || defined(__alpha) || defined(__alpha__) || defined(__i386__) || defined(i386)
1492 #define GetHighWord(x) (((int) (x)) >> 16)
1493 #else
1494 #define GetHighWord(x) (((int) (x)) / 65536)
1495 #endif
1496
1497 #if IMAGE_BYTE_ORDER == MSBFirst
1498 #define intToCoord(i,x,y)   (((x) = GetHighWord(i)), ((y) = (int) ((short) (i))))
1499 #define coordToInt(x,y) (((x) << 16) | (y))
1500 #define intToX(i)       (GetHighWord(i))
1501 #define intToY(i)       ((int) ((short) i))
1502 #else
1503 #define intToCoord(i,x,y)   (((x) = (int) ((short) (i))), ((y) = GetHighWord(i)))
1504 #define coordToInt(x,y) (((y) << 16) | (x))
1505 #define intToX(i)       ((int) ((short) (i)))
1506 #define intToY(i)       (GetHighWord(i))
1507 #endif