1 /* Last non-groff version: gprint.h 1.1 84/10/08 2 * 3 * This file contains standard definitions used by the gprint program. 4 */ 5 6 #include <stdio.h> 7 #include <math.h> 8 9 10 #define xorn(x,y) (x) 11 /* was 512 */ 12 #define yorn(x,y) (511 - (y)) /* switch direction for */ 13 /* y-coordinates */ 14 15 #define STYLES 6 16 #define SIZES 4 17 #define FONTS 4 18 #define SOLID -1 19 #define DOTTED 004 /* 014 */ 20 #define DASHED 020 /* 034 */ 21 #define DOTDASHED 024 /* 054 */ 22 #define LONGDASHED 074 23 24 #define DEFTHICK -1 /* default thicknes */ 25 #define DEFSTYLE SOLID /* default line style */ 26 27 #define TRUE 1 28 #define FALSE 0 29 30 #define nullelt -1 31 #define nullpt -1 32 #define nullun NULL 33 34 #define BOTLEFT 0 35 #define BOTRIGHT 1 36 #define CENTCENT 2 37 #define VECTOR 3 38 #define ARC 4 39 #define CURVE 5 40 #define POLYGON 6 41 #define BSPLINE 7 42 #define BEZIER 8 43 #define TOPLEFT 10 44 #define TOPCENT 11 45 #define TOPRIGHT 12 46 #define CENTLEFT 13 47 #define CENTRIGHT 14 48 #define BOTCENT 15 49 #define TEXT(t) ( (t <= CENTCENT) || (t >= TOPLEFT) ) 50 51 /* WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING 52 * The above (TEXT) test is dependent on the relative values of the 53 * constants and will have to change if these values change or if new 54 * commands are added with value greater than BOTCENT 55 */ 56 57 #define NUSER 4 58 #define NFONTS 4 59 #define NBRUSHES 6 60 #define NSIZES 4 61 #define NJUSTS 9 62 #define NSTIPPLES 16 63 64 #define ADD 1 65 #define DELETE 2 66 #define MOD 3 67 68 typedef struct point { 69 double x, y; 70 struct point *nextpt; 71 } POINT; 72 73 typedef struct elmt { 74 int type, brushf, size, textlength; 75 char *textpt; 76 POINT *ptlist; 77 struct elmt *nextelt, *setnext; 78 } ELT; 79 80 #define DBNextElt(elt) (elt->nextelt) 81 #define DBNextofSet(elt) (elt->setnext) 82 #define DBNullelt(elt) (elt == NULL) 83 #define Nullpoint(pt) ((pt) == (POINT *) NULL) 84 #define PTNextPoint(pt) (pt->nextpt) 85 86 /* EOF */ 87