aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-07-10 20:32:14 +0000
committerGerd Moellmann2000-07-10 20:32:14 +0000
commit209f68d91b9376a90684c184a8baf322a2cc9828 (patch)
tree8561171ee7da6383486cda76963641c132de9bad /src
parentef12165928480dc7a4c59580ac1aea400d55003e (diff)
downloademacs-209f68d91b9376a90684c184a8baf322a2cc9828.tar.gz
emacs-209f68d91b9376a90684c184a8baf322a2cc9828.zip
(x_fill_stretch_glyph_string): Consume runs of stretch
glyphs instead of a single one. (BUILD_STRETCH_GLYPH_STRING): Call x_fill_stretch_glyph_string with new argument list. (x_set_glyph_string_gc): Make sure the face's GC is valid.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c60
1 files changed, 47 insertions, 13 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 8e45559662c..c2f3a49c696 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2488,6 +2488,9 @@ static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
2488 int, int, int, XRectangle *)); 2488 int, int, int, XRectangle *));
2489static void x_fix_overlapping_area P_ ((struct window *, struct glyph_row *, 2489static void x_fix_overlapping_area P_ ((struct window *, struct glyph_row *,
2490 enum glyph_row_area)); 2490 enum glyph_row_area));
2491static int x_fill_stretch_glyph_string P_ ((struct glyph_string *,
2492 struct glyph_row *,
2493 enum glyph_row_area, int, int));
2491 2494
2492#if GLYPH_DEBUG 2495#if GLYPH_DEBUG
2493static void x_check_font P_ ((struct frame *, XFontStruct *)); 2496static void x_check_font P_ ((struct frame *, XFontStruct *));
@@ -2661,7 +2664,6 @@ x_set_mode_line_face_gc (s)
2661 struct glyph_string *s; 2664 struct glyph_string *s;
2662{ 2665{
2663 s->gc = s->face->gc; 2666 s->gc = s->face->gc;
2664 xassert (s->gc != 0);
2665} 2667}
2666 2668
2667 2669
@@ -2673,6 +2675,8 @@ static INLINE void
2673x_set_glyph_string_gc (s) 2675x_set_glyph_string_gc (s)
2674 struct glyph_string *s; 2676 struct glyph_string *s;
2675{ 2677{
2678 PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
2679
2676 if (s->hl == DRAW_NORMAL_TEXT) 2680 if (s->hl == DRAW_NORMAL_TEXT)
2677 { 2681 {
2678 s->gc = s->face->gc; 2682 s->gc = s->face->gc;
@@ -4134,11 +4138,12 @@ static int x_fill_composite_glyph_string P_ ((struct glyph_string *,
4134 struct face **, int)); 4138 struct face **, int));
4135 4139
4136 4140
4137/* Load glyph string S with a composition components specified by S->cmp. 4141/* Fill glyph string S with composition components specified by S->cmp.
4142
4138 FACES is an array of faces for all components of this composition. 4143 FACES is an array of faces for all components of this composition.
4139 S->gidx is the index of the first component for S. 4144 S->gidx is the index of the first component for S.
4140 OVERLAPS_P non-zero means S should draw the foreground only, and 4145 OVERLAPS_P non-zero means S should draw the foreground only, and
4141 use its lines physical height for clipping. 4146 use its physical height for clipping.
4142 4147
4143 Value is the index of a component not in S. */ 4148 Value is the index of a component not in S. */
4144 4149
@@ -4192,11 +4197,12 @@ x_fill_composite_glyph_string (s, faces, overlaps_p)
4192} 4197}
4193 4198
4194 4199
4195/* Load glyph string S with a sequence characters. 4200/* Fill glyph string S from a sequence of character glyphs.
4201
4196 FACE_ID is the face id of the string. START is the index of the 4202 FACE_ID is the face id of the string. START is the index of the
4197 first glyph to consider, END is the index of the last + 1. 4203 first glyph to consider, END is the index of the last + 1.
4198 OVERLAPS_P non-zero means S should draw the foreground only, and 4204 OVERLAPS_P non-zero means S should draw the foreground only, and
4199 use its lines physical height for clipping. 4205 use its physical height for clipping.
4200 4206
4201 Value is the index of the first glyph not in S. */ 4207 Value is the index of the first glyph not in S. */
4202 4208
@@ -4279,19 +4285,48 @@ x_fill_image_glyph_string (s)
4279} 4285}
4280 4286
4281 4287
4282/* Fill glyph string S from stretch glyph S->first_glyph. */ 4288/* Fill glyph string S from a sequence of stretch glyphs.
4283 4289
4284static void 4290 ROW is the glyph row in which the glyphs are found, AREA is the
4285x_fill_stretch_glyph_string (s) 4291 area within the row. START is the index of the first glyph to
4292 consider, END is the index of the last + 1.
4293
4294 Value is the index of the first glyph not in S. */
4295
4296static int
4297x_fill_stretch_glyph_string (s, row, area, start, end)
4286 struct glyph_string *s; 4298 struct glyph_string *s;
4299 struct glyph_row *row;
4300 enum glyph_row_area area;
4301 int start, end;
4287{ 4302{
4303 struct glyph *glyph, *last;
4304 int voffset, face_id;
4305
4288 xassert (s->first_glyph->type == STRETCH_GLYPH); 4306 xassert (s->first_glyph->type == STRETCH_GLYPH);
4289 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); 4307
4308 glyph = s->row->glyphs[s->area] + start;
4309 last = s->row->glyphs[s->area] + end;
4310 face_id = glyph->face_id;
4311 s->face = FACE_FROM_ID (s->f, face_id);
4290 s->font = s->face->font; 4312 s->font = s->face->font;
4291 s->width = s->first_glyph->pixel_width; 4313 s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
4314 s->width = glyph->pixel_width;
4315 voffset = glyph->voffset;
4316
4317 for (++glyph;
4318 (glyph < last
4319 && glyph->type == STRETCH_GLYPH
4320 && glyph->voffset == voffset
4321 && glyph->face_id == face_id);
4322 ++glyph)
4323 s->width += glyph->pixel_width;
4292 4324
4293 /* Adjust base line for subscript/superscript text. */ 4325 /* Adjust base line for subscript/superscript text. */
4294 s->ybase += s->first_glyph->voffset; 4326 s->ybase += voffset;
4327
4328 xassert (s->face && s->face->gc);
4329 return glyph - s->row->glyphs[s->area];
4295} 4330}
4296 4331
4297 4332
@@ -4380,9 +4415,8 @@ x_set_glyph_string_background_width (s, start, last_x)
4380 { \ 4415 { \
4381 s = (struct glyph_string *) alloca (sizeof *s); \ 4416 s = (struct glyph_string *) alloca (sizeof *s); \
4382 x_init_glyph_string (s, NULL, W, ROW, AREA, START, HL); \ 4417 x_init_glyph_string (s, NULL, W, ROW, AREA, START, HL); \
4383 x_fill_stretch_glyph_string (s); \ 4418 START = x_fill_stretch_glyph_string (s, ROW, AREA, START, END); \
4384 x_append_glyph_string (&HEAD, &TAIL, s); \ 4419 x_append_glyph_string (&HEAD, &TAIL, s); \
4385 ++START; \
4386 s->x = (X); \ 4420 s->x = (X); \
4387 } \ 4421 } \
4388 while (0) 4422 while (0)