projects
/
chise
/
xemacs-chise.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sync up with r21-4-12-chise-b1.
[chise/xemacs-chise.git]
/
src
/
redisplay-x.c
diff --git
a/src/redisplay-x.c
b/src/redisplay-x.c
index
afccf66
..
711638b
100644
(file)
--- a/
src/redisplay-x.c
+++ b/
src/redisplay-x.c
@@
-123,7
+123,7
@@
struct textual_run
static int
separate_textual_runs (unsigned char *text_storage,
struct textual_run *run_storage,
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
{
Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a
possible valid charset when
@@
-137,16
+137,25
@@
separate_textual_runs (unsigned char *text_storage,
for (i = 0; i < len; i++)
{
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;
int byte1, byte2;
int dimension;
int graphic;
- BREAKUP_CHAR (ch, charset, byte1, byte2);
dimension = XCHARSET_DIMENSION (charset);
graphic = XCHARSET_GRAPHIC (charset);
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;
if (!EQ (charset, prev_charset))
{
run_storage[runs_so_far].ptr = text_storage;
@@
-165,9
+174,9
@@
separate_textual_runs (unsigned char *text_storage,
#ifdef MULE
{
Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset);
#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
}
}
#endif
}
@@
-241,7
+250,7
@@
x_text_width_single_run (struct face_cachel *cachel, struct textual_run *run)
*/
static int
*/
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;
Charcount len)
{
int width_so_far = 0;
@@
-318,7
+327,7
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
int cursor_width, int cursor_height)
{
struct frame *f = XFRAME (w->frame);
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);
Lisp_Object window;
struct display_block *db = Dynarr_atp (dl->display_blocks, block);
@@
-341,7
+350,7
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
findex = rb->findex;
xpos = rb->xpos;
if (rb->type == RUNE_CHAR)
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);
if (end < 0)
end = Dynarr_length (rba);
@@
-352,10
+361,11
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
rb = Dynarr_atp (rba, elt);
if (rb->findex == findex && rb->type == RUNE_CHAR
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++;
}
width += rb->width;
elt++;
}
@@
-376,17
+386,17
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
{
findex = rb->findex;
xpos = rb->xpos;
{
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->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
{
{
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,
x_output_string (w, dl, buf, xpos, 0, start_pixpos,
rb->width, findex, 1,
cursor_start, cursor_width,
@@
-397,7
+407,7
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
xpos += rb->width;
elt++;
}
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,
{
/* Clear in case a cursor was formerly here. */
redisplay_clear_region (window, findex, xpos,
@@
-439,11
+449,12
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
Lisp_Object instance;
struct display_box dbox;
struct display_glyph_area dga;
Lisp_Object instance;
struct display_box dbox;
struct display_glyph_area dga;
+
redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset,
redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset,
- start_pixpos, rb->width,
- &dbox, &dga);
+ rb->object.dglyph.yoffset, start_pixpos,
+ rb->width, &dbox, &dga);
- XSETWINDOW (window, w);
+ XSETWINDOW (window, w);
instance = glyph_image_instance (rb->object.dglyph.glyph,
window, ERROR_ME_NOT, 1);
findex = rb->findex;
instance = glyph_image_instance (rb->object.dglyph.glyph,
window, ERROR_ME_NOT, 1);
findex = rb->findex;
@@
-458,12
+469,12
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
cursor_start, cursor_width,
cursor_height, 0);
break;
cursor_start, cursor_width,
cursor_height, 0);
break;
-
+
case IMAGE_WIDGET:
if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
Qlayout))
{
case IMAGE_WIDGET:
if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
Qlayout))
{
- redisplay_output_layout (w, instance, &dbox, &dga, findex,
+ redisplay_output_layout (window, instance, &dbox, &dga, findex,
cursor_start, cursor_width,
cursor_height);
break;
cursor_start, cursor_width,
cursor_height);
break;
@@
-473,17
+484,17
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
cursor_start, cursor_width,
cursor_height);
break;
cursor_start, cursor_width,
cursor_height);
break;
-
+
case IMAGE_NOTHING:
/* nothing is as nothing does */
break;
case IMAGE_NOTHING:
/* nothing is as nothing does */
break;
-
+
case IMAGE_TEXT:
case IMAGE_POINTER:
default:
abort ();
}
case IMAGE_TEXT:
case IMAGE_POINTER:
default:
abort ();
}
- IMAGE_INSTANCE_OPTIMIZE_OUTPUT
+ IMAGE_INSTANCE_OPTIMIZE_OUTPUT
(XIMAGE_INSTANCE (instance)) = 0;
}
(XIMAGE_INSTANCE (instance)) = 0;
}
@@
-514,7
+525,7
@@
x_output_display_block (struct window *w, struct display_line *dl, int block,
/*****************************************************************************
x_bevel_area
/*****************************************************************************
x_bevel_area
- Draw a shadows for the given area in the given face.
+ Draw shadows for the given area in the given face.
****************************************************************************/
static void
x_bevel_area (struct window *w, face_index findex,
****************************************************************************/
static void
x_bevel_area (struct window *w, face_index findex,
@@
-764,7
+775,7
@@
x_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
****************************************************************************/
void
x_output_string (struct window *w, struct display_line *dl,
****************************************************************************/
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)
{
int width, face_index findex, int cursor,
int cursor_start, int cursor_width, int cursor_height)
{
@@
-971,7
+982,8
@@
x_output_string (struct window *w, struct display_line *dl,
/* We draw underlines in the same color as the text. */
if (cachel->underline)
{
/* We draw underlines in the same color as the text. */
if (cachel->underline)
{
- unsigned long upos, uthick;
+ unsigned long upos;
+ unsigned long uthick;
XFontStruct *xfont;
xfont = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font));
XFontStruct *xfont;
xfont = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font));
@@
-1706,6
+1718,7
@@
x_redraw_exposed_window (struct window *w, int x, int y, int width, int height)
f->windows_structure_changed = 1;
}
f->windows_structure_changed = 1;
}
+ redisplay_clear_top_of_window (w);
if (window_needs_vertical_divider (w))
{
x_output_vertical_divider (w, 0);
if (window_needs_vertical_divider (w))
{
x_output_vertical_divider (w, 0);
@@
-2000,7
+2013,7
@@
x_flash (struct device *d)
w->pixel_width, flash_height);
}
else
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);
XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
w->pixel_width, w->pixel_height);
@@
-2033,7
+2046,7
@@
x_flash (struct device *d)
w->pixel_width, flash_height);
}
else
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);
XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
w->pixel_width, w->pixel_height);
@@
-2064,8
+2077,8
@@
x_ring_bell (struct device *d, int volume, int pitch, int duration)
/* #### grab server? */
XGetKeyboardControl (display, &state);
/* #### grab server? */
XGetKeyboardControl (display, &state);
- ctl.bell_pitch = (pitch >= 0 ? pitch : state.bell_pitch);
- ctl.bell_duration = (duration >= 0 ? duration : state.bell_duration);
+ ctl.bell_pitch = (pitch >= 0 ? pitch : (int) state.bell_pitch);
+ ctl.bell_duration = (duration >= 0 ? duration : (int) state.bell_duration);
XChangeKeyboardControl (display, KBBellPitch|KBBellDuration, &ctl);
XBell (display, (volume * 2) - 100);
XChangeKeyboardControl (display, KBBellPitch|KBBellDuration, &ctl);
XBell (display, (volume * 2) - 100);