Lisp_Object font_instance =
ensure_face_cachel_contains_charset (cachel, data->window,
charset);
- struct Lisp_Font_Instance *fi;
+ Lisp_Font_Instance *fi;
if (EQ (font_instance, Vthe_null_font_instance))
{
prop_block_dynarr *prop = NULL;
if (VECTORP (entry))
{
- struct Lisp_Vector *de = XVECTOR (entry);
+ Lisp_Vector *de = XVECTOR (entry);
EMACS_INT len = vector_length (de);
int elt;
{
struct window *w = XWINDOW (data->window);
+ /* If window faces changed, and glyph instance is text, then
+ glyph sizes might have changed too */
+ invalidate_glyph_geometry_maybe (gb->glyph, w);
+
+ /* This makes sure the glyph is in the cachels.
+
+ #### We need to change this so that we hold onto the glyph_index
+ here, not the glyph itself. */
+ get_glyph_cachel_index (w, gb->glyph);
+
/* A nil extent indicates a special glyph (ex. truncator). */
if (NILP (gb->extent)
|| (pos_type == BEGIN_GLYPHS &&
}
static Charcount
-add_string_to_fstring_db_runes (pos_data *data, CONST Bufbyte *str,
+add_string_to_fstring_db_runes (pos_data *data, const Bufbyte *str,
Charcount pos, Charcount min_pos, Charcount max_pos)
{
/* This function has been Mule-ized. */
Charcount end;
- CONST Bufbyte *cur_pos = str;
+ const Bufbyte *cur_pos = str;
struct display_block *db = data->db;
data->blank_width = space_width (XWINDOW (data->window));
add_blank_rune (data, NULL, 0);
end = (Dynarr_length (db->runes) +
- bytecount_to_charcount (str, strlen ((CONST char *) str)));
+ bytecount_to_charcount (str, strlen ((const char *) str)));
if (max_pos != -1)
end = min (max_pos, end);
while (pos < end && *cur_pos)
{
- CONST Bufbyte *old_cur_pos = cur_pos;
+ const Bufbyte *old_cur_pos = cur_pos;
int succeeded;
data->ch = charptr_emchar (cur_pos);
{
Charcount tmp_max = (max_pos == -1 ? pos + size - *offset :
min (pos + size - *offset, max_pos));
- CONST Bufbyte *tmp_last = charptr_n_addr (last, *offset);
+ const Bufbyte *tmp_last = charptr_n_addr (last, *offset);
pos = add_string_to_fstring_db_runes (data, tmp_last,
pos, pos, tmp_max);
while (num_to_add--)
pos = add_string_to_fstring_db_runes
- (data, (CONST Bufbyte *) "-", pos, pos, max_pos);
+ (data, (const Bufbyte *) "-", pos, pos, max_pos);
}
else if (*this != 0)
{
*offset -= size;
else
{
- CONST Bufbyte *tmp_str = charptr_n_addr (str, *offset);
+ const Bufbyte *tmp_str = charptr_n_addr (str, *offset);
- /* ### NOTE: I don't understand why a tmp_max is not
+ /* #### NOTE: I don't understand why a tmp_max is not
computed and used here as in the plain string case
above. -- dv */
pos = add_string_to_fstring_db_runes (data, tmp_str,
*offset -= size;
else
{
- CONST Bufbyte *tmp_str = charptr_n_addr (str, *offset);
+ const Bufbyte *tmp_str = charptr_n_addr (str, *offset);
- /* ### NOTE: I don't understand why a tmp_max is not
+ /* #### NOTE: I don't understand why a tmp_max is not
computed and used here as in the plain string case
above. -- dv */
pos = add_string_to_fstring_db_runes (data, tmp_str, pos,
*offset -= size;
else
{
- CONST Bufbyte *tmp_str =
- charptr_n_addr ((CONST Bufbyte *) str, *offset);
+ const Bufbyte *tmp_str =
+ charptr_n_addr ((const Bufbyte *) str, *offset);
- /* ### NOTE: I don't understand why a tmp_max is not computed and
+ /* #### NOTE: I don't understand why a tmp_max is not computed and
used here as in the plain string case above. -- dv */
pos = add_string_to_fstring_db_runes (data, tmp_str, pos,
min_pos, max_pos);
if (min_pos > pos)
{
- add_string_to_fstring_db_runes (data, (CONST Bufbyte *) "", pos,
+ add_string_to_fstring_db_runes (data, (const Bufbyte *) "", pos,
min_pos, -1);
}
against this case. */
struct buffer *b = BUFFERP (w->buffer) ? XBUFFER (w->buffer) : 0;
struct device *d = XDEVICE (f->device);
- struct Lisp_String* s = XSTRING (disp_string);
+ Lisp_String* s = XSTRING (disp_string);
/* we're working with these a lot so precalculate them */
Bytecount slen = XSTRING_LENGTH (disp_string);
if (truncate_win && data.bi_bufpos == bi_string_zv)
{
- CONST Bufbyte* endb = charptr_n_addr (string_data (s), bi_string_zv);
+ const Bufbyte* endb = charptr_n_addr (string_data (s), bi_string_zv);
DEC_CHARPTR (endb);
if (charptr_emchar (endb) != '\n')
{
the cache purely because glyphs have changed - this is now
handled by the dirty flag.*/
if ((!echo_active && b != window_display_buffer (w))
- || !Dynarr_length (w->glyph_cachels))
+ || !Dynarr_length (w->glyph_cachels) || f->faces_changed)
reset_glyph_cachels (w);
else
mark_glyph_cachels_as_not_updated (w);
return 0;
}
-/* Ensure that all frames on the given device are correctly displayed. */
+/* Ensure that all frames on the given device are correctly displayed.
+ If AUTOMATIC is non-zero, and the device implementation indicates
+ no automatic redisplay, as printers do, then the device is not
+ redisplayed. AUTOMATIC is set to zero when called from lisp
+ functions (redraw-device) and (redisplay-device), and to non-zero
+ when called from "lazy" redisplay();
+*/
static int
-redisplay_device (struct device *d)
+redisplay_device (struct device *d, int automatic)
{
Lisp_Object frame, frmcons;
int preempted = 0;
int size_change_failed = 0;
struct frame *f;
+ if (automatic
+ && (MAYBE_INT_DEVMETH (d, device_implementation_flags, ())
+ & XDEVIMPF_NO_AUTO_REDISPLAY))
+ return 0;
+
if (DEVICE_STREAM_P (d)) /* nothing to do */
return 0;
if (CLASS_REDISPLAY_FLAGS_CHANGEDP (d))
{
- preempted = redisplay_device (d);
+ preempted = redisplay_device (d, 1);
if (preempted)
{
decode_mode_spec (struct window *w, Emchar spec, int type)
{
Lisp_Object obj = Qnil;
- CONST char *str = NULL;
+ const char *str = NULL;
struct buffer *b = XBUFFER (w->buffer);
Dynarr_reset (mode_spec_bufbyte_string);
long_to_string (buf, col);
Dynarr_add_many (mode_spec_bufbyte_string,
- (CONST Bufbyte *) buf, strlen (buf));
+ (const Bufbyte *) buf, strlen (buf));
goto decode_mode_spec_done;
}
{
XFRAME (XCAR (frmcons))->clear = 1;
}
- redisplay_device (d);
+ redisplay_device (d, 0);
return unbind_to (count, Qnil);
}
disable_preemption++;
}
- redisplay_device (d);
+ redisplay_device (d, 0);
return unbind_to (count, Qnil);
}
if (!initialized)
#endif
{
- cmotion_display_lines = Dynarr_new (display_line);
- mode_spec_bufbyte_string = Dynarr_new (Bufbyte);
- formatted_string_extent_dynarr = Dynarr_new (EXTENT);
- formatted_string_extent_start_dynarr = Dynarr_new (Bytecount);
- formatted_string_extent_end_dynarr = Dynarr_new (Bytecount);
- internal_cache = Dynarr_new (line_start_cache);
+ if (!cmotion_display_lines)
+ cmotion_display_lines = Dynarr_new (display_line);
+ if (!mode_spec_bufbyte_string)
+ mode_spec_bufbyte_string = Dynarr_new (Bufbyte);
+ if (!formatted_string_extent_dynarr)
+ formatted_string_extent_dynarr = Dynarr_new (EXTENT);
+ if (!formatted_string_extent_start_dynarr)
+ formatted_string_extent_start_dynarr = Dynarr_new (Bytecount);
+ if (!formatted_string_extent_end_dynarr)
+ formatted_string_extent_end_dynarr = Dynarr_new (Bytecount);
+ if (!internal_cache)
+ internal_cache = Dynarr_new (line_start_cache);
}
/* window system is nil when in -batch mode */