diff options
| author | Kim F. Storm | 2004-11-12 14:26:34 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-11-12 14:26:34 +0000 |
| commit | db0c5a7d08be0a760d02831a788f7b6111f9496f (patch) | |
| tree | 96eb0ba1ef532fa79950e8b4b539b200a770c46e /src | |
| parent | 381f7091f64d97deb26781de0b24b30844b8e2bc (diff) | |
| download | emacs-db0c5a7d08be0a760d02831a788f7b6111f9496f.tar.gz emacs-db0c5a7d08be0a760d02831a788f7b6111f9496f.zip | |
(struct glyph_row): New member extra_line_spacing.
(struct it): New member max_extra_line_spacing.
(MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP)
(MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros.
(MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible
part of last line is only extra line spacing (so the text on the
line is fully visible). Use helper macros.
Add W arg (to use them). All callers changed.
(MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P)
(MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index d6c93cb270e..7e8d15d8e8f 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -694,6 +694,10 @@ struct glyph_row | |||
| 694 | frames. It may be < 0 in case of completely invisible rows. */ | 694 | frames. It may be < 0 in case of completely invisible rows. */ |
| 695 | int visible_height; | 695 | int visible_height; |
| 696 | 696 | ||
| 697 | /* Extra line spacing added after this row. Do not consider this | ||
| 698 | in last row when checking if row is fully visible. */ | ||
| 699 | int extra_line_spacing; | ||
| 700 | |||
| 697 | /* Hash code. This hash code is available as soon as the row | 701 | /* Hash code. This hash code is available as soon as the row |
| 698 | is constructed, i.e. after a call to display_line. */ | 702 | is constructed, i.e. after a call to display_line. */ |
| 699 | unsigned hash; | 703 | unsigned hash; |
| @@ -916,22 +920,39 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int)); | |||
| 916 | 920 | ||
| 917 | #define MATRIX_ROW_DISPLAYS_TEXT_P(ROW) ((ROW)->displays_text_p) | 921 | #define MATRIX_ROW_DISPLAYS_TEXT_P(ROW) ((ROW)->displays_text_p) |
| 918 | 922 | ||
| 923 | |||
| 924 | /* Helper macros */ | ||
| 925 | |||
| 926 | #define MR_PARTIALLY_VISIBLE(ROW) \ | ||
| 927 | ((ROW)->height != (ROW)->visible_height) | ||
| 928 | |||
| 929 | #define MR_PARTIALLY_VISIBLE_AT_TOP(W, ROW) \ | ||
| 930 | ((ROW)->y < WINDOW_HEADER_LINE_HEIGHT ((W))) | ||
| 931 | |||
| 932 | #define MR_PARTIALLY_VISIBLE_AT_BOTTOM(W, ROW) \ | ||
| 933 | (((ROW)->y + (ROW)->height - (ROW)->extra_line_spacing) \ | ||
| 934 | > WINDOW_BOX_HEIGHT_NO_MODE_LINE ((W))) | ||
| 935 | |||
| 919 | /* Non-zero if ROW is not completely visible in window W. */ | 936 | /* Non-zero if ROW is not completely visible in window W. */ |
| 920 | 937 | ||
| 921 | #define MATRIX_ROW_PARTIALLY_VISIBLE_P(ROW) \ | 938 | #define MATRIX_ROW_PARTIALLY_VISIBLE_P(W, ROW) \ |
| 922 | ((ROW)->height != (ROW)->visible_height) | 939 | (MR_PARTIALLY_VISIBLE ((ROW)) \ |
| 940 | && (MR_PARTIALLY_VISIBLE_AT_TOP ((W), (ROW)) \ | ||
| 941 | || MR_PARTIALLY_VISIBLE_AT_BOTTOM ((W), (ROW)))) | ||
| 942 | |||
| 943 | |||
| 923 | 944 | ||
| 924 | /* Non-zero if ROW is partially visible at the top of window W. */ | 945 | /* Non-zero if ROW is partially visible at the top of window W. */ |
| 925 | 946 | ||
| 926 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \ | 947 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \ |
| 927 | (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ | 948 | (MR_PARTIALLY_VISIBLE ((ROW)) \ |
| 928 | && (ROW)->y < WINDOW_HEADER_LINE_HEIGHT ((W))) | 949 | && MR_PARTIALLY_VISIBLE_AT_TOP ((W), (ROW))) |
| 929 | 950 | ||
| 930 | /* Non-zero if ROW is partially visible at the bottom of window W. */ | 951 | /* Non-zero if ROW is partially visible at the bottom of window W. */ |
| 931 | 952 | ||
| 932 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ | 953 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ |
| 933 | (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ | 954 | (MR_PARTIALLY_VISIBLE ((ROW)) \ |
| 934 | && (ROW)->y + (ROW)->height > WINDOW_BOX_HEIGHT_NO_MODE_LINE ((W))) | 955 | && MR_PARTIALLY_VISIBLE_AT_BOTTOM ((W), (ROW))) |
| 935 | 956 | ||
| 936 | /* Return the bottom Y + 1 of ROW. */ | 957 | /* Return the bottom Y + 1 of ROW. */ |
| 937 | 958 | ||
| @@ -1990,10 +2011,13 @@ struct it | |||
| 1990 | line, if the window has one. */ | 2011 | line, if the window has one. */ |
| 1991 | int last_visible_y; | 2012 | int last_visible_y; |
| 1992 | 2013 | ||
| 1993 | /* Additional space in pixels between lines (for window systems | 2014 | /* Default amount of additional space in pixels between lines (for |
| 1994 | only.) */ | 2015 | window systems only.) */ |
| 1995 | int extra_line_spacing; | 2016 | int extra_line_spacing; |
| 1996 | 2017 | ||
| 2018 | /* Max extra line spacing added in this row. */ | ||
| 2019 | int max_extra_line_spacing; | ||
| 2020 | |||
| 1997 | /* Override font height information for this glyph. | 2021 | /* Override font height information for this glyph. |
| 1998 | Used if override_ascent >= 0. Cleared after this glyph. */ | 2022 | Used if override_ascent >= 0. Cleared after this glyph. */ |
| 1999 | int override_ascent, override_descent, override_boff; | 2023 | int override_ascent, override_descent, override_boff; |