home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / apa16 / mfbwait.c < prev    next >
C/C++ Source or Header  |  1991-12-30  |  5KB  |  179 lines

  1. #include "X.h"
  2. #include "Xmd.h"
  3. #include "Xprotostr.h"
  4.  
  5. #include "misc.h"
  6. #include "regionstr.h"
  7. #include "gcstruct.h"
  8. #include "windowstr.h"
  9. #include "pixmapstr.h"
  10. #include "scrnintstr.h"
  11.  
  12. #include "mistruct.h"
  13. #include "mfb.h"
  14. #include "maskbits.h"
  15.  
  16. #include "servermd.h"
  17.  
  18. #include "OScompiler.h"
  19. #include "ibmTrace.h"
  20. #include "apa16Hdwr.h"
  21.  
  22. void
  23. apa16SetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted)
  24.     DrawablePtr         pDrawable;
  25.     GCPtr               pGC;
  26.     int                 *psrc;
  27.     register DDXPointPtr ppt;
  28.     int                 *pwidth;
  29.     int                 nspans;
  30.     int                 fSorted;
  31. {
  32.     if (pDrawable->type == DRAWABLE_WINDOW)
  33.     QUEUE_WAIT();
  34.     mfbSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
  35. }
  36.  
  37. void
  38. apa16PolyFillRect(pDrawable, pGC, nrectFill, prectInit)
  39.     DrawablePtr pDrawable;
  40.     GCPtr       pGC;
  41.     int         nrectFill;      /* number of rectangles to fill */
  42.     xRectangle  *prectInit;     /* Pointer to first rectangle to fill */
  43. {
  44.     if (pDrawable->type == DRAWABLE_WINDOW)
  45.     QUEUE_WAIT();
  46.     mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit);
  47. }
  48.  
  49.  
  50. void
  51. apa16SaveAreas(pPixmap, prgnSave, xorg, yorg)
  52.     PixmapPtr          pPixmap;      /* Backing pixmap */
  53.     RegionPtr          prgnSave;     /* Region to save (pixmap-relative) */
  54.     int                  xorg;            /* X origin of region */
  55.     int                  yorg;            /* Y origin of region */
  56. {
  57.     QUEUE_WAIT();
  58.     mfbSaveAreas(pPixmap, prgnSave, xorg, yorg);
  59. }
  60.  
  61.  
  62. void
  63. apa16RestoreAreas(pPixmap, prgnRestore, xorg, yorg)
  64.     PixmapPtr          pPixmap;      /* Backing pixmap */
  65.     RegionPtr          prgnRestore;     /* Region to restore (screen-relative)*/
  66.     int                  xorg;            /* X origin of window */
  67.     int                  yorg;            /* Y origin of window */
  68. {
  69.     QUEUE_WAIT();
  70.     mfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg);
  71. }
  72.  
  73.  
  74. void
  75. apa16PushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
  76.     GCPtr    pGC;
  77.     PixmapPtr    pBitMap;
  78.     DrawablePtr pDrawable;
  79.     int        dx, dy, xOrg, yOrg;
  80. {
  81.     if (pDrawable->type == DRAWABLE_WINDOW)
  82.     QUEUE_WAIT();
  83.     mfbPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg);
  84. }
  85.  
  86. void
  87. apa16SolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
  88.     GCPtr    pGC;
  89.     PixmapPtr    pBitMap;
  90.     DrawablePtr pDrawable;
  91.     int        dx, dy, xOrg, yOrg;
  92. {
  93.     if (pDrawable->type == DRAWABLE_WINDOW)
  94.     QUEUE_WAIT();
  95.     mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg);
  96. }
  97.  
  98.  
  99. void
  100. apa16PutImage(dst, pGC, depth, x, y, w, h, leftPad, format, pImage)
  101.     DrawablePtr dst;
  102.     GCPtr    pGC;
  103.     int        depth, x, y, w, h;
  104.     int leftPad;
  105.     unsigned int format;
  106.     int     *pImage;
  107. {
  108.     if (dst->type == DRAWABLE_WINDOW)
  109.     QUEUE_WAIT();
  110.     mfbPutImage(dst, pGC, depth, x, y, w, h, leftPad, format, pImage);
  111. }
  112.  
  113.  
  114. void
  115. apa16GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
  116.     DrawablePtr         pDrawable;      /* drawable from which to get bits */
  117.     int                 wMax;           /* largest value of all *pwidths */
  118.     register DDXPointPtr ppt;           /* points to start copying from */
  119.     int                 *pwidth;        /* list of number of bits to copy */
  120.     int                 nspans;         /* number of scanlines to copy */
  121.     unsigned int        *pdstStart;     /* where to put the bits */
  122. {
  123.     if (pDrawable->type == DRAWABLE_WINDOW)
  124.     QUEUE_WAIT();
  125.     mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
  126. }
  127.  
  128.  
  129. void
  130. apa16GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
  131.     DrawablePtr pDrawable;
  132.     int         sx, sy, w, h;
  133.     unsigned int format;
  134.     unsigned long planeMask;
  135.     pointer     pdstLine;
  136. {
  137.     if (pDrawable->type == DRAWABLE_WINDOW)
  138.     QUEUE_WAIT();
  139.     mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
  140. }
  141.  
  142. void
  143. apa16ZeroPolyArcSS(pDraw, pGC, narcs, parcs)
  144.     DrawablePtr    pDraw;
  145.     GCPtr    pGC;
  146.     int        narcs;
  147.     xArc    *parcs;
  148. {
  149.     if (pDraw->type == DRAWABLE_WINDOW)
  150.     QUEUE_WAIT();
  151.     mfbZeroPolyArcSS(pDraw, pGC, narcs, parcs);
  152. }
  153.  
  154. void
  155. apa16StippleFillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
  156. DrawablePtr pDrawable;
  157. GC *pGC;
  158. int nInit;            /* number of spans to fill */
  159. DDXPointPtr pptInit;        /* pointer to list of start points */
  160. int *pwidthInit;        /* pointer to list of n widths */
  161. int fSorted;
  162. {
  163.   if (pDrawable->type == DRAWABLE_WINDOW)
  164.     QUEUE_WAIT();
  165.   switch(((mfbPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop)
  166.     {
  167.     case RROP_WHITE:
  168.       mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted);
  169.       break;
  170.     case RROP_INVERT:
  171.       mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted);
  172.       break;
  173.     case RROP_BLACK:
  174.       mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted);
  175.       break;
  176.     }
  177.   return;
  178. }
  179.