changeset 27000:d7f15cd9c4ad

All codes adjusted for the change of struct glyph.
author Kenichi Handa <handa@m17n.org>
date Mon, 27 Dec 1999 05:09:13 +0000
parents 5d0057e6170e
children b84a7b6ab411
files src/xdisp.c src/xterm.c
diffstat 2 files changed, 39 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Mon Dec 27 05:07:56 1999 +0000
+++ b/src/xdisp.c	Mon Dec 27 05:09:13 1999 +0000
@@ -10592,11 +10592,11 @@
 		       'C',
 		       glyph->charpos,
 		       glyph->pixel_width,
-		       glyph->u.ch.code,
-		       (glyph->u.ch.code < 0x80 && glyph->u.ch.code >= ' '
-			? glyph->u.ch.code
+		       glyph->u.ch,
+		       (glyph->u.ch < 0x80 && glyph->u.ch >= ' '
+			? glyph->u.ch
 			: '.'),
-		       glyph->u.ch.face_id,
+		       glyph->face_id,
 		       glyph->left_box_line_p,
 		       glyph->right_box_line_p);
 	    }
@@ -10610,7 +10610,7 @@
 		       glyph->pixel_width,
 		       0,
 		       '.',
-		       glyph->u.stretch.face_id,
+		       glyph->u.face_id,
 		       glyph->left_box_line_p,
 		       glyph->right_box_line_p);
 	    }
@@ -10622,9 +10622,9 @@
 		       'I',
 		       glyph->charpos,
 		       glyph->pixel_width,
-		       glyph->u.img.id,
+		       glyph->u.img_id,
 		       '.',
-		       glyph->u.img.face_id,
+		       glyph->u.face_id,
 		       glyph->left_box_line_p,
 		       glyph->right_box_line_p);
 	    }
@@ -10889,6 +10889,8 @@
     for (i = 0; i < row->used[area]; ++i)
       row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff)
 		   + row->glyphs[area][i].u.val
+		   + row->glyphs[area][i].face_id
+		   + row->glyphs[area][i].padding_p
 		   + (row->glyphs[area][i].type << 2));
 
   it->max_ascent = it->max_descent = 0;
@@ -11010,7 +11012,7 @@
       if (it->glyph_row->used[TEXT_AREA] == 0)
 	{
 	  it->glyph_row->glyphs[TEXT_AREA][0] = space_glyph;
-	  it->glyph_row->glyphs[TEXT_AREA][0].u.ch.face_id = it->face_id;
+	  it->glyph_row->glyphs[TEXT_AREA][0].face_id = it->face_id;
 	  it->glyph_row->used[TEXT_AREA] = 1;
 	}
     }
@@ -11087,7 +11089,7 @@
       /* Skip over the space glyph inserted to display the
 	 cursor at the end of a line.  */
       if (glyph->type == CHAR_GLYPH
-	  && glyph->u.ch.code == ' '
+	  && glyph->u.ch == ' '
 	  && glyph->object == 0)
 	--glyph;
 
@@ -11098,7 +11100,7 @@
 	  && BUFFERP (glyph->object)
 	  && (glyph->type == STRETCH_GLYPH
 	      || (glyph->type == CHAR_GLYPH
-		  && glyph->u.ch.code == ' '))
+		  && glyph->u.ch == ' '))
 	  && trailing_whitespace_p (glyph->charpos))
 	{
 	  int face_id = lookup_named_face (f, Qtrailing_whitespace,
@@ -11108,14 +11110,8 @@
 		 && BUFFERP (glyph->object)
 		 && (glyph->type == STRETCH_GLYPH
 		     || (glyph->type == CHAR_GLYPH
-			 && glyph->u.ch.code == ' ')))
-	    {
-	      if (glyph->type == STRETCH_GLYPH)
-		glyph->u.stretch.face_id = face_id;
-	      else
-		glyph->u.ch.face_id = face_id;
-	      --glyph;
-	    }
+			 && glyph->u.ch == ' ')))
+	    (glyph--)->face_id = face_id;
 	}
     }
 }
--- a/src/xterm.c	Mon Dec 27 05:07:56 1999 +0000
+++ b/src/xterm.c	Mon Dec 27 05:09:13 1999 +0000
@@ -1347,7 +1347,7 @@
 
 
 /* Get face and two-byte form of character glyph GLYPH on frame F.
-   The encoding of GLYPH->u.ch.code is returned in *CHAR2B.  Value is
+   The encoding of GLYPH->u.ch is returned in *CHAR2B.  Value is
    a pointer to a realized face that is ready for display.  */
 
 static INLINE struct face *
@@ -1359,21 +1359,21 @@
   struct face *face;
 
   xassert (glyph->type == CHAR_GLYPH);
-  face = FACE_FROM_ID (f, glyph->u.ch.face_id);
+  face = FACE_FROM_ID (f, glyph->face_id);
 
   if (!glyph->multibyte_p)
     {
       /* Unibyte case.  We don't have to encode, but we have to make
 	 sure to use a face suitable for unibyte.  */
       char2b->byte1 = 0;
-      char2b->byte2 = glyph->u.ch.code;
-    }
-  else if (glyph->u.ch.code < 128
-	   && glyph->u.ch.face_id < BASIC_FACE_ID_SENTINEL)
+      char2b->byte2 = glyph->u.ch;
+    }
+  else if (glyph->u.ch < 128
+	   && glyph->face_id < BASIC_FACE_ID_SENTINEL)
     {
       /* Case of ASCII in a face known to fit ASCII.  */
       char2b->byte1 = 0;
-      char2b->byte2 = glyph->u.ch.code;
+      char2b->byte2 = glyph->u.ch;
     }
   else
     {
@@ -1381,7 +1381,7 @@
       
       /* Split characters into bytes.  If c2 is -1 afterwards, C is
 	 really a one-byte character so that byte1 is zero.  */
-      SPLIT_CHAR (glyph->u.ch.code, charset, c1, c2);
+      SPLIT_CHAR (glyph->u.ch, charset, c1, c2);
       if (c2 > 0)
 	char2b->byte1 = c1, char2b->byte2 = c2;
       else
@@ -1394,7 +1394,7 @@
 	    = FONT_INFO_FROM_ID (f, face->font_info_id);
 	  if (font_info)
 	    {
-	      x_encode_char (glyph->u.ch.code, char2b, font_info);
+	      x_encode_char (glyph->u.ch, char2b, font_info);
 	      if (charset == charset_latin_iso8859_1)
 		char2b->byte2 |= 0x80;
 	    }
@@ -1431,8 +1431,8 @@
       
       glyph->type = CHAR_GLYPH;
       glyph->pixel_width = it->pixel_width;
-      glyph->u.ch.code = it->char_to_display;
-      glyph->u.ch.face_id = it->face_id;
+      glyph->u.ch = it->char_to_display;
+      glyph->face_id = it->face_id;
       glyph->charpos = CHARPOS (it->position);
       glyph->object = it->object;
       glyph->left_box_line_p = it->start_of_box_run_p;
@@ -1467,8 +1467,8 @@
       
       glyph->type = COMPOSITE_GLYPH;
       glyph->pixel_width = it->pixel_width;
-      glyph->u.cmp.id = it->cmp_id;
-      glyph->u.cmp.face_id = it->face_id;
+      glyph->u.cmp_id = it->cmp_id;
+      glyph->face_id = it->face_id;
       glyph->charpos = CHARPOS (it->position);
       glyph->object = it->object;
       glyph->left_box_line_p = it->start_of_box_run_p;
@@ -1552,8 +1552,8 @@
       if (glyph < it->glyph_row->glyphs[area + 1])
 	{
 	  glyph->type = IMAGE_GLYPH;
-	  glyph->u.img.id = img->id;
-	  glyph->u.img.face_id = it->face_id;
+	  glyph->u.img_id = img->id;
+	  glyph->face_id = it->face_id;
 	  glyph->pixel_width = it->pixel_width;
 	  glyph->charpos = CHARPOS (it->position);
 	  glyph->object = it->object;
@@ -1590,7 +1590,7 @@
       glyph->type = STRETCH_GLYPH;
       glyph->u.stretch.ascent = height * ascent;
       glyph->u.stretch.height = height;
-      glyph->u.stretch.face_id = it->face_id;
+      glyph->face_id = it->face_id;
       glyph->pixel_width = width;
       glyph->charpos = CHARPOS (it->position);
       glyph->object = object;
@@ -4138,7 +4138,7 @@
 	 && glyph->type == CHAR_GLYPH
 	 && glyph->voffset == voffset
 	 /* Same face id implies same charset, nowadays.  */
-	 && glyph->u.ch.face_id == face_id)
+	 && glyph->face_id == face_id)
     {
       s->face = x_get_glyph_face_and_encoding (s->f, glyph,
 					       s->char2b + s->nchars);
@@ -4179,9 +4179,9 @@
      struct glyph_string *s;
 {
   xassert (s->first_glyph->type == IMAGE_GLYPH);
-  s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img.id);
+  s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id);
   xassert (s->img);
-  s->face = FACE_FROM_ID (s->f, s->first_glyph->u.img.face_id);
+  s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
   s->font = s->face->font;
   s->width = s->first_glyph->pixel_width;
   
@@ -4197,7 +4197,7 @@
      struct glyph_string *s;
 {
   xassert (s->first_glyph->type == STRETCH_GLYPH);
-  s->face = FACE_FROM_ID (s->f, s->first_glyph->u.stretch.face_id);
+  s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
   s->font = s->face->font;
   s->width = s->first_glyph->pixel_width;
   
@@ -4335,9 +4335,9 @@
 	 int c, charset, face_id;					   \
 	 XChar2b *char2b;						   \
 									   \
-	 c = (ROW)->glyphs[AREA][START].u.ch.code;			   \
+	 c = (ROW)->glyphs[AREA][START].u.ch;				   \
 	 charset = CHAR_CHARSET (c);					   \
-	 face_id = (ROW)->glyphs[AREA][START].u.ch.face_id;		   \
+	 face_id = (ROW)->glyphs[AREA][START].face_id;			   \
 									   \
 	 s = (struct glyph_string *) alloca (sizeof *s);		   \
 	 char2b = (XChar2b *) alloca ((END - START) * sizeof *char2b);	   \
@@ -4362,8 +4362,8 @@
 
 #define BUILD_COMPOSITE_GLYPH_STRING(W, ROW, AREA, START, END, HEAD, TAIL, HL, X, LAST_X, OVERLAPS_P)	  \
   do {									  \
-    int cmp_id = (ROW)->glyphs[AREA][START].u.cmp.id;			  \
-    int face_id = (ROW)->glyphs[AREA][START].u.cmp.face_id;		  \
+    int cmp_id = (ROW)->glyphs[AREA][START].u.cmp_id;			  \
+    int face_id = (ROW)->glyphs[AREA][START].face_id;			  \
     struct composition *cmp = composition_table[cmp_id];		  \
     int glyph_len = cmp->glyph_len;					  \
     XChar2b *char2b;							  \
@@ -4376,7 +4376,7 @@
     /* At first, fill in `char2b' and `faces'.  */			  \
     for (n = 0; n < glyph_len; n++)					  \
       {									  \
-	int c = FAST_GLYPH_CHAR (COMPOSITION_GLYPH (cmp, n));		  \
+	int c = COMPOSITION_GLYPH (cmp, n);				  \
 	faces[n] = x_get_char_face_and_encoding (XFRAME (w->frame), c,	  \
 						 face_id, char2b + n, 1); \
       }									  \