home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_06 / v7n6042a.txt < prev    next >
Text File  |  1989-07-25  |  3KB  |  105 lines

  1.  
  2. /*
  3.  *              Glimit  Window limits in world coordinates (WC)
  4.  */
  5.  
  6. typedef struct {
  7.         double xmin;         /*  x min. limit     */
  8.         double xmax;         /*  x max. limit     */
  9.         double ymin;         /*  y min. limit     */
  10.         double ymax;         /*  y max. limit     */
  11.                } Glimit;
  12.  
  13. /*
  14.  *              Gilimit   Viewport limits in device coordinates (DC)
  15.  */
  16.  
  17. typedef struct {
  18.         int xmin;            /*  x min. limit     */
  19.         int xmax;            /*  x max. limit     */
  20.         int ymin;            /*  y min. limit     */
  21.         int ymax;            /*  y max. limit     */
  22.                } Gilimit;
  23.  
  24. /*
  25.  *              Gtran   Window -> Viewport transformation  
  26.  */
  27.  
  28. typedef struct {
  29.         Glimit  w;            /*    window          */
  30.         Gilimit v;            /*    viewport        */
  31.                } Gtran;
  32.  
  33. /*
  34.  *               Gpoint   A point in WC
  35.  */
  36.  
  37. typedef struct {
  38.         double x,y;
  39.                } Gpoint;
  40.  
  41. /*
  42.  *               Gipoint  A point in DC
  43.  */
  44.  
  45. typedef struct {
  46.         int x,y;
  47.                } Gipoint;
  48.  
  49. /*
  50.  *               Gmap   Transformation matrix.
  51.  */
  52.  
  53. typedef struct {
  54.         double xm,ym,xa,ya;
  55.                } Gmap;
  56.  
  57.  
  58. /*
  59.  *              Gflinter. Fill interior style.
  60.  */
  61.  
  62. typedef enum   {
  63.         HOLLOW,
  64.         SOLID,
  65.         PATTERN,
  66.         HATCH
  67.                } Gflinter;
  68.  
  69.  
  70. /*
  71.  *      Define the users function return values.
  72.  */
  73.  
  74. extern int setwindow(),setviewport(),selntran();
  75. extern int setlinetype(),setlinecolour();
  76. extern int setfillintstyle(),setfillcolour(),setfillindex();
  77. extern int openws(),closews(),polyline(),gdp51(),gdp52(),gdp53();
  78. extern int pause();
  79.  
  80.  
  81. /*
  82.  *       Graphics state list.
  83.  */
  84.  
  85. #include "gks.h"
  86. #define NUMTRAN 12
  87. #define NUMWS   4
  88.  
  89. typedef struct {
  90.         int scr_width;          /* Screen width in pixels.          */
  91.         int scr_height;         /* Screen height in pixels.         */
  92.         Gtran ntran[NUMTRAN];   /* Vector of transformations.       */
  93.         Gtran curntr;           /* Current transformation.          */
  94.         Gmap  curmap;           /* Current transformation matrix.   */
  95.         int ltype;              /* Current linetype.                */
  96.         int lci;                /* Current line colour index.       */
  97.         Gflinter fstyle;        /* Current fill style.              */
  98.         int fstyle_index;       /* Fill style index.                */
  99.         int fci;                /* Fill colour index.               */
  100.                 } Gstate;
  101.  
  102. Gstate wsdt[NUMWS];
  103.  
  104.  
  105. Gstate *wsd;            /* Current workstation state table. */