Mercurial > hg > xemacs-beta
comparison src/redisplay.c @ 2:ac2d302a0011 r19-15b2
Import from CVS: tag r19-15b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:35 +0200 |
parents | 376386a54a3c |
children | b82b59fe008d |
comparison
equal
deleted
inserted
replaced
1:c0c6a60d29db | 2:ac2d302a0011 |
---|---|
138 any begin-glyphs and end-glyphs. */ | 138 any begin-glyphs and end-glyphs. */ |
139 struct extent_fragment *ef; | 139 struct extent_fragment *ef; |
140 face_index findex; | 140 face_index findex; |
141 | 141 |
142 /* The height of a pixmap may either be predetermined if the user | 142 /* The height of a pixmap may either be predetermined if the user |
143 has set a baseline value, or it may be depedent on whatever the | 143 has set a baseline value, or it may be dependent on whatever the |
144 line ascent and descent values end up being based just on font | 144 line ascent and descent values end up being, based just on font |
145 information. In the first case we can immediately update the | 145 information. In the first case we can immediately update the |
146 values, thus their inclusion here. In the last case we cannot | 146 values, thus their inclusion here. In the last case we cannot |
147 determine the actual contribution to the line height until we | 147 determine the actual contribution to the line height until we |
148 have finished laying out all text on the line. Thus we propagate | 148 have finished laying out all text on the line. Thus we propagate |
149 the max height of such pixmaps and do a final calculation after | 149 the max height of such pixmaps and do a final calculation after |
414 int toolbar_changed_set; | 414 int toolbar_changed_set; |
415 | 415 |
416 /* non-nil if any window has changed since the last time redisplay completed */ | 416 /* non-nil if any window has changed since the last time redisplay completed */ |
417 int windows_changed; | 417 int windows_changed; |
418 | 418 |
419 /* non-nil if any frame's window struture has changed since the last | 419 /* non-nil if any frame's window structure has changed since the last |
420 time redisplay completed */ | 420 time redisplay completed */ |
421 int windows_structure_changed; | 421 int windows_structure_changed; |
422 | 422 |
423 /* If non-nil, use vertical bar cursor. */ | 423 /* If non-nil, use vertical bar cursor. */ |
424 Lisp_Object Vbar_cursor; | 424 Lisp_Object Vbar_cursor; |
867 if (!fi->proportional_p) | 867 if (!fi->proportional_p) |
868 /* sweetness and light. */ | 868 /* sweetness and light. */ |
869 data->last_char_width = fi->width; | 869 data->last_char_width = fi->width; |
870 else | 870 else |
871 data->last_char_width = -1; | 871 data->last_char_width = -1; |
872 data->new_ascent = max (data->new_ascent, (int) fi->ascent); | 872 data->new_ascent = max (data->new_ascent, (int) fi->ascent); |
873 data->new_descent = max (data->new_descent, (int) fi->descent); | 873 data->new_descent = max (data->new_descent, (int) fi->descent); |
874 } | 874 } |
875 | 875 |
876 width = data->last_char_width; | 876 width = data->last_char_width; |
877 if (width < 0) | 877 if (width < 0) |
4033 | 4033 |
4034 return pos; | 4034 return pos; |
4035 } | 4035 } |
4036 | 4036 |
4037 /* The caller is responsible for freeing the returned string. */ | 4037 /* The caller is responsible for freeing the returned string. */ |
4038 char * | 4038 Bufbyte * |
4039 generate_formatted_string (struct window *w, Lisp_Object format_str, | 4039 generate_formatted_string (struct window *w, Lisp_Object format_str, |
4040 Lisp_Object result_str, face_index findex, int type) | 4040 Lisp_Object result_str, face_index findex, int type) |
4041 { | 4041 { |
4042 struct display_line *dl; | 4042 struct display_line *dl; |
4043 struct display_block *db; | 4043 struct display_block *db; |
4044 int elt = 0; | 4044 int elt = 0; |
4045 char *retval; | |
4046 | 4045 |
4047 dl = &formatted_string_display_line; | 4046 dl = &formatted_string_display_line; |
4048 db = get_display_block_from_line (dl, TEXT); | 4047 db = get_display_block_from_line (dl, TEXT); |
4049 Dynarr_reset (db->runes); | 4048 Dynarr_reset (db->runes); |
4050 | 4049 |
4055 while (elt < Dynarr_length (db->runes)) | 4054 while (elt < Dynarr_length (db->runes)) |
4056 { | 4055 { |
4057 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) | 4056 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) |
4058 Dynarr_add (formatted_string_emchar_dynarr, | 4057 Dynarr_add (formatted_string_emchar_dynarr, |
4059 Dynarr_atp (db->runes, elt)->object.chr.ch); | 4058 Dynarr_atp (db->runes, elt)->object.chr.ch); |
4060 | |
4061 elt++; | 4059 elt++; |
4062 } | 4060 } |
4063 | 4061 |
4064 retval = (char *) (convert_emchar_string_into_malloced_string | 4062 return |
4065 (Dynarr_atp (formatted_string_emchar_dynarr, 0), | 4063 convert_emchar_string_into_malloced_string |
4066 Dynarr_length (formatted_string_emchar_dynarr), 0)); | 4064 ( Dynarr_atp (formatted_string_emchar_dynarr, 0), |
4067 | 4065 Dynarr_length (formatted_string_emchar_dynarr), 0); |
4068 return retval; | |
4069 } | 4066 } |
4070 | 4067 |
4071 /* Update just the modeline. Assumes the desired display structs. If | 4068 /* Update just the modeline. Assumes the desired display structs. If |
4072 they do not have a modeline block, it does nothing. */ | 4069 they do not have a modeline block, it does nothing. */ |
4073 static void | 4070 static void |
4142 /* #### Kludge or not a kludge. I tend towards the former. */ | 4139 /* #### Kludge or not a kludge. I tend towards the former. */ |
4143 int | 4140 int |
4144 real_current_modeline_height (struct window *w) | 4141 real_current_modeline_height (struct window *w) |
4145 { | 4142 { |
4146 Fset_marker (w->start[CMOTION_DISP], w->start[CURRENT_DISP], w->buffer); | 4143 Fset_marker (w->start[CMOTION_DISP], w->start[CURRENT_DISP], w->buffer); |
4144 Fset_marker (w->pointm[CMOTION_DISP], w->pointm[CURRENT_DISP], w->buffer); | |
4147 | 4145 |
4148 if (ensure_modeline_generated (w, CMOTION_DISP)) | 4146 if (ensure_modeline_generated (w, CMOTION_DISP)) |
4149 { | 4147 { |
4150 display_line_dynarr *dla; | 4148 display_line_dynarr *dla; |
4151 | 4149 |