1 /* 2 * Copyright (c) 1992 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc. 7 * 8 * %sccs.include.redist.c% 9 * 10 * from: $Hdr: vt100.h,v 4.300 91/06/09 06:14:58 root Rel41 $ SONY 11 * 12 * @(#)vt100.h 7.2 (Berkeley) 07/28/92 13 */ 14 15 #include "../include/fix_machine_type.h" 16 17 /* 18 * vt100 emulator header 19 */ 20 21 #include "../bm/vt100esc.h" 22 23 /* 24 * terminal mode 25 */ 26 #define KAM 0x00000001 /* k-action(lock or not) */ 27 #define IRM 0x00000002 /* insert mode */ 28 #define SRM 0x00000004 /* local echo disable */ 29 #define LNM 0x00000008 /* new line mode */ 30 #define DECCKM 0x00000010 /* cursor application */ 31 #define DECCOLM 0x00000020 /* 132 column mode */ 32 #define DECSCLM 0x00000040 /* jump scroll */ 33 #define DECSCNM 0x00000080 /* screen reverse */ 34 #define DECOM 0x00000100 /* origin mode */ 35 #define DECAWM 0x00000200 /* auto wrap mode */ 36 #define DECARM 0x00000400 /* auto repeat mode */ 37 #define DECKPA_NM 0x00000800 /* ten key application */ 38 #define DECCSR_ACTV 0x00001000 /* cursor active */ 39 40 41 /* 42 * cursor attributes 43 */ 44 #define NORMALM 0x0000 /* attributes clear */ 45 #define BOLD 0x0001 /* bold */ 46 #define USCORE 0x0002 /* under line */ 47 #define BLINK 0x0004 /* blinking */ 48 #define REVERSE 0x0008 /* reverse */ 49 50 51 /* 52 * cursor current status 53 */ 54 #define ESCAPE 0x00000001 /* processing esc sequence */ 55 #define WRAP 0x00000002 /* local flag in addch() */ 56 #define SKANJI 0x00000004 /* receive kanji shift jis code */ 57 #define JKANJI 0x00000008 /* kanji mode (JIS) */ 58 #define EKANA 0x00000010 59 #define EKANJI 0x00000020 60 61 /* 62 * shift jis code conversion table 63 */ 64 #define JVR1S 0x81 /* starting of vertical range 1 */ 65 #define JVR1E 0x9f /* ending of vertical range 1 */ 66 #define JVR2S 0xe0 /* starting of vertical range 2 */ 67 #define JVR2E 0xfc /* ending of vertical range 2 */ 68 #define JHR1S 0x40 /* starting of horizontal range 1 */ 69 #define JHR1E 0x7e /* ending of horizontal range 1 */ 70 #define JHR2S 0x80 /* starting of horizontal range 2 */ 71 #define JHR2E 0x9e /* ending of horizontal range 2 */ 72 #define JHR3S 0x9f /* starting of horizontal range 3 */ 73 #define JHR3E 0xfc /* ending of horizontal range 3 */ 74 75 /* 76 * EUC conversion table 77 */ 78 #define SS2 0x8e 79 #define CS1S 0xa1 80 #define CS1E 0xfe 81 82 83 /* 84 * screen width 85 */ 86 #define TOP_M 1 /* screen top margin */ 87 #define LFT_M 1 /* screen left margin */ 88 89 /* 90 * default value 91 */ 92 #define DIM_CNT_DFLT 10 /* initial dimmer count */ 93 #define BELL_LEN_DFLT 32 /* bell length */ 94 95 /* 96 * max and min value of above values 97 */ 98 #define FONT_W_MAX 16 99 #define FONT_W_MIN 5 100 #define FONT_H_MAX 32 101 #define FONT_H_MIN 8 102 #define CHAR_W_MAX 16 103 #define CHAR_W_MIN 6 104 #define CHAR_H_MAX 32 105 #define CHAR_H_MIN 9 106 #define CH_POS_MAX 32 107 #define CH_POS_MIN 0 108 #define UL_POS_MAX 32 109 #define UL_POS_MIN 0 110 #define SCR_W_MAX 1024 111 #define SCR_W_MIN 0 112 #define SCR_H_MAX 1024 113 #define SCR_H_MIN 0 114 #define X_OFST_MAX 1024 115 #define X_OFST_MIN 0 116 #define Y_OFST_MAX 1024 117 #define Y_OFST_MIN 0 118 #define RIT_M_MAX 136 119 #define RIT_M_MIN 2 120 #define BTM_M_MAX 100 121 #define BTM_M_MIN 1 122 #define DIM_CNT_MAX 32767 123 #define DIM_CNT_MIN 1 124 #define BELL_LEN_MAX 19200 125 #define BELL_LEN_MIN 1 126 127 /* 128 * scroll region 129 */ 130 struct region { 131 int top_margin; 132 int btm_margin; 133 }; 134 135 /* 136 * cursor position and status 137 */ 138 struct cursor { 139 int csr_x; /* cursor position x */ 140 int csr_y; /* cursor position y */ 141 lPoint csr_p; /* cursor point */ 142 int csr_attributes; /* cursor attributes */ 143 }; 144 145 /* 146 * screen information 147 */ 148 typedef struct screen { 149 int s_term_mode; 150 int s_current_stat; /* current status */ 151 struct esc_sequence *s_estp; /* for escape handler */ 152 int (*s_esc_handler)(); 153 int s_plane; /* color bitmap plane # */ 154 int s_bgcol; /* back ground color */ 155 char s_tab_pos[RIT_M_MAX + 1]; /* tab stop position */ 156 struct cursor s_csr; 157 struct region s_region; 158 } SCREEN; 159 160 #define ESC_BUF_SIZ 32 161 #define PARM_BUF_SIZ 8 162 #define AN_BUF_SIZ 32 163 164 extern unsigned short fbuf[256]; 165 extern int fp; 166 extern int fpn; 167 extern lPoint fpp; 168 extern int fpa; 169 170 #define INVALID -1 171 #define TRUE 1 172 #define FALSE 0 173 174 #define C_MESS_SIZ 32 175 176 extern int fcolor; 177 extern int bcolor; 178 179 extern lRectangle char_r1; 180 extern lRectangle char_r2; 181 extern lRectangle font_r1; 182 extern lRectangle font_r2; 183 184 extern int font_len1; 185 extern int font_len2; 186 187 extern int char_w; 188 extern int char_h; 189 extern int char_wx2; 190 extern int font_w; 191 extern int font_h; 192 extern int ch_pos; 193 extern int ul_pos; 194 extern int x_ofst; 195 extern int y_ofst; 196 extern int rit_m; 197 extern int btm_m; 198 extern int scr_w; 199 extern int scr_h; 200 extern int dim_cnt; 201 extern int bell_len; 202 extern int a_dim_on; 203