1: /******************************************************************************
2: *
3: * defs -- constant and macro definitions for dipress
4: *
5: * John Mellor-Crummey (Xerox Corp)
6: *
7: * Copyright (c) 1985 Xerox Corporation
8: *
9: *****************************************************************************/
10:
11: #define QUIT 1
12: #define CONTINUE 0
13:
14: #define MAX_NUM_FONTS 60
15:
16: #define DEFAULTRANGEBOT -9999 /* used to fill in an unspecified lower page# */
17: #define DEFAULTRANGETOP 9999 /* used to fill in an unspecified top page# */
18: #define MAXPAGESPEC 25 /* maximum number of page specifications on
19: * the command line using -o
20: */
21:
22: #define TRUE 1
23:
24: #define BUFFERSIZE 512 /* buffer for reading ditroff commands */
25: #define Showbuff_size 255
26: #define INCH 2540 /* micas per inch */
27: #define F_transform 0
28: #define maxPointsInSpline 60 /* maximum number of points in a
29: * wiggly line
30: */
31:
32: #define curr_strokewidth (pointsizeTab[size - 1] * 4)
33: #define gobj_size(h1,v1,h2,v2) new_bitmap(curr_strokewidth, h1, v1, h2, v2)
34:
35: /* macros for positioning within the document */
36: #define hInc(n) hor_pos += n
37: #define hMov(n) hor_pos = n
38: #define vInc(n) ver_pos += n
39: #define vMov(n) ver_pos = n
40:
41: /* translate ditroff h and v into interpress x and y */
42: /* (rx and ry are for relative x and y values) */
43:
44: # define xloc(h) ((h) * scale)
45: # define rx(h) x(h)
46: # define yloc(v) (11 * INCH - ((v) * scale))
47: # define ry(v) (-(v) * scale)
48:
49: /* fontNumber -- coerce an out of range font index to the default font */
50: #define fontNumber(n) ((n < 0 || n > device.num_fonts) ? 1 : n)
51:
52: #define white(ch) (ch == ' ' || ch == '\t')
53: #define abs(n) (((n) < 0) ? - (n) : (n))
54: #define sqr(n) ((n) * (n))
55:
56:
57: /* constants for drawarc -- definition of the directions of movement */
58: #define M1 1
59: #define M2 2
60: #define M3 3
61:
62: #define setpixel() set_pixel(hor_pos,ver_pos)
63:
64: #define MAXSTATE 5 /* maximum number of stacked environments */
65:
66: /* mneumonics for the Device Independent Troff Commands */
67:
68: #define cmdPointSize 's'
69: #define cmdFont 'f'
70: #define cmdChar 'c'
71: #define cmdSpecChar 'C'
72: #define cmdAbsHoriz 'H'
73: #define cmdRelHoriz 'h'
74: #define cmdAbsVert 'V'
75: #define cmdRelVert 'v'
76: #define cmdEol 'n'
77: #define cmdWordSep 'w'
78: #define cmdNewPage 'p'
79: #define cmdPushEnv '{'
80: #define cmdPopEnv '}'
81: #define cmdCharString 't'
82: #define '#'
83: #define cmdDraw 'D'
84: #define drawLine 'l'
85: #define drawCircle 'c'
86: #define drawEllipse 'e'
87: #define drawArc 'a'
88: #define drawWigglyLine '~'
89: #define cmdDevice 'x'
90: #define deviceInit 'i'
91: #define deviceName 'T'
92: #define deviceResolution 'r'
93: #define devicePause 'p'
94: #define deviceStop 's'
95: #define deviceTrailer 't'
96: #define deviceFont 'f'
97: #define deviceHeight 'H'
98: #define deviceSlant 'S'
Defined macros
INCH
defined in line
26; used 1 times
M1
defined in line
58; used 1 times
M2
defined in line
59; used 2 times
M3
defined in line
60; used 1 times
QUIT
defined in line
11; used 15 times
TRUE
defined in line
22; used 1 times
abs
defined in line
53; used 16 times
defined in line
82;
never used
hInc
defined in line
36; used 2 times
hMov
defined in line
37; used 15 times
rx
defined in line
45;
never used
ry
defined in line
47;
never used
sqr
defined in line
54;
never used
vInc
defined in line
38; used 1 times
vMov
defined in line
39; used 12 times
white
defined in line
52; used 6 times
xloc
defined in line
44; used 4 times
yloc
defined in line
46; used 3 times
Usage of this include