static int
separate_textual_runs (unsigned char *text_storage,
struct textual_run *run_storage,
- const Emchar *str, Charcount len)
+ const Charc *str, Charcount len)
{
Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a
possible valid charset when
for (i = 0; i < len; i++)
{
- Emchar ch = str[i];
- Lisp_Object charset;
+ Charc cc = str[i];
+ Lisp_Object charset = CHARC_CHARSET (cc);
+ int code_point = CHARC_CODE_POINT (cc);
int byte1, byte2;
int dimension;
int graphic;
- BREAKUP_CHAR (ch, charset, byte1, byte2);
dimension = XCHARSET_DIMENSION (charset);
graphic = XCHARSET_GRAPHIC (charset);
-
+ if (dimension == 1)
+ {
+ byte1 = code_point;
+ byte2 = 0;
+ }
+ else
+ {
+ byte1 = code_point >> 8;
+ byte2 = code_point & 0xFF;
+ }
if (!EQ (charset, prev_charset))
{
run_storage[runs_so_far].ptr = text_storage;
#ifdef MULE
{
Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset);
- need_ccl_conversion = !NILP (ccl_prog);
- if (need_ccl_conversion)
- setup_ccl_program (&char_converter, ccl_prog);
+ if ((!NILP (ccl_prog))
+ && (setup_ccl_program (&char_converter, ccl_prog) >= 0))
+ need_ccl_conversion = 1;
}
#endif
}
*/
static int
-x_text_width (struct frame *f, struct face_cachel *cachel, const Emchar *str,
+x_text_width (struct frame *f, struct face_cachel *cachel, const Charc *str,
Charcount len)
{
int width_so_far = 0;
}
/*****************************************************************************
- x_output_begin
+ x_window_output_begin
Perform any necessary initialization prior to an update.
****************************************************************************/
static void
-x_output_begin (struct device *d)
+x_window_output_begin (struct window *w)
{
}
/*****************************************************************************
- x_output_end
+ x_window_output_end
Perform any necessary flushing of queues when an update has completed.
****************************************************************************/
static void
-x_output_end (struct device *d)
+x_window_output_end (struct window *w)
{
- XFlush (DEVICE_X_DISPLAY (d));
+ XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w)));
}
/*****************************************************************************
int cursor_width, int cursor_height)
{
struct frame *f = XFRAME (w->frame);
- Emchar_dynarr *buf = Dynarr_new (Emchar);
+ Charc_dynarr *buf = Dynarr_new (Charc);
Lisp_Object window;
struct display_block *db = Dynarr_atp (dl->display_blocks, block);
findex = rb->findex;
xpos = rb->xpos;
if (rb->type == RUNE_CHAR)
- charset = CHAR_CHARSET (rb->object.chr.ch);
+ charset = CHARC_CHARSET (rb->object.cglyph);
if (end < 0)
end = Dynarr_length (rba);
rb = Dynarr_atp (rba, elt);
if (rb->findex == findex && rb->type == RUNE_CHAR
- && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
- && EQ (charset, CHAR_CHARSET (rb->object.chr.ch)))
+ && (!CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
+ && rb->cursor_type != CURSOR_ON
+ && EQ (charset, CHARC_CHARSET (rb->object.cglyph)))
{
- Dynarr_add (buf, rb->object.chr.ch);
+ Dynarr_add (buf, rb->object.cglyph);
width += rb->width;
elt++;
}
{
findex = rb->findex;
xpos = rb->xpos;
- charset = CHAR_CHARSET (rb->object.chr.ch);
+ charset = CHARC_CHARSET (rb->object.cglyph);
if (rb->cursor_type == CURSOR_ON)
{
- if (rb->object.chr.ch == '\n')
+ if (CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
{
x_output_eol_cursor (w, dl, xpos, findex);
}
else
{
- Dynarr_add (buf, rb->object.chr.ch);
+ Dynarr_add (buf, rb->object.cglyph);
x_output_string (w, dl, buf, xpos, 0, start_pixpos,
rb->width, findex, 1,
cursor_start, cursor_width,
xpos += rb->width;
elt++;
}
- else if (rb->object.chr.ch == '\n')
+ else if (CHARC_ASCII_EQ (rb->object.cglyph, '\n'))
{
/* Clear in case a cursor was formerly here. */
redisplay_clear_region (window, findex, xpos,
cursor_start, cursor_width,
cursor_height, 0);
break;
-
+
case IMAGE_WIDGET:
+ if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
+ Qlayout))
+ {
+ redisplay_output_layout (window, instance, &dbox, &dga, findex,
+ cursor_start, cursor_width,
+ cursor_height);
+ break;
+ }
case IMAGE_SUBWINDOW:
redisplay_output_subwindow (w, instance, &dbox, &dga, findex,
cursor_start, cursor_width,
cursor_height);
break;
-
- case IMAGE_LAYOUT:
- redisplay_output_layout (w, instance, &dbox, &dga, findex,
- cursor_start, cursor_width,
- cursor_height);
- break;
-
+
case IMAGE_NOTHING:
/* nothing is as nothing does */
break;
-
+
case IMAGE_TEXT:
case IMAGE_POINTER:
default:
abort ();
}
- IMAGE_INSTANCE_OPTIMIZE_OUTPUT
+ IMAGE_INSTANCE_OPTIMIZE_OUTPUT
(XIMAGE_INSTANCE (instance)) = 0;
}
****************************************************************************/
void
x_output_string (struct window *w, struct display_line *dl,
- Emchar_dynarr *buf, int xpos, int xoffset, int clip_start,
+ Charc_dynarr *buf, int xpos, int xoffset, int clip_start,
int width, face_index findex, int cursor,
int cursor_start, int cursor_width, int cursor_height)
{
w->pixel_width, flash_height);
}
else
- /* If it is short, flash it all. */
+ /* If it is short, flash it all. */
XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
w->pixel_width, w->pixel_height);
w->pixel_width, flash_height);
}
else
- /* If it is short, flash it all. */
+ /* If it is short, flash it all. */
XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
w->pixel_width, w->pixel_height);
CONSOLE_HAS_METHOD (x, output_vertical_divider);
CONSOLE_HAS_METHOD (x, clear_region);
CONSOLE_HAS_METHOD (x, clear_frame);
- CONSOLE_HAS_METHOD (x, output_begin);
- CONSOLE_HAS_METHOD (x, output_end);
+ CONSOLE_HAS_METHOD (x, window_output_begin);
+ CONSOLE_HAS_METHOD (x, window_output_end);
CONSOLE_HAS_METHOD (x, flash);
CONSOLE_HAS_METHOD (x, ring_bell);
CONSOLE_HAS_METHOD (x, bevel_area);