XEmacs 21.4.22.
[chise/xemacs-chise.git.1] / src / redisplay-x.c
index b6a89ba..daf3c27 100644 (file)
@@ -123,7 +123,7 @@ struct textual_run
 static int
 separate_textual_runs (unsigned char *text_storage,
                       struct textual_run *run_storage,
-                      const Charc *str, Charcount len)
+                      const Emchar *str, Charcount len)
 {
   Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a
                                          possible valid charset when
@@ -137,25 +137,16 @@ separate_textual_runs (unsigned char *text_storage,
 
   for (i = 0; i < len; i++)
     {
-      Charc cc = str[i];
-      Lisp_Object charset = CHARC_CHARSET (cc);
-      int code_point = CHARC_CODE_POINT (cc);
+      Emchar ch = str[i];
+      Lisp_Object charset;
       int byte1, byte2;
       int dimension;
       int graphic;
 
+      BREAKUP_CHAR (ch, charset, byte1, byte2);
       dimension = XCHARSET_DIMENSION (charset);
       graphic   = XCHARSET_GRAPHIC   (charset);
-      if (dimension == 1)
-       {
-         byte1 = code_point;
-         byte2 = 0;
-       }
-      else
-       {
-         byte1 = code_point >> 8;
-         byte2 = code_point & 0xFF;
-       }
+
       if (!EQ (charset, prev_charset))
        {
          run_storage[runs_so_far].ptr       = text_storage;
@@ -250,7 +241,7 @@ x_text_width_single_run (struct face_cachel *cachel, struct textual_run *run)
    */
 
 static int
-x_text_width (struct frame *f, struct face_cachel *cachel, const Charc *str,
+x_text_width (struct frame *f, struct face_cachel *cachel, const Emchar *str,
              Charcount len)
 {
   int width_so_far = 0;
@@ -327,7 +318,7 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
                        int cursor_width, int cursor_height)
 {
   struct frame *f = XFRAME (w->frame);
-  Charc_dynarr *buf = Dynarr_new (Charc);
+  Emchar_dynarr *buf;
   Lisp_Object window;
 
   struct display_block *db = Dynarr_atp (dl->display_blocks, block);
@@ -350,22 +341,21 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
   findex = rb->findex;
   xpos = rb->xpos;
   if (rb->type == RUNE_CHAR)
-    charset = CHARC_CHARSET (rb->object.cglyph);
+    charset = CHAR_CHARSET (rb->object.chr.ch);
 
   if (end < 0)
     end = Dynarr_length (rba);
-  Dynarr_reset (buf);
+  buf = Dynarr_new (Emchar);
 
   while (elt < end)
     {
       rb = Dynarr_atp (rba, elt);
 
       if (rb->findex == findex && rb->type == RUNE_CHAR
-         && (!CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
-         && rb->cursor_type != CURSOR_ON
-         && EQ (charset, CHARC_CHARSET (rb->object.cglyph)))
+         && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
+         && EQ (charset, CHAR_CHARSET (rb->object.chr.ch)))
        {
-         Dynarr_add (buf, rb->object.cglyph);
+         Dynarr_add (buf, rb->object.chr.ch);
          width += rb->width;
          elt++;
        }
@@ -386,17 +376,17 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
            {
              findex = rb->findex;
              xpos = rb->xpos;
-             charset = CHARC_CHARSET (rb->object.cglyph);
+             charset = CHAR_CHARSET (rb->object.chr.ch);
 
              if (rb->cursor_type == CURSOR_ON)
                {
-                 if (CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
+                 if (rb->object.chr.ch == '\n')
                    {
                      x_output_eol_cursor (w, dl, xpos, findex);
                    }
                  else
                    {
-                     Dynarr_add (buf, rb->object.cglyph);
+                     Dynarr_add (buf, rb->object.chr.ch);
                      x_output_string (w, dl, buf, xpos, 0, start_pixpos,
                                       rb->width, findex, 1,
                                       cursor_start, cursor_width,
@@ -407,7 +397,7 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
                  xpos += rb->width;
                  elt++;
                }
-             else if (CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
+             else if (rb->object.chr.ch == '\n')
                {
                  /* Clear in case a cursor was formerly here. */
                  redisplay_clear_region (window, findex, xpos,
@@ -775,7 +765,7 @@ x_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
  ****************************************************************************/
 void
 x_output_string (struct window *w, struct display_line *dl,
-                Charc_dynarr *buf, int xpos, int xoffset, int clip_start,
+                Emchar_dynarr *buf, int xpos, int xoffset, int clip_start,
                 int width, face_index findex, int cursor,
                 int cursor_start, int cursor_width, int cursor_height)
 {