xref: /csrg-svn/old/lib2648/2648.h (revision 11503)
1*11503Sralph /*	2648.h	4.1	83/03/09	*/
2*11503Sralph /*
3*11503Sralph  * lib2648: routines to deal directly with the HP 2648 Graphics terminal.
4*11503Sralph  */
5*11503Sralph 
6*11503Sralph #include <stdio.h>
7*11503Sralph 
8*11503Sralph #define ESC	'\033'	/* Escape */
9*11503Sralph 
10*11503Sralph /* Normal/inverse video */
11*11503Sralph #define NORMAL	0	/* not inverse video */
12*11503Sralph #define INVERSE	1	/* inverse video */
13*11503Sralph 
14*11503Sralph /* Kinds of lines we can draw */
15*11503Sralph #define MX	10	/* exclusive or what's on screen */
16*11503Sralph #define MC	11	/* clear what's on screen */
17*11503Sralph #define MS	12	/* set what's on screen */
18*11503Sralph 
19*11503Sralph /* Escape sequence modes the terminal might be in */
20*11503Sralph #define NONE	20	/* not in an escape sequence */
21*11503Sralph #define ESCD	21	/* in an escape * d sequence */
22*11503Sralph #define ESCP	22	/* in an escape * p sequence */
23*11503Sralph #define ESCM	23	/* in an escape * m sequence */
24*11503Sralph #define TEXT	24	/* in graphics text mode */
25*11503Sralph 
26*11503Sralph /*
27*11503Sralph  * Constants for 2648 ^E/^F handshaking.
28*11503Sralph  */
29*11503Sralph #define ENQ	5	/* ^E sent by system to terminal */
30*11503Sralph #define ACK	6	/* ^F reply by terminal to system */
31*11503Sralph #define TBLKSIZ	32	/* Max # chars between handshakes */
32*11503Sralph 
33*11503Sralph /*
34*11503Sralph  * Misc. variables used by lib2648.
35*11503Sralph  */
36*11503Sralph int	_on2648;	/* true if getenv("TERM") is hp2648 */
37*11503Sralph int	_video;		/* are we in inverse video mode? */
38*11503Sralph int	_actsmode;	/* line type mode screen actually in */
39*11503Sralph int	_supsmode;	/* line type mode screen supposed to be in */
40*11503Sralph int	_escmode;	/* flavor of escape sequence currently in */
41*11503Sralph int	_cursoron;	/* true if cursor is on */
42*11503Sralph 
43*11503Sralph int	_outcount;	/* # of consecutive chars without read sent */
44*11503Sralph char	_pushback[BUFSIZ]; /* queue of chars pushed back onto the input */
45*11503Sralph char	*_pb_front, *_pb_back;
46*11503Sralph 
47*11503Sralph int	_penx, _peny;	/* where pen is really at */
48*11503Sralph int	_curx, _cury;	/* where cursor is really at */
49*11503Sralph int	_supx, _supy;	/* where pen and cursor are supposed to be */
50*11503Sralph 
51*11503Sralph #ifdef TRACE
52*11503Sralph FILE	*trace;		/* trace file for debugging */
53*11503Sralph #endif
54