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 / apa16GBlt.h < prev    next >
C/C++ Source or Header  |  1991-12-30  |  4KB  |  108 lines

  1. #ifndef APA16_GBLTH
  2. #define    APA16_GBLTH 1
  3. /***********************************************************
  4.         Copyright IBM Corporation 1988
  5.  
  6.                       All Rights Reserved
  7.  
  8. Permission to use, copy, modify, and distribute this software and its 
  9. documentation for any purpose and without fee is hereby granted, 
  10. provided that the above copyright notice appear in all copies and that
  11. both that copyright notice and this permission notice appear in 
  12. supporting documentation, and that the name of IBM not be
  13. used in advertising or publicity pertaining to distribution of the
  14. software without specific, written prior permission.  
  15.  
  16. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  18. IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  19. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  21. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22. SOFTWARE.
  23.  
  24. ******************************************************************/
  25. /***********************************************************
  26. Copyright 1989 by the Massachusetts Institute of Technology
  27.  
  28.                      All rights reserved.
  29.  
  30. Permission to use, copy, modify, and distribute this software and its
  31. documentation for any purpose and without fee is hereby granted,
  32. provided that the above copyright notice appear in all copies and that
  33. both that copyright notice and this permission notice appear in
  34. supporting documentation, and that the name of the Massachusetts
  35. Institute of Technology (M.I.T.) not be used in advertising or publicity
  36. pertaining to distribution of the software without specific, written
  37. prior permission.
  38.  
  39. M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  40. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  41. M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  42. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  43. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  44. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  45. SOFTWARE.
  46.  
  47. ******************************************************************/
  48.  
  49. /* $Header: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/apa16/RCS/apa16GBlt.h,v 5.0 1991/12/30 19:22:35 jfc Exp $ */
  50. /* $Source: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/apa16/RCS/apa16GBlt.h,v $ */
  51.  
  52. #if !defined(lint) && !defined(LOCORE)  && defined(RCS_HDRS)
  53. static char *rcsidapa16GBlt = "$Header: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/apa16/RCS/apa16GBlt.h,v 5.0 1991/12/30 19:22:35 jfc Exp $";
  54. #endif
  55.  
  56. /* "@(#)apa16gblt.h    3.1 88/09/22 09:30:37" */
  57. #define    UNCLIPPED    getleftbits((int *)pGlyph,w,tmpSrc)
  58. #define    CLIPPED        getshiftedleftbits((int *)pGlyph,glyphCol,w,tmpSrc)
  59.  
  60.             /* glyph all in one longword */
  61. #define    GLYPH_NARROW(cl)    \
  62.             maskpartialbits(xOff, w, startmask);\
  63.             while (h--) {\
  64.             cl;\
  65.             *pDst = (SCRRIGHT(tmpSrc, xOff) & startmask);\
  66.             pGlyph += widthGlyph;\
  67.             pDst += APA16_WIDTH>>5;\
  68.             }
  69.  
  70.             /* glyph crosses longword boundary */
  71. #define    GLYPH_CROSSES(cl)    \
  72.         mask32bits(xOff, w, startmask, endmask);\
  73.             nFirst = 32 - xOff;\
  74.             while (h--) {\
  75.             cl;\
  76.             *pDst = (SCRRIGHT(tmpSrc, xOff) & startmask);\
  77.             *(pDst+1) = (SCRLEFT(tmpSrc, nFirst) & endmask);\
  78.             pGlyph += widthGlyph;\
  79.             pDst += APA16_WIDTH>>5;\
  80.             }
  81.  
  82. #define    GLYPH_WIDE() {\
  83.         int    nlw,row,left,right;\
  84.         unsigned *tmpGlyph,tmpBits;\
  85.         maskbits(xOff,w,startmask,endmask,nlw);\
  86.         mask32bits(xOff,32,right,left);\
  87.             nFirst = 32 - xOff;\
  88.             while (h--) {\
  89.             getleftbits((tmpGlyph=(unsigned *)pGlyph), 32, tmpSrc);\
  90.             *pDst = (SCRRIGHT(tmpSrc, xOff) & startmask);\
  91.             for (row=1;row<=nlw;row++) {\
  92.             tmpBits= (SCRLEFT(tmpSrc,nFirst)&left);\
  93.             tmpGlyph++;\
  94.             getleftbits(tmpGlyph,32,tmpSrc);\
  95.             tmpBits|= SCRRIGHT(tmpSrc,xOff)&right;\
  96.             *(pDst+row)= tmpBits;\
  97.             }\
  98.             getleftbits((tmpGlyph+1),32,tmpBits);\
  99.             tmpSrc= (SCRLEFT(tmpSrc,nFirst)&left)|\
  100.                     (SCRRIGHT(tmpBits,xOff)&right);\
  101.             *(pDst+nlw+1) = (tmpSrc & endmask);\
  102.             pGlyph += widthGlyph;\
  103.             pDst += APA16_WIDTH>>5;\
  104.             }\
  105.         }
  106.  
  107. #endif /* ndef APA16_GBLTH */
  108.