comparison src/dispextern.h @ 58174:1e3a9e2d4cad

(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.
author Kim F. Storm <storm@cua.dk>
date Fri, 12 Nov 2004 14:26:34 +0000
parents 1550c9f141cc
children 18b94da7a313 3ec251523b3e
comparison
equal deleted inserted replaced
58173:46e6d0e52da4 58174:1e3a9e2d4cad
692 /* Portion of row that is visible. Partially visible rows may be 692 /* Portion of row that is visible. Partially visible rows may be
693 found at the top and bottom of a window. This is 1 for tty 693 found at the top and bottom of a window. This is 1 for tty
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;
700 704
701 /* First position in this row. This is the text position, including 705 /* First position in this row. This is the text position, including
914 /* Non-zero if ROW displays text. Value is non-zero if the row is 918 /* Non-zero if ROW displays text. Value is non-zero if the row is
915 blank but displays a line end. */ 919 blank but displays a line end. */
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
938 #define MATRIX_ROW_BOTTOM_Y(ROW) ((ROW)->y + (ROW)->height) 959 #define MATRIX_ROW_BOTTOM_Y(ROW) ((ROW)->y + (ROW)->height)
939 960
1988 2009
1989 /* Last visible y-position + 1 in the display area without a mode 2010 /* Last visible y-position + 1 in the display area without a mode
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;
2017
2018 /* Max extra line spacing added in this row. */
2019 int max_extra_line_spacing;
1996 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;
2000 2024