1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
/*
*
* Tektronix 4014 control codes.
*
*/
#define NUL '\000'
#define SOH '\001'
#define STX '\002'
#define ETX '\003'
#define EOT '\004'
#define ENQ '\005'
#define ACK '\006'
#define BEL '\007'
#define BS '\010'
#define HT '\011'
#define NL '\012'
#define VT '\013'
#define FF '\014'
#define CR '\015'
#define SO '\016'
#define SI '\017'
#define DLE '\020'
#define DC1 '\021'
#define DC2 '\022'
#define DC3 '\023'
#define DC4 '\024'
#define NAK '\025'
#define SYN '\026'
#define ETB '\027'
#define CAN '\030'
#define EM '\031'
#define SUB '\032'
#define ESC '\033'
#define FS '\034'
#define GS '\035'
#define RS '\036'
#define US '\037'
#define DEL '\177'
/*
*
* A few definitions used to classify the different tektronix states. OUTMODED
* is returned by control() and esc(), and typically means the state has changed.
*
*/
#define OUTMODED -1
#define ALPHA 0
#define GIN 1
#define GRAPH 2
#define POINT 3
#define SPECIALPOINT 4
#define INCREMENTAL 5
#define RESET 6
#define EXIT 7
/*
*
* The pen state, either UP or DOWN, controls whether vectors are drawn.
*
*/
#define UP 0
#define DOWN 1
/*
*
* Coordinates of the upper right corner of the screen - almost the real screen
* dimensions.
*
*/
#define TEKXMAX 4096
#define TEKYMAX 3120
/*
*
* The size of the spot in SPECIALPOINT mode is controlled by a non-linear
* function that has a domain that consists of the integers from 040 to 0175.
* The next definition is used to initialize the special point mode intensity
* array that implements the function. Data came from table F-6 in the tektronix
* 4014 manual.
*
*/
#define INTENSITY \
\
{ \
14, 16, 17, 19, 20, 22, 23, 25, \
28, 31, 34, 38, 41, 44, 47, 50, \
56, 62, 69, 75, 81, 88, 94,100, \
56, 62, 69, 75, 81, 88, 94,100, \
0, 1, 1, 1, 1, 1, 1, 2, \
2, 2, 2, 2, 3, 3, 3, 3, \
4, 4, 4, 5, 5, 5, 6, 6, \
7, 8, 9, 10, 11, 12, 12, 13, \
14, 16, 17, 19, 20, 22, 23, 25, \
28, 31, 34, 38, 41, 44, 47, 50, \
56, 62, 69, 75, 81, 88, 94,100, \
56, 62, 69, 75, 81, 88, 94,100, \
}
/*
*
* The next two definitions give the height and width of characters in the four
* different sizes available on tektronix terminals. TEKFONT is the default index
* into CHARHEIGHT and CHARWIDTH.
*
*/
#define CHARHEIGHT {88, 82, 53, 48}
#define CHARWIDTH {56, 51, 34, 31}
#define TEKFONT 2
/*
*
* The entries defined in STYLES are passed on to the PostScript operator setdash.
* They're used to implement the different tektronix line styles. Belongs in the
* prologue!
*
*/
#define STYLES \
\
{ \
"[]", \
"[.5 2]", \
"[.5 2 4 2]", \
"[4 4]", \
"[8 4]", \
"[]" \
}
/*
*
* Variables of type Point are used to keep track of the cursor position.
*
*/
typedef struct {
int x;
int y;
} Point;
/*
*
* An array of type Fontmap helps convert font names requested by users into
* legitimate PostScript names. The array is initialized using FONTMAP, which must
* end with an entry that has NULL defined as its name field.
*
*/
typedef struct {
char *name; /* user's font name */
char *val; /* corresponding PostScript name */
} Fontmap;
#define FONTMAP \
\
{ \
"R", "Courier", \
"I", "Courier-Oblique", \
"B", "Courier-Bold", \
"CO", "Courier", \
"CI", "Courier-Oblique", \
"CB", "Courier-Bold", \
"CW", "Courier", \
"PO", "Courier", \
"courier", "Courier", \
"cour", "Courier", \
"co", "Courier", \
NULL, NULL \
}
/*
*
* Some of the non-integer valued functions in posttek.c.
*
*/
char *get_font();
|