else if (crb->type != drb->type)
return 0;
else if (crb->type == RUNE_CHAR &&
- (crb->object.chr.ch != drb->object.chr.ch))
+ !CHARC_EQ (crb->object.cglyph, drb->object.cglyph))
return 0;
else if (crb->type == RUNE_HLINE &&
(crb->object.hline.thickness != drb->object.hline.thickness ||
return 0;
/* Only check dirtiness if we know something has changed. */
else if (crb->type == RUNE_DGLYPH &&
- ((XFRAME (w->frame)->glyphs_changed &&
- XGLYPH_DIRTYP (crb->object.dglyph.glyph)) ||
+ (XGLYPH_DIRTYP (crb->object.dglyph.glyph) ||
crb->findex != drb->findex))
{
/* We need some way of telling redisplay_output_layout () that the
XSETWINDOW (window, w);
image = glyph_image_instance (crb->object.dglyph.glyph,
window, ERROR_ME_NOT, 1);
+
+ if (!IMAGE_INSTANCEP (image))
+ return 0;
ii = XIMAGE_INSTANCE (image);
if (TEXT_IMAGE_INSTANCEP (image) &&
cases they will actually be the same object. This does not
mean, however, that nothing has changed. We therefore need to
check the current hash of the glyph against the last recorded
- display hash. See update_subwindow (). */
- if (IMAGE_INSTANCE_DISPLAY_HASH (ii) == 0 ||
- IMAGE_INSTANCE_DISPLAY_HASH (ii) !=
- internal_hash (image, IMAGE_INSTANCE_HASH_DEPTH) ||
+ display hash and the pending display items. See
+ update_subwindow (). */
+ if (image_instance_changed (image) ||
crb->findex != drb->findex ||
WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))
{
}
else
{
- DEVMETH (d, output_begin, (d));
-
- /* #### This is a gross kludge. Cursor handling is such a royal
- pain in the ass. */
- if (rb->type == RUNE_DGLYPH &&
- (EQ (rb->object.dglyph.glyph, Vtruncation_glyph) ||
- EQ (rb->object.dglyph.glyph, Vcontinuation_glyph)))
- rb->cursor_type = NO_CURSOR;
- else
- rb->cursor_type = CURSOR_OFF;
+ {
+ MAYBE_DEVMETH (d, frame_output_begin, (f));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
+ }
+ rb->cursor_type = CURSOR_OFF;
dl->cursor_elt = -1;
output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width);
}
if (w != XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d))))
{
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 1;
}
output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width);
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 1;
}
else
make_int (ADJ_BUFPOS), w->buffer);
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 1;
}
}
if (!no_output_end)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
return 0;
}
#undef ADJ_BUFPOS
(f, dl->ypos - 1, rb->xpos));
if (run_end_begin_meths)
- DEVMETH (d, output_begin, (d));
+ {
+ MAYBE_DEVMETH (d, frame_output_begin, (f));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
+ }
output_display_line (w, 0, dla, y, rb->xpos, rb->xpos + rb->width);
if (run_end_begin_meths)
- DEVMETH (d, output_end, (d));
+ {
+ MAYBE_DEVMETH (d, window_output_end, (w));
+ MAYBE_DEVMETH (d, frame_output_end, (f));
+ }
}
}
static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height,
Lisp_Object ignored_window)
{
- int elt;
+ Lisp_Object rest;
- for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++)
+ LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))
{
- struct subwindow_cachel *cachel =
- Dynarr_atp (f->subwindow_cachels, elt);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (XCAR (rest));
- if (cachel->being_displayed
+ if (IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)
&&
- cachel->x + cachel->width > x && cachel->x < x + width
+ IMAGE_INSTANCE_DISPLAY_X (ii)
+ + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) > x
+ &&
+ IMAGE_INSTANCE_DISPLAY_X (ii) < x + width
&&
- cachel->y + cachel->height > y && cachel->y < y + height
+ IMAGE_INSTANCE_DISPLAY_Y (ii)
+ + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) > y
+ &&
+ IMAGE_INSTANCE_DISPLAY_Y (ii) < y + height
&&
- !EQ (cachel->subwindow, ignored_window))
+ !EQ (XCAR (rest), ignored_window))
{
- unmap_subwindow (cachel->subwindow);
+ unmap_subwindow (XCAR (rest));
}
}
}
****************************************************************************/
void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height)
{
- if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f)))
+ if (!NILP (XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))))
{
redisplay_unmap_subwindows (f, x, y, width, height, Qnil);
}
static void redisplay_unmap_subwindows_except_us (struct frame* f, int x, int y, int width,
int height, Lisp_Object subwindow)
{
- if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f)))
+ if (!NILP (XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))))
{
redisplay_unmap_subwindows (f, x, y, width, height, subwindow);
}
{
Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
Lisp_Object window, rest;
- Emchar_dynarr *buf = Dynarr_new (Emchar);
+ Charc_dynarr *buf = Dynarr_new (Charc);
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
int layout_height, layout_width;
dga->height = layout_height;
dga->width = layout_width;
-
+#ifdef DEBUG_WIDGET_OUTPUT
+ printf ("outputing layout glyph %p\n", p);
+#endif
/* This makes the glyph area fit into the display area. */
if (!redisplay_normalize_glyph_area (db, dga))
return;
continue;
/* We have to invert the offset here as normalization
will have made them positive which the output
- routines will treat as a truely +ve offset. */
+ routines will treat as a truly +ve offset. */
cdga.xoffset = -cdga.xoffset;
cdga.yoffset = -cdga.yoffset;
struct display_line dl; /* this is fake */
Lisp_Object string =
IMAGE_INSTANCE_TEXT_STRING (childii);
- convert_bufbyte_string_into_emchar_dynarr
- (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
+ Charset_ID charsets[NUM_LEADING_BYTES];
+ struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
+
+ find_charsets_in_bufbyte_string (charsets,
+ XSTRING_DATA (string),
+ XSTRING_LENGTH (string));
+ ensure_face_cachel_complete (cachel, window, charsets);
+
+ convert_bufbyte_string_into_charc_dynarr
+ (XSTRING_DATA (string), XSTRING_LENGTH (string),
+ buf);
redisplay_normalize_display_box (&cdb, &cdga);
/* Offsets are now +ve again so be careful
break;
case IMAGE_WIDGET:
+ if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (childii), Qlayout))
+ {
+ redisplay_output_layout (w, child, &cdb, &cdga, findex,
+ 0, 0, 0);
+ break;
+ }
case IMAGE_SUBWINDOW:
if (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) ||
IMAGE_INSTANCE_DIRTYP (childii))
0, 0, 0);
break;
- case IMAGE_LAYOUT:
- redisplay_output_layout (w, child, &cdb, &cdga, findex,
- 0, 0, 0);
- break;
-
case IMAGE_NOTHING:
/* nothing is as nothing does */
break;
display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP);
display_line_dynarr *ddla = window_display_lines (w, DESIRED_DISP);
- DEVMETH (d, output_begin, (d));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
while (first_line <= last_line)
{
}
#endif
- /* This has to be done after we've updated the values. We don't
- call output_end for tty frames. Redisplay will do this after all
- tty windows have been updated. This cuts down on cursor
- flicker. */
- if (FRAME_TTY_P (f))
- redisplay_redraw_cursor (f, 0);
- else
- DEVMETH (d, output_end, (d));
+ redisplay_redraw_cursor (f, 0);
+ MAYBE_DEVMETH (d, window_output_end, (w));
}
/*****************************************************************************
}
/* Perform any output initialization. */
- DEVMETH (d, output_begin, (d));
+ MAYBE_DEVMETH (d, window_output_begin, (w));
/* If the window's structure has changed clear the internal border
above it if it is topmost (the function will check). */
if (window_needs_vertical_divider (w)
&& (f->windows_structure_changed || f->clear))
{
- DEVMETH (d, output_vertical_divider, (w, f->windows_structure_changed));
+ MAYBE_DEVMETH (d, output_vertical_divider, (w, f->windows_structure_changed));
}
/* Clear the rest of the window, if necessary. */
get invalidated when it should be. */
INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (d);
- /* We don't call output_end for tty frames. Redisplay will do this
- after all tty windows have been updated. This cuts down on
- cursor flicker. */
- if (FRAME_TTY_P (f))
- redisplay_redraw_cursor (f, 0);
- else
- DEVMETH (d, output_end, (d));
+ redisplay_redraw_cursor (f, 0);
+ MAYBE_DEVMETH (d, window_output_end, (w));
#ifdef HAVE_SCROLLBARS
update_window_scrollbars (w, NULL, !MINI_WINDOW_P (w), 0);