comparison src/redisplay-tty.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents ee648375d8d6
children 54cc21c15cbb
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
346 346
347 /* Now truncate the first rb->object.dglyph.xoffset 347 /* Now truncate the first rb->object.dglyph.xoffset
348 columns. */ 348 columns. */
349 for (i = 0; i < rb->object.dglyph.xoffset;) 349 for (i = 0; i < rb->object.dglyph.xoffset;)
350 { 350 {
351 #ifdef MULE
352 Emchar ch = charptr_emchar (temptemp);
353 i += XCHARSET_COLUMNS (CHAR_CHARSET (ch));
354 #else
351 i++; /* telescope this */ 355 i++; /* telescope this */
356 #endif
352 INC_CHARPTR (temptemp); 357 INC_CHARPTR (temptemp);
353 } 358 }
354 359
355 /* If we truncated one column too many, then 360 /* If we truncated one column too many, then
356 add a space at the beginning. */ 361 add a space at the beginning. */
422 int line; 427 int line;
423 int y1 = WINDOW_TEXT_TOP (w); 428 int y1 = WINDOW_TEXT_TOP (w);
424 int y2 = WINDOW_TEXT_BOTTOM (w); 429 int y2 = WINDOW_TEXT_BOTTOM (w);
425 unsigned char divv = '|'; 430 unsigned char divv = '|';
426 431
427 tty_turn_on_face (w, MODELINE_INDEX); 432 tty_turn_on_face (w, DEFAULT_INDEX);
428 for (line = y1; line < y2; line++) 433 for (line = y1; line < y2; line++)
429 { 434 {
430 cmgoto (f, line, WINDOW_TEXT_LEFT (w) - 1); 435 cmgoto (f, line, WINDOW_TEXT_LEFT (w) - 1);
431 send_string_to_tty_console (c, &divv, 1); 436 send_string_to_tty_console (c, &divv, 1);
432 TTY_INC_CURSOR_X (c, 1); 437 TTY_INC_CURSOR_X (c, 1);
433 } 438 }
439 tty_turn_off_face (w, DEFAULT_INDEX);
434 440
435 /* Draw the divider in the modeline. */ 441 /* Draw the divider in the modeline. */
436 cmgoto (f, y2, WINDOW_TEXT_LEFT (w) - 1); 442 cmgoto (f, y2, WINDOW_TEXT_LEFT (w) - 1);
443 tty_turn_on_face (w, MODELINE_INDEX);
437 send_string_to_tty_console (c, &divv, 1); 444 send_string_to_tty_console (c, &divv, 1);
438 TTY_INC_CURSOR_X (c, 1); 445 TTY_INC_CURSOR_X (c, 1);
439 tty_turn_off_face (w, MODELINE_INDEX); 446 tty_turn_off_face (w, MODELINE_INDEX);
440 } 447 }
441 448
913 reset_tty_modes (struct console *c) 920 reset_tty_modes (struct console *c)
914 { 921 {
915 if (!CONSOLE_TTY_P (c)) 922 if (!CONSOLE_TTY_P (c))
916 return; 923 return;
917 924
918 OUTPUT1_IF (c, TTY_SD (c).orig_pair);
919 OUTPUT1_IF (c, TTY_SD (c).keypad_off); 925 OUTPUT1_IF (c, TTY_SD (c).keypad_off);
920 OUTPUT1_IF (c, TTY_SD (c).cursor_normal); 926 OUTPUT1_IF (c, TTY_SD (c).cursor_normal);
921 OUTPUT1_IF (c, TTY_SD (c).end_motion); 927 OUTPUT1_IF (c, TTY_SD (c).end_motion);
922 tty_output_end (XDEVICE (CONSOLE_SELECTED_DEVICE (c))); 928 tty_output_end (XDEVICE (CONSOLE_SELECTED_DEVICE (c)));
923 } 929 }
1065 static void 1071 static void
1066 tty_ring_bell (struct device *d, int volume, int pitch, int duration) 1072 tty_ring_bell (struct device *d, int volume, int pitch, int duration)
1067 { 1073 {
1068 struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); 1074 struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
1069 1075
1070 if (volume) 1076 OUTPUT1 (c, TTY_SD (c).audio_bell);
1071 { 1077 Lstream_flush (XLSTREAM (CONSOLE_TTY_DATA (c)->outstream));
1072 OUTPUT1 (c, TTY_SD (c).audio_bell);
1073 Lstream_flush (XLSTREAM (CONSOLE_TTY_DATA (c)->outstream));
1074 }
1075 } 1078 }
1076 1079
1077 1080
1078 int 1081 int
1079 init_tty_for_redisplay (struct device *d, char *terminal_type) 1082 init_tty_for_redisplay (struct device *d, char *terminal_type)
1199 TTY_SD (c).turn_on_reverse = tgetstr ("mr", &bufptr); 1202 TTY_SD (c).turn_on_reverse = tgetstr ("mr", &bufptr);
1200 TTY_SD (c).turn_on_blinking = tgetstr ("mb", &bufptr); 1203 TTY_SD (c).turn_on_blinking = tgetstr ("mb", &bufptr);
1201 TTY_SD (c).turn_on_bold = tgetstr ("md", &bufptr); 1204 TTY_SD (c).turn_on_bold = tgetstr ("md", &bufptr);
1202 TTY_SD (c).turn_on_dim = tgetstr ("mh", &bufptr); 1205 TTY_SD (c).turn_on_dim = tgetstr ("mh", &bufptr);
1203 TTY_SD (c).turn_off_attributes = tgetstr ("me", &bufptr); 1206 TTY_SD (c).turn_off_attributes = tgetstr ("me", &bufptr);
1204 TTY_SD (c).orig_pair = tgetstr ("op", &bufptr);
1205 1207
1206 TTY_SD (c).visual_bell = tgetstr ("vb", &bufptr); 1208 TTY_SD (c).visual_bell = tgetstr ("vb", &bufptr);
1207 TTY_SD (c).audio_bell = tgetstr ("bl", &bufptr); 1209 TTY_SD (c).audio_bell = tgetstr ("bl", &bufptr);
1208 if (!TTY_SD (c).audio_bell) 1210 if (!TTY_SD (c).audio_bell)
1209 { 1211 {
1267 1269
1268 #### we should support the other (non-ANSI) ways of specifying 1270 #### we should support the other (non-ANSI) ways of specifying
1269 color, too. */ 1271 color, too. */
1270 char foobuf[500]; 1272 char foobuf[500];
1271 char *fooptr = foobuf; 1273 char *fooptr = foobuf;
1272 if ((tgetstr ("AB", &fooptr) && tgetstr ("AF", &fooptr)) || 1274 if (tgetstr ("AB", &fooptr) && tgetstr ("AF", &fooptr))
1273 (tgetstr ("Sf", &fooptr) && tgetstr ("Sb", &fooptr)) ||
1274 ((tgetnum ("Co") > 0) && (tgetnum ("pa") > 0)))
1275 DEVICE_CLASS (d) = Qcolor; 1275 DEVICE_CLASS (d) = Qcolor;
1276 else 1276 else
1277 DEVICE_CLASS (d) = Qmono; 1277 DEVICE_CLASS (d) = Qmono;
1278 } 1278 }
1279 1279
1327 {"kL", "deleteline"}, /* terminfo */ 1327 {"kL", "deleteline"}, /* terminfo */
1328 {"kI", "insertchar"}, /* terminfo */ 1328 {"kI", "insertchar"}, /* terminfo */
1329 {"kD", "delete"}, /* terminfo */ 1329 {"kD", "delete"}, /* terminfo */
1330 {"kB", "backtab"}, /* terminfo */ 1330 {"kB", "backtab"}, /* terminfo */
1331 /* 1331 /*
1332 * "kp-backtab", "kp-space", "kp-tab" --- no termcaps 1332 * "kp_backtab", "kp_space", "kp_tab" --- no termcaps
1333 */ 1333 */
1334 {"@8", "kp-enter"}, /* terminfo */ 1334 {"@8", "kp_enter"}, /* terminfo */
1335 /* 1335 /*
1336 * "kp-f1", "kp-f2", "kp-f3" "kp-f4", 1336 * "kp_f1", "kp_f2", "kp_f3" "kp_f4",
1337 * "kp-multiply", "kp-add", "kp-separator", 1337 * "kp_multiply", "kp_add", "kp_separator",
1338 * "kp-subtract", "kp-decimal", "kp-divide", "kp-0"; 1338 * "kp_subtract", "kp_decimal", "kp_divide", "kp_0";
1339 * --- no termcaps for any of these. 1339 * --- no termcaps for any of these.
1340 */ 1340 */
1341 {"K4", "kp-1"}, /* terminfo */ 1341 {"K4", "kp_1"}, /* terminfo */
1342 /* 1342 /*
1343 * "kp-2" --- no termcap 1343 * "kp_2" --- no termcap
1344 */ 1344 */
1345 {"K5", "kp-3"}, /* terminfo */ 1345 {"K5", "kp_3"}, /* terminfo */
1346 /* 1346 /*
1347 * "kp-4" --- no termcap 1347 * "kp_4" --- no termcap
1348 */ 1348 */
1349 {"K2", "kp-5"}, /* terminfo */ 1349 {"K2", "kp_5"}, /* terminfo */
1350 /* 1350 /*
1351 * "kp-6" --- no termcap 1351 * "kp_6" --- no termcap
1352 */ 1352 */
1353 {"K1", "kp-7"}, /* terminfo */ 1353 {"K1", "kp_7"}, /* terminfo */
1354 /* 1354 /*
1355 * "kp-8" --- no termcap 1355 * "kp_8" --- no termcap
1356 */ 1356 */
1357 {"K3", "kp-9"}, /* terminfo */ 1357 {"K3", "kp_9"}, /* terminfo */
1358 /* 1358 /*
1359 * "kp-equal" --- no termcap 1359 * "kp_equal" --- no termcap
1360 */ 1360 */
1361 {"k1", "f1"}, 1361 {"k1", "f1"},
1362 {"k2", "f2"}, 1362 {"k2", "f2"},
1363 {"k3", "f3"}, 1363 {"k3", "f3"},
1364 {"k4", "f4"}, 1364 {"k4", "f4"},