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