summaryrefslogtreecommitdiff
path: root/dviware/textool/defs.h
blob: 9724b6ceed3cb77091dd9a0821be956aefe15b30 (plain)
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
/*
 * The various defines needed by TeXtool.
 */

typedef short Boolean;

char *calloc();
#define NEW(count, type) ((type *) calloc(count, sizeof(type)))

#define DEBUG				/* for massive printing of input */
							/* trace information; select with -d */
							/* or -x for pxl font stuff */

#define BINARYOPEN fopen	/* byte-oriented host version */

#define USEGLOBALMAG		/* when defined, the dvi global
							 * magnification is applied
							 * and user specified magnifications
							 * are also allowed
							 */
/*
 * This is problematical. It would allow better resolution to be obtained
 * by expanding the page but the code only allocates a fixed size canvas
 * for drawing on, big enough for a normal page. If magnification is used
 * the right and bottom of the page will not fall on the canvas and will
 * never be visible. Scrolling only moves the canvas under the frame and
 * will not redraw anything.
 * It is rare to have a complete set of fonts at any other mag anyway.
 */

#define KEYBOARDSCROLL			/* allows h,j,k,l,c scrolling */
					/*
					 * NOTE: this will expose bugs in the
					 * scrolling code in V3.0. Do not use
					 * with 3.0
					 */

#define  FALSE			0
#define  TRUE			1
#define  NOTCACHED		-1
#define  SETCMD			1
#define  PUTCMD			0
#define  DVIFORMAT		2
#define  FIRSTPXLCHAR	0
#define  LASTPXLCHAR	255
#define  NPXLCHARS		256
#define  PXLID			1001
#ifndef  PXLFONTAREA
#define  PXLFONTAREA	"/u/tex/pxlfiles"
#endif
#ifndef  PKFONTAREA
#define  PKFONTAREA		"/u/tex/pk118"
#endif
#define  MAXOPEN		9	/* limit of number of PXL files open */
							/*
							 * Not very many as SunView needs a lot
							 * You need two spare after allowing 3 for
							 * stdin, stout & stderr, 12 for SunView and
							 * 1 for the .dvi file. So MAXOPEN should
							 * be a max. of NOFILE-18.
							 */
#define  RESOLUTION		118	/* is really about 81 (11in raster, 900 dots */
#define  STACKSIZE		100
#define  STRSIZE		256

/* these are defined as macros for speed */
#define MoveDown(a) v += (a);
#define MoveOver(b) h += (b);
#define PixRound(x, conv) ((int)(((x) + ((conv) >> 1)) / (conv)));

/* status bits for main_state */
#define SB_INITIAL 01			/* for case where called as textool <file> */
#define SB_NOFILE 02			/* set after error or for no file name */
#define SB_NEWFILE 04			/* we have a new dvi name to open */
#define SB_NODVIFILE 010		/* we can't access(2) the dvi file */
#define SB_NOTEXFILE 020		/* we can't access(2) the tex file */
#define SB_INTERPRET 040		/* safe to process dvi file */
#define SB_PLUSNUMBER 0100		/* accumulating a positive number */
#define SB_MINUSNUMBER 0200		/* accumulating a negative number */
#define SB_TEXING 0400			/* subwindow currently running tex or latex */
#define SB_EDITING 01000		/* subwindow currently running vi */
#define SB_SHELL 02000			/* subwindow currently running shell */