/[emacs]/emacs/src/xdisp.c
ViewVC logotype

Diff of /emacs/src/xdisp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.928 by kfstorm, Tue Nov 9 13:26:01 2004 UTC revision 1.929 by kfstorm, Fri Nov 12 14:27:07 2004 UTC
# Line 2075  init_iterator (it, w, charpos, bytepos, Line 2075  init_iterator (it, w, charpos, bytepos,
2075                                    * FRAME_LINE_HEIGHT (it->f));                                    * FRAME_LINE_HEIGHT (it->f));
2076        else if (it->f->extra_line_spacing > 0)        else if (it->f->extra_line_spacing > 0)
2077          it->extra_line_spacing = it->f->extra_line_spacing;          it->extra_line_spacing = it->f->extra_line_spacing;
2078          it->max_extra_line_spacing = 0;
2079      }      }
2080    
2081    /* If realized faces have been removed, e.g. because of face    /* If realized faces have been removed, e.g. because of face
# Line 6067  move_it_vertically_backward (it, dy) Line 6068  move_it_vertically_backward (it, dy)
6068  {  {
6069    int nlines, h;    int nlines, h;
6070    struct it it2, it3;    struct it it2, it3;
6071    int start_pos = IT_CHARPOS (*it);    int start_pos;
6072    
6073     move_further_back:
6074    xassert (dy >= 0);    xassert (dy >= 0);
6075    
6076      start_pos = IT_CHARPOS (*it);
6077    
6078    /* Estimate how many newlines we must move back.  */    /* Estimate how many newlines we must move back.  */
6079    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));
6080    
# Line 6136  move_it_vertically_backward (it, dy) Line 6140  move_it_vertically_backward (it, dy)
6140               a line height of 13 pixels each, recentering with point               a line height of 13 pixels each, recentering with point
6141               on the bottom line will try to move -39/2 = 19 pixels               on the bottom line will try to move -39/2 = 19 pixels
6142               backward.  Try to avoid moving into the first line.  */               backward.  Try to avoid moving into the first line.  */
6143            && it->current_y - target_y > line_height / 3 * 2            && it->current_y - target_y > line_height * 2 / 3
6144            && IT_CHARPOS (*it) > BEGV)            && IT_CHARPOS (*it) > BEGV)
6145          {          {
6146            TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",            TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",
6147                         target_y - it->current_y));                         target_y - it->current_y));
6148            move_it_vertically (it, target_y - it->current_y);            dy = it->current_y - target_y;
6149            xassert (IT_CHARPOS (*it) >= BEGV);            goto move_further_back;
6150          }          }
6151        else if (target_y >= it->current_y + line_height        else if (target_y >= it->current_y + line_height
6152                 && IT_CHARPOS (*it) < ZV)                 && IT_CHARPOS (*it) < ZV)
# Line 6183  move_it_vertically (it, dy) Line 6187  move_it_vertically (it, dy)
6187  {  {
6188    if (dy <= 0)    if (dy <= 0)
6189      move_it_vertically_backward (it, -dy);      move_it_vertically_backward (it, -dy);
6190    else if (dy > 0)    else
6191      {      {
6192        TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy));        TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy));
6193        move_it_to (it, ZV, -1, it->current_y + dy, -1,        move_it_to (it, ZV, -1, it->current_y + dy, -1,
# Line 6280  move_it_by_lines (it, dvpos, need_y_p) Line 6284  move_it_by_lines (it, dvpos, need_y_p)
6284        /* DVPOS == 0 means move to the start of the screen line.  */        /* DVPOS == 0 means move to the start of the screen line.  */
6285        move_it_vertically_backward (it, 0);        move_it_vertically_backward (it, 0);
6286        xassert (it->current_x == 0 && it->hpos == 0);        xassert (it->current_x == 0 && it->hpos == 0);
6287          /* Let next call to line_bottom_y calculate real line height */
6288          last_height = 0;
6289      }      }
6290    else if (dvpos > 0)    else if (dvpos > 0)
6291      move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);      move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
# Line 7423  resize_mini_window (w, exact_p) Line 7429  resize_mini_window (w, exact_p)
7429              height = it.current_y + last_height;              height = it.current_y + last_height;
7430            else            else
7431              height = it.current_y + it.max_ascent + it.max_descent;              height = it.current_y + it.max_ascent + it.max_descent;
7432            height -= it.extra_line_spacing;            height -= min (it.extra_line_spacing, it.max_extra_line_spacing);
7433            height = (height + unit - 1) / unit;            height = (height + unit - 1) / unit;
7434          }          }
7435    
# Line 8701  display_tool_bar_line (it) Line 8707  display_tool_bar_line (it)
8707      {      {
8708        row->height = row->phys_height = it->last_visible_y - row->y;        row->height = row->phys_height = it->last_visible_y - row->y;
8709        row->ascent = row->phys_ascent = 0;        row->ascent = row->phys_ascent = 0;
8710          row->extra_line_spacing = 0;
8711      }      }
8712    
8713    row->full_width_p = 1;    row->full_width_p = 1;
# Line 10889  make_cursor_line_fully_visible (w, force Line 10896  make_cursor_line_fully_visible (w, force
10896    row = MATRIX_ROW (matrix, w->cursor.vpos);    row = MATRIX_ROW (matrix, w->cursor.vpos);
10897    
10898    /* If the cursor row is not partially visible, there's nothing to do.  */    /* If the cursor row is not partially visible, there's nothing to do.  */
10899    if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row))    if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
10900      return 1;      return 1;
10901    
10902    /* If the row the cursor is in is taller than the window's height,    /* If the row the cursor is in is taller than the window's height,
# Line 11043  try_scrolling (window, just_this_one_p, Line 11050  try_scrolling (window, just_this_one_p,
11050      {      {
11051        start_display (&it, w, scroll_margin_pos);        start_display (&it, w, scroll_margin_pos);
11052        if (this_scroll_margin)        if (this_scroll_margin)
11053          move_it_vertically (&it, - this_scroll_margin);          move_it_vertically_backward (&it, this_scroll_margin);
11054        if (extra_scroll_margin_lines)        if (extra_scroll_margin_lines)
11055          move_it_by_lines (&it, - extra_scroll_margin_lines, 0);          move_it_by_lines (&it, - extra_scroll_margin_lines, 0);
11056        scroll_margin_pos = it.current.pos;        scroll_margin_pos = it.current.pos;
# Line 11163  try_scrolling (window, just_this_one_p, Line 11170  try_scrolling (window, just_this_one_p,
11170            if (amount_to_scroll <= 0)            if (amount_to_scroll <= 0)
11171              return SCROLLING_FAILED;              return SCROLLING_FAILED;
11172    
11173            move_it_vertically (&it, - amount_to_scroll);            move_it_vertically_backward (&it, amount_to_scroll);
11174            startp = it.current.pos;            startp = it.current.pos;
11175          }          }
11176      }      }
# Line 11467  try_cursor_movement (window, startp, scr Line 11474  try_cursor_movement (window, startp, scr
11474                /* if PT is not in the glyph row, give up.  */                /* if PT is not in the glyph row, give up.  */
11475                rc = CURSOR_MOVEMENT_MUST_SCROLL;                rc = CURSOR_MOVEMENT_MUST_SCROLL;
11476              }              }
11477            else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (row))            else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
11478              {              {
11479                if (PT == MATRIX_ROW_END_CHARPOS (row)                if (PT == MATRIX_ROW_END_CHARPOS (row)
11480                    && !row->ends_at_zv_p                    && !row->ends_at_zv_p
# Line 12042  redisplay_window (window, just_this_one_ Line 12049  redisplay_window (window, just_this_one_
12049    if (it.current_y <= 0)    if (it.current_y <= 0)
12050      {      {
12051        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
12052        move_it_vertically (&it, 0);        move_it_vertically_backward (&it, 0);
12053        xassert (IT_CHARPOS (it) <= PT);        xassert (IT_CHARPOS (it) <= PT);
12054        it.current_y = 0;        it.current_y = 0;
12055      }      }
# Line 12391  try_window_reusing_current_matrix (w) Line 12398  try_window_reusing_current_matrix (w)
12398    /* Give up if old or new display is scrolled vertically.  We could    /* Give up if old or new display is scrolled vertically.  We could
12399       make this function handle this, but right now it doesn't.  */       make this function handle this, but right now it doesn't.  */
12400    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
12401    if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row))    if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row))
12402      return 0;      return 0;
12403    
12404    /* The variable new_start now holds the new window start.  The old    /* The variable new_start now holds the new window start.  The old
# Line 12439  try_window_reusing_current_matrix (w) Line 12446  try_window_reusing_current_matrix (w)
12446                start = start_row->start.pos;                start = start_row->start.pos;
12447                /* If there are no more rows to try, or just one, give up.  */                /* If there are no more rows to try, or just one, give up.  */
12448                if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1                if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
12449                    || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)                    || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
12450                    || CHARPOS (start) == ZV)                    || CHARPOS (start) == ZV)
12451                  {                  {
12452                    clear_glyph_matrix (w->desired_matrix);                    clear_glyph_matrix (w->desired_matrix);
# Line 14233  compute_line_metrics (it) Line 14240  compute_line_metrics (it)
14240            row->height = it->max_ascent + it->max_descent;            row->height = it->max_ascent + it->max_descent;
14241            row->phys_ascent = it->max_phys_ascent;            row->phys_ascent = it->max_phys_ascent;
14242            row->phys_height = it->max_phys_ascent + it->max_phys_descent;            row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14243              row->extra_line_spacing = it->max_extra_line_spacing;
14244          }          }
14245    
14246        /* Compute the width of this line.  */        /* Compute the width of this line.  */
# Line 14276  compute_line_metrics (it) Line 14284  compute_line_metrics (it)
14284          row->pixel_width -= it->truncation_pixel_width;          row->pixel_width -= it->truncation_pixel_width;
14285        row->ascent = row->phys_ascent = 0;        row->ascent = row->phys_ascent = 0;
14286        row->height = row->phys_height = row->visible_height = 1;        row->height = row->phys_height = row->visible_height = 1;
14287          row->extra_line_spacing = 0;
14288      }      }
14289    
14290    /* Compute a hash code for this row.  */    /* Compute a hash code for this row.  */
# Line 14612  display_line (it) Line 14621  display_line (it)
14621    row->height = it->max_ascent + it->max_descent;    row->height = it->max_ascent + it->max_descent;
14622    row->phys_ascent = it->max_phys_ascent;    row->phys_ascent = it->max_phys_ascent;
14623    row->phys_height = it->max_phys_ascent + it->max_phys_descent;    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14624      row->extra_line_spacing = it->max_extra_line_spacing;
14625    
14626    /* Loop generating characters.  The loop is left with IT on the next    /* Loop generating characters.  The loop is left with IT on the next
14627       character to display.  */       character to display.  */
# Line 14677  display_line (it) Line 14687  display_line (it)
14687            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14688            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14689                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14690              row->extra_line_spacing = max (row->extra_line_spacing,
14691                                             it->max_extra_line_spacing);
14692            set_iterator_to_next (it, 1);            set_iterator_to_next (it, 1);
14693            continue;            continue;
14694          }          }
# Line 14705  display_line (it) Line 14717  display_line (it)
14717            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14718            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14719                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14720              row->extra_line_spacing = max (row->extra_line_spacing,
14721                                             it->max_extra_line_spacing);
14722            if (it->current_x - it->pixel_width < it->first_visible_x)            if (it->current_x - it->pixel_width < it->first_visible_x)
14723              row->x = x - it->first_visible_x;              row->x = x - it->first_visible_x;
14724          }          }
# Line 14856  display_line (it) Line 14870  display_line (it)
14870            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14871            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14872                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14873              row->extra_line_spacing = max (row->extra_line_spacing,
14874                                             it->max_extra_line_spacing);
14875    
14876            /* End of this display line if row is continued.  */            /* End of this display line if row is continued.  */
14877            if (row->continued_p || row->ends_at_zv_p)            if (row->continued_p || row->ends_at_zv_p)
# Line 16767  display_string (string, lisp_string, fac Line 16783  display_string (string, lisp_string, fac
16783    row->height = it->max_ascent + it->max_descent;    row->height = it->max_ascent + it->max_descent;
16784    row->phys_ascent = it->max_phys_ascent;    row->phys_ascent = it->max_phys_ascent;
16785    row->phys_height = it->max_phys_ascent + it->max_phys_descent;    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
16786      row->extra_line_spacing = it->max_extra_line_spacing;
16787    
16788    /* This condition is for the case that we are called with current_x    /* This condition is for the case that we are called with current_x
16789       past last_visible_x.  */       past last_visible_x.  */
# Line 16826  display_string (string, lisp_string, fac Line 16843  display_string (string, lisp_string, fac
16843            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
16844            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
16845                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
16846              row->extra_line_spacing = max (row->extra_line_spacing,
16847                                             it->max_extra_line_spacing);
16848            x += glyph->pixel_width;            x += glyph->pixel_width;
16849            ++i;            ++i;
16850          }          }
# Line 19448  x_produce_glyphs (it) Line 19467  x_produce_glyphs (it)
19467      it->current_x += it->pixel_width;      it->current_x += it->pixel_width;
19468    
19469    if (extra_line_spacing > 0)    if (extra_line_spacing > 0)
19470      it->descent += extra_line_spacing;      {
19471          it->descent += extra_line_spacing;
19472          if (extra_line_spacing > it->max_extra_line_spacing)
19473            it->max_extra_line_spacing = extra_line_spacing;
19474        }
19475    
19476    it->max_ascent = max (it->max_ascent, it->ascent);    it->max_ascent = max (it->max_ascent, it->ascent);
19477    it->max_descent = max (it->max_descent, it->descent);    it->max_descent = max (it->max_descent, it->descent);

Legend:
Removed from v.1.928  
changed lines
  Added in v.1.929

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26