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.
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
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.
30 ********************************************************/
37 #include "miscstruct.h"
39 #include "windowstr.h"
46 private filed of pixmap
47 pixmap.devPrivate = (unsigned int *)pointer_to_bits
48 pixmap.devKind = width_of_pixmap_in_bytes
51 extern int cfbGCPrivateIndex;
52 extern int cfbWindowPrivateIndex;
54 /* private field of GC */
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 */
68 typedef cfbPrivGC *cfbPrivGCPtr;
70 #define cfbGetGCPrivate(pGC) ((cfbPrivGCPtr)\
71 (pGC)->devPrivates[cfbGCPrivateIndex].ptr)
73 #define cfbGetCompositeClip(pGC) (((cfbPrivGCPtr)\
74 (pGC)->devPrivates[cfbGCPrivateIndex].ptr)->pCompositeClip)
76 /* way to carry RROP info around */
79 unsigned long xor, and;
80 } cfbRRopRec, *cfbRRopPtr;
82 /* private field of window */
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;
92 #define cfbGetWindowPrivate(_pWin) ((cfbPrivWin *)\
93 (_pWin)->devPrivates[cfbWindowPrivateIndex].ptr)
98 extern int cfbSetStipple(
99 #if NeedFunctionPrototypes
101 unsigned long /*fg*/,
102 unsigned long /*planemask*/
106 extern int cfbSetOpaqueStipple(
107 #if NeedFunctionPrototypes
109 unsigned long /*fg*/,
110 unsigned long /*bg*/,
111 unsigned long /*planemask*/
115 extern int cfbComputeClipMasks32(
116 #if NeedFunctionPrototypes
128 extern void cfbCopyImagePlane(
129 #if NeedFunctionPrototypes
130 DrawablePtr /*pSrcDrawable*/,
131 DrawablePtr /*pDstDrawable*/,
133 RegionPtr /*prgnDst*/,
134 DDXPointPtr /*pptSrc*/,
135 unsigned long /*planemask*/
139 extern void cfbCopyPlane8to1(
140 #if NeedFunctionPrototypes
141 DrawablePtr /*pSrcDrawable*/,
142 DrawablePtr /*pDstDrawable*/,
144 RegionPtr /*prgnDst*/,
145 DDXPointPtr /*pptSrc*/,
146 unsigned long /*planemask*/,
147 unsigned long /*bitPlane*/
152 extern int cfb8LineSS1RectCopy(
153 #if NeedFunctionPrototypes
154 DrawablePtr /*pDrawable*/,
158 DDXPointPtr /*pptInit*/,
159 DDXPointPtr /*pptInitOrig*/,
167 extern void cfb8LineSS1Rect(
168 #if NeedFunctionPrototypes
169 DrawablePtr /*pDrawable*/,
173 DDXPointPtr /*pptInit*/
177 extern void cfb8ClippedLineCopy(
178 #if NeedFunctionPrototypes
179 DrawablePtr /*pDrawable*/,
191 extern int cfb8LineSS1RectPreviousCopy(
192 #if NeedFunctionPrototypes
193 DrawablePtr /*pDrawable*/,
197 DDXPointPtr /*pptInit*/,
198 DDXPointPtr /*pptInitOrig*/,
208 extern int cfb8LineSS1RectGeneral(
209 #if NeedFunctionPrototypes
210 DrawablePtr /*pDrawable*/,
214 DDXPointPtr /*pptInit*/,
215 DDXPointPtr /*pptInitOrig*/,
223 extern void cfb8ClippedLineGeneral(
224 #if NeedFunctionPrototypes
225 DrawablePtr /*pDrawable*/,
237 extern int cfb8LineSS1RectXor(
238 #if NeedFunctionPrototypes
239 DrawablePtr /*pDrawable*/,
243 DDXPointPtr /*pptInit*/,
244 DDXPointPtr /*pptInitOrig*/,
252 extern void cfb8ClippedLineXor(
253 #if NeedFunctionPrototypes
254 DrawablePtr /*pDrawable*/,
266 extern int cfb8SegmentSS1RectCopy(
267 #if NeedFunctionPrototypes
268 DrawablePtr /*pDrawable*/,
271 xSegment * /*pSegInit*/
276 extern int cfb8SegmentSS1RectShiftCopy(
277 #if NeedFunctionPrototypes
278 DrawablePtr /*pDrawable*/,
281 xSegment * /*pSegInit*/
285 extern void cfb8SegmentSS1Rect(
286 #if NeedFunctionPrototypes
287 DrawablePtr /*pDrawable*/,
290 xSegment * /*pSegInit*/
295 extern int cfb8SegmentSS1RectGeneral(
296 #if NeedFunctionPrototypes
297 DrawablePtr /*pDrawable*/,
300 xSegment * /*pSegInit*/
305 extern int cfb8SegmentSS1RectXor(
306 #if NeedFunctionPrototypes
307 DrawablePtr /*pDrawable*/,
310 xSegment * /*pSegInit*/
315 extern Bool cfbAllocatePrivates(
316 #if NeedFunctionPrototypes
317 ScreenPtr /*pScreen*/,
318 int * /*window_index*/,
324 extern RegionPtr cfbBitBlt(
325 #if NeedFunctionPrototypes
326 DrawablePtr /*pSrcDrawable*/,
327 DrawablePtr /*pDstDrawable*/,
335 void (* /*doBitBlt*/)(
336 #if NeedNestedPrototypes
337 DrawablePtr /*pSrc*/,
338 DrawablePtr /*pDst*/,
340 RegionPtr /*prgnDst*/,
341 DDXPointPtr /*pptSrc*/,
342 unsigned long /*planemask*/,
343 unsigned long /*bitPlane*/
346 unsigned long /*bitPlane*/
350 extern void cfbDoBitblt(
351 #if NeedFunctionPrototypes
352 DrawablePtr /*pSrc*/,
353 DrawablePtr /*pDst*/,
355 RegionPtr /*prgnDst*/,
356 DDXPointPtr /*pptSrc*/,
357 unsigned long /*planemask*/
361 extern RegionPtr cfbCopyArea(
362 #if NeedFunctionPrototypes
363 DrawablePtr /*pSrcDrawable*/,
364 DrawablePtr /*pDstDrawable*/,
375 extern void cfbCopyPlane1to8(
376 #if NeedFunctionPrototypes
377 DrawablePtr /*pSrcDrawable*/,
378 DrawablePtr /*pDstDrawable*/,
380 RegionPtr /*prgnDst*/,
381 DDXPointPtr /*pptSrc*/,
382 unsigned long /*planemask*/,
383 unsigned long /*bitPlane*/
387 extern RegionPtr cfbCopyPlane(
388 #if NeedFunctionPrototypes
389 DrawablePtr /*pSrcDrawable*/,
390 DrawablePtr /*pDstDrawable*/,
398 unsigned long /*bitPlane*/
403 extern void cfbDoBitbltCopy(
404 #if NeedFunctionPrototypes
405 DrawablePtr /*pSrc*/,
406 DrawablePtr /*pDst*/,
408 RegionPtr /*prgnDst*/,
409 DDXPointPtr /*pptSrc*/,
410 unsigned long /*planemask*/
415 extern void cfbDoBitbltGeneral(
416 #if NeedFunctionPrototypes
417 DrawablePtr /*pSrc*/,
418 DrawablePtr /*pDst*/,
420 RegionPtr /*prgnDst*/,
421 DDXPointPtr /*pptSrc*/,
422 unsigned long /*planemask*/
427 extern void cfbDoBitbltOr(
428 #if NeedFunctionPrototypes
429 DrawablePtr /*pSrc*/,
430 DrawablePtr /*pDst*/,
432 RegionPtr /*prgnDst*/,
433 DDXPointPtr /*pptSrc*/,
434 unsigned long /*planemask*/
439 extern void cfbDoBitbltXor(
440 #if NeedFunctionPrototypes
441 DrawablePtr /*pSrc*/,
442 DrawablePtr /*pDst*/,
444 RegionPtr /*prgnDst*/,
445 DDXPointPtr /*pptSrc*/,
446 unsigned long /*planemask*/
451 extern void cfbBresS(
452 #if NeedFunctionPrototypes
454 unsigned long /*and*/,
455 unsigned long /*xor*/,
456 unsigned long * /*addrl*/,
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*/,
494 extern void cfbSaveAreas(
495 #if NeedFunctionPrototypes
496 PixmapPtr /*pPixmap*/,
497 RegionPtr /*prgnSave*/,
504 extern void cfbRestoreAreas(
505 #if NeedFunctionPrototypes
506 PixmapPtr /*pPixmap*/,
507 RegionPtr /*prgnRestore*/,
515 extern int cfbListInstalledColormaps(
516 #if NeedFunctionPrototypes
517 ScreenPtr /*pScreen*/,
522 extern void cfbInstallColormap(
523 #if NeedFunctionPrototypes
528 extern void cfbUninstallColormap(
529 #if NeedFunctionPrototypes
534 extern void cfbResolveColor(
535 #if NeedFunctionPrototypes
536 unsigned short * /*pred*/,
537 unsigned short * /*pgreen*/,
538 unsigned short * /*pblue*/,
539 VisualPtr /*pVisual*/
543 extern Bool cfbInitializeColormap(
544 #if NeedFunctionPrototypes
549 extern int cfbExpandDirectColors(
550 #if NeedFunctionPrototypes
551 ColormapPtr /*pmap*/,
553 xColorItem * /*indefs*/,
554 xColorItem * /*outdefs*/
558 extern Bool cfbCreateDefColormap(
559 #if NeedFunctionPrototypes
560 ScreenPtr /*pScreen*/
564 extern Bool cfbSetVisualTypes(
565 #if NeedFunctionPrototypes
572 extern Bool cfbInitVisuals(
573 #if NeedFunctionPrototypes
574 VisualPtr * /*visualp*/,
575 DepthPtr * /*depthp*/,
578 int * /*rootDepthp*/,
579 VisualID * /*defaultVisp*/,
580 unsigned long /*sizes*/,
586 extern void cfbPolyFillArcSolidCopy(
587 #if NeedFunctionPrototypes
588 DrawablePtr /*pDraw*/,
596 extern void cfbPolyFillArcSolidGeneral(
597 #if NeedFunctionPrototypes
598 DrawablePtr /*pDraw*/,
606 extern void cfbFillBoxTileOdd(
607 #if NeedFunctionPrototypes
608 DrawablePtr /*pDrawable*/,
617 extern void cfbFillRectTileOdd(
618 #if NeedFunctionPrototypes
619 DrawablePtr /*pDrawable*/,
626 extern void cfbPolyFillRect(
627 #if NeedFunctionPrototypes
628 DrawablePtr /*pDrawable*/,
631 xRectangle * /*prectInit*/
636 extern void cfbUnnaturalTileFS(
637 #if NeedFunctionPrototypes
638 DrawablePtr /*pDrawable*/,
641 DDXPointPtr /*pptInit*/,
642 int * /*pwidthInit*/,
647 extern void cfbUnnaturalStippleFS(
648 #if NeedFunctionPrototypes
649 DrawablePtr /*pDrawable*/,
652 DDXPointPtr /*pptInit*/,
653 int * /*pwidthInit*/,
658 extern void cfb8Stipple32FS(
659 #if NeedFunctionPrototypes
660 DrawablePtr /*pDrawable*/,
663 DDXPointPtr /*pptInit*/,
664 int * /*pwidthInit*/,
669 extern void cfb8OpaqueStipple32FS(
670 #if NeedFunctionPrototypes
671 DrawablePtr /*pDrawable*/,
674 DDXPointPtr /*pptInit*/,
675 int * /*pwidthInit*/,
681 extern GCOpsPtr cfbMatchCommon(
682 #if NeedFunctionPrototypes
684 cfbPrivGCPtr /*devPriv*/
688 extern Bool cfbCreateGC(
689 #if NeedFunctionPrototypes
694 extern void cfbValidateGC(
695 #if NeedFunctionPrototypes
697 unsigned long /*changes*/,
698 DrawablePtr /*pDrawable*/
704 extern void cfbGetSpans(
705 #if NeedFunctionPrototypes
706 DrawablePtr /*pDrawable*/,
716 extern void cfbPolyGlyphBlt8(
717 #if NeedFunctionPrototypes
718 DrawablePtr /*pDrawable*/,
722 unsigned int /*nglyph*/,
723 CharInfoPtr * /*ppci*/,
724 pointer /*pglyphBase*/
729 extern void cfbPolyGlyphRop8(
730 #if NeedFunctionPrototypes
731 DrawablePtr /*pDrawable*/,
735 unsigned int /*nglyph*/,
736 CharInfoPtr * /*ppci*/,
737 pointer /*pglyphBase*/
743 #if NeedFunctionPrototypes
745 unsigned long /*and*/,
746 unsigned long /*xor*/,
747 unsigned long * /*addrl*/,
755 extern void cfbVertS(
756 #if NeedFunctionPrototypes
758 unsigned long /*and*/,
759 unsigned long /*xor*/,
760 unsigned long * /*addrl*/,
769 extern void cfbImageGlyphBlt8(
770 #if NeedFunctionPrototypes
771 DrawablePtr /*pDrawable*/,
775 unsigned int /*nglyph*/,
776 CharInfoPtr * /*ppci*/,
777 pointer /*pglyphBase*/
782 extern void cfbPutImage(
783 #if NeedFunctionPrototypes
784 DrawablePtr /*pDraw*/,
797 extern void cfbGetImage(
798 #if NeedFunctionPrototypes
799 DrawablePtr /*pDrawable*/,
804 unsigned int /*format*/,
805 unsigned long /*planeMask*/,
811 extern void cfbLineSS(
812 #if NeedFunctionPrototypes
813 DrawablePtr /*pDrawable*/,
817 DDXPointPtr /*pptInit*/
821 extern void cfbLineSD(
822 #if NeedFunctionPrototypes
823 DrawablePtr /*pDrawable*/,
827 DDXPointPtr /*pptInit*/
833 extern PixmapPtr cfbCreatePixmap(
834 #if NeedFunctionPrototypes
835 ScreenPtr /*pScreen*/,
842 extern Bool cfbDestroyPixmap(
843 #if NeedFunctionPrototypes
844 PixmapPtr /*pPixmap*/
848 extern PixmapPtr cfbCopyPixmap(
849 #if NeedFunctionPrototypes
854 extern void cfbPadPixmap(
855 #if NeedFunctionPrototypes
856 PixmapPtr /*pPixmap*/
860 extern void cfbXRotatePixmap(
861 #if NeedFunctionPrototypes
867 extern void cfbYRotatePixmap(
868 #if NeedFunctionPrototypes
874 extern void cfbCopyRotatePixmap(
875 #if NeedFunctionPrototypes
876 PixmapPtr /*psrcPix*/,
877 PixmapPtr * /*ppdstPix*/,
884 extern void cfbFillPoly1RectCopy(
885 #if NeedFunctionPrototypes
886 DrawablePtr /*pDrawable*/,
891 DDXPointPtr /*ptsIn*/
896 extern void cfbFillPoly1RectGeneral(
897 #if NeedFunctionPrototypes
898 DrawablePtr /*pDrawable*/,
903 DDXPointPtr /*ptsIn*/
908 extern void cfbPaintWindow(
909 #if NeedFunctionPrototypes
911 RegionPtr /*pRegion*/,
916 extern void cfbFillBoxSolid(
917 #if NeedFunctionPrototypes
918 DrawablePtr /*pDrawable*/,
921 unsigned long /*pixel*/
925 extern void cfbFillBoxTile32(
926 #if NeedFunctionPrototypes
927 DrawablePtr /*pDrawable*/,
935 extern void cfbPolyPoint(
936 #if NeedFunctionPrototypes
937 DrawablePtr /*pDrawable*/,
946 extern void cfbPushPixels8(
947 #if NeedFunctionPrototypes
949 PixmapPtr /*pBitmap*/,
950 DrawablePtr /*pDrawable*/,
959 extern void cfb8FillRectOpaqueStippled32(
960 #if NeedFunctionPrototypes
961 DrawablePtr /*pDrawable*/,
968 extern void cfb8FillRectTransparentStippled32(
969 #if NeedFunctionPrototypes
970 DrawablePtr /*pDrawable*/,
977 extern void cfb8FillRectStippledUnnatural(
978 #if NeedFunctionPrototypes
979 DrawablePtr /*pDrawable*/,
987 extern int cfbReduceRasterOp(
988 #if NeedFunctionPrototypes
990 unsigned long /*fg*/,
991 unsigned long /*pm*/,
992 unsigned long * /*andp*/,
993 unsigned long * /*xorp*/
998 extern Bool cfbCloseScreen(
999 #if NeedFunctionPrototypes
1001 ScreenPtr /*pScreen*/
1005 extern Bool cfbSetupScreen(
1006 #if NeedFunctionPrototypes
1007 ScreenPtr /*pScreen*/,
1017 extern int cfbFinishScreenInit(
1018 #if NeedFunctionPrototypes
1019 ScreenPtr /*pScreen*/,
1029 extern Bool cfbScreenInit(
1030 #if NeedFunctionPrototypes
1031 ScreenPtr /*pScreen*/,
1042 extern void cfbSegmentSS(
1043 #if NeedFunctionPrototypes
1044 DrawablePtr /*pDrawable*/,
1051 extern void cfbSegmentSD(
1052 #if NeedFunctionPrototypes
1053 DrawablePtr /*pDrawable*/,
1061 extern int cfbSetScanline(
1062 #if NeedFunctionPrototypes
1067 unsigned int * /*psrc*/,
1071 unsigned long /*planemask*/
1075 extern void cfbSetSpans(
1076 #if NeedFunctionPrototypes
1077 DrawablePtr /*pDrawable*/,
1080 DDXPointPtr /*ppt*/,
1088 extern void cfbFillRectSolidCopy(
1089 #if NeedFunctionPrototypes
1090 DrawablePtr /*pDrawable*/,
1097 extern void cfbSolidSpansCopy(
1098 #if NeedFunctionPrototypes
1099 DrawablePtr /*pDrawable*/,
1102 DDXPointPtr /*pptInit*/,
1103 int * /*pwidthInit*/,
1109 extern void cfbFillRectSolidGeneral(
1110 #if NeedFunctionPrototypes
1111 DrawablePtr /*pDrawable*/,
1118 extern void cfbSolidSpansGeneral(
1119 #if NeedFunctionPrototypes
1120 DrawablePtr /*pDrawable*/,
1123 DDXPointPtr /*pptInit*/,
1124 int * /*pwidthInit*/,
1130 extern void cfbFillRectSolidXor(
1131 #if NeedFunctionPrototypes
1132 DrawablePtr /*pDrawable*/,
1139 extern void cfbSolidSpansXor(
1140 #if NeedFunctionPrototypes
1141 DrawablePtr /*pDrawable*/,
1144 DDXPointPtr /*pptInit*/,
1145 int * /*pwidthInit*/,
1151 extern void cfbTEGlyphBlt8(
1152 #if NeedFunctionPrototypes
1153 DrawablePtr /*pDrawable*/,
1157 unsigned int /*nglyph*/,
1158 CharInfoPtr * /*ppci*/,
1159 pointer /*pglyphBase*/
1164 extern void cfbTEGlyphBlt(
1165 #if NeedFunctionPrototypes
1166 DrawablePtr /*pDrawable*/,
1170 unsigned int /*nglyph*/,
1171 CharInfoPtr * /*ppci*/,
1172 pointer /*pglyphBase*/
1177 extern void cfbFillRectTile32Copy(
1178 #if NeedFunctionPrototypes
1179 DrawablePtr /*pDrawable*/,
1186 extern void cfbTile32FSCopy(
1187 #if NeedFunctionPrototypes
1188 DrawablePtr /*pDrawable*/,
1191 DDXPointPtr /*pptInit*/,
1192 int * /*pwidthInit*/,
1198 extern void cfbFillRectTile32General(
1199 #if NeedFunctionPrototypes
1200 DrawablePtr /*pDrawable*/,
1207 extern void cfbTile32FSGeneral(
1208 #if NeedFunctionPrototypes
1209 DrawablePtr /*pDrawable*/,
1212 DDXPointPtr /*pptInit*/,
1213 int * /*pwidthInit*/,
1219 extern void cfbFillBoxTileOddCopy(
1220 #if NeedFunctionPrototypes
1221 DrawablePtr /*pDrawable*/,
1228 unsigned long /*planemask*/
1232 extern void cfbFillSpanTileOddCopy(
1233 #if NeedFunctionPrototypes
1234 DrawablePtr /*pDrawable*/,
1236 DDXPointPtr /*ppt*/,
1242 unsigned long /*planemask*/
1246 extern void cfbFillBoxTile32sCopy(
1247 #if NeedFunctionPrototypes
1248 DrawablePtr /*pDrawable*/,
1255 unsigned long /*planemask*/
1259 extern void cfbFillSpanTile32sCopy(
1260 #if NeedFunctionPrototypes
1261 DrawablePtr /*pDrawable*/,
1263 DDXPointPtr /*ppt*/,
1269 unsigned long /*planemask*/
1274 extern void cfbFillBoxTileOddGeneral(
1275 #if NeedFunctionPrototypes
1276 DrawablePtr /*pDrawable*/,
1283 unsigned long /*planemask*/
1287 extern void cfbFillSpanTileOddGeneral(
1288 #if NeedFunctionPrototypes
1289 DrawablePtr /*pDrawable*/,
1291 DDXPointPtr /*ppt*/,
1297 unsigned long /*planemask*/
1301 extern void cfbFillBoxTile32sGeneral(
1302 #if NeedFunctionPrototypes
1303 DrawablePtr /*pDrawable*/,
1310 unsigned long /*planemask*/
1314 extern void cfbFillSpanTile32sGeneral(
1315 #if NeedFunctionPrototypes
1316 DrawablePtr /*pDrawable*/,
1318 DDXPointPtr /*ppt*/,
1324 unsigned long /*planemask*/
1329 extern Bool cfbCreateWindow(
1330 #if NeedFunctionPrototypes
1335 extern Bool cfbDestroyWindow(
1336 #if NeedFunctionPrototypes
1341 extern Bool cfbMapWindow(
1342 #if NeedFunctionPrototypes
1343 WindowPtr /*pWindow*/
1347 extern Bool cfbPositionWindow(
1348 #if NeedFunctionPrototypes
1355 extern Bool cfbUnmapWindow(
1356 #if NeedFunctionPrototypes
1357 WindowPtr /*pWindow*/
1361 extern void cfbCopyWindow(
1362 #if NeedFunctionPrototypes
1364 DDXPointRec /*ptOldOrg*/,
1365 RegionPtr /*prgnSrc*/
1369 extern Bool cfbChangeWindowAttributes(
1370 #if NeedFunctionPrototypes
1372 unsigned long /*mask*/
1377 extern void cfbZeroPolyArcSS8Copy(
1378 #if NeedFunctionPrototypes
1379 DrawablePtr /*pDraw*/,
1387 extern void cfbZeroPolyArcSS8General(
1388 #if NeedFunctionPrototypes
1389 DrawablePtr /*pDraw*/,
1397 extern void cfbZeroPolyArcSS8Xor(
1398 #if NeedFunctionPrototypes
1399 DrawablePtr /*pDraw*/,
1407 * This is the only completely portable way to
1411 #define BitsPerPixel(d) (\
1412 PixmapWidthPaddingInfo[d].notPower2 ? \
1413 (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \
1414 ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
1415 (PixmapWidthPaddingInfo[d].padRoundUp+1)))
1417 /* Common macros for extracting drawing information */
1419 #if !defined(SINGLEDEPTH) && PSZ != 8 || defined(FORCE_SEPARATE_PRIVATE)
1421 #define CFB_NEED_SCREEN_PRIVATE
1423 extern int cfbScreenPrivateIndex;
1424 #define cfbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivates[cfbScreenPrivateIndex].ptr)
1426 #define cfbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
1429 #ifdef PIXMAP_PER_WINDOW
1430 #define cfbGetWindowPixmap(d) ((PixmapPtr) ((WindowPtr) d)->devPrivates[frameWindowPrivateIndex].ptr)
1432 #define cfbGetWindowPixmap(d) cfbGetScreenPixmap((d)->pScreen)
1435 #define cfbGetTypedWidth(pDrawable,wtype) (\
1436 (((pDrawable)->type != DRAWABLE_PIXMAP) ? \
1437 (int) (cfbGetWindowPixmap(pDrawable)->devKind) : \
1438 (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
1440 #define cfbGetByteWidth(pDrawable) cfbGetTypedWidth(pDrawable, unsigned char)
1442 #define cfbGetPixelWidth(pDrawable) cfbGetTypedWidth(pDrawable, PixelType)
1444 #define cfbGetLongWidth(pDrawable) cfbGetTypedWidth(pDrawable, unsigned long)
1446 #define cfbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
1448 if ((pDrawable)->type != DRAWABLE_PIXMAP) \
1449 _pPix = cfbGetWindowPixmap(pDrawable); \
1451 _pPix = (PixmapPtr) (pDrawable); \
1452 (pointer) = (ptype *) _pPix->devPrivate.ptr; \
1453 (width) = ((int) _pPix->devKind) / sizeof (wtype); \
1456 #define cfbGetByteWidthAndPointer(pDrawable, width, pointer) \
1457 cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
1459 #define cfbGetLongWidthAndPointer(pDrawable, width, pointer) \
1460 cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned long, unsigned long)
1462 #define cfbGetPixelWidthAndPointer(pDrawable, width, pointer) \
1463 cfbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
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); \
1471 #define cfbGetWindowLongWidthAndPointer(pWin, width, pointer) \
1472 cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned long, unsigned long)
1474 #define cfbGetWindowByteWidthAndPointer(pWin, width, pointer) \
1475 cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned char, unsigned char)
1477 #define cfbGetWindowPixelWidthAndPointer(pDrawable, width, pointer) \
1478 cfbGetWindowTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
1480 /* Macros which handle a coordinate in a single register */
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.
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.
1491 #if defined(mips) || defined(sparc) || defined(__alpha) || defined(__alpha__) || defined(__i386__) || defined(i386)
1492 #define GetHighWord(x) (((int) (x)) >> 16)
1494 #define GetHighWord(x) (((int) (x)) / 65536)
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))
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))