Mercurial > emacs
comparison src/fringe.c @ 90016:ff0e824afa37
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-57
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-594
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-598
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-599
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-600
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-602
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-603
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-604
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-609
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-611
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-614
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-615
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-42
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-43
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-44
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-46
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-47
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-48
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-49
Add {arch}/=commit-merge-make-log
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-50
{arch}/=commit-merge-make-log: Don't die if there are no ChangeLog changes
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 14 Oct 2004 08:50:09 +0000 |
parents | 6c1af301b455 3c27c0be625d |
children | cb7f41387eb3 |
comparison
equal
deleted
inserted
replaced
90015:9ee566735998 | 90016:ff0e824afa37 |
---|---|
720 if (WINDOW_RIGHT_FRINGE_WIDTH (w) != 0) | 720 if (WINDOW_RIGHT_FRINGE_WIDTH (w) != 0) |
721 draw_fringe_bitmap (w, row, 0); | 721 draw_fringe_bitmap (w, row, 0); |
722 } | 722 } |
723 | 723 |
724 /* Draw the fringes of window W. Only fringes for rows marked for | 724 /* Draw the fringes of window W. Only fringes for rows marked for |
725 update in redraw_fringe_bitmaps_p are drawn. */ | 725 update in redraw_fringe_bitmaps_p are drawn. |
726 | 726 |
727 void | 727 Return >0 if left or right fringe was redrawn in any way. |
728 draw_window_fringes (w) | 728 |
729 If NO_FRINGE is non-zero, also return >0 if either fringe has zero width. | |
730 | |
731 A return value >0 indicates that the vertical line between windows | |
732 needs update (as it may be drawn in the fringe). | |
733 */ | |
734 | |
735 int | |
736 draw_window_fringes (w, no_fringe) | |
729 struct window *w; | 737 struct window *w; |
738 int no_fringe; | |
730 { | 739 { |
731 struct glyph_row *row; | 740 struct glyph_row *row; |
732 int yb = window_text_bottom_y (w); | 741 int yb = window_text_bottom_y (w); |
733 int nrows = w->current_matrix->nrows; | 742 int nrows = w->current_matrix->nrows; |
734 int y = 0, rn; | 743 int y = 0, rn; |
744 int updated = 0; | |
735 | 745 |
736 if (w->pseudo_window_p) | 746 if (w->pseudo_window_p) |
737 return; | 747 return 0; |
748 | |
749 /* Must draw line if no fringe */ | |
750 if (no_fringe | |
751 && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0 | |
752 || WINDOW_RIGHT_FRINGE_WIDTH (w) == 0)) | |
753 updated++; | |
738 | 754 |
739 for (y = 0, rn = 0, row = w->current_matrix->rows; | 755 for (y = 0, rn = 0, row = w->current_matrix->rows; |
740 y < yb && rn < nrows; | 756 y < yb && rn < nrows; |
741 y += row->height, ++row, ++rn) | 757 y += row->height, ++row, ++rn) |
742 { | 758 { |
743 if (!row->redraw_fringe_bitmaps_p) | 759 if (!row->redraw_fringe_bitmaps_p) |
744 continue; | 760 continue; |
745 draw_row_fringe_bitmaps (w, row); | 761 draw_row_fringe_bitmaps (w, row); |
746 row->redraw_fringe_bitmaps_p = 0; | 762 row->redraw_fringe_bitmaps_p = 0; |
747 } | 763 updated++; |
764 } | |
765 | |
766 return updated; | |
748 } | 767 } |
749 | 768 |
750 | 769 |
751 /* Recalculate the bitmaps to show in the fringes of window W. | 770 /* Recalculate the bitmaps to show in the fringes of window W. |
752 If FORCE_P is 0, only mark rows with modified bitmaps for update in | 771 If FORCE_P is 0, only mark rows with modified bitmaps for update in |
948 Since the combined left and right fringe must occupy an integral | 967 Since the combined left and right fringe must occupy an integral |
949 number of columns, we may need to add some pixels to each fringe. | 968 number of columns, we may need to add some pixels to each fringe. |
950 Typically, we add an equal amount (+/- 1 pixel) to each fringe, | 969 Typically, we add an equal amount (+/- 1 pixel) to each fringe, |
951 but a negative width value is taken literally (after negating it). | 970 but a negative width value is taken literally (after negating it). |
952 | 971 |
953 We never make the fringes narrower than specified. It is planned | 972 We never make the fringes narrower than specified. |
954 to make fringe bitmaps customizable and expandable, and at that | |
955 time, the user will typically specify the minimum number of pixels | |
956 needed for his bitmaps, so we shouldn't select anything less than | |
957 what is specified. | |
958 */ | 973 */ |
959 | 974 |
960 void | 975 void |
961 compute_fringe_widths (f, redraw) | 976 compute_fringe_widths (f, redraw) |
962 struct frame *f; | 977 struct frame *f; |
1341 | 1356 |
1342 DEFUN ("fringe-bitmaps-at-pos", Ffringe_bitmaps_at_pos, Sfringe_bitmaps_at_pos, | 1357 DEFUN ("fringe-bitmaps-at-pos", Ffringe_bitmaps_at_pos, Sfringe_bitmaps_at_pos, |
1343 0, 2, 0, | 1358 0, 2, 0, |
1344 doc: /* Return fringe bitmaps of row containing position POS in window WINDOW. | 1359 doc: /* Return fringe bitmaps of row containing position POS in window WINDOW. |
1345 If WINDOW is nil, use selected window. If POS is nil, use value of point | 1360 If WINDOW is nil, use selected window. If POS is nil, use value of point |
1346 in that window. Return value is a cons (LEFT . RIGHT) where LEFT and RIGHT | 1361 in that window. Return value is a list (LEFT RIGHT OV), where LEFT |
1347 are the fringe bitmap numbers for the bitmaps in the left and right fringe, | 1362 is the symbol for the bitmap in the left fringe (or nil if no bitmap), |
1348 resp. If left or right fringe is empty, the corresponding element is nil. | 1363 RIGHT is similar for the right fringe, and OV is non-nil if there is an |
1364 overlay arrow in the left fringe. | |
1349 Return nil if POS is not visible in WINDOW. */) | 1365 Return nil if POS is not visible in WINDOW. */) |
1350 (pos, window) | 1366 (pos, window) |
1351 Lisp_Object pos, window; | 1367 Lisp_Object pos, window; |
1352 { | 1368 { |
1353 struct window *w; | 1369 struct window *w; |
1371 textpos = XMARKER (w->pointm)->charpos; | 1387 textpos = XMARKER (w->pointm)->charpos; |
1372 | 1388 |
1373 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); | 1389 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
1374 row = row_containing_pos (w, textpos, row, NULL, 0); | 1390 row = row_containing_pos (w, textpos, row, NULL, 0); |
1375 if (row) | 1391 if (row) |
1376 return Fcons (get_fringe_bitmap_name (row->left_fringe_bitmap), | 1392 return list3 (get_fringe_bitmap_name (row->left_fringe_bitmap), |
1377 get_fringe_bitmap_name (row->right_fringe_bitmap)); | 1393 get_fringe_bitmap_name (row->right_fringe_bitmap), |
1394 (row->overlay_arrow_p ? Qt : Qnil)); | |
1378 else | 1395 else |
1379 return Qnil; | 1396 return Qnil; |
1380 } | 1397 } |
1381 | 1398 |
1382 | 1399 |