Mercurial > hg > xemacs-beta
comparison src/redisplay.c @ 434:9d177e8d4150 r21-2-25
Import from CVS: tag r21-2-25
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:30:53 +0200 |
parents | a5df635868b2 |
children | 84b14dcb0985 |
comparison
equal
deleted
inserted
replaced
433:892ca416f0fb | 434:9d177e8d4150 |
---|---|
154 (those off the left side of the screen) need | 154 (those off the left side of the screen) need |
155 to be skipped before anything is displayed. */ | 155 to be skipped before anything is displayed. */ |
156 Bytind bi_start_col_enabled; | 156 Bytind bi_start_col_enabled; |
157 int start_col_xoffset; /* Number of pixels that still need to | 157 int start_col_xoffset; /* Number of pixels that still need to |
158 be skipped. This is used for | 158 be skipped. This is used for |
159 horizontal scrolling of glyphs, where we want | 159 horizontal scrolling of glyphs, where we want |
160 to be able to scroll over part of the glyph. */ | 160 to be able to scroll over part of the glyph. */ |
161 | 161 |
162 int hscroll_glyph_width_adjust; /* how much the width of the hscroll | 162 int hscroll_glyph_width_adjust; /* how much the width of the hscroll |
163 glyph differs from space_width (w). | 163 glyph differs from space_width (w). |
164 0 if no hscroll glyph was used, | 164 0 if no hscroll glyph was used, |
1813 only lines that start with less than selective_display columns of | 1813 only lines that start with less than selective_display columns of |
1814 space will be displayed. If selective_display is t then all text | 1814 space will be displayed. If selective_display is t then all text |
1815 after a ^M is invisible. */ | 1815 after a ^M is invisible. */ |
1816 int selective = (INTP (b->selective_display) | 1816 int selective = (INTP (b->selective_display) |
1817 ? XINT (b->selective_display) | 1817 ? XINT (b->selective_display) |
1818 : ((!NILP (b->selective_display) ? -1 : 0))); | 1818 : (!NILP (b->selective_display) ? -1 : 0)); |
1819 | 1819 |
1820 /* The variable ctl-arrow allows the user to specify what characters | 1820 /* The variable ctl-arrow allows the user to specify what characters |
1821 can actually be displayed and which octal should be used for. | 1821 can actually be displayed and which octal should be used for. |
1822 #### This variable should probably have some rethought done to | 1822 #### This variable should probably have some rethought done to |
1823 it. | 1823 it. |
2286 int next_tab_start; | 2286 int next_tab_start; |
2287 int char_tab_width; | 2287 int char_tab_width; |
2288 int prop_width = 0; | 2288 int prop_width = 0; |
2289 | 2289 |
2290 if (data.start_col > 1) | 2290 if (data.start_col > 1) |
2291 tab_start_pixpos -= (space_width (w) * (data.start_col - 1)) | 2291 tab_start_pixpos -= (space_width (w) * (data.start_col - 1)) |
2292 + data.start_col_xoffset; | 2292 + data.start_col_xoffset; |
2293 | 2293 |
2294 next_tab_start = | 2294 next_tab_start = |
2295 next_tab_position (w, tab_start_pixpos, | 2295 next_tab_position (w, tab_start_pixpos, |
2296 dl->bounds.left_in + | 2296 dl->bounds.left_in + |
4339 dl->left_margin_findex = default_face; | 4339 dl->left_margin_findex = default_face; |
4340 dl->right_margin_findex = default_face; | 4340 dl->right_margin_findex = default_face; |
4341 } | 4341 } |
4342 else | 4342 else |
4343 { | 4343 { |
4344 dl->left_margin_findex = | 4344 dl->left_margin_findex = |
4345 get_builtin_face_cache_index (w, Vleft_margin_face); | 4345 get_builtin_face_cache_index (w, Vleft_margin_face); |
4346 dl->right_margin_findex = | 4346 dl->right_margin_findex = |
4347 get_builtin_face_cache_index (w, Vright_margin_face); | 4347 get_builtin_face_cache_index (w, Vright_margin_face); |
4348 } | 4348 } |
4349 | 4349 |
4350 xzero (data); | 4350 xzero (data); |
4351 data.ef = extent_fragment_new (disp_string, f); | 4351 data.ef = extent_fragment_new (disp_string, f); |
4378 data.cursor_type = NO_CURSOR; | 4378 data.cursor_type = NO_CURSOR; |
4379 data.cursor_x = -1; | 4379 data.cursor_x = -1; |
4380 | 4380 |
4381 data.start_col = 0; | 4381 data.start_col = 0; |
4382 /* I don't think we want this, string areas should not scroll with | 4382 /* I don't think we want this, string areas should not scroll with |
4383 the window | 4383 the window |
4384 data.start_col = w->hscroll; | 4384 data.start_col = w->hscroll; |
4385 data.bi_start_col_enabled = (w->hscroll ? bi_start_pos : 0); | 4385 data.bi_start_col_enabled = (w->hscroll ? bi_start_pos : 0); |
4386 */ | 4386 */ |
4387 data.bi_start_col_enabled = 0; | 4387 data.bi_start_col_enabled = 0; |
4388 data.hscroll_glyph_width_adjust = 0; | 4388 data.hscroll_glyph_width_adjust = 0; |
4847 if (data.bi_bufpos > bi_string_zv) | 4847 if (data.bi_bufpos > bi_string_zv) |
4848 dl->end_bufpos = buffer_or_string_bytind_to_bufpos (disp_string, bi_string_zv); | 4848 dl->end_bufpos = buffer_or_string_bytind_to_bufpos (disp_string, bi_string_zv); |
4849 else | 4849 else |
4850 dl->end_bufpos = buffer_or_string_bytind_to_bufpos (disp_string, data.bi_bufpos) - 1; | 4850 dl->end_bufpos = buffer_or_string_bytind_to_bufpos (disp_string, data.bi_bufpos) - 1; |
4851 if (truncate_win) | 4851 if (truncate_win) |
4852 data.dl->num_chars = | 4852 data.dl->num_chars = |
4853 string_column_at_point (s, dl->end_bufpos, b ? XINT (b->tab_width) : 8); | 4853 string_column_at_point (s, dl->end_bufpos, b ? XINT (b->tab_width) : 8); |
4854 else | 4854 else |
4855 /* This doesn't correctly take into account tabs and control | 4855 /* This doesn't correctly take into account tabs and control |
4856 characters but if the window isn't being truncated then this | 4856 characters but if the window isn't being truncated then this |
4857 value isn't going to end up being used anyhow. */ | 4857 value isn't going to end up being used anyhow. */ |
4887 /* Given a display line and a starting position, ensure that the | 4887 /* Given a display line and a starting position, ensure that the |
4888 contents of the display line accurately represent the visual | 4888 contents of the display line accurately represent the visual |
4889 representation of the buffer contents starting from the given | 4889 representation of the buffer contents starting from the given |
4890 position when displayed in the given window. The display line ends | 4890 position when displayed in the given window. The display line ends |
4891 when the contents of the line reach the right boundary of the given | 4891 when the contents of the line reach the right boundary of the given |
4892 window. | 4892 window. |
4893 | 4893 |
4894 This is very similar to generate_display_line but with the same | 4894 This is very similar to generate_display_line but with the same |
4895 limitations as create_string_text_block. I have taken the liberty | 4895 limitations as create_string_text_block. I have taken the liberty |
4896 of fixing the bytind stuff though.*/ | 4896 of fixing the bytind stuff though.*/ |
4897 | 4897 |
4898 static Bufpos | 4898 static Bufpos |
4903 face_index default_face) | 4903 face_index default_face) |
4904 { | 4904 { |
4905 Bufpos ret_bufpos; | 4905 Bufpos ret_bufpos; |
4906 | 4906 |
4907 /* you must set bounds before calling this. */ | 4907 /* you must set bounds before calling this. */ |
4908 | 4908 |
4909 /* Reset what this line is using. */ | 4909 /* Reset what this line is using. */ |
4910 if (dl->display_blocks) | 4910 if (dl->display_blocks) |
4911 Dynarr_reset (dl->display_blocks); | 4911 Dynarr_reset (dl->display_blocks); |
4912 if (dl->left_glyphs) | 4912 if (dl->left_glyphs) |
4913 { | 4913 { |
5149 dlp->ypos = (ypos + dlp->ascent) - yclip; | 5149 dlp->ypos = (ypos + dlp->ascent) - yclip; |
5150 ypos = dlp->ypos + dlp->descent; | 5150 ypos = dlp->ypos + dlp->descent; |
5151 | 5151 |
5152 /* See if we've been asked to start midway through a line, for | 5152 /* See if we've been asked to start midway through a line, for |
5153 partial display line scrolling. */ | 5153 partial display line scrolling. */ |
5154 if (yclip) | 5154 if (yclip) |
5155 { | 5155 { |
5156 dlp->top_clip = yclip; | 5156 dlp->top_clip = yclip; |
5157 yclip = 0; | 5157 yclip = 0; |
5158 } | 5158 } |
5159 else | 5159 else |
6309 like the clicked state of button. We have to do this before | 6309 like the clicked state of button. We have to do this before |
6310 redisplaying the gutters as subwindows get unmapped in the | 6310 redisplaying the gutters as subwindows get unmapped in the |
6311 process.*/ | 6311 process.*/ |
6312 if (!Dynarr_length (f->subwindow_cachels) | 6312 if (!Dynarr_length (f->subwindow_cachels) |
6313 || f->subwindows_changed | 6313 || f->subwindows_changed |
6314 || f->faces_changed | |
6314 || f->frame_changed) | 6315 || f->frame_changed) |
6315 { | 6316 { |
6316 reset_subwindow_cachels (f); | 6317 reset_subwindow_cachels (f); |
6317 /* we have to do this so the gutter gets regenerated. */ | 6318 /* we have to do this so the gutter gets regenerated. */ |
6318 reset_gutter_display_lines (f); | 6319 reset_gutter_display_lines (f); |
7134 if (dl->modeline) | 7135 if (dl->modeline) |
7135 continue; | 7136 continue; |
7136 else | 7137 else |
7137 { | 7138 { |
7138 struct line_start_cache lsc; | 7139 struct line_start_cache lsc; |
7139 | 7140 |
7140 lsc.start = dl->bufpos; | 7141 lsc.start = dl->bufpos; |
7141 lsc.end = dl->end_bufpos; | 7142 lsc.end = dl->end_bufpos; |
7142 lsc.height = dl->ascent + dl->descent; | 7143 lsc.height = dl->ascent + dl->descent; |
7143 | 7144 |
7144 Dynarr_add (internal_cache, lsc); | 7145 Dynarr_add (internal_cache, lsc); |
7655 | 7656 |
7656 cur_elt = point_in_line_start_cache (w, cur_pos, 2) - 1; | 7657 cur_elt = point_in_line_start_cache (w, cur_pos, 2) - 1; |
7657 assert (cur_elt >= -1); | 7658 assert (cur_elt >= -1); |
7658 /* This used to be cur_elt>=0 under the assumption that if | 7659 /* This used to be cur_elt>=0 under the assumption that if |
7659 point is in the top line and not at BUF_BEGV, then | 7660 point is in the top line and not at BUF_BEGV, then |
7660 setting the window_start to a newline before the start of | 7661 setting the window_start to a newline before the start of |
7661 the first line will always cause scrolling. | 7662 the first line will always cause scrolling. |
7662 | 7663 |
7663 However in my (jv) opinion this is wrong. That new line | 7664 However in my (jv) opinion this is wrong. That new line |
7664 can be hidden in various ways: invisible extents, an | 7665 can be hidden in various ways: invisible extents, an |
7665 explicit window-start not at a newline character etc. | 7666 explicit window-start not at a newline character etc. |
7666 The existence of those are indeed known to create crashes | 7667 The existence of those are indeed known to create crashes |
7667 on that assert. So we have no option but to continue the | 7668 on that assert. So we have no option but to continue the |
7668 search if we found point at the top of the line_start_cache | 7669 search if we found point at the top of the line_start_cache |
7669 again. */ | 7670 again. */ |
7670 cur_pos = Dynarr_atp (w->line_start_cache,0)->start; | 7671 cur_pos = Dynarr_atp (w->line_start_cache,0)->start; |
7671 } | 7672 } |
7672 prev_pos = cur_pos; | 7673 prev_pos = cur_pos; |
7673 } | 7674 } |
7674 } | 7675 } |
7675 | 7676 |