Mercurial > hg > xemacs-beta
comparison src/console-tty.h @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | 74fd4e045ea6 |
children |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
27 Therefore, all stuff for both input and output is lumped into | 27 Therefore, all stuff for both input and output is lumped into |
28 the console structure. If it ever becomes meaningful to | 28 the console structure. If it ever becomes meaningful to |
29 have more than one device on a TTY console, the output stuff | 29 have more than one device on a TTY console, the output stuff |
30 will have to get separated out. */ | 30 will have to get separated out. */ |
31 | 31 |
32 #ifndef INCLUDED_console_tty_h_ | 32 #ifndef _XEMACS_CONSOLE_TTY_H_ |
33 #define INCLUDED_console_tty_h_ | 33 #define _XEMACS_CONSOLE_TTY_H_ |
34 | 34 |
35 #include "console.h" | 35 #include "console.h" |
36 #include "syssignal.h" /* Always include before systty.h */ | 36 #include "syssignal.h" /* Always include before systty.h */ |
37 #include "systty.h" | 37 #include "systty.h" |
38 | 38 |
39 DECLARE_CONSOLE_TYPE (tty); | 39 DECLARE_CONSOLE_TYPE (tty); |
40 | 40 |
41 struct tty_console | 41 struct tty_console |
42 { | 42 { |
43 int infd, outfd; | 43 int infd, outfd; |
44 #ifdef HAVE_GPM | |
45 int mouse_fd; | |
46 #endif | |
44 Lisp_Object instream, outstream; | 47 Lisp_Object instream, outstream; |
45 Lisp_Object terminal_type; | 48 Lisp_Object terminal_type; |
46 Lisp_Object controlling_process; | 49 Lisp_Object controlling_process; |
47 char *term_entry_buffer; | 50 char *term_entry_buffer; |
48 | 51 |
91 /* cursor motion entries - each entry is commented with the terminfo | 94 /* cursor motion entries - each entry is commented with the terminfo |
92 and the termcap entry */ | 95 and the termcap entry */ |
93 struct | 96 struct |
94 { | 97 { |
95 /* local cursor movement */ | 98 /* local cursor movement */ |
96 const char *up; /* cuu1, up */ | 99 CONST char *up; /* cuu1, up */ |
97 const char *down; /* cud1, do */ | 100 CONST char *down; /* cud1, do */ |
98 const char *left; /* cub1, le */ | 101 CONST char *left; /* cub1, le */ |
99 const char *right; /* cuf1, nd */ | 102 CONST char *right; /* cuf1, nd */ |
100 const char *home; /* home, ho */ | 103 CONST char *home; /* home, ho */ |
101 const char *low_left; /* ll, ll */ | 104 CONST char *low_left; /* ll, ll */ |
102 const char *car_return; /* cr, cr */ | 105 CONST char *car_return; /* cr, cr */ |
103 | 106 |
104 /* parameterized local cursor movement */ | 107 /* parameterized local cursor movement */ |
105 const char *multi_up; /* cuu, UP */ | 108 CONST char *multi_up; /* cuu, UP */ |
106 const char *multi_down; /* cud, DO */ | 109 CONST char *multi_down; /* cud, DO */ |
107 const char *multi_left; /* cub, LE */ | 110 CONST char *multi_left; /* cub, LE */ |
108 const char *multi_right; /* cuf, RI */ | 111 CONST char *multi_right; /* cuf, RI */ |
109 | 112 |
110 /* absolute cursor motion */ | 113 /* absolute cursor motion */ |
111 const char *abs; /* cup, cm */ | 114 CONST char *abs; /* cup, cm */ |
112 const char *hor_abs; /* hpa, ch */ | 115 CONST char *hor_abs; /* hpa, ch */ |
113 const char *ver_abs; /* vpa, cv */ | 116 CONST char *ver_abs; /* vpa, cv */ |
114 | 117 |
115 /* scrolling */ | 118 /* scrolling */ |
116 const char *scroll_forw; /* ind, sf */ | 119 CONST char *scroll_forw; /* ind, sf */ |
117 const char *scroll_back; /* ri, sr */ | 120 CONST char *scroll_back; /* ri, sr */ |
118 const char *multi_scroll_forw; /* indn, SF */ | 121 CONST char *multi_scroll_forw; /* indn, SF */ |
119 const char *multi_scroll_back; /* rin, SR */ | 122 CONST char *multi_scroll_back; /* rin, SR */ |
120 const char *set_scroll_region; /* csr, cs */ | 123 CONST char *set_scroll_region; /* csr, cs */ |
121 } cm; | 124 } cm; |
122 | 125 |
123 /* screen editing entries - each entry is commented with the | 126 /* screen editing entries - each entry is commented with the |
124 terminfo and the termcap entry */ | 127 terminfo and the termcap entry */ |
125 struct | 128 struct |
126 { | 129 { |
127 /* adding to the screen */ | 130 /* adding to the screen */ |
128 const char *ins_line; /* il1, al */ | 131 CONST char *ins_line; /* il1, al */ |
129 const char *multi_ins_line; /* il, AL */ | 132 CONST char *multi_ins_line; /* il, AL */ |
130 const char *repeat; /* rep, rp */ | 133 CONST char *repeat; /* rep, rp */ |
131 const char *begin_ins_mode; /* smir, im */ | 134 CONST char *begin_ins_mode; /* smir, im */ |
132 const char *end_ins_mode; /* rmir, ei */ | 135 CONST char *end_ins_mode; /* rmir, ei */ |
133 const char *ins_char; /* ich1, ic */ | 136 CONST char *ins_char; /* ich1, ic */ |
134 const char *multi_ins_char; /* ich, IC */ | 137 CONST char *multi_ins_char; /* ich, IC */ |
135 const char *insert_pad; /* ip, ip */ | 138 CONST char *insert_pad; /* ip, ip */ |
136 | 139 |
137 /* deleting from the screen */ | 140 /* deleting from the screen */ |
138 const char *clr_frame; /* clear, cl */ | 141 CONST char *clr_frame; /* clear, cl */ |
139 const char *clr_from_cursor; /* ed, cd */ | 142 CONST char *clr_from_cursor; /* ed, cd */ |
140 const char *clr_to_eol; /* el, ce */ | 143 CONST char *clr_to_eol; /* el, ce */ |
141 const char *del_line; /* dl1, dl */ | 144 CONST char *del_line; /* dl1, dl */ |
142 const char *multi_del_line; /* dl, DL */ | 145 CONST char *multi_del_line; /* dl, DL */ |
143 const char *del_char; /* dch1, dc */ | 146 CONST char *del_char; /* dch1, dc */ |
144 const char *multi_del_char; /* dch, DC */ | 147 CONST char *multi_del_char; /* dch, DC */ |
145 const char *begin_del_mode; /* smdc, dm */ | 148 CONST char *begin_del_mode; /* smdc, dm */ |
146 const char *end_del_mode; /* rmdc, ed */ | 149 CONST char *end_del_mode; /* rmdc, ed */ |
147 const char *erase_at_cursor; /* ech, ec */ | 150 CONST char *erase_at_cursor; /* ech, ec */ |
148 } se; | 151 } se; |
149 | 152 |
150 /* screen display entries - each entry is commented with the | 153 /* screen display entries - each entry is commented with the |
151 terminfo and termcap entry */ | 154 terminfo and termcap entry */ |
152 struct | 155 struct |
153 { | 156 { |
154 const char *begin_standout; /* smso, so */ | 157 CONST char *begin_standout; /* smso, so */ |
155 const char *end_standout; /* rmso, se */ | 158 CONST char *end_standout; /* rmso, se */ |
156 const char *begin_underline; /* smul, us */ | 159 CONST char *begin_underline; /* smul, us */ |
157 const char *end_underline; /* rmul, ue */ | 160 CONST char *end_underline; /* rmul, ue */ |
158 const char *begin_alternate; /* smacs, as */ | 161 CONST char *begin_alternate; /* smacs, as */ |
159 const char *end_alternate; /* rmacs, ae */ | 162 CONST char *end_alternate; /* rmacs, ae */ |
160 | 163 |
161 const char *turn_on_reverse; /* rev, mr */ | 164 CONST char *turn_on_reverse; /* rev, mr */ |
162 const char *turn_on_blinking; /* blink, mb */ | 165 CONST char *turn_on_blinking; /* blink, mb */ |
163 const char *turn_on_bold; /* bold, md */ | 166 CONST char *turn_on_bold; /* bold, md */ |
164 const char *turn_on_dim; /* dim, mh */ | 167 CONST char *turn_on_dim; /* dim, mh */ |
165 const char *turn_off_attributes; /* sgr0, me */ | 168 CONST char *turn_off_attributes; /* sgr0, me */ |
166 | 169 |
167 const char *visual_bell; /* flash, vb */ | 170 CONST char *visual_bell; /* flash, vb */ |
168 const char *audio_bell; /* bel, bl */ | 171 CONST char *audio_bell; /* bel, bl */ |
169 | 172 |
170 const char *cursor_visible; /* cvvis, vs */ | 173 CONST char *cursor_visible; /* cvvis, vs */ |
171 const char *cursor_normal; /* cnorm, ve */ | 174 CONST char *cursor_normal; /* cnorm, ve */ |
172 const char *init_motion; /* smcup, ti */ | 175 CONST char *init_motion; /* smcup, ti */ |
173 const char *end_motion; /* rmcup, te */ | 176 CONST char *end_motion; /* rmcup, te */ |
174 const char *keypad_on; /* smkx, ks */ | 177 CONST char *keypad_on; /* smkx, ks */ |
175 const char *keypad_off; /* rmkx, ke */ | 178 CONST char *keypad_off; /* rmkx, ke */ |
176 | 179 |
177 const char *orig_pair; /* op, op */ | 180 CONST char *orig_pair; /* op, op */ |
178 } sd; | 181 } sd; |
179 | 182 |
180 /* costs of various operations */ | 183 /* costs of various operations */ |
181 struct | 184 struct |
182 { | 185 { |
198 /* Is this TTY our controlling terminal? */ | 201 /* Is this TTY our controlling terminal? */ |
199 unsigned int controlling_terminal :1; | 202 unsigned int controlling_terminal :1; |
200 unsigned int is_stdio :1; | 203 unsigned int is_stdio :1; |
201 }; | 204 }; |
202 | 205 |
206 #ifdef HAVE_GPM | |
207 #define CONSOLE_TTY_MOUSE_FD(c) (CONSOLE_TTY_DATA (c)->mouse_fd) | |
208 #endif | |
203 #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty) | 209 #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty) |
204 #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x) | 210 #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x) |
205 #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y) | 211 #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y) |
206 #define CONSOLE_TTY_REAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->real_cursor_x) | 212 #define CONSOLE_TTY_REAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->real_cursor_x) |
207 #define CONSOLE_TTY_REAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->real_cursor_y) | 213 #define CONSOLE_TTY_REAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->real_cursor_y) |
287 Error_behavior errb); | 293 Error_behavior errb); |
288 Lisp_Object tty_canonicalize_device_connection (Lisp_Object connection, | 294 Lisp_Object tty_canonicalize_device_connection (Lisp_Object connection, |
289 Error_behavior errb); | 295 Error_behavior errb); |
290 struct console * tty_find_console_from_fd (int fd); | 296 struct console * tty_find_console_from_fd (int fd); |
291 | 297 |
292 #endif /* INCLUDED_console_tty_h_ */ | 298 #endif /* _XEMACS_CONSOLE_TTY_H_ */ |