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