X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fredisplay.c;h=8c2a78c76c1dd92ee2d2b87fedd79ec15b0cd296;hb=ac155f65fdad732a944b5217c90d8340818e0c0a;hp=6604dd2032d269647e1e6ebe8be737a58e166117;hpb=59eec5f21669e81977b5b1fe9bf717cab49cf7fb;p=chise%2Fxemacs-chise.git- diff --git a/src/redisplay.c b/src/redisplay.c index 6604dd2..8c2a78c 100644 --- a/src/redisplay.c +++ b/src/redisplay.c @@ -300,7 +300,7 @@ static Bytecount_dynarr *formatted_string_extent_end_dynarr; /* #### probably temporary */ -int cache_adjustment; +Fixnum cache_adjustment; /* This holds a string representing the text corresponding to a single modeline % spec. */ @@ -315,10 +315,10 @@ int disable_preemption; /* Used for debugging redisplay and for static int preemption_count; /* Minimum pixel height of clipped bottom display line. */ -int vertical_clip; +Fixnum vertical_clip; /* Minimum visible pixel width of clipped glyphs at right margin. */ -int horizontal_clip; +Fixnum horizontal_clip; /* Nonzero means reading single-character input with prompt so put cursor on minibuffer after the prompt. */ @@ -425,10 +425,10 @@ Lisp_Object Vglobal_mode_string; /* The number of lines scroll a window by when point leaves the window; if it is <=0 then point is centered in the window */ -int scroll_step; +Fixnum scroll_step; /* Scroll up to this many lines, to bring point back on screen. */ -int scroll_conservatively; +Fixnum scroll_conservatively; /* Marker for where to display an arrow on top of the buffer text. */ Lisp_Object Voverlay_arrow_position; @@ -451,7 +451,8 @@ Lisp_Object Vpre_redisplay_hook, Vpost_redisplay_hook; Lisp_Object Qpre_redisplay_hook, Qpost_redisplay_hook; #endif /* INHIBIT_REDISPLAY_HOOKS */ -static int last_display_warning_tick, display_warning_tick; +static Fixnum last_display_warning_tick; +static Fixnum display_warning_tick; Lisp_Object Qdisplay_warning_buffer; int inhibit_warning_display; @@ -464,8 +465,7 @@ int column_number_start_at_one; Lisp_Object Qtop_bottom; -#define WINDOW_SCROLLED(w) \ -(w->hscroll > 0 || w->left_xoffset) +#define WINDOW_SCROLLED(w) ((w)->hscroll > 0 || (w)->left_xoffset) /***************************************************************************/ @@ -475,13 +475,13 @@ Lisp_Object Qtop_bottom; /***************************************************************************/ static int -redisplay_text_width_emchar_string (struct window *w, int findex, - Emchar *str, Charcount len) +redisplay_text_width_charc_string (struct window *w, int findex, + Charc *str, Charcount len) { - unsigned char charsets[NUM_LEADING_BYTES]; + Charset_ID charsets[NUM_LEADING_BYTES]; Lisp_Object window; - find_charsets_in_emchar_string (charsets, str, len); + find_charsets_in_charc_string (charsets, str, len); XSETWINDOW (window, w); ensure_face_cachel_complete (WINDOW_FACE_CACHEL (w, findex), window, charsets); @@ -490,24 +490,24 @@ redisplay_text_width_emchar_string (struct window *w, int findex, WINDOW_FACE_CACHEL (w, findex), str, len)); } -static Emchar_dynarr *rtw_emchar_dynarr; +static Charc_dynarr *rtw_charc_dynarr; int redisplay_text_width_string (struct window *w, int findex, Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount len) { - if (!rtw_emchar_dynarr) - rtw_emchar_dynarr = Dynarr_new (Emchar); - Dynarr_reset (rtw_emchar_dynarr); + if (!rtw_charc_dynarr) + rtw_charc_dynarr = Dynarr_new (Charc); + Dynarr_reset (rtw_charc_dynarr); fixup_internal_substring (nonreloc, reloc, offset, &len); if (STRINGP (reloc)) nonreloc = XSTRING_DATA (reloc); - convert_bufbyte_string_into_emchar_dynarr (nonreloc, len, rtw_emchar_dynarr); - return redisplay_text_width_emchar_string - (w, findex, Dynarr_atp (rtw_emchar_dynarr, 0), - Dynarr_length (rtw_emchar_dynarr)); + convert_bufbyte_string_into_charc_dynarr (nonreloc, len, rtw_charc_dynarr); + return redisplay_text_width_charc_string + (w, findex, Dynarr_atp (rtw_charc_dynarr, 0), + Dynarr_length (rtw_charc_dynarr)); } int @@ -515,26 +515,26 @@ redisplay_frame_text_width_string (struct frame *f, Lisp_Object face, Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount len) { - unsigned char charsets[NUM_LEADING_BYTES]; + Charset_ID charsets[NUM_LEADING_BYTES]; Lisp_Object frame; struct face_cachel cachel; - if (!rtw_emchar_dynarr) - rtw_emchar_dynarr = Dynarr_new (Emchar); - Dynarr_reset (rtw_emchar_dynarr); + if (!rtw_charc_dynarr) + rtw_charc_dynarr = Dynarr_new (Charc); + Dynarr_reset (rtw_charc_dynarr); fixup_internal_substring (nonreloc, reloc, offset, &len); if (STRINGP (reloc)) nonreloc = XSTRING_DATA (reloc); - convert_bufbyte_string_into_emchar_dynarr (nonreloc, len, rtw_emchar_dynarr); + convert_bufbyte_string_into_charc_dynarr (nonreloc, len, rtw_charc_dynarr); find_charsets_in_bufbyte_string (charsets, nonreloc, len); reset_face_cachel (&cachel); cachel.face = face; XSETFRAME (frame, f); ensure_face_cachel_complete (&cachel, frame, charsets); return DEVMETH (XDEVICE (FRAME_DEVICE (f)), - text_width, (f, &cachel, Dynarr_atp (rtw_emchar_dynarr, 0), - Dynarr_length (rtw_emchar_dynarr))); + text_width, (f, &cachel, Dynarr_atp (rtw_charc_dynarr, 0), + Dynarr_length (rtw_charc_dynarr))); } /* Return the display block from DL of the given TYPE. A display line @@ -820,6 +820,7 @@ add_emchar_rune (pos_data *data) { struct rune rb, *crb; int width, local; + Charc char_glyph; if (data->start_col) { @@ -836,13 +837,17 @@ add_emchar_rune (pos_data *data) if (data->ch == '\n') { + char_glyph = ASCII_TO_CHARC ('\n'); data->font_is_bogus = 0; /* Cheesy end-of-line pseudo-character. */ width = data->blank_width; } else { - Lisp_Object charset = CHAR_CHARSET (data->ch); + Lisp_Object charset; + + char_glyph = CHAR_TO_CHARC (data->ch); + charset = CHARC_CHARSET (char_glyph); if (!EQ (charset, data->last_charset) || data->findex != data->last_findex) { @@ -878,9 +883,9 @@ add_emchar_rune (pos_data *data) if (width < 0) { /* bummer. Proportional fonts. */ - width = redisplay_text_width_emchar_string (XWINDOW (data->window), - data->findex, - &data->ch, 1); + width = redisplay_text_width_charc_string (XWINDOW (data->window), + data->findex, + &char_glyph, 1); } } @@ -911,7 +916,8 @@ add_emchar_rune (pos_data *data) data->bi_bufpos); else crb->bufpos = - bytecount_to_charcount (XSTRING_DATA (data->string), data->bi_bufpos); + bytecount_to_charcount (XSTRING_DATA (data->string), + data->bi_bufpos); } else if (data->is_modeline) crb->bufpos = data->modeline_charpos; @@ -919,7 +925,9 @@ add_emchar_rune (pos_data *data) /* Text but not in buffer */ crb->bufpos = 0; crb->type = RUNE_CHAR; - crb->object.chr.ch = data->font_is_bogus ? '~' : data->ch; + crb->object.cglyph = data->font_is_bogus + ? ASCII_TO_CHARC ('~') + : char_glyph; crb->endpos = 0; if (data->cursor_type == CURSOR_ON) @@ -2531,7 +2539,7 @@ done: { struct rune *rb = Dynarr_atp (db->runes, elt); - if ((rb->type == RUNE_CHAR && rb->object.chr.ch == ' ') + if ((rb->type == RUNE_CHAR && CHARC_ASCII_EQ (rb->object.cglyph, ' ')) || rb->type == RUNE_BLANK) { dl->bounds.left_white += rb->width; @@ -2551,8 +2559,7 @@ done: { struct rune *rb = Dynarr_atp (db->runes, elt); - if (!(rb->type == RUNE_CHAR && rb->object.chr.ch < 0x100 - && isspace (rb->object.chr.ch)) + if (!(rb->type == RUNE_CHAR && CHARC_IS_SPACE (rb->object.cglyph)) && !rb->type == RUNE_BLANK) { dl->bounds.right_white = rb->xpos + rb->width; @@ -3550,8 +3557,9 @@ generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) { len += (set_charptr_emchar - (strdata + len, Dynarr_atp (db->runes, - elt)->object.chr.ch)); + (strdata + len, + CHARC_TO_CHAR (Dynarr_atp (db->runes, + elt)->object.cglyph))); } } @@ -4780,7 +4788,7 @@ done: { struct rune *rb = Dynarr_atp (db->runes, elt); - if ((rb->type == RUNE_CHAR && rb->object.chr.ch == ' ') + if ((rb->type == RUNE_CHAR && CHARC_ASCII_EQ (rb->object.cglyph, ' ')) || rb->type == RUNE_BLANK) { dl->bounds.left_white += rb->width; @@ -4800,8 +4808,7 @@ done: { struct rune *rb = Dynarr_atp (db->runes, elt); - if (!(rb->type == RUNE_CHAR && rb->object.chr.ch < 0x100 - && isspace (rb->object.chr.ch)) + if (!(rb->type == RUNE_CHAR && CHARC_IS_SPACE (rb->object.cglyph)) && !rb->type == RUNE_BLANK) { dl->bounds.right_white = rb->xpos + rb->width; @@ -8705,7 +8712,7 @@ pixel_to_glyph_translation (struct frame *f, int x_coord, int y_coord, } else if (past_end || (rb->type == RUNE_CHAR - && rb->object.chr.ch == '\n')) + && CHARC_ASCII_EQ (rb->object.cglyph, '\n'))) { (*row)--; /* At this point we may have glyphs in the right @@ -9286,7 +9293,7 @@ See also `overlay-arrow-string'. DEFVAR_LISP_MAGIC ("overlay-arrow-string", &Voverlay_arrow_string /* String or glyph to display as an arrow. See also `overlay-arrow-position'. -(Note that despite the name of this variable, it can be set to a glyph as +\(Note that despite the name of this variable, it can be set to a glyph as well as a string.) */ , redisplay_variable_changed); @@ -9367,7 +9374,7 @@ Non-nil means put cursor in minibuffer, at end of any message there. maybe a caret cursor, etc. */ DEFVAR_LISP ("bar-cursor", &Vbar_cursor /* -Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2. +*Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2. */ ); Vbar_cursor = Qnil; @@ -9451,7 +9458,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, left_margin_width), some_window_value_changed, offsetof (struct frame, left_margin_width), - margin_width_changed_in_frame); + margin_width_changed_in_frame, 0); DEFVAR_SPECIFIER ("right-margin-width", &Vright_margin_width /* *Width of right margin. @@ -9463,7 +9470,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, right_margin_width), some_window_value_changed, offsetof (struct frame, right_margin_width), - margin_width_changed_in_frame); + margin_width_changed_in_frame, 0); DEFVAR_SPECIFIER ("minimum-line-ascent", &Vminimum_line_ascent /* *Minimum ascent height of lines. @@ -9474,7 +9481,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vminimum_line_ascent, offsetof (struct window, minimum_line_ascent), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("minimum-line-descent", &Vminimum_line_descent /* *Minimum descent height of lines. @@ -9485,7 +9492,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vminimum_line_descent, offsetof (struct window, minimum_line_descent), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("use-left-overflow", &Vuse_left_overflow /* *Non-nil means use the left outside margin as extra whitespace when @@ -9497,7 +9504,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vuse_left_overflow, offsetof (struct window, use_left_overflow), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("use-right-overflow", &Vuse_right_overflow /* *Non-nil means use the right outside margin as extra whitespace when @@ -9509,7 +9516,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vuse_right_overflow, offsetof (struct window, use_right_overflow), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("text-cursor-visible-p", &Vtext_cursor_visible_p /* *Non-nil means the text cursor is visible (this is usually the case). @@ -9520,6 +9527,6 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vtext_cursor_visible_p, offsetof (struct window, text_cursor_visible_p), text_cursor_visible_p_changed, - 0, 0); + 0, 0, 0); }