home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / ppc / ppcGenFS.c < prev    next >
C/C++ Source or Header  |  1989-11-14  |  6KB  |  189 lines

  1. /*
  2.  * Copyright IBM Corporation 1987,1988,1989
  3.  *
  4.  * All Rights Reserved
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted,
  8.  * provided that the above copyright notice appear in all copies and that 
  9.  * both that copyright notice and this permission notice appear in
  10.  * supporting documentation, and that the name of IBM not be
  11.  * used in advertising or publicity pertaining to distribution of the
  12.  * software without specific, written prior permission.
  13.  *
  14.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20.  * SOFTWARE.
  21.  *
  22. */
  23.  
  24. /* $Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ppc/RCS/ppcGenFS.c,v 1.1 89/05/07 15:29:07 paul Exp $ */
  25. /* $Source: /andrew/X11/r3src/r3plus/server/ddx/ibm/ppc/RCS/ppcGenFS.c,v $ */
  26.  
  27. #ifndef lint
  28. static char *rcsid = "$Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ppc/RCS/ppcGenFS.c,v 1.1 89/05/07 15:29:07 paul Exp $" ;
  29. #endif
  30.  
  31. #include "X.h"
  32. #include "misc.h"
  33. #include "gcstruct.h"
  34. #include "window.h"
  35. #include "pixmapstr.h"
  36. #include "scrnintstr.h"
  37. #include "windowstr.h"
  38.  
  39. #include "OScompiler.h"
  40.  
  41. #include "ppc.h"
  42.  
  43. #include "ibmTrace.h"
  44. extern int mfbGCPrivateIndex;
  45.  
  46. /* Declared in ppcPixmapFS.o */
  47. void ppcSolidWindowFS() ;
  48. void ppcStippleWindowFS() ;
  49. void ppcOpStippleWindowFS() ;
  50. void ppcTileWindowFS() ;
  51.  
  52. /* Declared in ppcPixmapFS.o */
  53. void ppcSolidPixmapFS() ;
  54. void ppcStipplePixmapFS() ;
  55. void ppcOpStipplePixmapFS() ;
  56. void ppcTilePixmapFS() ;
  57.  
  58. void
  59. ppcTileGenFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
  60. DrawablePtr pDrawable ;
  61. GC        *pGC ;
  62. int        nInit ;        /* number of spans to fill */
  63. DDXPointPtr pptInit ;        /* pointer to list of start points */
  64. int *pwidthInit ;        /* pointer to list of n widths */
  65. int fSorted ;
  66. {
  67.     TRACE( ( "ppcTileFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
  68.         pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
  69.  
  70.     (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  71.      ? ppcTilePixmapFS
  72.      : ppcTileWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  73.                 pwidthInit, fSorted ) ;
  74.  
  75.     return ;
  76. }
  77.  
  78. void
  79. ppcOpStippleGenFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
  80.     DrawablePtr pDrawable ;
  81.     GCPtr    pGC ;
  82.     int        nInit ;            /* number of spans to fill */
  83.     DDXPointPtr pptInit ;        /* pointer to list of start points */
  84.     int        *pwidthInit ;        /* pointer to list of n widths */
  85.     int     fSorted ;
  86. {
  87.     TRACE(("ppcOpStippleFS(pDrawable=0x%x, pGC=0x%x, nInit=%d, pptInit=0x%x, pwidthInit=0x%x, fSorted=%d)\n", pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)) ;
  88.  
  89.     (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  90.      ? ppcOpStipplePixmapFS
  91.      : ppcOpStippleWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  92.                      pwidthInit, fSorted ) ;
  93.  
  94.     return ;
  95. }
  96.  
  97. void
  98. ppcStippleGenFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
  99.     DrawablePtr pDrawable ;
  100.     GCPtr    pGC ;
  101.     int        nInit ;            /* number of spans to fill */
  102.     DDXPointPtr pptInit ;        /* pointer to list of start points */
  103.     int        *pwidthInit ;        /* pointer to list of n widths */
  104.     int     fSorted ;
  105. {
  106.     TRACE( ( "ppcStippleFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
  107.         pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
  108.  
  109.     (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  110.      ? ppcStipplePixmapFS
  111.      : ppcStippleWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  112.                    pwidthInit, fSorted ) ;
  113.  
  114.     return ;
  115. }
  116.  
  117. void
  118. ppcSolidGenFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
  119.     DrawablePtr pDrawable ;
  120.     GCPtr    pGC ;
  121.     int        nInit ;            /* number of spans to fill */
  122.     DDXPointPtr pptInit ;        /* pointer to list of start points */
  123.     int        *pwidthInit ;        /* pointer to list of n widths */
  124.     int     fSorted ;
  125. {
  126.     TRACE( ( "ppcSolidFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
  127.        pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
  128.  
  129.     (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  130.      ? ppcSolidPixmapFS
  131.      : ppcSolidWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  132.                  pwidthInit, fSorted ) ;
  133.  
  134.     return ;
  135. }
  136.  
  137. void
  138. ppcFillSpans( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
  139.     DrawablePtr pDrawable ;
  140.     GCPtr    pGC ;
  141.     int        nInit ;            /* number of spans to fill */
  142.     DDXPointPtr pptInit ;        /* pointer to list of start points */
  143.     int        *pwidthInit ;        /* pointer to list of n widths */
  144.     int     fSorted ;
  145. {
  146. register void (*spanFunc)() ;
  147.  
  148. if ( pDrawable->type == DRAWABLE_WINDOW )
  149.     switch ( ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fillStyle ) {
  150.         case FillSolid :
  151.             spanFunc = ppcSolidWindowFS ;
  152.             break ;
  153.         case FillStippled :
  154.             spanFunc = ppcStippleWindowFS ;
  155.             break ;
  156.         case FillOpaqueStippled :
  157.            spanFunc = ppcOpStippleWindowFS ;
  158.            break ;
  159.         case FillTiled :
  160.             spanFunc = ppcTileWindowFS ;
  161.             break ;
  162.         default :
  163.             ErrorF( "ppcFillSpans: unknown Fill Style" ) ;
  164.             break ;
  165.     }
  166. else /* pDrawable->type == DRAWABLE_PIXMAP */
  167.     switch ( ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fillStyle ) {
  168.         case FillSolid :
  169.             spanFunc = ppcSolidPixmapFS ;
  170.             break ;
  171.         case FillStippled :
  172.             spanFunc = ppcStipplePixmapFS ;
  173.             break ;
  174.         case FillOpaqueStippled :
  175.             spanFunc = ppcOpStipplePixmapFS ;
  176.             break ;
  177.         case FillTiled :
  178.             spanFunc = ppcTileWindowFS ;
  179.             break ;
  180.         default :
  181.             ErrorF( "ppcFillSpans: unknown Fill Style" ) ;
  182.             break ;
  183.     }
  184.  
  185. (* spanFunc)( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ;
  186.  
  187. return ;
  188. }
  189.