xref: /csrg-svn/sys/news3400/bm/vt100.h (revision 63256)
153889Smckusick /*
2*63256Sbostic  * Copyright (c) 1992, 1993
3*63256Sbostic  *	The Regents of the University of California.  All rights reserved.
453889Smckusick  *
553889Smckusick  * This code is derived from software contributed to Berkeley by
653889Smckusick  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
753889Smckusick  *
853889Smckusick  * %sccs.include.redist.c%
953889Smckusick  *
1053889Smckusick  * from: $Hdr: vt100.h,v 4.300 91/06/09 06:14:58 root Rel41 $ SONY
1153889Smckusick  *
12*63256Sbostic  *	@(#)vt100.h	8.1 (Berkeley) 06/10/93
1353889Smckusick  */
1453889Smckusick 
1553889Smckusick /*
1653889Smckusick  *  vt100 emulator header
1753889Smckusick  */
1853889Smckusick 
1957177Sutashiro #include <news3400/bm/vt100esc.h>
2053889Smckusick 
2153889Smckusick /*
2253889Smckusick  *  terminal mode
2353889Smckusick  */
2453889Smckusick #define	KAM		0x00000001	/*  k-action(lock or not) */
2553889Smckusick #define	IRM		0x00000002	/*  insert mode 	*/
2653889Smckusick #define	SRM		0x00000004	/*  local echo disable	*/
2753889Smckusick #define	LNM		0x00000008	/*  new line mode	*/
2853889Smckusick #define	DECCKM		0x00000010	/*  cursor application	*/
2953889Smckusick #define	DECCOLM		0x00000020	/*  132 column mode	*/
3053889Smckusick #define	DECSCLM		0x00000040	/*  jump scroll		*/
3153889Smckusick #define	DECSCNM		0x00000080	/*  screen reverse	*/
3253889Smckusick #define	DECOM		0x00000100	/*  origin mode		*/
3353889Smckusick #define	DECAWM		0x00000200	/*  auto wrap mode	*/
3453889Smckusick #define	DECARM		0x00000400	/*  auto repeat mode	*/
3553889Smckusick #define	DECKPA_NM	0x00000800	/*  ten key application	*/
3653889Smckusick #define	DECCSR_ACTV	0x00001000	/*  cursor active	*/
3753889Smckusick 
3853889Smckusick 
3953889Smckusick /*
4053889Smckusick  *  cursor attributes
4153889Smckusick  */
4253889Smckusick #define	NORMALM		0x0000		/*  attributes clear	*/
4353889Smckusick #define	BOLD		0x0001		/*  bold	*/
4453889Smckusick #define	USCORE		0x0002		/*  under line	*/
4553889Smckusick #define	BLINK		0x0004		/*  blinking	*/
4653889Smckusick #define	REVERSE		0x0008		/*  reverse	*/
4753889Smckusick 
4853889Smckusick 
4953889Smckusick /*
5053889Smckusick  *  cursor current status
5153889Smckusick  */
5253889Smckusick #define	ESCAPE	0x00000001		/*  processing esc sequence	*/
5353889Smckusick #define	WRAP	0x00000002		/*  local flag in addch()	*/
5453889Smckusick #define	SKANJI	0x00000004		/*  receive kanji shift jis code  */
5553889Smckusick #define	JKANJI	0x00000008		/*  kanji mode (JIS)	*/
5653889Smckusick #define EKANA	0x00000010
5753889Smckusick #define EKANJI	0x00000020
5853889Smckusick 
5953889Smckusick /*
6053889Smckusick  *  shift jis code conversion table
6153889Smckusick  */
6253889Smckusick #define	JVR1S	0x81	/*  starting of vertical range  1	*/
6353889Smckusick #define	JVR1E	0x9f	/*  ending of vertical range  1		*/
6453889Smckusick #define	JVR2S	0xe0	/*  starting of vertical range  2	*/
6553889Smckusick #define JVR2E	0xfc	/*  ending of vertical range  2		*/
6653889Smckusick #define	JHR1S	0x40	/*  starting of horizontal range  1	*/
6753889Smckusick #define	JHR1E	0x7e	/*  ending of horizontal range  1	*/
6853889Smckusick #define	JHR2S	0x80	/*  starting of horizontal range  2	*/
6953889Smckusick #define	JHR2E	0x9e	/*  ending of horizontal range  2	*/
7053889Smckusick #define	JHR3S	0x9f	/*  starting of horizontal range  3	*/
7153889Smckusick #define JHR3E	0xfc	/*  ending of horizontal range  3	*/
7253889Smckusick 
7353889Smckusick /*
7453889Smckusick  *  EUC conversion table
7553889Smckusick  */
7653889Smckusick #define SS2	0x8e
7753889Smckusick #define	CS1S	0xa1
7853889Smckusick #define CS1E	0xfe
7953889Smckusick 
8053889Smckusick 
8153889Smckusick /*
8253889Smckusick  *  screen width
8353889Smckusick  */
8453889Smckusick #define	TOP_M	1		/*  screen top margin	*/
8553889Smckusick #define	LFT_M	1		/*  screen left margin	*/
8653889Smckusick 
8753889Smckusick /*
8853889Smckusick  *  default value
8953889Smckusick  */
9053889Smckusick #define	DIM_CNT_DFLT	10	/*  initial dimmer count	*/
9153889Smckusick #define	BELL_LEN_DFLT	32	/*  bell length	*/
9253889Smckusick 
9353889Smckusick /*
9453889Smckusick  *  max and min value of above values
9553889Smckusick  */
9653889Smckusick #define	FONT_W_MAX	16
9753889Smckusick #define	FONT_W_MIN	5
9853889Smckusick #define	FONT_H_MAX	32
9953889Smckusick #define	FONT_H_MIN	8
10053889Smckusick #define	CHAR_W_MAX	16
10153889Smckusick #define	CHAR_W_MIN	6
10253889Smckusick #define	CHAR_H_MAX	32
10353889Smckusick #define	CHAR_H_MIN	9
10453889Smckusick #define	CH_POS_MAX	32
10553889Smckusick #define	CH_POS_MIN	0
10653889Smckusick #define	UL_POS_MAX	32
10753889Smckusick #define	UL_POS_MIN	0
10853889Smckusick #define	SCR_W_MAX	1024
10953889Smckusick #define	SCR_W_MIN	0
11053889Smckusick #define	SCR_H_MAX	1024
11153889Smckusick #define	SCR_H_MIN	0
11253889Smckusick #define	X_OFST_MAX	1024
11353889Smckusick #define	X_OFST_MIN	0
11453889Smckusick #define	Y_OFST_MAX	1024
11553889Smckusick #define	Y_OFST_MIN	0
11653889Smckusick #define	RIT_M_MAX	136
11753889Smckusick #define	RIT_M_MIN	2
11853889Smckusick #define	BTM_M_MAX	100
11953889Smckusick #define	BTM_M_MIN	1
12053889Smckusick #define	DIM_CNT_MAX	32767
12153889Smckusick #define	DIM_CNT_MIN	1
12253889Smckusick #define	BELL_LEN_MAX	19200
12353889Smckusick #define	BELL_LEN_MIN	1
12453889Smckusick 
12553889Smckusick /*
12653889Smckusick  *  scroll region
12753889Smckusick  */
12853889Smckusick struct	region {
12953889Smckusick 	int	top_margin;
13053889Smckusick 	int	btm_margin;
13153889Smckusick };
13253889Smckusick 
13353889Smckusick /*
13453889Smckusick  *  cursor position and status
13553889Smckusick  */
13653889Smckusick struct	cursor {
13753889Smckusick 	int	csr_x;		/*  cursor position x	*/
13853889Smckusick 	int	csr_y;		/*  cursor position y	*/
13953889Smckusick 	lPoint	csr_p;		/*  cursor point	*/
14053889Smckusick 	int	csr_attributes;	/*  cursor attributes	*/
14153889Smckusick };
14253889Smckusick 
14353889Smckusick /*
14453889Smckusick  *  screen information
14553889Smckusick  */
14653889Smckusick typedef	struct	screen {
14753889Smckusick 	int	s_term_mode;
14853889Smckusick 	int	s_current_stat;		/*  current status	*/
14953889Smckusick 	struct	esc_sequence  *s_estp;	/*  for escape handler	*/
15053889Smckusick 	int	(*s_esc_handler)();
15153889Smckusick 	int	s_plane;		/*  color bitmap plane #  */
15253889Smckusick 	int	s_bgcol;		/*  back ground color	*/
15353889Smckusick 	char	s_tab_pos[RIT_M_MAX + 1];	/*  tab stop position	*/
15453889Smckusick 	struct	cursor	s_csr;
15553889Smckusick 	struct	region	s_region;
15653889Smckusick } SCREEN;
15753889Smckusick 
15853889Smckusick #define	ESC_BUF_SIZ	32
15953889Smckusick #define	PARM_BUF_SIZ	8
16053889Smckusick #define	AN_BUF_SIZ	32
16153889Smckusick 
16253889Smckusick extern unsigned short fbuf[256];
16353889Smckusick extern int	fp;
16453889Smckusick extern int	fpn;
16553889Smckusick extern lPoint	fpp;
16653889Smckusick extern int	fpa;
16753889Smckusick 
16853889Smckusick #define	INVALID	-1
16953889Smckusick #define	TRUE	1
17053889Smckusick #define	FALSE	0
17153889Smckusick 
17253889Smckusick #define	C_MESS_SIZ	32
17353889Smckusick 
17453889Smckusick extern	int	fcolor;
17553889Smckusick extern	int	bcolor;
17653889Smckusick 
17753889Smckusick extern	lRectangle	char_r1;
17853889Smckusick extern	lRectangle	char_r2;
17953889Smckusick extern	lRectangle	font_r1;
18053889Smckusick extern	lRectangle	font_r2;
18153889Smckusick 
18253889Smckusick extern	int	font_len1;
18353889Smckusick extern	int	font_len2;
18453889Smckusick 
18553889Smckusick extern	int	char_w;
18653889Smckusick extern	int	char_h;
18753889Smckusick extern	int	char_wx2;
18853889Smckusick extern	int	font_w;
18953889Smckusick extern	int	font_h;
19053889Smckusick extern	int	ch_pos;
19153889Smckusick extern	int	ul_pos;
19253889Smckusick extern	int	x_ofst;
19353889Smckusick extern	int	y_ofst;
19453889Smckusick extern	int	rit_m;
19553889Smckusick extern	int	btm_m;
19653889Smckusick extern	int	scr_w;
19753889Smckusick extern	int	scr_h;
19853889Smckusick extern	int	dim_cnt;
19953889Smckusick extern	int	bell_len;
20053889Smckusick extern	int	a_dim_on;
201