Cleanup changes following fix for bug #11832.

src/ xdisp.c (display_line): Add commentary about displaying 
 truncation glyphs on GUI frames.
 (produce_special_glyphs): Move here from term.c.
 src/term.c (produce_special_glyphs): Move to xdisp.c.
 src/dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
 section.
This commit is contained in:
Eli Zaretskii 2012-07-08 19:38:43 +03:00
parent c4b3bc8aaf
commit 3434fe8a23
4 changed files with 75 additions and 63 deletions

View file

@ -2,6 +2,14 @@
* xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
has no font, use the frame's font. (Bug#11813)
(display_line): Add commentary about displaying truncation glyphs
on GUI frames.
(produce_special_glyphs): Move here from term.c.
* term.c (produce_special_glyphs): Move to xdisp.c.
* dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
section.
2012-07-07 Andreas Schwab <schwab@linux-m68k.org>

View file

@ -3065,7 +3065,7 @@ extern ptrdiff_t compute_display_string_pos (struct text_pos *,
extern ptrdiff_t compute_display_string_end (ptrdiff_t,
struct bidi_string_data *);
extern void produce_stretch_glyph (struct it *);
extern void produce_special_glyphs (struct it *, enum display_element_type);
#ifdef HAVE_WINDOW_SYSTEM
@ -3353,7 +3353,6 @@ extern int string_cost (const char *);
extern int per_line_cost (const char *);
extern void calculate_costs (struct frame *);
extern void produce_glyphs (struct it *);
extern void produce_special_glyphs (struct it *, enum display_element_type);
extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long);
extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
extern struct terminal *get_named_tty (const char *);

View file

@ -1885,67 +1885,6 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
append_glyphless_glyph (it, face_id, str);
}
/* Get information about special display element WHAT in an
environment described by IT. WHAT is one of IT_TRUNCATION or
IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a
non-null glyph_row member. This function ensures that fields like
face_id, c, len of IT are left untouched. */
void
produce_special_glyphs (struct it *it, enum display_element_type what)
{
struct it temp_it;
Lisp_Object gc;
GLYPH glyph;
temp_it = *it;
temp_it.dp = NULL;
temp_it.what = IT_CHARACTER;
temp_it.len = 1;
temp_it.object = make_number (0);
memset (&temp_it.current, 0, sizeof temp_it.current);
if (what == IT_CONTINUATION)
{
/* Continuation glyph. For R2L lines, we mirror it by hand. */
if (it->bidi_it.paragraph_dir == R2L)
SET_GLYPH_FROM_CHAR (glyph, '/');
else
SET_GLYPH_FROM_CHAR (glyph, '\\');
if (it->dp
&& (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc)))
{
/* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
}
else if (what == IT_TRUNCATION)
{
/* Truncation glyph. */
SET_GLYPH_FROM_CHAR (glyph, '$');
if (it->dp
&& (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc)))
{
/* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
}
else
abort ();
temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
temp_it.face_id = GLYPH_FACE (glyph);
temp_it.len = CHAR_BYTES (temp_it.c);
PRODUCE_GLYPHS (&temp_it);
it->pixel_width = temp_it.pixel_width;
it->nglyphs = temp_it.pixel_width;
}
/***********************************************************************
Faces

View file

@ -19773,6 +19773,13 @@ display_line (struct it *it)
#ifdef HAVE_WINDOW_SYSTEM
else
{
/* On a GUI frame, when the right fringe (left
fringe for R2L rows) is turned off, we produce
truncation glyphs preceded by a stretch glyph
whose width is computed such that the truncation
glyphs are aligned at the window margin, even
when very different fonts are used in different
glyph rows. */
int stretch_width = it->last_visible_x - it->current_x;
row->used[TEXT_AREA] = i;
@ -24196,6 +24203,65 @@ produce_stretch_glyph (struct it *it)
it->nglyphs = width;
}
/* Get information about special display element WHAT in an
environment described by IT. WHAT is one of IT_TRUNCATION or
IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a
non-null glyph_row member. This function ensures that fields like
face_id, c, len of IT are left untouched. */
void
produce_special_glyphs (struct it *it, enum display_element_type what)
{
struct it temp_it;
Lisp_Object gc;
GLYPH glyph;
temp_it = *it;
temp_it.dp = NULL;
temp_it.what = IT_CHARACTER;
temp_it.len = 1;
temp_it.object = make_number (0);
memset (&temp_it.current, 0, sizeof temp_it.current);
if (what == IT_CONTINUATION)
{
/* Continuation glyph. For R2L lines, we mirror it by hand. */
if (it->bidi_it.paragraph_dir == R2L)
SET_GLYPH_FROM_CHAR (glyph, '/');
else
SET_GLYPH_FROM_CHAR (glyph, '\\');
if (it->dp
&& (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc)))
{
/* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
}
else if (what == IT_TRUNCATION)
{
/* Truncation glyph. */
SET_GLYPH_FROM_CHAR (glyph, '$');
if (it->dp
&& (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc)))
{
/* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
}
else
abort ();
temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
temp_it.face_id = GLYPH_FACE (glyph);
temp_it.len = CHAR_BYTES (temp_it.c);
PRODUCE_GLYPHS (&temp_it);
it->pixel_width = temp_it.pixel_width;
it->nglyphs = temp_it.pixel_width;
}
#ifdef HAVE_WINDOW_SYSTEM
/* Calculate line-height and line-spacing properties.