1 /* 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 y-coordinates */ 13 14 #define STYLES 6 15 #define SIZES 4 16 #define FONTS 4 17 #define SOLID -1 18 #define DOTTED 004 /* 014 */ 19 #define DASHED 020 /* 034 */ 20 #define DOTDASHED 024 /* 054 */ 21 #define LONGDASHED 074 22 23 #define TRUE 1 24 #define FALSE 0 25 26 #define nullelt -1 27 #define nullpt -1 28 #define nullun NULL 29 30 #define BOTLEFT 0 31 #define BOTRIGHT 1 32 #define CENTCENT 2 33 #define VECTOR 3 34 #define ARC 4 35 #define CURVE 5 36 #define POLYGON 6 37 #define TOPLEFT 10 38 #define TOPCENT 11 39 #define TOPRIGHT 12 40 #define CENTLEFT 13 41 #define CENTRIGHT 14 42 #define BOTCENT 15 43 #define TEXT(t) ( (t <= CENTCENT) || (t >= TOPLEFT) ) 44 /* WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING 45 * The above (TEXT) test is dependent on the relative values of the 46 * constants and will have to change if these values change or if new 47 * commands are added with value greater than BOTCENT 48 */ 49 50 #define NUSER 4 51 #define NFONTS 4 52 #define NBRUSHES 6 53 #define NSIZES 4 54 #define NJUSTS 9 55 #define NSTIPPLES 8 56 57 #define ADD 1 58 #define DELETE 2 59 #define MOD 3 60 61 typedef struct point { 62 float x, y; 63 struct point *nextpt; 64 } POINT; 65 66 typedef struct elmt { 67 int type, brushf, size, textlength; 68 char *textpt; 69 POINT *ptlist; 70 struct elmt *nextelt, *setnext; 71 } ELT; 72 73 typedef struct unlt { 74 int action; 75 ELT *(*dbase), *oldelt, *newelt; 76 struct unlt *nextun; 77 } UNELT; 78 79 typedef struct { 80 int tx_x; /* First column of field */ 81 int tx_y; /* Row containing field */ 82 int tx_size; /* Size of field in characters */ 83 } TXFIELD; 84 85 #define DBNextElt(elt) (elt->nextelt) 86 #define DBNextofSet(elt) (elt->setnext) 87 #define DBNullelt(elt) (elt == NULL) 88 #define Nullpoint(pt) ((pt) == (POINT *) NULL) 89 #define PTNextPoint(pt) (pt->nextpt) 90