Mercurial > emacs
comparison src/fringe.c @ 109358:a9586dc942d5
Merge from mainline.
author | Katsumi Yamaoka <katsumi@flagship2> |
---|---|
date | Mon, 12 Jul 2010 13:21:11 +0000 |
parents | 60516122d066 |
children | 9ad1e76fc718 |
comparison
equal
deleted
inserted
replaced
109240:6f0915b37828 | 109358:a9586dc942d5 |
---|---|
553 struct frame *f = XFRAME (WINDOW_FRAME (w)); | 553 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
554 struct draw_fringe_bitmap_params p; | 554 struct draw_fringe_bitmap_params p; |
555 struct fringe_bitmap *fb; | 555 struct fringe_bitmap *fb; |
556 int period; | 556 int period; |
557 int face_id = DEFAULT_FACE_ID; | 557 int face_id = DEFAULT_FACE_ID; |
558 | 558 int offset, header_line_height; |
559 p.cursor_p = 0; | 559 |
560 p.overlay_p = (overlay & 1) == 1; | 560 p.overlay_p = (overlay & 1) == 1; |
561 p.cursor_p = (overlay & 2) == 2; | 561 p.cursor_p = (overlay & 2) == 2; |
562 | 562 |
563 if (which != NO_FRINGE_BITMAP) | 563 if (which != NO_FRINGE_BITMAP) |
564 { | 564 { |
565 offset = 0; | |
565 } | 566 } |
566 else if (left_p) | 567 else if (left_p) |
567 { | 568 { |
568 which = row->left_fringe_bitmap; | 569 which = row->left_fringe_bitmap; |
569 face_id = row->left_fringe_face_id; | 570 face_id = row->left_fringe_face_id; |
571 offset = row->left_fringe_offset; | |
570 } | 572 } |
571 else | 573 else |
572 { | 574 { |
573 which = row->right_fringe_bitmap; | 575 which = row->right_fringe_bitmap; |
574 face_id = row->right_fringe_face_id; | 576 face_id = row->right_fringe_face_id; |
577 offset = row->right_fringe_offset; | |
575 } | 578 } |
576 | 579 |
577 if (face_id == DEFAULT_FACE_ID) | 580 if (face_id == DEFAULT_FACE_ID) |
578 { | 581 { |
579 Lisp_Object face = fringe_faces[which]; | 582 Lisp_Object face = fringe_faces[which]; |
589 ? which : UNDEF_FRINGE_BITMAP]; | 592 ? which : UNDEF_FRINGE_BITMAP]; |
590 | 593 |
591 period = fb->period; | 594 period = fb->period; |
592 | 595 |
593 /* Convert row to frame coordinates. */ | 596 /* Convert row to frame coordinates. */ |
594 p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | 597 p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y) + offset; |
595 | 598 |
596 p.which = which; | 599 p.which = which; |
597 p.bits = fb->bits; | 600 p.bits = fb->bits; |
598 p.wd = fb->width; | 601 p.wd = fb->width; |
599 | 602 |
600 p.h = fb->height; | 603 p.h = fb->height; |
601 p.dh = (period > 0 ? (p.y % period) : 0); | 604 p.dh = (period > 0 ? (p.y % period) : 0); |
602 p.h -= p.dh; | 605 p.h -= p.dh; |
603 /* Clip bitmap if too high. */ | 606 |
604 if (p.h > row->height) | 607 /* Adjust y to the offset in the row to start drawing the bitmap. */ |
605 p.h = row->height; | 608 switch (fb->align) |
609 { | |
610 case ALIGN_BITMAP_CENTER: | |
611 p.y += (row->height - p.h) / 2; | |
612 break; | |
613 case ALIGN_BITMAP_BOTTOM: | |
614 p.y += (row->visible_height - p.h); | |
615 break; | |
616 case ALIGN_BITMAP_TOP: | |
617 break; | |
618 } | |
606 | 619 |
607 p.face = FACE_FROM_ID (f, face_id); | 620 p.face = FACE_FROM_ID (f, face_id); |
608 | 621 |
609 if (p.face == NULL) | 622 if (p.face == NULL) |
610 { | 623 { |
616 PREPARE_FACE_FOR_DISPLAY (f, p.face); | 629 PREPARE_FACE_FOR_DISPLAY (f, p.face); |
617 | 630 |
618 /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill | 631 /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill |
619 the fringe. */ | 632 the fringe. */ |
620 p.bx = -1; | 633 p.bx = -1; |
634 header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); | |
635 p.by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, row->y)); | |
636 p.ny = row->visible_height; | |
621 if (left_p) | 637 if (left_p) |
622 { | 638 { |
623 int wd = WINDOW_LEFT_FRINGE_WIDTH (w); | 639 int wd = WINDOW_LEFT_FRINGE_WIDTH (w); |
624 int x = window_box_left (w, (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | 640 int x = window_box_left (w, (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) |
625 ? LEFT_MARGIN_AREA | 641 ? LEFT_MARGIN_AREA |
626 : TEXT_AREA)); | 642 : TEXT_AREA)); |
627 if (p.wd > wd) | 643 if (p.wd > wd) |
628 p.wd = wd; | 644 p.wd = wd; |
629 p.x = x - p.wd - (wd - p.wd) / 2; | 645 p.x = x - p.wd - (wd - p.wd) / 2; |
630 | 646 |
631 if (p.wd < wd || row->height > p.h) | 647 if (p.wd < wd || p.y > p.by || p.y + p.h < p.by + p.ny) |
632 { | 648 { |
633 /* If W has a vertical border to its left, don't draw over it. */ | 649 /* If W has a vertical border to its left, don't draw over it. */ |
634 wd -= ((!WINDOW_LEFTMOST_P (w) | 650 wd -= ((!WINDOW_LEFTMOST_P (w) |
635 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) | 651 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) |
636 ? 1 : 0); | 652 ? 1 : 0); |
648 if (p.wd > wd) | 664 if (p.wd > wd) |
649 p.wd = wd; | 665 p.wd = wd; |
650 p.x = x + (wd - p.wd) / 2; | 666 p.x = x + (wd - p.wd) / 2; |
651 /* Clear right fringe if no bitmap to draw of if bitmap doesn't fill | 667 /* Clear right fringe if no bitmap to draw of if bitmap doesn't fill |
652 the fringe. */ | 668 the fringe. */ |
653 if (p.wd < wd || row->height > p.h) | 669 if (p.wd < wd || p.y > p.by || p.y + p.h < p.by + p.ny) |
654 { | 670 { |
655 p.bx = x; | 671 p.bx = x; |
656 p.nx = wd; | 672 p.nx = wd; |
657 } | 673 } |
658 } | |
659 | |
660 if (p.bx >= 0) | |
661 { | |
662 int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); | |
663 | |
664 p.by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, row->y)); | |
665 p.ny = row->visible_height; | |
666 } | |
667 | |
668 /* Adjust y to the offset in the row to start drawing the bitmap. */ | |
669 switch (fb->align) | |
670 { | |
671 case ALIGN_BITMAP_CENTER: | |
672 p.y += (row->height - p.h) / 2; | |
673 break; | |
674 case ALIGN_BITMAP_BOTTOM: | |
675 p.h = fb->height; | |
676 p.y += (row->visible_height - p.h); | |
677 break; | |
678 case ALIGN_BITMAP_TOP: | |
679 break; | |
680 } | 674 } |
681 | 675 |
682 FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p); | 676 FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p); |
683 } | 677 } |
684 | 678 |
890 draw_window_fringes (struct window *w, int no_fringe) | 884 draw_window_fringes (struct window *w, int no_fringe) |
891 { | 885 { |
892 struct glyph_row *row; | 886 struct glyph_row *row; |
893 int yb = window_text_bottom_y (w); | 887 int yb = window_text_bottom_y (w); |
894 int nrows = w->current_matrix->nrows; | 888 int nrows = w->current_matrix->nrows; |
895 int y = 0, rn; | 889 int y, rn; |
896 int updated = 0; | 890 int updated = 0; |
897 | 891 |
898 if (w->pseudo_window_p) | 892 if (w->pseudo_window_p) |
899 return 0; | 893 return 0; |
900 | 894 |
902 if (no_fringe | 896 if (no_fringe |
903 && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0 | 897 && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0 |
904 || WINDOW_RIGHT_FRINGE_WIDTH (w) == 0)) | 898 || WINDOW_RIGHT_FRINGE_WIDTH (w) == 0)) |
905 updated++; | 899 updated++; |
906 | 900 |
907 for (y = 0, rn = 0, row = w->current_matrix->rows; | 901 for (y = w->vscroll, rn = 0, row = w->current_matrix->rows; |
908 y < yb && rn < nrows; | 902 y < yb && rn < nrows; |
909 y += row->height, ++row, ++rn) | 903 y += row->height, ++row, ++rn) |
910 { | 904 { |
911 if (!row->redraw_fringe_bitmaps_p) | 905 if (!row->redraw_fringe_bitmaps_p) |
912 continue; | 906 continue; |
936 Lisp_Object arrow_top = Qnil, arrow_bot = Qnil; | 930 Lisp_Object arrow_top = Qnil, arrow_bot = Qnil; |
937 Lisp_Object empty_pos; | 931 Lisp_Object empty_pos; |
938 Lisp_Object ind = Qnil; | 932 Lisp_Object ind = Qnil; |
939 #define MAX_BITMAP_CACHE (8*4) | 933 #define MAX_BITMAP_CACHE (8*4) |
940 int bitmap_cache[MAX_BITMAP_CACHE]; | 934 int bitmap_cache[MAX_BITMAP_CACHE]; |
935 int top_ind_rn, bot_ind_rn; | |
936 int top_ind_min_y, bot_ind_max_y; | |
937 int top_row_ends_at_zv_p, bot_row_ends_at_zv_p; | |
941 | 938 |
942 if (w->pseudo_window_p) | 939 if (w->pseudo_window_p) |
943 return 0; | 940 return 0; |
944 | 941 |
945 if (!MINI_WINDOW_P (w) | 942 if (!MINI_WINDOW_P (w) |
964 else | 961 else |
965 /* Anything else means boundary on left and no arrows. */ | 962 /* Anything else means boundary on left and no arrows. */ |
966 boundary_top = boundary_bot = Qleft; | 963 boundary_top = boundary_bot = Qleft; |
967 } | 964 } |
968 | 965 |
966 top_ind_rn = bot_ind_rn = -1; | |
969 if (!NILP (ind)) | 967 if (!NILP (ind)) |
970 { | 968 { |
971 int done_top = 0, done_bot = 0; | 969 for (y = w->vscroll, rn = 0; |
972 | |
973 for (y = 0, rn = 0; | |
974 y < yb && rn < nrows; | 970 y < yb && rn < nrows; |
975 y += row->height, ++rn) | 971 y += row->height, ++rn) |
976 { | 972 { |
977 unsigned indicate_bob_p, indicate_top_line_p; | 973 unsigned indicate_bob_p, indicate_top_line_p; |
978 unsigned indicate_eob_p, indicate_bottom_line_p; | 974 unsigned indicate_eob_p, indicate_bottom_line_p; |
989 row->indicate_bob_p = row->indicate_top_line_p = 0; | 985 row->indicate_bob_p = row->indicate_top_line_p = 0; |
990 row->indicate_eob_p = row->indicate_bottom_line_p = 0; | 986 row->indicate_eob_p = row->indicate_bottom_line_p = 0; |
991 | 987 |
992 if (!row->mode_line_p) | 988 if (!row->mode_line_p) |
993 { | 989 { |
994 if (!done_top) | 990 if (top_ind_rn < 0 && row->visible_height > 0) |
995 { | 991 { |
996 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)) | 992 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)) |
997 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) | 993 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) |
998 row->indicate_bob_p = !NILP (boundary_top); | 994 row->indicate_bob_p = !NILP (boundary_top); |
999 else | 995 else |
1000 row->indicate_top_line_p = !NILP (arrow_top); | 996 row->indicate_top_line_p = !NILP (arrow_top); |
1001 done_top = 1; | 997 top_ind_rn = rn; |
1002 } | 998 } |
1003 | 999 |
1004 if (!done_bot) | 1000 if (bot_ind_rn < 0) |
1005 { | 1001 { |
1006 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) | 1002 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) |
1007 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) | 1003 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) |
1008 row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; | 1004 row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn; |
1009 else if (y + row->height >= yb) | 1005 else if (y + row->height >= yb) |
1010 row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1; | 1006 row->indicate_bottom_line_p = !NILP (arrow_bot), bot_ind_rn = rn; |
1011 } | 1007 } |
1012 } | 1008 } |
1013 | |
1014 if (indicate_bob_p != row->indicate_bob_p | |
1015 || indicate_top_line_p != row->indicate_top_line_p | |
1016 || indicate_eob_p != row->indicate_eob_p | |
1017 || indicate_bottom_line_p != row->indicate_bottom_line_p) | |
1018 row->redraw_fringe_bitmaps_p = 1; | |
1019 } | 1009 } |
1020 } | 1010 } |
1021 | 1011 |
1022 empty_pos = XBUFFER (w->buffer)->indicate_empty_lines; | 1012 empty_pos = XBUFFER (w->buffer)->indicate_empty_lines; |
1023 if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) | 1013 if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) |
1037 ? bitmap_cache[cache*4+2+partial_p] \ | 1027 ? bitmap_cache[cache*4+2+partial_p] \ |
1038 : (bitmap_cache[cache*4+2+partial_p] = \ | 1028 : (bitmap_cache[cache*4+2+partial_p] = \ |
1039 get_logical_fringe_bitmap (w, which, 1, partial_p))) | 1029 get_logical_fringe_bitmap (w, which, 1, partial_p))) |
1040 | 1030 |
1041 | 1031 |
1042 for (y = 0, rn = 0; | 1032 /* Extend top-aligned top indicator (or bottom-aligned bottom |
1033 indicator) to adjacent rows if it doesn't fit in one row. */ | |
1034 top_ind_min_y = bot_ind_max_y = -1; | |
1035 if (top_ind_rn >= 0) | |
1036 { | |
1037 int bn = NO_FRINGE_BITMAP; | |
1038 | |
1039 row = w->desired_matrix->rows + top_ind_rn; | |
1040 if (!row->enabled_p) | |
1041 row = w->current_matrix->rows + top_ind_rn; | |
1042 | |
1043 top_row_ends_at_zv_p = row->ends_at_zv_p; | |
1044 if (row->indicate_bob_p) | |
1045 { | |
1046 if (EQ (boundary_top, Qleft)) | |
1047 bn = ((row->indicate_eob_p && EQ (boundary_bot, Qleft)) | |
1048 ? LEFT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p) | |
1049 : LEFT_FRINGE (2, Qtop, 0)); | |
1050 else | |
1051 bn = ((row->indicate_eob_p && EQ (boundary_bot, Qright)) | |
1052 ? RIGHT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p) | |
1053 : RIGHT_FRINGE (2, Qtop, 0)); | |
1054 } | |
1055 else if (row->indicate_top_line_p) | |
1056 { | |
1057 if (EQ (arrow_top, Qleft)) | |
1058 bn = LEFT_FRINGE (6, Qup, 0); | |
1059 else | |
1060 bn = RIGHT_FRINGE (6, Qup, 0); | |
1061 } | |
1062 | |
1063 if (bn != NO_FRINGE_BITMAP) | |
1064 { | |
1065 struct fringe_bitmap *fb; | |
1066 | |
1067 fb = fringe_bitmaps[bn]; | |
1068 if (fb == NULL) | |
1069 fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | |
1070 ? bn : UNDEF_FRINGE_BITMAP]; | |
1071 if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) | |
1072 { | |
1073 struct glyph_row *row1; | |
1074 int top_ind_max_y; | |
1075 | |
1076 top_ind_min_y = WINDOW_HEADER_LINE_HEIGHT (w); | |
1077 top_ind_max_y = top_ind_min_y + fb->height; | |
1078 if (top_ind_max_y > yb) | |
1079 top_ind_max_y = yb; | |
1080 | |
1081 for (y = row->y + row->height, rn = top_ind_rn + 1; | |
1082 y < top_ind_max_y && rn < nrows; | |
1083 y += row1->height, rn++) | |
1084 { | |
1085 if (bot_ind_rn >= 0 && rn >= bot_ind_rn) | |
1086 break; | |
1087 | |
1088 row1 = w->desired_matrix->rows + rn; | |
1089 if (!row1->enabled_p) | |
1090 row1 = w->current_matrix->rows + rn; | |
1091 | |
1092 row1->indicate_bob_p = row->indicate_bob_p; | |
1093 row1->indicate_top_line_p = row->indicate_top_line_p; | |
1094 } | |
1095 } | |
1096 } | |
1097 } | |
1098 if (bot_ind_rn >= 0) | |
1099 { | |
1100 int bn = NO_FRINGE_BITMAP; | |
1101 | |
1102 row = w->desired_matrix->rows + bot_ind_rn; | |
1103 if (!row->enabled_p) | |
1104 row = w->current_matrix->rows + bot_ind_rn; | |
1105 | |
1106 bot_row_ends_at_zv_p = row->ends_at_zv_p; | |
1107 if (row->indicate_eob_p) | |
1108 { | |
1109 if (EQ (boundary_bot, Qleft)) | |
1110 bn = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p); | |
1111 else | |
1112 bn = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p); | |
1113 } | |
1114 else if (row->indicate_bottom_line_p) | |
1115 { | |
1116 if (EQ (arrow_bot, Qleft)) | |
1117 bn = LEFT_FRINGE (7, Qdown, 0); | |
1118 else | |
1119 bn = RIGHT_FRINGE (7, Qdown, 0); | |
1120 } | |
1121 | |
1122 if (bn != NO_FRINGE_BITMAP) | |
1123 { | |
1124 struct fringe_bitmap *fb; | |
1125 | |
1126 fb = fringe_bitmaps[bn]; | |
1127 if (fb == NULL) | |
1128 fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | |
1129 ? bn : UNDEF_FRINGE_BITMAP]; | |
1130 if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) | |
1131 { | |
1132 struct glyph_row *row1; | |
1133 int bot_ind_min_y; | |
1134 | |
1135 bot_ind_max_y = row->y + row->visible_height; | |
1136 bot_ind_min_y = bot_ind_max_y - fb->height; | |
1137 if (bot_ind_min_y < WINDOW_HEADER_LINE_HEIGHT (w)) | |
1138 bot_ind_min_y = WINDOW_HEADER_LINE_HEIGHT (w); | |
1139 | |
1140 for (y = row->y, rn = bot_ind_rn - 1; | |
1141 y >= bot_ind_min_y && rn >= 0; | |
1142 y -= row1->height, rn--) | |
1143 { | |
1144 if (top_ind_rn >= 0 && rn <= top_ind_rn) | |
1145 break; | |
1146 | |
1147 row1 = w->desired_matrix->rows + rn; | |
1148 if (!row1->enabled_p) | |
1149 row1 = w->current_matrix->rows + rn; | |
1150 | |
1151 row1->indicate_eob_p = row->indicate_eob_p; | |
1152 row1->indicate_bottom_line_p = row->indicate_bottom_line_p; | |
1153 } | |
1154 } | |
1155 } | |
1156 } | |
1157 | |
1158 for (y = w->vscroll, rn = 0; | |
1043 y < yb && rn < nrows; | 1159 y < yb && rn < nrows; |
1044 y += row->height, rn++) | 1160 y += row->height, rn++) |
1045 { | 1161 { |
1046 int left, right; | 1162 int left, right; |
1047 unsigned left_face_id, right_face_id; | 1163 unsigned left_face_id, right_face_id; |
1164 int left_offset, right_offset; | |
1048 | 1165 |
1049 row = w->desired_matrix->rows + rn; | 1166 row = w->desired_matrix->rows + rn; |
1050 cur = w->current_matrix->rows + rn; | 1167 cur = w->current_matrix->rows + rn; |
1051 if (!row->enabled_p) | 1168 if (!row->enabled_p) |
1052 row = cur; | 1169 row = cur; |
1053 | 1170 |
1054 left_face_id = right_face_id = DEFAULT_FACE_ID; | 1171 left_face_id = right_face_id = DEFAULT_FACE_ID; |
1172 left_offset = right_offset = 0; | |
1055 | 1173 |
1056 /* Decide which bitmap to draw in the left fringe. */ | 1174 /* Decide which bitmap to draw in the left fringe. */ |
1057 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) | 1175 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) |
1058 left = NO_FRINGE_BITMAP; | 1176 left = NO_FRINGE_BITMAP; |
1059 else if (row->left_user_fringe_bitmap != NO_FRINGE_BITMAP) | 1177 else if (row->left_user_fringe_bitmap != NO_FRINGE_BITMAP) |
1063 } | 1181 } |
1064 else if ((!row->reversed_p && row->truncated_on_left_p) | 1182 else if ((!row->reversed_p && row->truncated_on_left_p) |
1065 || (row->reversed_p && row->truncated_on_right_p)) | 1183 || (row->reversed_p && row->truncated_on_right_p)) |
1066 left = LEFT_FRINGE(0, Qtruncation, 0); | 1184 left = LEFT_FRINGE(0, Qtruncation, 0); |
1067 else if (row->indicate_bob_p && EQ (boundary_top, Qleft)) | 1185 else if (row->indicate_bob_p && EQ (boundary_top, Qleft)) |
1068 left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft)) | 1186 { |
1069 ? LEFT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p) | 1187 left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft)) |
1070 : LEFT_FRINGE (2, Qtop, 0)); | 1188 ? LEFT_FRINGE (1, Qtop_bottom, top_row_ends_at_zv_p) |
1189 : LEFT_FRINGE (2, Qtop, 0)); | |
1190 if (top_ind_min_y >= 0) | |
1191 left_offset = top_ind_min_y - row->y; | |
1192 } | |
1071 else if (row->indicate_eob_p && EQ (boundary_bot, Qleft)) | 1193 else if (row->indicate_eob_p && EQ (boundary_bot, Qleft)) |
1072 left = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p); | 1194 { |
1073 else if ((!row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row)) | 1195 left = LEFT_FRINGE (3, Qbottom, bot_row_ends_at_zv_p); |
1074 || (row->reversed_p && row->continued_p)) | 1196 if (bot_ind_max_y >= 0) |
1197 left_offset = bot_ind_max_y - (row->y + row->visible_height); | |
1198 } | |
1199 else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) | |
1075 left = LEFT_FRINGE (4, Qcontinuation, 0); | 1200 left = LEFT_FRINGE (4, Qcontinuation, 0); |
1076 else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft)) | 1201 else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft)) |
1077 left = LEFT_FRINGE (5, Qempty_line, 0); | 1202 left = LEFT_FRINGE (5, Qempty_line, 0); |
1078 else if (row->indicate_top_line_p && EQ (arrow_top, Qleft)) | 1203 else if (row->indicate_top_line_p && EQ (arrow_top, Qleft)) |
1079 left = LEFT_FRINGE (6, Qup, 0); | 1204 { |
1205 left = LEFT_FRINGE (6, Qup, 0); | |
1206 if (top_ind_min_y >= 0) | |
1207 left_offset = top_ind_min_y - row->y; | |
1208 } | |
1080 else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qleft)) | 1209 else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qleft)) |
1081 left = LEFT_FRINGE (7, Qdown, 0); | 1210 { |
1211 left = LEFT_FRINGE (7, Qdown, 0); | |
1212 if (bot_ind_max_y >= 0) | |
1213 left_offset = bot_ind_max_y - (row->y + row->visible_height); | |
1214 } | |
1082 else | 1215 else |
1083 left = NO_FRINGE_BITMAP; | 1216 left = NO_FRINGE_BITMAP; |
1084 | 1217 |
1085 /* Decide which bitmap to draw in the right fringe. */ | 1218 /* Decide which bitmap to draw in the right fringe. */ |
1086 if (WINDOW_RIGHT_FRINGE_WIDTH (w) == 0) | 1219 if (WINDOW_RIGHT_FRINGE_WIDTH (w) == 0) |
1092 } | 1225 } |
1093 else if ((!row->reversed_p && row->truncated_on_right_p) | 1226 else if ((!row->reversed_p && row->truncated_on_right_p) |
1094 || (row->reversed_p && row->truncated_on_left_p)) | 1227 || (row->reversed_p && row->truncated_on_left_p)) |
1095 right = RIGHT_FRINGE (0, Qtruncation, 0); | 1228 right = RIGHT_FRINGE (0, Qtruncation, 0); |
1096 else if (row->indicate_bob_p && EQ (boundary_top, Qright)) | 1229 else if (row->indicate_bob_p && EQ (boundary_top, Qright)) |
1097 right = ((row->indicate_eob_p && EQ (boundary_bot, Qright)) | 1230 { |
1098 ? RIGHT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p) | 1231 right = ((row->indicate_eob_p && EQ (boundary_bot, Qright)) |
1099 : RIGHT_FRINGE (2, Qtop, 0)); | 1232 ? RIGHT_FRINGE (1, Qtop_bottom, top_row_ends_at_zv_p) |
1233 : RIGHT_FRINGE (2, Qtop, 0)); | |
1234 if (top_ind_min_y >= 0) | |
1235 right_offset = top_ind_min_y - row->y; | |
1236 } | |
1100 else if (row->indicate_eob_p && EQ (boundary_bot, Qright)) | 1237 else if (row->indicate_eob_p && EQ (boundary_bot, Qright)) |
1101 right = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p); | 1238 { |
1102 else if ((!row->reversed_p && row->continued_p) | 1239 right = RIGHT_FRINGE (3, Qbottom, bot_row_ends_at_zv_p); |
1103 || (row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row))) | 1240 if (bot_ind_max_y >= 0) |
1241 right_offset = bot_ind_max_y - (row->y + row->visible_height); | |
1242 } | |
1243 else if (row->continued_p) | |
1104 right = RIGHT_FRINGE (4, Qcontinuation, 0); | 1244 right = RIGHT_FRINGE (4, Qcontinuation, 0); |
1105 else if (row->indicate_top_line_p && EQ (arrow_top, Qright)) | 1245 else if (row->indicate_top_line_p && EQ (arrow_top, Qright)) |
1106 right = RIGHT_FRINGE (6, Qup, 0); | 1246 { |
1247 right = RIGHT_FRINGE (6, Qup, 0); | |
1248 if (top_ind_min_y >= 0) | |
1249 right_offset = top_ind_min_y - row->y; | |
1250 } | |
1107 else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qright)) | 1251 else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qright)) |
1108 right = RIGHT_FRINGE (7, Qdown, 0); | 1252 { |
1253 right = RIGHT_FRINGE (7, Qdown, 0); | |
1254 if (bot_ind_max_y >= 0) | |
1255 right_offset = bot_ind_max_y - (row->y + row->visible_height); | |
1256 } | |
1109 else if (row->indicate_empty_line_p && EQ (empty_pos, Qright)) | 1257 else if (row->indicate_empty_line_p && EQ (empty_pos, Qright)) |
1110 right = RIGHT_FRINGE (5, Qempty_line, 0); | 1258 right = RIGHT_FRINGE (5, Qempty_line, 0); |
1111 else | 1259 else |
1112 right = NO_FRINGE_BITMAP; | 1260 right = NO_FRINGE_BITMAP; |
1113 | 1261 |
1116 || row->ends_at_zv_p != cur->ends_at_zv_p | 1264 || row->ends_at_zv_p != cur->ends_at_zv_p |
1117 || left != cur->left_fringe_bitmap | 1265 || left != cur->left_fringe_bitmap |
1118 || right != cur->right_fringe_bitmap | 1266 || right != cur->right_fringe_bitmap |
1119 || left_face_id != cur->left_fringe_face_id | 1267 || left_face_id != cur->left_fringe_face_id |
1120 || right_face_id != cur->right_fringe_face_id | 1268 || right_face_id != cur->right_fringe_face_id |
1269 || left_offset != cur->left_fringe_offset | |
1270 || right_offset != cur->right_fringe_offset | |
1121 || cur->redraw_fringe_bitmaps_p) | 1271 || cur->redraw_fringe_bitmaps_p) |
1122 { | 1272 { |
1123 redraw_p = row->redraw_fringe_bitmaps_p = 1; | 1273 redraw_p = row->redraw_fringe_bitmaps_p = 1; |
1124 if (!keep_current_p) | 1274 if (!keep_current_p) |
1125 { | 1275 { |
1126 cur->redraw_fringe_bitmaps_p = 1; | 1276 cur->redraw_fringe_bitmaps_p = 1; |
1127 cur->left_fringe_bitmap = left; | 1277 cur->left_fringe_bitmap = left; |
1128 cur->right_fringe_bitmap = right; | 1278 cur->right_fringe_bitmap = right; |
1129 cur->left_fringe_face_id = left_face_id; | 1279 cur->left_fringe_face_id = left_face_id; |
1130 cur->right_fringe_face_id = right_face_id; | 1280 cur->right_fringe_face_id = right_face_id; |
1281 cur->left_fringe_offset = left_offset; | |
1282 cur->right_fringe_offset = right_offset; | |
1131 } | 1283 } |
1132 } | 1284 } |
1133 | 1285 |
1134 if (row->overlay_arrow_bitmap < 0) | 1286 if (row->overlay_arrow_bitmap < 0) |
1135 row->overlay_arrow_bitmap = get_logical_fringe_bitmap (w, Qoverlay_arrow, 0, 0); | 1287 row->overlay_arrow_bitmap = get_logical_fringe_bitmap (w, Qoverlay_arrow, 0, 0); |
1142 | 1294 |
1143 row->left_fringe_bitmap = left; | 1295 row->left_fringe_bitmap = left; |
1144 row->right_fringe_bitmap = right; | 1296 row->right_fringe_bitmap = right; |
1145 row->left_fringe_face_id = left_face_id; | 1297 row->left_fringe_face_id = left_face_id; |
1146 row->right_fringe_face_id = right_face_id; | 1298 row->right_fringe_face_id = right_face_id; |
1147 | 1299 row->left_fringe_offset = left_offset; |
1148 if (rn > 0 && row->redraw_fringe_bitmaps_p) | 1300 row->right_fringe_offset = right_offset; |
1149 row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1; | |
1150 } | 1301 } |
1151 | 1302 |
1152 return redraw_p && !keep_current_p; | 1303 return redraw_p && !keep_current_p; |
1153 } | 1304 } |
1154 | 1305 |