comparison src/console-tty.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents bbff43aa5eb7
children a86b2b5e0111
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
30 #include "console-tty.h" 30 #include "console-tty.h"
31 #include "console-stream.h" 31 #include "console-stream.h"
32 #include "faces.h" 32 #include "faces.h"
33 #include "frame.h" 33 #include "frame.h"
34 #include "lstream.h" 34 #include "lstream.h"
35 #include "glyphs.h"
35 #include "sysdep.h" 36 #include "sysdep.h"
36 #include "sysfile.h" 37 #include "sysfile.h"
37 #ifdef FILE_CODING 38 #ifdef FILE_CODING
38 #include "file-coding.h" 39 #include "file-coding.h"
39 #endif 40 #endif
40 #ifdef HAVE_GPM
41 #include "gpmevent.h"
42 #endif
43 41
44 DEFINE_CONSOLE_TYPE (tty); 42 DEFINE_CONSOLE_TYPE (tty);
43 DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing);
44 DECLARE_IMAGE_INSTANTIATOR_FORMAT (string);
45 DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string);
46 DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit);
45 47
46 Lisp_Object Qterminal_type; 48 Lisp_Object Qterminal_type;
47 Lisp_Object Qcontrolling_process; 49 Lisp_Object Qcontrolling_process;
48 50
49 51
123 Fget_coding_system (Vterminal_coding_system)); 125 Fget_coding_system (Vterminal_coding_system));
124 #endif /* MULE */ 126 #endif /* MULE */
125 tty_con->terminal_type = terminal_type; 127 tty_con->terminal_type = terminal_type;
126 tty_con->controlling_process = controlling_process; 128 tty_con->controlling_process = controlling_process;
127 129
128 #ifdef HAVE_GPM
129 connect_to_gpm (con);
130 #endif
131
132 if (NILP (CONSOLE_NAME (con))) 130 if (NILP (CONSOLE_NAME (con)))
133 CONSOLE_NAME (con) = Ffile_name_nondirectory (tty); 131 CONSOLE_NAME (con) = Ffile_name_nondirectory (tty);
134 { 132 {
135 int tty_pg; 133 int tty_pg;
136 int controlling_tty_pg; 134 int controlling_tty_pg;
159 157
160 UNGCPRO; 158 UNGCPRO;
161 } 159 }
162 160
163 static void 161 static void
164 tty_mark_console (struct console *con, void (*markobj) (Lisp_Object)) 162 tty_mark_console (struct console *con)
165 { 163 {
166 struct tty_console *tty_con = CONSOLE_TTY_DATA (con); 164 struct tty_console *tty_con = CONSOLE_TTY_DATA (con);
167 markobj (tty_con->terminal_type); 165 mark_object (tty_con->terminal_type);
168 markobj (tty_con->instream); 166 mark_object (tty_con->instream);
169 markobj (tty_con->outstream); 167 mark_object (tty_con->outstream);
170 } 168 }
171 169
172 static int 170 static int
173 tty_initially_selected_for_input (struct console *con) 171 tty_initially_selected_for_input (struct console *con)
174 { 172 {
278 (console, codesys)) 276 (console, codesys))
279 { 277 {
280 set_encoding_stream_coding_system 278 set_encoding_stream_coding_system
281 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream), 279 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream),
282 Fget_coding_system (NILP (codesys) ? Vterminal_coding_system : codesys)); 280 Fget_coding_system (NILP (codesys) ? Vterminal_coding_system : codesys));
281 /* Redraw tty */
282 face_property_was_changed (Vdefault_face, Qfont, Qtty);
283 return Qnil; 283 return Qnil;
284 } 284 }
285 285
286 /* ### Move this function to lisp */ 286 /* #### Move this function to lisp */
287 DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system, 287 DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system,
288 0, 2, 0, /* 288 0, 2, 0, /*
289 Set the input and output coding systems of tty console CONSOLE to CODESYS. 289 Set the input and output coding systems of tty console CONSOLE to CODESYS.
290 CONSOLE defaults to the selected console. 290 CONSOLE defaults to the selected console.
291 If CODESYS is nil, the values of `keyboard-coding-system' and 291 If CODESYS is nil, the values of `keyboard-coding-system' and
365 CONSOLE_HAS_METHOD (tty, semi_canonicalize_console_connection); 365 CONSOLE_HAS_METHOD (tty, semi_canonicalize_console_connection);
366 CONSOLE_HAS_METHOD (tty, semi_canonicalize_device_connection); 366 CONSOLE_HAS_METHOD (tty, semi_canonicalize_device_connection);
367 } 367 }
368 368
369 void 369 void
370 reinit_console_type_create_tty (void)
371 {
372 REINITIALIZE_CONSOLE_TYPE (tty);
373 }
374
375 void
376 image_instantiator_format_create_glyphs_tty (void)
377 {
378 IIFORMAT_VALID_CONSOLE (tty, nothing);
379 IIFORMAT_VALID_CONSOLE (tty, string);
380 IIFORMAT_VALID_CONSOLE (tty, formatted_string);
381 IIFORMAT_VALID_CONSOLE (tty, inherit);
382 }
383
384 void
370 vars_of_console_tty (void) 385 vars_of_console_tty (void)
371 { 386 {
372 Fprovide (Qtty); 387 Fprovide (Qtty);
373 } 388 }