1 /* $Id: ttydef.h,v 1.1.1.1 2000/06/27 01:48:01 amura Exp $ */
2 /*
3  * Name:	MicroEMACS
4  *		Amiga console device virtual terminal header file
5  * Version:	MG 2a
6  * Last edit:	28-Nov-87 ...!seismo!ut-sally!ut-ngp!mic (mic@emx.cc.utexas.edu)
7  * Created:	20-Apr-86 ...!seismo!ut-sally!ut-ngp!mic
8  */
9 
10 /*
11  * $Log: ttydef.h,v $
12  * Revision 1.1.1.1  2000/06/27 01:48:01  amura
13  * import to CVS
14  *
15  */
16 
17 #define	GOSLING				/* Compile in fancy display. */
18 /* #define	TOP_OFFSET	11 */	/* # raster lines from top of window */
19                                         /* For Font Sensitive By H.Konishi */
20 #define TOP_OFFSET	((WBInfo. Font->ta_YSize)+3)
21 
22 #ifndef	NROW
23 #define	NROW		51		/* Max rows (interlaced screen)	  */
24 #endif
25 
26 #ifndef	NCOL
27 #define	NCOL		85		/* Max cols (MoreRows, borderless) */
28 #endif
29 
30 #ifndef LR_BORDER
31 #define	LR_BORDER (3 + 20)		/* Vertical border size (pixels)  */
32 #endif
33 
34 #ifndef TB_BORDER
35 #define	TB_BORDER (TOP_OFFSET + 2)	/* Horizontal border size (pixels)*/
36 #endif
37 
38 #ifndef	INIT_ROWS
39 #define	INIT_ROWS 24			/* Desired initial window height  */
40 #endif
41 
42 #ifndef	INIT_COLS
43 #define	INIT_COLS 80			/* Desired initial window width	  */
44 #endif
45 
46 /*
47  * Function key codes (using 16-bit KEY values)
48  */
49 #define	KFIRST	0x100
50 
51 #define	KUP	0x100
52 #define	KDOWN	0x101
53 #define KLEFT	0x102
54 #define	KRIGHT	0x103
55 
56 #define	KSUP	0x104
57 #define	KSDOWN	0x105
58 #define	KSLEFT	0x106
59 #define	KSRIGHT	0x107
60 
61 #define	KHELP	0x108
62 #define	KMENU	0x109
63 #define	KRESIZE	0x10A
64 
65 #define	KF1	0x10C
66 #define	KF2	0x10D
67 #define KF3	0x10E
68 #define	KF4	0x10F
69 #define KF5	0x110
70 #define KF6	0x111
71 #define KF7	0x112
72 #define KF8	0x113
73 #define KF9	0x114
74 #define KF10	0x115
75 
76 #define	KSF1	0x116
77 #define	KSF2	0x117
78 #define KSF3	0x118
79 #define	KSF4	0x119
80 #define KSF5	0x11A
81 #define KSF6	0x11B
82 #define KSF7	0x11C
83 #define KSF8	0x11D
84 #define KSF9	0x11E
85 #define KSF10	0x11F
86 
87 #define	KW___MOUSE	0x120
88 #define	KW__CMOUSE	0x121
89 #define	KW_S_MOUSE	0x122
90 #define	KW_SCMOUSE	0x123
91 #define	KWA__MOUSE	0x124
92 #define	KWA_CMOUSE	0x125
93 #define	KWAS_MOUSE	0x126
94 #define	KWASCMOUSE	0x127
95 #define	KM___MOUSE	0x128
96 #define	KM__CMOUSE	0x129
97 #define	KM_S_MOUSE	0x12A
98 #define	KM_SCMOUSE	0x12B
99 #define	KMA__MOUSE	0x12C
100 #define	KMA_CMOUSE	0x12D
101 #define	KMAS_MOUSE	0x12E
102 #define	KMASCMOUSE	0x12F
103 #define	KE___MOUSE	0x130
104 #define	KE__CMOUSE	0x131
105 #define	KE_S_MOUSE	0x132
106 #define	KE_SCMOUSE	0x133
107 #define	KEA__MOUSE	0x134
108 #define	KEA_CMOUSE	0x135
109 #define	KEAS_MOUSE	0x136
110 #define	KEASCMOUSE	0x137
111 
112 #define	KLAST	KEASCMOUSE
113 
114 /*
115  * Mouse key encoding stuff...  The bit fields are:
116  *
117  *		   4 3	   2 	  1	 0
118  *		| where	| ALT | SHIFT | CTRL
119  *
120  * Where ALT, SHIFT, and CTRL indicate qualifiers, and the 2-bit
121  * where field indicates whether the click was (initially) in a window,
122  * a mode line, or the echo line.  The mouse functions are smart enough
123  * to remap themselves if necessary; we implement these as keys so
124  * users can rebind things to their taste.
125  */
126 #define	M_X_ZERO	' '
127 #define	M_Y_ZERO	' '
128 #define	MQ_OFFSET	0x40
129 #define	MQ_NOQUAL	0x00
130 #define	MQ_CTRL		0x01
131 #define	MQ_SHIFT	0x02
132 #define	MQ_ALT		0x04
133 #define	MQ_WINDOW	0x00
134 #define	MQ_MODE		0x08
135 #define	MQ_ECHO		0x10
136 #define	MQ_WHERE(m)	(m & 0x18)	/* get where field */
137 #define	MQ_QUALS(m)	(m & 0x07)	/* get qualifier field */
138 
139 /*
140  * Intuition menu interface.  Each set of menu items kept in a table of
141  * MenuBinding structures, which is in turn kept in a table of MenuInfo
142  * structures. These tables are indexed via the menu and item numbers to
143  * find the internal extended name of the function associated with a
144  * certain item.
145  */
146 #define	MN_OFFSET	' '		/* menu char - ' ' = real code */
147 struct MenuBinding {
148 	char	*Command;
149 #ifdef	SUPPORT_ANSI
150 	int	(*Function)(int,int);
151 #else
152 	int	(*Function)();
153 #endif
154 };
155 
156 struct MenuInfo {
157 	char *Name;			/* name of menu			*/
158 	short NumItems;			/* # of items			*/
159 	struct MenuBinding *Items;	/* item name, internal binding	*/
160 };
161 
162 #define NITEMS(arr) (sizeof(arr) / (sizeof(arr[0])))
163 
164 /*
165  * If either MENU, or BROWSER is defined, we need to define
166  * DO_MENU to get the code for dealing with menu selections
167  * compiled in.
168  */
169 
170 #ifdef	MENU
171 #define	DO_MENU
172 #else
173 #ifdef	BROWSER
174 #define	DO_MENU
175 #endif	BROWSER
176 #endif	MENU
177 
178 /*
179  * MODE_RENDITION and TEXT_RENDITION determine the way the mode line and
180  * text area are rendered (using the SGR sequence).  TEXT_* and MODE_* set
181  * the foreground (FG) and background (BG) color to the specified number.
182  * If you* #define CHANGE_COLOR, you can redefine these dynamically.
183  */
184 
185 #ifndef MODE_RENDITION
186 #define	MODE_RENDITION 7
187 #endif
188 
189 #ifndef TEXT_RENDITION
190 #define	TEXT_RENDITION 0
191 #endif
192 
193 #ifndef	TEXT_FG
194 #define TEXT_FG 1
195 #endif
196 
197 #ifndef TEXT_BG
198 #define TEXT_BG 0
199 #endif
200 
201 #ifndef	MODE_FG
202 #define MODE_FG 1
203 #endif
204 
205 #ifndef	MODE_BG
206 #define MODE_BG 0
207 #endif
208 
209 /*
210  * Return the width and height of
211  * the default font for a window.
212  */
213 
214 #define	FontWidth(w) (w)->RPort->TxWidth
215 #define	FontHeight(w) (w)->RPort->TxHeight
216 
217 /* Dec.17,1992 Add by H.Ohkubo */
218 #ifdef	KANJI	/* 90.02.05  by S.Yoshida */
219 #define	ungetkbd(c)	(ttungetc(c))
220 #endif	/* KANJI */
221