aboutsummaryrefslogtreecommitdiffstats
path: root/src/dispextern.h
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-05 20:25:20 +0400
committerDmitry Antipov2013-09-05 20:25:20 +0400
commitb969582835bb7d6085a802322c77150fe559960e (patch)
treebe9ab059004c356ec2ba8e3dbe0bf489fcb5dd74 /src/dispextern.h
parent1f896cb7ede7d658797737574b2d6b00d128a592 (diff)
downloademacs-b969582835bb7d6085a802322c77150fe559960e.tar.gz
emacs-b969582835bb7d6085a802322c77150fe559960e.zip
Cache current header and mode line height for each window.
* window.h (struct window): New fields mode_line_height and header_line_height. * window.c (make_window): Initialize them. * dispextern.h (CURRENT_MODE_LINE_HEIGHT) (CURRENT_HEADER_LINE_HEIGHT): Use them. Adjust comment. (current_mode_line_height, current_header_line_height): Remove declaration. * xdisp.c (current_mode_line_height, current_header_line_height): Remove. (pos_visible_p, init_xdisp): Adjust user. (redisplay_window): Invalidate mode_line_height and header_line_height if current and desired matrices do not agree.
Diffstat (limited to 'src/dispextern.h')
-rw-r--r--src/dispextern.h47
1 files changed, 23 insertions, 24 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 947e50fa4dd..ebb07c1d37f 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1428,31 +1428,31 @@ struct glyph_string
1428#define CURRENT_MODE_LINE_FACE_ID(W) \ 1428#define CURRENT_MODE_LINE_FACE_ID(W) \
1429 (CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W))) 1429 (CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W)))
1430 1430
1431/* Return the current height of the mode line of window W. If not 1431/* Return the current height of the mode line of window W. If not known
1432 known from current_mode_line_height, look at W's current glyph 1432 from W->mode_line_height, look at W's current glyph matrix, or return
1433 matrix, or return a default based on the height of the font of the 1433 a default based on the height of the font of the face `mode-line'. */
1434 face `mode-line'. */ 1434
1435 1435#define CURRENT_MODE_LINE_HEIGHT(W) \
1436#define CURRENT_MODE_LINE_HEIGHT(W) \ 1436 (W->mode_line_height >= 0 \
1437 (current_mode_line_height >= 0 \ 1437 ? W->mode_line_height \
1438 ? current_mode_line_height \ 1438 : (W->mode_line_height \
1439 : (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ 1439 = (MATRIX_MODE_LINE_HEIGHT (W->current_matrix) \
1440 ? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ 1440 ? MATRIX_MODE_LINE_HEIGHT (W->current_matrix) \
1441 : estimate_mode_line_height (XFRAME ((W)->frame), \ 1441 : estimate_mode_line_height \
1442 CURRENT_MODE_LINE_FACE_ID (W)))) 1442 (XFRAME (W->frame), CURRENT_MODE_LINE_FACE_ID (W)))))
1443 1443
1444/* Return the current height of the header line of window W. If not 1444/* Return the current height of the header line of window W. If not known
1445 known from current_header_line_height, look at W's current glyph 1445 from W->header_line_height, look at W's current glyph matrix, or return
1446 matrix, or return an estimation based on the height of the font of 1446 an estimation based on the height of the font of the face `header-line'. */
1447 the face `header-line'. */
1448 1447
1449#define CURRENT_HEADER_LINE_HEIGHT(W) \ 1448#define CURRENT_HEADER_LINE_HEIGHT(W) \
1450 (current_header_line_height >= 0 \ 1449 (W->header_line_height >= 0 \
1451 ? current_header_line_height \ 1450 ? W->header_line_height \
1452 : (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ 1451 : (W->header_line_height \
1453 ? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ 1452 = (MATRIX_HEADER_LINE_HEIGHT (W->current_matrix) \
1454 : estimate_mode_line_height (XFRAME ((W)->frame), \ 1453 ? MATRIX_HEADER_LINE_HEIGHT (W->current_matrix) \
1455 HEADER_LINE_FACE_ID))) 1454 : estimate_mode_line_height \
1455 (XFRAME (W->frame), HEADER_LINE_FACE_ID))))
1456 1456
1457/* Return the height of the desired mode line of window W. */ 1457/* Return the height of the desired mode line of window W. */
1458 1458
@@ -3201,7 +3201,6 @@ int frame_mode_line_height (struct frame *);
3201extern Lisp_Object Qtool_bar; 3201extern Lisp_Object Qtool_bar;
3202extern bool redisplaying_p; 3202extern bool redisplaying_p;
3203extern int help_echo_showing_p; 3203extern int help_echo_showing_p;
3204extern int current_mode_line_height, current_header_line_height;
3205extern Lisp_Object help_echo_string, help_echo_window; 3204extern Lisp_Object help_echo_string, help_echo_window;
3206extern Lisp_Object help_echo_object, previous_help_echo_string; 3205extern Lisp_Object help_echo_object, previous_help_echo_string;
3207extern ptrdiff_t help_echo_pos; 3206extern ptrdiff_t help_echo_pos;