1 /* @(#)gremlin.h	1.3	05/29/84
2  *
3  *
4  * This file contains standard definitions used by the gremlin program.
5  *
6  * (modified from software written by John Ousterhout for the caesar
7  * program)
8  */
9 
10 #include <stdio.h>
11 #include <math.h>
12 
13 #define TRUE  1
14 #define FALSE 0
15 
16 #define nullelt -1
17 #define nullpt  -1
18 #define nullun   NULL
19 
20 #define rmask1 00
21 #define rmask2 00
22 #define rmask3 00
23 
24 #define bordstyle   5
25 #define gridstyle   9
26 #define pointstyle 10
27 #define eraseany    0
28 
29 #define gridmask  0200
30 #define pointmask 0100
31 #define setmask    040
32 #define textmask    07
33 #define linemask    07
34 
35 #define pointchar 1
36 #define halfpoint 3
37 #define numspace  6
38 
39 #define BOTLEFT 0
40 #define BOTRIGHT 1
41 #define CENTCENT 2
42 #define VECTOR 3
43 #define ARC 4
44 #define CURVE 5
45 #define POLYGON 6
46 #define TOPLEFT 10
47 #define TOPCENT 11
48 #define TOPRIGHT 12
49 #define CENTLEFT 13
50 #define CENTRIGHT 14
51 #define BOTCENT 15
52 #define TEXT(t) ( (t <= CENTCENT) || (t >= TOPLEFT) )
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 NOADJ 0
60 #define HORZ  1
61 #define VERT  2
62 #define MAN   3
63 
64 #define NUSER 4
65 #define NFONTS 4
66 #define NBRUSHES 6
67 #define NSIZES 4
68 #define NJUSTS 9
69 
70 #define himask linemask
71 #define hicolor 6
72 
73 #define ADD 1
74 #define DELETE 2
75 #define MOD 3
76 
77 /* The following represents the maximum distance a point may be from another
78  * and still be affected by gravity.  The distance is represented as the
79  * square of the number of pixels (32) of the actual distance.
80  */
81 
82 #define MAXGDIST 32*32
83 
84 typedef struct point
85         {
86                float x, y;
87                struct point *nextpt;
88         } POINT;
89 
90 typedef struct elmt
91         {
92                int type, brushf, size, textlength;
93                char *textpt;
94                POINT *ptlist;
95                struct elmt *nextelt, *setnext;
96         } ELT;
97 
98 
99 typedef struct unlt
100         {
101              int action;
102              ELT *(*dbase), *oldelt, *newelt;
103              struct unlt *nextun;
104         } UNELT;
105 
106 typedef struct {
107     int tx_x;		/* First column of field */
108     int tx_y;		/* Row containing field */
109     int tx_size;	/* Size of field in characters */
110     } TXFIELD;
111 
112