comparison src/redisplay-tty.c @ 3571:f6cd5fe9bf4c

[xemacs-hg @ 2006-08-24 21:21:34 by aidan] Vary support for multiple-width characters on a per-console basis.
author aidan
date Thu, 24 Aug 2006 21:21:36 +0000
parents 2b84dd8eb906
children ea701c23ed84
comparison
equal deleted inserted replaced
3570:1ebada1a4643 3571:f6cd5fe9bf4c
98 static void term_get_fkeys (Lisp_Object keymap, char **address); 98 static void term_get_fkeys (Lisp_Object keymap, char **address);
99 99
100 /***************************************************************************** 100 /*****************************************************************************
101 tty_text_width 101 tty_text_width
102 102
103 Non-Mule tty's don't have fonts (that we use at least), so everything 103 Non-Mule TTYs don't have fonts (that we use at least), so everything
104 is considered to be fixed width -- in other words, we return LEN. 104 is considered to be fixed width -- in other words, we return LEN.
105 Under Mule, however, a character can still cover more than one 105 Under Mule, however, a character can still cover more than one
106 column, so we use ichar_string_displayed_columns(). 106 column, so we use ichar_string_displayed_columns().
107 ****************************************************************************/ 107 ****************************************************************************/
108 static int 108 static int
109 tty_text_width (struct frame *UNUSED (f), struct face_cachel *UNUSED (cachel), 109 tty_text_width (struct frame *f, struct face_cachel *UNUSED (cachel),
110 const Ichar *str, Charcount len) 110 const Ichar *str, Charcount len)
111 { 111 {
112 return ichar_string_displayed_columns (str, len); 112 struct console *c = XCONSOLE(FRAME_CONSOLE (f));
113
114 if (CONSOLE_TTY_MULTIPLE_WIDTH (c))
115 {
116 return ichar_string_displayed_columns (str, len);
117 }
118
119 return len;
113 } 120 }
114 121
115 /***************************************************************************** 122 /*****************************************************************************
116 tty_divider_height 123 tty_divider_height
117 124
531 Ibyte *str, Bytecount len, int xpos, 538 Ibyte *str, Bytecount len, int xpos,
532 face_index findex, int UNUSED (cursor)) 539 face_index findex, int UNUSED (cursor))
533 { 540 {
534 struct frame *f = XFRAME (w->frame); 541 struct frame *f = XFRAME (w->frame);
535 struct console *c = XCONSOLE (FRAME_CONSOLE (f)); 542 struct console *c = XCONSOLE (FRAME_CONSOLE (f));
543 int incing = CONSOLE_TTY_MULTIPLE_WIDTH (c) ?
544 ibyte_string_displayed_columns (str, len) :
545 bytecount_to_charcount(str, len);
536 546
537 /* First position the cursor. */ 547 /* First position the cursor. */
538 cmgoto (f, dl->ypos - 1, xpos); 548 cmgoto (f, dl->ypos - 1, xpos);
539 549
540 /* Enable any face properties. */ 550 /* Enable any face properties. */
541 tty_turn_on_face (w, findex); 551 tty_turn_on_face (w, findex);
542 552
543 send_string_to_tty_console (c, str, len); 553 send_string_to_tty_console (c, str, len);
544 TTY_INC_CURSOR_X (c, ibyte_string_displayed_columns (str, len)); 554 TTY_INC_CURSOR_X (c, incing);
545 555
546 /* Turn the face properties back off. */ 556 /* Turn the face properties back off. */
547 tty_turn_off_face (w, findex); 557 tty_turn_off_face (w, findex);
548 } 558 }
549 559