home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / ibm8514 / brcPgon.c < prev    next >
C/C++ Source or Header  |  1991-09-20  |  3KB  |  97 lines

  1. /*
  2.  * $Id: brcPgon.c,v 1.1 1991/09/20 19:10:24 mtranle Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1990
  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.  * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990
  27.  * LICENSED MATERIALS - PROPERTY OF IBM
  28.  * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
  29.  */
  30. /*
  31.  *  Hardware interface routines for IBM 8514/A adapter for
  32.  *  X.11 server(s) on IBM equipment.
  33.  *
  34.  */
  35.  
  36. /* POLYGON FILL
  37.  *
  38.  */
  39. #include     "X.h"
  40. #include     "pixmapstr.h"
  41. #include        "gcstruct.h"
  42. #include        "windowstr.h"
  43. #include        "colormapst.h"
  44.  
  45. #include    "ppc.h"
  46. #include        "ibmTrace.h"
  47.  
  48. #include     "x8514.h"
  49. extern int mfbGCPrivateIndex;
  50.  
  51. void
  52. ibm8514FillPolygon( dst, pgc, shape, mode, count, pPts )
  53.      DrawablePtr    dst;
  54.      register GCPtr    pgc;
  55.      int        shape, mode;
  56.      register int    count;
  57.      DDXPointPtr    pPts;
  58. {
  59.     DDXPointPtr ppt;
  60.     int i ;
  61.  
  62.     if ( !( i = count ) )
  63.     return ;
  64.  
  65.     if (((ppcPrivGCPtr)pgc->devPrivates[mfbGCPrivateIndex].ptr)->colorRrop.fillStyle != FillSolid)
  66.     {
  67.     miFillPolygon(dst, pgc, shape, mode, count, pPts);
  68.     return;
  69.     }
  70.  
  71.     if (dst->type != DRAWABLE_WINDOW)
  72.     {
  73.     ErrorF("ibm8514FillPolygon: not a window\n");
  74.     miFillPolygon(dst, pgc, shape, mode, count, pPts);
  75.     return;
  76.     }
  77.  
  78.     ppt = pPts ;
  79.     if ( pgc->miTranslate ) {
  80.         if ( mode != CoordModeOrigin)
  81.         for ( ppt++ ; count-- ; ppt++ ) {
  82.         ppt->x += (ppt-1)->x;
  83.         ppt->y += (ppt-1)->y;
  84.         }
  85.     }
  86.     else
  87.     if ( mode == CoordModePrevious )
  88.         for ( ppt++ ; count-- ; ppt++ ) {
  89.         ppt->x += (ppt-1)->x ;
  90.         ppt->y += (ppt-1)->y ;
  91.         }
  92.  
  93.     ibm8514SolidFillPoly( dst, pgc, i, pPts ) ;
  94.  
  95.     return ;
  96. }
  97.