aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1999-12-27 05:09:13 +0000
committerKenichi Handa1999-12-27 05:09:13 +0000
commit43d120d80e1c46cd991ffbc1ea990906baad6467 (patch)
tree37b3c2daa1c22b6a3e705e906e162d483e08dc86
parent32de38e46d61c5b88ea5428041c74be4415967a3 (diff)
downloademacs-43d120d80e1c46cd991ffbc1ea990906baad6467.tar.gz
emacs-43d120d80e1c46cd991ffbc1ea990906baad6467.zip
All codes adjusted for the change of struct glyph.
-rw-r--r--src/xdisp.c32
-rw-r--r--src/xterm.c48
2 files changed, 38 insertions, 42 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index df01be46a0a..662a37fd592 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10592,11 +10592,11 @@ dump_glyph_row (matrix, vpos, with_glyphs_p)
10592 'C', 10592 'C',
10593 glyph->charpos, 10593 glyph->charpos,
10594 glyph->pixel_width, 10594 glyph->pixel_width,
10595 glyph->u.ch.code, 10595 glyph->u.ch,
10596 (glyph->u.ch.code < 0x80 && glyph->u.ch.code >= ' ' 10596 (glyph->u.ch < 0x80 && glyph->u.ch >= ' '
10597 ? glyph->u.ch.code 10597 ? glyph->u.ch
10598 : '.'), 10598 : '.'),
10599 glyph->u.ch.face_id, 10599 glyph->face_id,
10600 glyph->left_box_line_p, 10600 glyph->left_box_line_p,
10601 glyph->right_box_line_p); 10601 glyph->right_box_line_p);
10602 } 10602 }
@@ -10610,7 +10610,7 @@ dump_glyph_row (matrix, vpos, with_glyphs_p)
10610 glyph->pixel_width, 10610 glyph->pixel_width,
10611 0, 10611 0,
10612 '.', 10612 '.',
10613 glyph->u.stretch.face_id, 10613 glyph->u.face_id,
10614 glyph->left_box_line_p, 10614 glyph->left_box_line_p,
10615 glyph->right_box_line_p); 10615 glyph->right_box_line_p);
10616 } 10616 }
@@ -10622,9 +10622,9 @@ dump_glyph_row (matrix, vpos, with_glyphs_p)
10622 'I', 10622 'I',
10623 glyph->charpos, 10623 glyph->charpos,
10624 glyph->pixel_width, 10624 glyph->pixel_width,
10625 glyph->u.img.id, 10625 glyph->u.img_id,
10626 '.', 10626 '.',
10627 glyph->u.img.face_id, 10627 glyph->u.face_id,
10628 glyph->left_box_line_p, 10628 glyph->left_box_line_p,
10629 glyph->right_box_line_p); 10629 glyph->right_box_line_p);
10630 } 10630 }
@@ -10889,6 +10889,8 @@ compute_line_metrics (it)
10889 for (i = 0; i < row->used[area]; ++i) 10889 for (i = 0; i < row->used[area]; ++i)
10890 row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff) 10890 row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff)
10891 + row->glyphs[area][i].u.val 10891 + row->glyphs[area][i].u.val
10892 + row->glyphs[area][i].face_id
10893 + row->glyphs[area][i].padding_p
10892 + (row->glyphs[area][i].type << 2)); 10894 + (row->glyphs[area][i].type << 2));
10893 10895
10894 it->max_ascent = it->max_descent = 0; 10896 it->max_ascent = it->max_descent = 0;
@@ -11010,7 +11012,7 @@ extend_face_to_end_of_line (it)
11010 if (it->glyph_row->used[TEXT_AREA] == 0) 11012 if (it->glyph_row->used[TEXT_AREA] == 0)
11011 { 11013 {
11012 it->glyph_row->glyphs[TEXT_AREA][0] = space_glyph; 11014 it->glyph_row->glyphs[TEXT_AREA][0] = space_glyph;
11013 it->glyph_row->glyphs[TEXT_AREA][0].u.ch.face_id = it->face_id; 11015 it->glyph_row->glyphs[TEXT_AREA][0].face_id = it->face_id;
11014 it->glyph_row->used[TEXT_AREA] = 1; 11016 it->glyph_row->used[TEXT_AREA] = 1;
11015 } 11017 }
11016 } 11018 }
@@ -11087,7 +11089,7 @@ highlight_trailing_whitespace (f, row)
11087 /* Skip over the space glyph inserted to display the 11089 /* Skip over the space glyph inserted to display the
11088 cursor at the end of a line. */ 11090 cursor at the end of a line. */
11089 if (glyph->type == CHAR_GLYPH 11091 if (glyph->type == CHAR_GLYPH
11090 && glyph->u.ch.code == ' ' 11092 && glyph->u.ch == ' '
11091 && glyph->object == 0) 11093 && glyph->object == 0)
11092 --glyph; 11094 --glyph;
11093 11095
@@ -11098,7 +11100,7 @@ highlight_trailing_whitespace (f, row)
11098 && BUFFERP (glyph->object) 11100 && BUFFERP (glyph->object)
11099 && (glyph->type == STRETCH_GLYPH 11101 && (glyph->type == STRETCH_GLYPH
11100 || (glyph->type == CHAR_GLYPH 11102 || (glyph->type == CHAR_GLYPH
11101 && glyph->u.ch.code == ' ')) 11103 && glyph->u.ch == ' '))
11102 && trailing_whitespace_p (glyph->charpos)) 11104 && trailing_whitespace_p (glyph->charpos))
11103 { 11105 {
11104 int face_id = lookup_named_face (f, Qtrailing_whitespace, 11106 int face_id = lookup_named_face (f, Qtrailing_whitespace,
@@ -11108,14 +11110,8 @@ highlight_trailing_whitespace (f, row)
11108 && BUFFERP (glyph->object) 11110 && BUFFERP (glyph->object)
11109 && (glyph->type == STRETCH_GLYPH 11111 && (glyph->type == STRETCH_GLYPH
11110 || (glyph->type == CHAR_GLYPH 11112 || (glyph->type == CHAR_GLYPH
11111 && glyph->u.ch.code == ' '))) 11113 && glyph->u.ch == ' ')))
11112 { 11114 (glyph--)->face_id = face_id;
11113 if (glyph->type == STRETCH_GLYPH)
11114 glyph->u.stretch.face_id = face_id;
11115 else
11116 glyph->u.ch.face_id = face_id;
11117 --glyph;
11118 }
11119 } 11115 }
11120 } 11116 }
11121} 11117}
diff --git a/src/xterm.c b/src/xterm.c
index a2acc107095..811bfcf45f8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1347,7 +1347,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p)
1347 1347
1348 1348
1349/* Get face and two-byte form of character glyph GLYPH on frame F. 1349/* Get face and two-byte form of character glyph GLYPH on frame F.
1350 The encoding of GLYPH->u.ch.code is returned in *CHAR2B. Value is 1350 The encoding of GLYPH->u.ch is returned in *CHAR2B. Value is
1351 a pointer to a realized face that is ready for display. */ 1351 a pointer to a realized face that is ready for display. */
1352 1352
1353static INLINE struct face * 1353static INLINE struct face *
@@ -1359,21 +1359,21 @@ x_get_glyph_face_and_encoding (f, glyph, char2b)
1359 struct face *face; 1359 struct face *face;
1360 1360
1361 xassert (glyph->type == CHAR_GLYPH); 1361 xassert (glyph->type == CHAR_GLYPH);
1362 face = FACE_FROM_ID (f, glyph->u.ch.face_id); 1362 face = FACE_FROM_ID (f, glyph->face_id);
1363 1363
1364 if (!glyph->multibyte_p) 1364 if (!glyph->multibyte_p)
1365 { 1365 {
1366 /* Unibyte case. We don't have to encode, but we have to make 1366 /* Unibyte case. We don't have to encode, but we have to make
1367 sure to use a face suitable for unibyte. */ 1367 sure to use a face suitable for unibyte. */
1368 char2b->byte1 = 0; 1368 char2b->byte1 = 0;
1369 char2b->byte2 = glyph->u.ch.code; 1369 char2b->byte2 = glyph->u.ch;
1370 } 1370 }
1371 else if (glyph->u.ch.code < 128 1371 else if (glyph->u.ch < 128
1372 && glyph->u.ch.face_id < BASIC_FACE_ID_SENTINEL) 1372 && glyph->face_id < BASIC_FACE_ID_SENTINEL)
1373 { 1373 {
1374 /* Case of ASCII in a face known to fit ASCII. */ 1374 /* Case of ASCII in a face known to fit ASCII. */
1375 char2b->byte1 = 0; 1375 char2b->byte1 = 0;
1376 char2b->byte2 = glyph->u.ch.code; 1376 char2b->byte2 = glyph->u.ch;
1377 } 1377 }
1378 else 1378 else
1379 { 1379 {
@@ -1381,7 +1381,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b)
1381 1381
1382 /* Split characters into bytes. If c2 is -1 afterwards, C is 1382 /* Split characters into bytes. If c2 is -1 afterwards, C is
1383 really a one-byte character so that byte1 is zero. */ 1383 really a one-byte character so that byte1 is zero. */
1384 SPLIT_CHAR (glyph->u.ch.code, charset, c1, c2); 1384 SPLIT_CHAR (glyph->u.ch, charset, c1, c2);
1385 if (c2 > 0) 1385 if (c2 > 0)
1386 char2b->byte1 = c1, char2b->byte2 = c2; 1386 char2b->byte1 = c1, char2b->byte2 = c2;
1387 else 1387 else
@@ -1394,7 +1394,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b)
1394 = FONT_INFO_FROM_ID (f, face->font_info_id); 1394 = FONT_INFO_FROM_ID (f, face->font_info_id);
1395 if (font_info) 1395 if (font_info)
1396 { 1396 {
1397 x_encode_char (glyph->u.ch.code, char2b, font_info); 1397 x_encode_char (glyph->u.ch, char2b, font_info);
1398 if (charset == charset_latin_iso8859_1) 1398 if (charset == charset_latin_iso8859_1)
1399 char2b->byte2 |= 0x80; 1399 char2b->byte2 |= 0x80;
1400 } 1400 }
@@ -1431,8 +1431,8 @@ x_append_glyph (it)
1431 1431
1432 glyph->type = CHAR_GLYPH; 1432 glyph->type = CHAR_GLYPH;
1433 glyph->pixel_width = it->pixel_width; 1433 glyph->pixel_width = it->pixel_width;
1434 glyph->u.ch.code = it->char_to_display; 1434 glyph->u.ch = it->char_to_display;
1435 glyph->u.ch.face_id = it->face_id; 1435 glyph->face_id = it->face_id;
1436 glyph->charpos = CHARPOS (it->position); 1436 glyph->charpos = CHARPOS (it->position);
1437 glyph->object = it->object; 1437 glyph->object = it->object;
1438 glyph->left_box_line_p = it->start_of_box_run_p; 1438 glyph->left_box_line_p = it->start_of_box_run_p;
@@ -1467,8 +1467,8 @@ x_append_composite_glyph (it)
1467 1467
1468 glyph->type = COMPOSITE_GLYPH; 1468 glyph->type = COMPOSITE_GLYPH;
1469 glyph->pixel_width = it->pixel_width; 1469 glyph->pixel_width = it->pixel_width;
1470 glyph->u.cmp.id = it->cmp_id; 1470 glyph->u.cmp_id = it->cmp_id;
1471 glyph->u.cmp.face_id = it->face_id; 1471 glyph->face_id = it->face_id;
1472 glyph->charpos = CHARPOS (it->position); 1472 glyph->charpos = CHARPOS (it->position);
1473 glyph->object = it->object; 1473 glyph->object = it->object;
1474 glyph->left_box_line_p = it->start_of_box_run_p; 1474 glyph->left_box_line_p = it->start_of_box_run_p;
@@ -1552,8 +1552,8 @@ x_produce_image_glyph (it)
1552 if (glyph < it->glyph_row->glyphs[area + 1]) 1552 if (glyph < it->glyph_row->glyphs[area + 1])
1553 { 1553 {
1554 glyph->type = IMAGE_GLYPH; 1554 glyph->type = IMAGE_GLYPH;
1555 glyph->u.img.id = img->id; 1555 glyph->u.img_id = img->id;
1556 glyph->u.img.face_id = it->face_id; 1556 glyph->face_id = it->face_id;
1557 glyph->pixel_width = it->pixel_width; 1557 glyph->pixel_width = it->pixel_width;
1558 glyph->charpos = CHARPOS (it->position); 1558 glyph->charpos = CHARPOS (it->position);
1559 glyph->object = it->object; 1559 glyph->object = it->object;
@@ -1590,7 +1590,7 @@ x_append_stretch_glyph (it, object, width, height, ascent)
1590 glyph->type = STRETCH_GLYPH; 1590 glyph->type = STRETCH_GLYPH;
1591 glyph->u.stretch.ascent = height * ascent; 1591 glyph->u.stretch.ascent = height * ascent;
1592 glyph->u.stretch.height = height; 1592 glyph->u.stretch.height = height;
1593 glyph->u.stretch.face_id = it->face_id; 1593 glyph->face_id = it->face_id;
1594 glyph->pixel_width = width; 1594 glyph->pixel_width = width;
1595 glyph->charpos = CHARPOS (it->position); 1595 glyph->charpos = CHARPOS (it->position);
1596 glyph->object = object; 1596 glyph->object = object;
@@ -4138,7 +4138,7 @@ x_fill_glyph_string (s, face_id, start, end, overlaps_p)
4138 && glyph->type == CHAR_GLYPH 4138 && glyph->type == CHAR_GLYPH
4139 && glyph->voffset == voffset 4139 && glyph->voffset == voffset
4140 /* Same face id implies same charset, nowadays. */ 4140 /* Same face id implies same charset, nowadays. */
4141 && glyph->u.ch.face_id == face_id) 4141 && glyph->face_id == face_id)
4142 { 4142 {
4143 s->face = x_get_glyph_face_and_encoding (s->f, glyph, 4143 s->face = x_get_glyph_face_and_encoding (s->f, glyph,
4144 s->char2b + s->nchars); 4144 s->char2b + s->nchars);
@@ -4179,9 +4179,9 @@ x_fill_image_glyph_string (s)
4179 struct glyph_string *s; 4179 struct glyph_string *s;
4180{ 4180{
4181 xassert (s->first_glyph->type == IMAGE_GLYPH); 4181 xassert (s->first_glyph->type == IMAGE_GLYPH);
4182 s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img.id); 4182 s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id);
4183 xassert (s->img); 4183 xassert (s->img);
4184 s->face = FACE_FROM_ID (s->f, s->first_glyph->u.img.face_id); 4184 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
4185 s->font = s->face->font; 4185 s->font = s->face->font;
4186 s->width = s->first_glyph->pixel_width; 4186 s->width = s->first_glyph->pixel_width;
4187 4187
@@ -4197,7 +4197,7 @@ x_fill_stretch_glyph_string (s)
4197 struct glyph_string *s; 4197 struct glyph_string *s;
4198{ 4198{
4199 xassert (s->first_glyph->type == STRETCH_GLYPH); 4199 xassert (s->first_glyph->type == STRETCH_GLYPH);
4200 s->face = FACE_FROM_ID (s->f, s->first_glyph->u.stretch.face_id); 4200 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
4201 s->font = s->face->font; 4201 s->font = s->face->font;
4202 s->width = s->first_glyph->pixel_width; 4202 s->width = s->first_glyph->pixel_width;
4203 4203
@@ -4335,9 +4335,9 @@ x_set_glyph_string_background_width (s, start, last_x)
4335 int c, charset, face_id; \ 4335 int c, charset, face_id; \
4336 XChar2b *char2b; \ 4336 XChar2b *char2b; \
4337 \ 4337 \
4338 c = (ROW)->glyphs[AREA][START].u.ch.code; \ 4338 c = (ROW)->glyphs[AREA][START].u.ch; \
4339 charset = CHAR_CHARSET (c); \ 4339 charset = CHAR_CHARSET (c); \
4340 face_id = (ROW)->glyphs[AREA][START].u.ch.face_id; \ 4340 face_id = (ROW)->glyphs[AREA][START].face_id; \
4341 \ 4341 \
4342 s = (struct glyph_string *) alloca (sizeof *s); \ 4342 s = (struct glyph_string *) alloca (sizeof *s); \
4343 char2b = (XChar2b *) alloca ((END - START) * sizeof *char2b); \ 4343 char2b = (XChar2b *) alloca ((END - START) * sizeof *char2b); \
@@ -4362,8 +4362,8 @@ x_set_glyph_string_background_width (s, start, last_x)
4362 4362
4363#define BUILD_COMPOSITE_GLYPH_STRING(W, ROW, AREA, START, END, HEAD, TAIL, HL, X, LAST_X, OVERLAPS_P) \ 4363#define BUILD_COMPOSITE_GLYPH_STRING(W, ROW, AREA, START, END, HEAD, TAIL, HL, X, LAST_X, OVERLAPS_P) \
4364 do { \ 4364 do { \
4365 int cmp_id = (ROW)->glyphs[AREA][START].u.cmp.id; \ 4365 int cmp_id = (ROW)->glyphs[AREA][START].u.cmp_id; \
4366 int face_id = (ROW)->glyphs[AREA][START].u.cmp.face_id; \ 4366 int face_id = (ROW)->glyphs[AREA][START].face_id; \
4367 struct composition *cmp = composition_table[cmp_id]; \ 4367 struct composition *cmp = composition_table[cmp_id]; \
4368 int glyph_len = cmp->glyph_len; \ 4368 int glyph_len = cmp->glyph_len; \
4369 XChar2b *char2b; \ 4369 XChar2b *char2b; \
@@ -4376,7 +4376,7 @@ x_set_glyph_string_background_width (s, start, last_x)
4376 /* At first, fill in `char2b' and `faces'. */ \ 4376 /* At first, fill in `char2b' and `faces'. */ \
4377 for (n = 0; n < glyph_len; n++) \ 4377 for (n = 0; n < glyph_len; n++) \
4378 { \ 4378 { \
4379 int c = FAST_GLYPH_CHAR (COMPOSITION_GLYPH (cmp, n)); \ 4379 int c = COMPOSITION_GLYPH (cmp, n); \
4380 faces[n] = x_get_char_face_and_encoding (XFRAME (w->frame), c, \ 4380 faces[n] = x_get_char_face_and_encoding (XFRAME (w->frame), c, \
4381 face_id, char2b + n, 1); \ 4381 face_id, char2b + n, 1); \
4382 } \ 4382 } \