XEmacs 21.4.20 "Double Solitaire".
[chise/xemacs-chise.git-] / src / redisplay-tty.c
index e726bca..ff29b5f 100644 (file)
@@ -76,11 +76,11 @@ EXTERN_C void tputs (const char *, int, void (*)(int));
   } while (0)
 #define OUTPUT1_IF(c, a) OUTPUTN_IF (c, a, 1)
 
-static void tty_output_charc_dynarr (struct window *w,
-                                    struct display_line *dl,
-                                    Charc_dynarr *buf, int xpos,
-                                    face_index findex,
-                                    int cursor);
+static void tty_output_emchar_dynarr (struct window *w,
+                                     struct display_line *dl,
+                                     Emchar_dynarr *buf, int xpos,
+                                     face_index findex,
+                                     int cursor);
 static void tty_output_bufbyte_string (struct window *w,
                                       struct display_line *dl,
                                       Bufbyte *str, Bytecount len,
@@ -99,13 +99,13 @@ static void term_get_fkeys (Lisp_Object keymap, char **address);
  Non-Mule tty's don't have fonts (that we use at least), so everything
  is considered to be fixed width -- in other words, we return LEN.
  Under Mule, however, a character can still cover more than one
- column, so we use charc_string_displayed_columns().
+ column, so we use emchar_string_displayed_columns().
  ****************************************************************************/
 static int
-tty_text_width (struct frame *f, struct face_cachel *cachel,
-               const Charc *str, Charcount len)
+tty_text_width (struct frame *f, struct face_cachel *cachel, const Emchar *str,
+               Charcount len)
 {
-  return charc_string_displayed_columns (str, len);
+  return emchar_string_displayed_columns (str, len);
 }
 
 /*****************************************************************************
@@ -196,7 +196,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
                          int cursor_height)
 {
   struct frame *f = XFRAME (w->frame);
-  Charc_dynarr *buf = Dynarr_new (Charc);
+  Emchar_dynarr *buf;
 
   struct display_block *db = Dynarr_atp (dl->display_blocks, block);
   rune_dynarr *rba = db->runes;
@@ -222,7 +222,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
   if (end < 0)
     end = Dynarr_length (rba);
 
-  Dynarr_reset (buf);
+  buf = Dynarr_new (Emchar);
 
   while (elt < end && Dynarr_atp (rba, elt)->xpos < start_pixpos)
     {
@@ -236,18 +236,18 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
       rb = Dynarr_atp (rba, elt);
 
       if (rb->findex == findex && rb->type == RUNE_CHAR
-         && (!CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
+         && rb->object.chr.ch != '\n'
          && (rb->cursor_type != CURSOR_ON
              || NILP (w->text_cursor_visible_p)))
        {
-         Dynarr_add (buf, rb->object.cglyph);
+         Dynarr_add (buf, rb->object.chr.ch);
          elt++;
        }
       else
        {
          if (Dynarr_length (buf))
            {
-             tty_output_charc_dynarr (w, dl, buf, xpos, findex, 0);
+             tty_output_emchar_dynarr (w, dl, buf, xpos, findex, 0);
              xpos = rb->xpos;
            }
          Dynarr_reset (buf);
@@ -257,12 +257,13 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
              findex = rb->findex;
              xpos = rb->xpos;
 
-             if (CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
+             if (rb->object.chr.ch == '\n')
                {
                  /* Clear in case a cursor was formerly here. */
-                 Dynarr_add (buf, ASCII_TO_CHARC (' '));
-                 tty_output_charc_dynarr (w, dl, buf, rb->xpos,
-                                          DEFAULT_INDEX, 0);
+
+                 Dynarr_add (buf, ' ');
+                 tty_output_emchar_dynarr (w, dl, buf, rb->xpos,
+                                           DEFAULT_INDEX, 0);
                  Dynarr_reset (buf);
 
                  cmgoto (f, dl->ypos - 1, rb->xpos);
@@ -273,8 +274,8 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
                {
                  /* There is not a distinct eol cursor on tty's. */
 
-                 Dynarr_add (buf, rb->object.cglyph);
-                 tty_output_charc_dynarr (w, dl, buf, xpos, findex, 0);
+                 Dynarr_add (buf, rb->object.chr.ch);
+                 tty_output_emchar_dynarr (w, dl, buf, xpos, findex, 0);
                  Dynarr_reset (buf);
 
                  cmgoto (f, dl->ypos - 1, xpos);
@@ -288,17 +289,17 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
              modeline and this will suffice for that. */
          else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
            {
-             Charc ec_to_add;
+             Emchar ch_to_add;
              int size = rb->width;
 
              if (rb->type == RUNE_BLANK)
-               ec_to_add = ASCII_TO_CHARC (' ');
+               ch_to_add = ' ';
              else
-               ec_to_add = ASCII_TO_CHARC ('-');
+               ch_to_add = '-';
 
              while (size--)
-               Dynarr_add (buf, ec_to_add);
-             tty_output_charc_dynarr (w, dl, buf, rb->xpos, findex, 0);
+               Dynarr_add (buf, ch_to_add);
+             tty_output_emchar_dynarr (w, dl, buf, rb->xpos, findex, 0);
 
              if (xpos >= cursor_start
                  && cursor_start < xpos + Dynarr_length (buf))
@@ -359,7 +360,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
     }
 
   if (Dynarr_length (buf))
-    tty_output_charc_dynarr (w, dl, buf, xpos, findex, 0);
+    tty_output_emchar_dynarr (w, dl, buf, xpos, findex, 0);
   Dynarr_free (buf);
 
 }
@@ -536,31 +537,31 @@ tty_output_bufbyte_string (struct window *w, struct display_line *dl,
   tty_turn_off_face (w, findex);
 }
 
-static Bufbyte_dynarr *tty_output_charc_dynarr_dynarr;
+static Bufbyte_dynarr *tty_output_emchar_dynarr_dynarr;
 
 /*****************************************************************************
- tty_output_charc_dynarr
+ tty_output_emchar_dynarr
 
  Given a string and a starting position, output that string in the
  given face.  If cursor is true, draw a cursor around the string.
  ****************************************************************************/
 static void
-tty_output_charc_dynarr (struct window *w, struct display_line *dl,
-                        Charc_dynarr *buf, int xpos, face_index findex,
-                        int cursor)
+tty_output_emchar_dynarr (struct window *w, struct display_line *dl,
+                         Emchar_dynarr *buf, int xpos, face_index findex,
+                         int cursor)
 {
-  if (!tty_output_charc_dynarr_dynarr)
-    tty_output_charc_dynarr_dynarr = Dynarr_new (Bufbyte);
+  if (!tty_output_emchar_dynarr_dynarr)
+    tty_output_emchar_dynarr_dynarr = Dynarr_new (Bufbyte);
   else
-    Dynarr_reset (tty_output_charc_dynarr_dynarr);
+    Dynarr_reset (tty_output_emchar_dynarr_dynarr);
 
-  convert_charc_string_into_bufbyte_dynarr (Dynarr_atp (buf, 0),
+  convert_emchar_string_into_bufbyte_dynarr (Dynarr_atp (buf, 0),
                                            Dynarr_length (buf),
-                                           tty_output_charc_dynarr_dynarr);
+                                           tty_output_emchar_dynarr_dynarr);
 
   tty_output_bufbyte_string (w, dl,
-                            Dynarr_atp (tty_output_charc_dynarr_dynarr, 0),
-                            Dynarr_length (tty_output_charc_dynarr_dynarr),
+                            Dynarr_atp (tty_output_emchar_dynarr_dynarr, 0),
+                            Dynarr_length (tty_output_emchar_dynarr_dynarr),
                             xpos, findex, cursor);
 }