diff options
author | Glenn Morris <[email protected]> | 2011-05-24 20:45:04 -0700 |
---|---|---|
committer | Glenn Morris <[email protected]> | 2011-05-24 20:45:04 -0700 |
commit | b9345dfd4b5479ec624f1870723a8ea5c9c719e7 (patch) | |
tree | ffe98c92f47b03463683ce41a1046d7dda5b13ca /src/fringe.c | |
parent | e949074338d3f5ccc7475721c7421eef6aea68d4 (diff) | |
parent | e61124cd850ad6e0fc511dc995031db77b3535cd (diff) |
Merge from emacs-23; up to 2010-06-12T08:59:37Z!albinus@detlef.
Diffstat (limited to 'src/fringe.c')
-rw-r--r-- | src/fringe.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/fringe.c b/src/fringe.c index f2d61225be..75c65bbcd8 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -521,6 +521,20 @@ get_fringe_bitmap_name (int bn) return num; } +/* Get fringe bitmap data for bitmap number BN. */ + +static struct fringe_bitmap * +get_fringe_bitmap_data (int bn) +{ + struct fringe_bitmap *fb; + + fb = fringe_bitmaps[bn]; + if (fb == NULL) + fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS + ? bn : UNDEF_FRINGE_BITMAP]; + + return fb; +} /* Draw the bitmap WHICH in one of the left or right fringes of window W. ROW is the glyph row for which to display the bitmap; it @@ -568,10 +582,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o face_id = FRINGE_FACE_ID; } - fb = fringe_bitmaps[which]; - if (fb == NULL) - fb = &standard_bitmaps[which < MAX_STANDARD_FRINGE_BITMAPS - ? which : UNDEF_FRINGE_BITMAP]; + fb = get_fringe_bitmap_data (which); period = fb->period; @@ -1041,12 +1052,8 @@ update_window_fringes (struct window *w, int keep_current_p) if (bn != NO_FRINGE_BITMAP) { - struct fringe_bitmap *fb; + struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); - fb = fringe_bitmaps[bn]; - if (fb == NULL) - fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS - ? bn : UNDEF_FRINGE_BITMAP]; if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) { struct glyph_row *row1; @@ -1100,12 +1107,8 @@ update_window_fringes (struct window *w, int keep_current_p) if (bn != NO_FRINGE_BITMAP) { - struct fringe_bitmap *fb; + struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); - fb = fringe_bitmaps[bn]; - if (fb == NULL) - fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS - ? bn : UNDEF_FRINGE_BITMAP]; if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) { struct glyph_row *row1; @@ -1141,6 +1144,7 @@ update_window_fringes (struct window *w, int keep_current_p) int left, right; unsigned left_face_id, right_face_id; int left_offset, right_offset; + int periodic_p; row = w->desired_matrix->rows + rn; cur = w->current_matrix->rows + rn; @@ -1149,6 +1153,7 @@ update_window_fringes (struct window *w, int keep_current_p) left_face_id = right_face_id = DEFAULT_FACE_ID; left_offset = right_offset = 0; + periodic_p = 0; /* Decide which bitmap to draw in the left fringe. */ if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) @@ -1240,6 +1245,9 @@ update_window_fringes (struct window *w, int keep_current_p) else right = NO_FRINGE_BITMAP; + periodic_p = (get_fringe_bitmap_data (left)->period != 0 + || get_fringe_bitmap_data (right)->period != 0); + if (row->y != cur->y || row->visible_height != cur->visible_height || row->ends_at_zv_p != cur->ends_at_zv_p @@ -1249,6 +1257,7 @@ update_window_fringes (struct window *w, int keep_current_p) || right_face_id != cur->right_fringe_face_id || left_offset != cur->left_fringe_offset || right_offset != cur->right_fringe_offset + || periodic_p != cur->fringe_bitmap_periodic_p || cur->redraw_fringe_bitmaps_p) { redraw_p = row->redraw_fringe_bitmaps_p = 1; @@ -1261,6 +1270,7 @@ update_window_fringes (struct window *w, int keep_current_p) cur->right_fringe_face_id = right_face_id; cur->left_fringe_offset = left_offset; cur->right_fringe_offset = right_offset; + cur->fringe_bitmap_periodic_p = periodic_p; } } @@ -1279,6 +1289,7 @@ update_window_fringes (struct window *w, int keep_current_p) row->right_fringe_face_id = right_face_id; row->left_fringe_offset = left_offset; row->right_fringe_offset = right_offset; + row->fringe_bitmap_periodic_p = periodic_p; } return redraw_p && !keep_current_p; |