comparison src/console-tty-impl.h @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents f6cd5fe9bf4c
children d1247f3cc363
comparison
equal deleted inserted replaced
5117:3742ea8250b5 5118:e0db3c197671
37 37
38 DECLARE_CONSOLE_TYPE (tty); 38 DECLARE_CONSOLE_TYPE (tty);
39 39
40 struct tty_console 40 struct tty_console
41 { 41 {
42 #ifdef NEW_GC
43 struct lrecord_header header;
44 #endif /* NEW_GC */
42 int infd, outfd; 45 int infd, outfd;
43 Lisp_Object instream, outstream; 46 Lisp_Object instream, outstream;
44 Lisp_Object terminal_type; 47 Lisp_Object terminal_type;
45 Lisp_Object controlling_process; 48 Lisp_Object controlling_process;
46 char *term_entry_buffer; 49 char *term_entry_buffer;
195 struct emacs_tty old_tty; 198 struct emacs_tty old_tty;
196 199
197 /* Is this TTY our controlling terminal? */ 200 /* Is this TTY our controlling terminal? */
198 unsigned int controlling_terminal :1; 201 unsigned int controlling_terminal :1;
199 unsigned int is_stdio :1; 202 unsigned int is_stdio :1;
203 /* Do East Asian chars take up two columns? */
204 unsigned int multiple_width :1;
200 }; 205 };
206
207 #ifdef NEW_GC
208 typedef struct tty_console Lisp_Tty_Console;
209
210 DECLARE_LISP_OBJECT (tty_console, Lisp_Tty_Console);
211
212 #define XTTY_CONSOLE(x) \
213 XRECORD (x, tty_console, Lisp_Tty_Console)
214 #define wrap_tty_console(p) wrap_record (p, tty_console)
215 #define TTY_CONSOLE_P(x) RECORDP (x, tty_console)
216 #endif /* NEW_GC */
201 217
202 #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty) 218 #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty)
203 #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x) 219 #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x)
204 #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y) 220 #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y)
205 #define CONSOLE_TTY_REAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->real_cursor_x) 221 #define CONSOLE_TTY_REAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->real_cursor_x)
206 #define CONSOLE_TTY_REAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->real_cursor_y) 222 #define CONSOLE_TTY_REAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->real_cursor_y)
207 #define CONSOLE_TTY_FINAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->final_cursor_x) 223 #define CONSOLE_TTY_FINAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->final_cursor_x)
208 #define CONSOLE_TTY_FINAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->final_cursor_y) 224 #define CONSOLE_TTY_FINAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->final_cursor_y)
209 225
226 /* In a more ideal world where available terminfo files actually included
227 information on whether a given TTY supports double-width characters or
228 not, oh, and where Mule was not conditional, SUPPORTS_MULTIPLE_WIDTH
229 would be as console-specific as its syntax implies.
230
231 In this world, this is overengineering more than it is anything. */
232 #define CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH(c) (1 != MAX_ICHAR_LEN)
233 #define CONSOLE_TTY_MULTIPLE_WIDTH(c) \
234 (CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH(c) ? \
235 CONSOLE_TTY_DATA (c)->multiple_width : (0))
236
210 #define TTY_CM(c) (CONSOLE_TTY_DATA (c)->cm) 237 #define TTY_CM(c) (CONSOLE_TTY_DATA (c)->cm)
211 #define TTY_SE(c) (CONSOLE_TTY_DATA (c)->se) 238 #define TTY_SE(c) (CONSOLE_TTY_DATA (c)->se)
212 #define TTY_SD(c) (CONSOLE_TTY_DATA (c)->sd) 239 #define TTY_SD(c) (CONSOLE_TTY_DATA (c)->sd)
213 #define TTY_FLAGS(c) (CONSOLE_TTY_DATA (c)->flags) 240 #define TTY_FLAGS(c) (CONSOLE_TTY_DATA (c)->flags)
214 #define TTY_COST(c) (CONSOLE_TTY_DATA (c)->cost) 241 #define TTY_COST(c) (CONSOLE_TTY_DATA (c)->cost)
226 CONSOLE_TTY_REAL_CURSOR_Y (c) += TICY_n; \ 253 CONSOLE_TTY_REAL_CURSOR_Y (c) += TICY_n; \
227 } while (0) 254 } while (0)
228 255
229 struct tty_device 256 struct tty_device
230 { 257 {
258 #ifdef NEW_GC
259 struct lrecord_header header;
260 #endif /* NEW_GC */
231 #ifdef HAVE_TERMIOS 261 #ifdef HAVE_TERMIOS
232 speed_t ospeed; /* Output speed (from sg_ospeed) */ 262 speed_t ospeed; /* Output speed (from sg_ospeed) */
233 #else 263 #else
234 short ospeed; /* Output speed (from sg_ospeed) */ 264 short ospeed; /* Output speed (from sg_ospeed) */
235 #endif 265 #endif
236 }; 266 };
237 267
268 #ifdef NEW_GC
269 typedef struct tty_device Lisp_Tty_Device;
270
271 DECLARE_LISP_OBJECT (tty_device, Lisp_Tty_Device);
272
273 #define XTTY_DEVICE(x) \
274 XRECORD (x, tty_device, Lisp_Tty_Device)
275 #define wrap_tty_device(p) wrap_record (p, tty_device)
276 #define TTY_DEVICE_P(x) RECORDP (x, tty_device)
277 #endif /* NEW_GC */
278
238 #define DEVICE_TTY_DATA(d) DEVICE_TYPE_DATA (d, tty) 279 #define DEVICE_TTY_DATA(d) DEVICE_TYPE_DATA (d, tty)
239 280
240 /* termcap requires this to be global */ 281 /* termcap requires this to be global */
241 #ifndef HAVE_TERMIOS 282 #ifndef HAVE_TERMIOS
242 extern short ospeed; /* Output speed (from sg_ospeed) */ 283 extern short ospeed; /* Output speed (from sg_ospeed) */