xref: /csrg-svn/old/lib2648/2648.h (revision 18795)
111503Sralph /*
2*18795Sdist  * Copyright (c) 1980 Regents of the University of California.
3*18795Sdist  * All rights reserved.  The Berkeley software License Agreement
4*18795Sdist  * specifies the terms and conditions for redistribution.
5*18795Sdist  *
6*18795Sdist  *	@(#)2648.h	5.1 (Berkeley) 04/26/85
7*18795Sdist  */
8*18795Sdist 
9*18795Sdist /*
1011503Sralph  * lib2648: routines to deal directly with the HP 2648 Graphics terminal.
1111503Sralph  */
1211503Sralph 
1311503Sralph #include <stdio.h>
1411503Sralph 
1511503Sralph #define ESC	'\033'	/* Escape */
1611503Sralph 
1711503Sralph /* Normal/inverse video */
1811503Sralph #define NORMAL	0	/* not inverse video */
1911503Sralph #define INVERSE	1	/* inverse video */
2011503Sralph 
2111503Sralph /* Kinds of lines we can draw */
2211503Sralph #define MX	10	/* exclusive or what's on screen */
2311503Sralph #define MC	11	/* clear what's on screen */
2411503Sralph #define MS	12	/* set what's on screen */
2511503Sralph 
2611503Sralph /* Escape sequence modes the terminal might be in */
2711503Sralph #define NONE	20	/* not in an escape sequence */
2811503Sralph #define ESCD	21	/* in an escape * d sequence */
2911503Sralph #define ESCP	22	/* in an escape * p sequence */
3011503Sralph #define ESCM	23	/* in an escape * m sequence */
3111503Sralph #define TEXT	24	/* in graphics text mode */
3211503Sralph 
3311503Sralph /*
3411503Sralph  * Constants for 2648 ^E/^F handshaking.
3511503Sralph  */
3611503Sralph #define ENQ	5	/* ^E sent by system to terminal */
3711503Sralph #define ACK	6	/* ^F reply by terminal to system */
3811503Sralph #define TBLKSIZ	32	/* Max # chars between handshakes */
3911503Sralph 
4011503Sralph /*
4111503Sralph  * Misc. variables used by lib2648.
4211503Sralph  */
4311503Sralph int	_on2648;	/* true if getenv("TERM") is hp2648 */
4411503Sralph int	_video;		/* are we in inverse video mode? */
4511503Sralph int	_actsmode;	/* line type mode screen actually in */
4611503Sralph int	_supsmode;	/* line type mode screen supposed to be in */
4711503Sralph int	_escmode;	/* flavor of escape sequence currently in */
4811503Sralph int	_cursoron;	/* true if cursor is on */
4911503Sralph 
5011503Sralph int	_outcount;	/* # of consecutive chars without read sent */
5111503Sralph char	_pushback[BUFSIZ]; /* queue of chars pushed back onto the input */
5211503Sralph char	*_pb_front, *_pb_back;
5311503Sralph 
5411503Sralph int	_penx, _peny;	/* where pen is really at */
5511503Sralph int	_curx, _cury;	/* where cursor is really at */
5611503Sralph int	_supx, _supy;	/* where pen and cursor are supposed to be */
5711503Sralph 
5811503Sralph #ifdef TRACE
5911503Sralph FILE	*trace;		/* trace file for debugging */
6011503Sralph #endif
61