home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / include / gcstruct.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-21  |  4.0 KB  |  125 lines

  1. /* $XConsortium: gcstruct.h,v 5.3 91/02/21 18:55:33 rws Exp $ */
  2. /***********************************************************
  3. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  4. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  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 names of Digital or MIT not be
  13. used in advertising or publicity pertaining to distribution of the
  14. software without specific, written prior permission.  
  15.  
  16. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  18. DIGITAL 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. #ifndef GCSTRUCT_H
  27. #define GCSTRUCT_H
  28.  
  29. #include "gc.h"
  30.  
  31. #include "miscstruct.h"
  32. #include "region.h"
  33. #include "pixmap.h"
  34. #include "screenint.h"
  35.  
  36. /*
  37.  * functions which modify the state of the GC
  38.  */
  39.  
  40. typedef struct _GCFuncs {
  41.     void    (* ValidateGC)();   /* pGC, pDrawable */
  42.     void    (* ChangeGC)();        /* pGC, mask */
  43.     void    (* CopyGC)();        /* pGCSrc, mask, pGCDst */
  44.     void    (* DestroyGC)();    /* pGC */
  45.     void    (* ChangeClip)();   /* pGC, clipType, pointer, nrects */
  46.     void    (* DestroyClip)();  /* pGC */
  47.     void    (* CopyClip)();        /* pgcDst, pgcSrc */
  48.     DevUnion    devPrivate;
  49. } GCFuncs;
  50.  
  51. /*
  52.  * graphics operations invoked through a GC
  53.  */
  54.  
  55. typedef struct _GCOps {
  56.     void    (* FillSpans)();
  57.     void    (* SetSpans)();
  58.     void    (* PutImage)();
  59.     RegionPtr    (* CopyArea)();
  60.     RegionPtr    (* CopyPlane)();
  61.     void    (* PolyPoint)();
  62.     void    (* Polylines)();
  63.     void    (* PolySegment)();
  64.     void    (* PolyRectangle)();
  65.     void    (* PolyArc)();
  66.     void    (* FillPolygon)();
  67.     void    (* PolyFillRect)();
  68.     void    (* PolyFillArc)();
  69.     int        (* PolyText8)();
  70.     int        (* PolyText16)();
  71.     void    (* ImageText8)();
  72.     void    (* ImageText16)();
  73.     void    (* ImageGlyphBlt)();
  74.     void    (* PolyGlyphBlt)();
  75.     void    (* PushPixels)();
  76.     void    (* LineHelper)();
  77.     DevUnion    devPrivate;
  78. } GCOps;
  79.  
  80. /* there is padding in the bit fields because the Sun compiler doesn't
  81.  * force alignment to 32-bit boundaries.  losers.
  82.  */
  83. typedef struct _GC {
  84.     ScreenPtr        pScreen;        
  85.     unsigned char    depth;    
  86.     unsigned char    alu;
  87.     unsigned short    lineWidth;          
  88.     unsigned short    dashOffset;
  89.     unsigned short    numInDashList;
  90.     unsigned char    *dash;
  91.     unsigned int    lineStyle : 2;
  92.     unsigned int    capStyle : 2;
  93.     unsigned int    joinStyle : 2;
  94.     unsigned int    fillStyle : 2;
  95.     unsigned int    fillRule : 1;
  96.     unsigned int     arcMode : 1;
  97.     unsigned int    subWindowMode : 1;
  98.     unsigned int    graphicsExposures : 1;
  99.     unsigned int    clientClipType : 2; /* CT_<kind> */
  100.     unsigned int    miTranslate:1; /* should mi things translate? */
  101.     unsigned int    tileIsPixel:1; /* tile is solid pixel */
  102.     unsigned int    unused:16; /* see comment above */
  103.     unsigned long    planemask;
  104.     unsigned long    fgPixel;
  105.     unsigned long    bgPixel;
  106.     /*
  107.      * alas -- both tile and stipple must be here as they
  108.      * are independently specifiable
  109.      */
  110.     PixUnion        tile;
  111.     PixmapPtr        stipple;
  112.     DDXPointRec        patOrg;        /* origin for (tile, stipple) */
  113.     struct _Font    *font;
  114.     DDXPointRec        clipOrg;
  115.     DDXPointRec        lastWinOrg;    /* position of window last validated */
  116.     pointer        clientClip;
  117.     unsigned long    stateChanges;    /* masked with GC_<kind> */
  118.     unsigned long       serialNumber;
  119.     GCFuncs        *funcs;
  120.     GCOps        *ops;
  121.     DevUnion        *devPrivates;
  122. } GC;
  123.  
  124. #endif /* GCSTRUCT_H */
  125.