home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / plot / plot2ps.sha / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  2.0 KB  |  64 lines

  1. /*
  2.     This file is part of plot2ps.
  3.  
  4.     Copyright (C) 1989 Rene' Seindal
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 1, or (at your option)
  9.     any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.     My current address is: seindal@diku.dk
  21. */
  22.  
  23. #include <stdio.h>
  24.  
  25. /* CONSTANTS */
  26.  
  27. #define XMAX        572    /* physical pagesizes in points */
  28. #define YMAX        579    /* (should be 818) */
  29.  
  30. #define XMIN        18    /* lower left x coordiate (ALW) */
  31. #define YMIN        25    /* lower left y coordiate (ALW) */
  32.  
  33. #define XRANGE        4096    /* default logical coor (values 0..XRANGE-1) */
  34. #define YRANGE        4096    /* values 0..YRANGE-1 */
  35.  
  36. #define FONT        "Helvetica"
  37. #define PTSIZE        12    /* pointsize for text (in points) */
  38. #define LINEWIDTH    0.1    /* width of lines (in points) */
  39. #define POINTDIAM    0.5    /* diameter of points (in points!) */
  40. #define MAXPATHLENGTH     1024    /* no path generated will contain */
  41.                 /* more segments than MAXPATHLENGTH */
  42.  
  43. /* COORDINATES AND SCALING */
  44.  
  45. extern double xscale;
  46. extern double yscale;
  47. extern double xoffset;
  48. extern double yoffset;
  49.  
  50. #define X(x) (xscale * ((double)(x)) + xoffset)
  51. #define Y(y) (yscale * ((double)(y)) + yoffset)
  52.  
  53. /*  POSTSCRIPT OUTPUT */
  54.  
  55. #define INVALID        0x01    /* plot not initialised or closed */
  56. #define CLEANPAGE    0x02    /* page is blank */
  57. #define CLEANPATH    0x04    /* current path is empty */
  58.  
  59. #define DIRTYPAGE state &= ~CLEANPAGE
  60. #define DIRTYPATH state &= ~(CLEANPAGE | CLEANPATH)
  61.  
  62. extern int state;    /* state of the page */
  63. extern int restpathlen;        /* length of current path */
  64.