diff options
| author | Glenn Morris | 2011-05-24 20:45:04 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-05-24 20:45:04 -0700 |
| commit | b9345dfd4b5479ec624f1870723a8ea5c9c719e7 (patch) | |
| tree | ffe98c92f47b03463683ce41a1046d7dda5b13ca /src/fringe.c | |
| parent | e949074338d3f5ccc7475721c7421eef6aea68d4 (diff) | |
| parent | e61124cd850ad6e0fc511dc995031db77b3535cd (diff) | |
| download | emacs-b9345dfd4b5479ec624f1870723a8ea5c9c719e7.tar.gz emacs-b9345dfd4b5479ec624f1870723a8ea5c9c719e7.zip | |
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 f2d61225be7..75c65bbcd87 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -521,6 +521,20 @@ get_fringe_bitmap_name (int bn) | |||
| 521 | return num; | 521 | return num; |
| 522 | } | 522 | } |
| 523 | 523 | ||
| 524 | /* Get fringe bitmap data for bitmap number BN. */ | ||
| 525 | |||
| 526 | static struct fringe_bitmap * | ||
| 527 | get_fringe_bitmap_data (int bn) | ||
| 528 | { | ||
| 529 | struct fringe_bitmap *fb; | ||
| 530 | |||
| 531 | fb = fringe_bitmaps[bn]; | ||
| 532 | if (fb == NULL) | ||
| 533 | fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | ||
| 534 | ? bn : UNDEF_FRINGE_BITMAP]; | ||
| 535 | |||
| 536 | return fb; | ||
| 537 | } | ||
| 524 | 538 | ||
| 525 | /* Draw the bitmap WHICH in one of the left or right fringes of | 539 | /* Draw the bitmap WHICH in one of the left or right fringes of |
| 526 | window W. ROW is the glyph row for which to display the bitmap; it | 540 | 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 | |||
| 568 | face_id = FRINGE_FACE_ID; | 582 | face_id = FRINGE_FACE_ID; |
| 569 | } | 583 | } |
| 570 | 584 | ||
| 571 | fb = fringe_bitmaps[which]; | 585 | fb = get_fringe_bitmap_data (which); |
| 572 | if (fb == NULL) | ||
| 573 | fb = &standard_bitmaps[which < MAX_STANDARD_FRINGE_BITMAPS | ||
| 574 | ? which : UNDEF_FRINGE_BITMAP]; | ||
| 575 | 586 | ||
| 576 | period = fb->period; | 587 | period = fb->period; |
| 577 | 588 | ||
| @@ -1041,12 +1052,8 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1041 | 1052 | ||
| 1042 | if (bn != NO_FRINGE_BITMAP) | 1053 | if (bn != NO_FRINGE_BITMAP) |
| 1043 | { | 1054 | { |
| 1044 | struct fringe_bitmap *fb; | 1055 | struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); |
| 1045 | 1056 | ||
| 1046 | fb = fringe_bitmaps[bn]; | ||
| 1047 | if (fb == NULL) | ||
| 1048 | fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | ||
| 1049 | ? bn : UNDEF_FRINGE_BITMAP]; | ||
| 1050 | if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) | 1057 | if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) |
| 1051 | { | 1058 | { |
| 1052 | struct glyph_row *row1; | 1059 | struct glyph_row *row1; |
| @@ -1100,12 +1107,8 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1100 | 1107 | ||
| 1101 | if (bn != NO_FRINGE_BITMAP) | 1108 | if (bn != NO_FRINGE_BITMAP) |
| 1102 | { | 1109 | { |
| 1103 | struct fringe_bitmap *fb; | 1110 | struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); |
| 1104 | 1111 | ||
| 1105 | fb = fringe_bitmaps[bn]; | ||
| 1106 | if (fb == NULL) | ||
| 1107 | fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | ||
| 1108 | ? bn : UNDEF_FRINGE_BITMAP]; | ||
| 1109 | if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) | 1112 | if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) |
| 1110 | { | 1113 | { |
| 1111 | struct glyph_row *row1; | 1114 | struct glyph_row *row1; |
| @@ -1141,6 +1144,7 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1141 | int left, right; | 1144 | int left, right; |
| 1142 | unsigned left_face_id, right_face_id; | 1145 | unsigned left_face_id, right_face_id; |
| 1143 | int left_offset, right_offset; | 1146 | int left_offset, right_offset; |
| 1147 | int periodic_p; | ||
| 1144 | 1148 | ||
| 1145 | row = w->desired_matrix->rows + rn; | 1149 | row = w->desired_matrix->rows + rn; |
| 1146 | cur = w->current_matrix->rows + rn; | 1150 | cur = w->current_matrix->rows + rn; |
| @@ -1149,6 +1153,7 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1149 | 1153 | ||
| 1150 | left_face_id = right_face_id = DEFAULT_FACE_ID; | 1154 | left_face_id = right_face_id = DEFAULT_FACE_ID; |
| 1151 | left_offset = right_offset = 0; | 1155 | left_offset = right_offset = 0; |
| 1156 | periodic_p = 0; | ||
| 1152 | 1157 | ||
| 1153 | /* Decide which bitmap to draw in the left fringe. */ | 1158 | /* Decide which bitmap to draw in the left fringe. */ |
| 1154 | if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) | 1159 | if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) |
| @@ -1240,6 +1245,9 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1240 | else | 1245 | else |
| 1241 | right = NO_FRINGE_BITMAP; | 1246 | right = NO_FRINGE_BITMAP; |
| 1242 | 1247 | ||
| 1248 | periodic_p = (get_fringe_bitmap_data (left)->period != 0 | ||
| 1249 | || get_fringe_bitmap_data (right)->period != 0); | ||
| 1250 | |||
| 1243 | if (row->y != cur->y | 1251 | if (row->y != cur->y |
| 1244 | || row->visible_height != cur->visible_height | 1252 | || row->visible_height != cur->visible_height |
| 1245 | || row->ends_at_zv_p != cur->ends_at_zv_p | 1253 | || row->ends_at_zv_p != cur->ends_at_zv_p |
| @@ -1249,6 +1257,7 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1249 | || right_face_id != cur->right_fringe_face_id | 1257 | || right_face_id != cur->right_fringe_face_id |
| 1250 | || left_offset != cur->left_fringe_offset | 1258 | || left_offset != cur->left_fringe_offset |
| 1251 | || right_offset != cur->right_fringe_offset | 1259 | || right_offset != cur->right_fringe_offset |
| 1260 | || periodic_p != cur->fringe_bitmap_periodic_p | ||
| 1252 | || cur->redraw_fringe_bitmaps_p) | 1261 | || cur->redraw_fringe_bitmaps_p) |
| 1253 | { | 1262 | { |
| 1254 | redraw_p = row->redraw_fringe_bitmaps_p = 1; | 1263 | redraw_p = row->redraw_fringe_bitmaps_p = 1; |
| @@ -1261,6 +1270,7 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1261 | cur->right_fringe_face_id = right_face_id; | 1270 | cur->right_fringe_face_id = right_face_id; |
| 1262 | cur->left_fringe_offset = left_offset; | 1271 | cur->left_fringe_offset = left_offset; |
| 1263 | cur->right_fringe_offset = right_offset; | 1272 | cur->right_fringe_offset = right_offset; |
| 1273 | cur->fringe_bitmap_periodic_p = periodic_p; | ||
| 1264 | } | 1274 | } |
| 1265 | } | 1275 | } |
| 1266 | 1276 | ||
| @@ -1279,6 +1289,7 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 1279 | row->right_fringe_face_id = right_face_id; | 1289 | row->right_fringe_face_id = right_face_id; |
| 1280 | row->left_fringe_offset = left_offset; | 1290 | row->left_fringe_offset = left_offset; |
| 1281 | row->right_fringe_offset = right_offset; | 1291 | row->right_fringe_offset = right_offset; |
| 1292 | row->fringe_bitmap_periodic_p = periodic_p; | ||
| 1282 | } | 1293 | } |
| 1283 | 1294 | ||
| 1284 | return redraw_p && !keep_current_p; | 1295 | return redraw_p && !keep_current_p; |