aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.h
diff options
context:
space:
mode:
authorJoakim Verona2012-08-15 21:49:40 +0200
committerJoakim Verona2012-08-15 21:49:40 +0200
commitb648c26ec642a1dc58c0bd7e59d6011b964dbe37 (patch)
treef0f3b38ffa9054702f475fc53622e28da14f97b1 /src/window.h
parentc8b0fc1999006af5a4317b44068fac13d9592143 (diff)
parent94c9ece10275f8ca9323c38f93607f1046035c79 (diff)
downloademacs-b648c26ec642a1dc58c0bd7e59d6011b964dbe37.tar.gz
emacs-b648c26ec642a1dc58c0bd7e59d6011b964dbe37.zip
upstream
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h229
1 files changed, 114 insertions, 115 deletions
diff --git a/src/window.h b/src/window.h
index ece58d2cf97..3e6f4f82b0a 100644
--- a/src/window.h
+++ b/src/window.h
@@ -86,9 +86,9 @@ struct cursor_pos
86 int hpos, vpos; 86 int hpos, vpos;
87}; 87};
88 88
89/* Most code should use this macro to access Lisp fields in struct window. */ 89/* Most code should use this macro to set Lisp fields in struct window. */
90 90
91#define WVAR(w, field) ((w)->INTERNAL_FIELD (field)) 91#define WSET(w, field, value) ((w)->field = (value))
92 92
93struct window 93struct window
94 { 94 {
@@ -96,140 +96,140 @@ struct window
96 struct vectorlike_header header; 96 struct vectorlike_header header;
97 97
98 /* The frame this window is on. */ 98 /* The frame this window is on. */
99 Lisp_Object INTERNAL_FIELD (frame); 99 Lisp_Object frame;
100 100
101 /* Following (to right or down) and preceding (to left or up) child 101 /* Following (to right or down) and preceding (to left or up) child
102 at same level of tree. */ 102 at same level of tree. */
103 Lisp_Object INTERNAL_FIELD (next); 103 Lisp_Object next;
104 Lisp_Object INTERNAL_FIELD (prev); 104 Lisp_Object prev;
105 105
106 /* First child of this window: vchild is used if this is a vertical 106 /* First child of this window: vchild is used if this is a vertical
107 combination, hchild if this is a horizontal combination. Of the 107 combination, hchild if this is a horizontal combination. Of the
108 fields vchild, hchild and buffer, one and only one is non-nil 108 fields vchild, hchild and buffer, one and only one is non-nil
109 unless the window is dead. */ 109 unless the window is dead. */
110 Lisp_Object INTERNAL_FIELD (hchild); 110 Lisp_Object hchild;
111 Lisp_Object INTERNAL_FIELD (vchild); 111 Lisp_Object vchild;
112 112
113 /* The window this one is a child of. */ 113 /* The window this one is a child of. */
114 Lisp_Object INTERNAL_FIELD (parent); 114 Lisp_Object parent;
115 115
116 /* The upper left corner coordinates of this window, as integers 116 /* The upper left corner coordinates of this window, as integers
117 relative to upper left corner of frame = 0, 0. */ 117 relative to upper left corner of frame = 0, 0. */
118 Lisp_Object INTERNAL_FIELD (left_col); 118 Lisp_Object left_col;
119 Lisp_Object INTERNAL_FIELD (top_line); 119 Lisp_Object top_line;
120 120
121 /* The size of the window. */ 121 /* The size of the window. */
122 Lisp_Object INTERNAL_FIELD (total_lines); 122 Lisp_Object total_lines;
123 Lisp_Object INTERNAL_FIELD (total_cols); 123 Lisp_Object total_cols;
124 124
125 /* The normal size of the window. */ 125 /* The normal size of the window. */
126 Lisp_Object INTERNAL_FIELD (normal_lines); 126 Lisp_Object normal_lines;
127 Lisp_Object INTERNAL_FIELD (normal_cols); 127 Lisp_Object normal_cols;
128 128
129 /* New sizes of the window. */ 129 /* New sizes of the window. */
130 Lisp_Object INTERNAL_FIELD (new_total); 130 Lisp_Object new_total;
131 Lisp_Object INTERNAL_FIELD (new_normal); 131 Lisp_Object new_normal;
132 132
133 /* The buffer displayed in this window. Of the fields vchild, 133 /* The buffer displayed in this window. Of the fields vchild,
134 hchild and buffer, one and only one is non-nil unless the window 134 hchild and buffer, one and only one is non-nil unless the window
135 is dead. */ 135 is dead. */
136 Lisp_Object INTERNAL_FIELD (buffer); 136 Lisp_Object buffer;
137 137
138 /* A marker pointing to where in the text to start displaying. 138 /* A marker pointing to where in the text to start displaying.
139 BIDI Note: This is the _logical-order_ start, i.e. the smallest 139 BIDI Note: This is the _logical-order_ start, i.e. the smallest
140 buffer position visible in the window, not necessarily the 140 buffer position visible in the window, not necessarily the
141 character displayed in the top left corner of the window. */ 141 character displayed in the top left corner of the window. */
142 Lisp_Object INTERNAL_FIELD (start); 142 Lisp_Object start;
143 143
144 /* A marker pointing to where in the text point is in this window, 144 /* A marker pointing to where in the text point is in this window,
145 used only when the window is not selected. 145 used only when the window is not selected.
146 This exists so that when multiple windows show one buffer 146 This exists so that when multiple windows show one buffer
147 each one can have its own value of point. */ 147 each one can have its own value of point. */
148 Lisp_Object INTERNAL_FIELD (pointm); 148 Lisp_Object pointm;
149 149
150 /* No permanent meaning; used by save-window-excursion's 150 /* No permanent meaning; used by save-window-excursion's
151 bookkeeping. */ 151 bookkeeping. */
152 Lisp_Object INTERNAL_FIELD (temslot); 152 Lisp_Object temslot;
153 153
154 /* This window's vertical scroll bar. This field is only for use 154 /* This window's vertical scroll bar. This field is only for use
155 by the window-system-dependent code which implements the 155 by the window-system-dependent code which implements the
156 scroll bars; it can store anything it likes here. If this 156 scroll bars; it can store anything it likes here. If this
157 window is newly created and we haven't displayed a scroll bar in 157 window is newly created and we haven't displayed a scroll bar in
158 it yet, or if the frame doesn't have any scroll bars, this is nil. */ 158 it yet, or if the frame doesn't have any scroll bars, this is nil. */
159 Lisp_Object INTERNAL_FIELD (vertical_scroll_bar); 159 Lisp_Object vertical_scroll_bar;
160 160
161 /* Width of left and right marginal areas. A value of nil means 161 /* Width of left and right marginal areas. A value of nil means
162 no margin. */ 162 no margin. */
163 Lisp_Object INTERNAL_FIELD (left_margin_cols); 163 Lisp_Object left_margin_cols;
164 Lisp_Object INTERNAL_FIELD (right_margin_cols); 164 Lisp_Object right_margin_cols;
165 165
166 /* Width of left and right fringes. 166 /* Width of left and right fringes.
167 A value of nil or t means use frame values. */ 167 A value of nil or t means use frame values. */
168 Lisp_Object INTERNAL_FIELD (left_fringe_width); 168 Lisp_Object left_fringe_width;
169 Lisp_Object INTERNAL_FIELD (right_fringe_width); 169 Lisp_Object right_fringe_width;
170 170
171 /* Pixel width of scroll bars. 171 /* Pixel width of scroll bars.
172 A value of nil or t means use frame values. */ 172 A value of nil or t means use frame values. */
173 Lisp_Object INTERNAL_FIELD (scroll_bar_width); 173 Lisp_Object scroll_bar_width;
174 174
175 /* Type of vertical scroll bar. A value of nil means 175 /* Type of vertical scroll bar. A value of nil means
176 no scroll bar. A value of t means use frame value. */ 176 no scroll bar. A value of t means use frame value. */
177 Lisp_Object INTERNAL_FIELD (vertical_scroll_bar_type); 177 Lisp_Object vertical_scroll_bar_type;
178 178
179 /* Z - the buffer position of the last glyph in the current matrix 179 /* Z - the buffer position of the last glyph in the current matrix
180 of W. Only valid if WINDOW_END_VALID is not nil. */ 180 of W. Only valid if WINDOW_END_VALID is not nil. */
181 Lisp_Object INTERNAL_FIELD (window_end_pos); 181 Lisp_Object window_end_pos;
182 /* Glyph matrix row of the last glyph in the current matrix 182 /* Glyph matrix row of the last glyph in the current matrix
183 of W. Only valid if WINDOW_END_VALID is not nil. */ 183 of W. Only valid if WINDOW_END_VALID is not nil. */
184 Lisp_Object INTERNAL_FIELD (window_end_vpos); 184 Lisp_Object window_end_vpos;
185 /* t if window_end_pos is truly valid. 185 /* t if window_end_pos is truly valid.
186 This is nil if nontrivial redisplay is preempted 186 This is nil if nontrivial redisplay is preempted
187 since in that case the frame image that window_end_pos 187 since in that case the frame image that window_end_pos
188 did not get onto the frame. */ 188 did not get onto the frame. */
189 Lisp_Object INTERNAL_FIELD (window_end_valid); 189 Lisp_Object window_end_valid;
190 190
191 /* Display-table to use for displaying chars in this window. 191 /* Display-table to use for displaying chars in this window.
192 Nil means use the buffer's own display-table. */ 192 Nil means use the buffer's own display-table. */
193 Lisp_Object INTERNAL_FIELD (display_table); 193 Lisp_Object display_table;
194 194
195 /* Non-nil usually means window is marked as dedicated. 195 /* Non-nil usually means window is marked as dedicated.
196 Note Lisp code may set this to something beyond Qnil 196 Note Lisp code may set this to something beyond Qnil
197 and Qt, so bitfield can't be used here. */ 197 and Qt, so bitfield can't be used here. */
198 Lisp_Object INTERNAL_FIELD (dedicated); 198 Lisp_Object dedicated;
199 199
200 /* Line number and position of a line somewhere above the top of the 200 /* Line number and position of a line somewhere above the top of the
201 screen. If this field is nil, it means we don't have a base 201 screen. If this field is nil, it means we don't have a base
202 line. */ 202 line. */
203 Lisp_Object INTERNAL_FIELD (base_line_number); 203 Lisp_Object base_line_number;
204 /* If this field is nil, it means we don't have a base line. 204 /* If this field is nil, it means we don't have a base line.
205 If it is a buffer, it means don't display the line number 205 If it is a buffer, it means don't display the line number
206 as long as the window shows that buffer. */ 206 as long as the window shows that buffer. */
207 Lisp_Object INTERNAL_FIELD (base_line_pos); 207 Lisp_Object base_line_pos;
208 208
209 /* If we have highlighted the region (or any part of it), 209 /* If we have highlighted the region (or any part of it),
210 this is the mark position that we used, as an integer. */ 210 this is the mark position that we used, as an integer. */
211 Lisp_Object INTERNAL_FIELD (region_showing); 211 Lisp_Object region_showing;
212 212
213 /* The column number currently displayed in this window's mode line, 213 /* The column number currently displayed in this window's mode line,
214 or nil if column numbers are not being displayed. */ 214 or nil if column numbers are not being displayed. */
215 Lisp_Object INTERNAL_FIELD (column_number_displayed); 215 Lisp_Object column_number_displayed;
216 216
217 /* If redisplay in this window goes beyond this buffer position, 217 /* If redisplay in this window goes beyond this buffer position,
218 must run the redisplay-end-trigger-hook. */ 218 must run the redisplay-end-trigger-hook. */
219 Lisp_Object INTERNAL_FIELD (redisplay_end_trigger); 219 Lisp_Object redisplay_end_trigger;
220 220
221 /* t means this window's child windows are not (re-)combined. */ 221 /* t means this window's child windows are not (re-)combined. */
222 Lisp_Object INTERNAL_FIELD (combination_limit); 222 Lisp_Object combination_limit;
223 223
224 /* Alist of <buffer, window-start, window-point> triples listing 224 /* Alist of <buffer, window-start, window-point> triples listing
225 buffers previously shown in this window. */ 225 buffers previously shown in this window. */
226 Lisp_Object INTERNAL_FIELD (prev_buffers); 226 Lisp_Object prev_buffers;
227 227
228 /* List of buffers re-shown in this window. */ 228 /* List of buffers re-shown in this window. */
229 Lisp_Object INTERNAL_FIELD (next_buffers); 229 Lisp_Object next_buffers;
230 230
231 /* An alist with parameters. */ 231 /* An alist with parameters. */
232 Lisp_Object INTERNAL_FIELD (window_parameters); 232 Lisp_Object window_parameters;
233 233
234 /* No Lisp data may follow below this point without changing 234 /* No Lisp data may follow below this point without changing
235 mark_object in alloc.c. The member current_matrix must be the 235 mark_object in alloc.c. The member current_matrix must be the
@@ -396,13 +396,13 @@ struct window
396 This includes scroll bars and fringes. */ 396 This includes scroll bars and fringes. */
397 397
398#define WINDOW_TOTAL_COLS(W) \ 398#define WINDOW_TOTAL_COLS(W) \
399 (XFASTINT (WVAR (W, total_cols))) 399 (XFASTINT (W->total_cols))
400 400
401/* Return the height of window W in canonical line units. 401/* Return the height of window W in canonical line units.
402 This includes header and mode lines, if any. */ 402 This includes header and mode lines, if any. */
403 403
404#define WINDOW_TOTAL_LINES(W) \ 404#define WINDOW_TOTAL_LINES(W) \
405 (XFASTINT (WVAR (W, total_lines))) 405 (XFASTINT (W->total_lines))
406 406
407/* Return the total pixel width of window W. */ 407/* Return the total pixel width of window W. */
408 408
@@ -430,7 +430,7 @@ struct window
430 This includes a left-hand scroll bar, if any. */ 430 This includes a left-hand scroll bar, if any. */
431 431
432#define WINDOW_LEFT_EDGE_COL(W) \ 432#define WINDOW_LEFT_EDGE_COL(W) \
433 (XFASTINT (WVAR (W, left_col))) 433 (XFASTINT (W->left_col))
434 434
435/* Return the canonical frame column before which window W ends. 435/* Return the canonical frame column before which window W ends.
436 This includes a right-hand scroll bar, if any. */ 436 This includes a right-hand scroll bar, if any. */
@@ -442,7 +442,7 @@ struct window
442 This includes a header line, if any. */ 442 This includes a header line, if any. */
443 443
444#define WINDOW_TOP_EDGE_LINE(W) \ 444#define WINDOW_TOP_EDGE_LINE(W) \
445 (XFASTINT (WVAR (W, top_line))) 445 (XFASTINT (W->top_line))
446 446
447/* Return the canonical frame line before which window W ends. 447/* Return the canonical frame line before which window W ends.
448 This includes a mode line, if any. */ 448 This includes a mode line, if any. */
@@ -468,14 +468,14 @@ struct window
468/* 1 if W is a menu bar window. */ 468/* 1 if W is a menu bar window. */
469 469
470#define WINDOW_MENU_BAR_P(W) \ 470#define WINDOW_MENU_BAR_P(W) \
471 (WINDOWP (FVAR (WINDOW_XFRAME (W), menu_bar_window)) \ 471 (WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \
472 && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), menu_bar_window))) 472 && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window))
473 473
474/* 1 if W is a tool bar window. */ 474/* 1 if W is a tool bar window. */
475 475
476#define WINDOW_TOOL_BAR_P(W) \ 476#define WINDOW_TOOL_BAR_P(W) \
477 (WINDOWP (FVAR (WINDOW_XFRAME (W), tool_bar_window)) \ 477 (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \
478 && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), tool_bar_window))) 478 && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window))
479 479
480/* Return the frame y-position at which window W starts. 480/* Return the frame y-position at which window W starts.
481 This includes a header line, if any. */ 481 This includes a header line, if any. */
@@ -546,32 +546,32 @@ struct window
546 546
547/* Width of left margin area in columns. */ 547/* Width of left margin area in columns. */
548 548
549#define WINDOW_LEFT_MARGIN_COLS(W) \ 549#define WINDOW_LEFT_MARGIN_COLS(W) \
550 (NILP (WVAR (W, left_margin_cols)) \ 550 (NILP (W->left_margin_cols) \
551 ? 0 \ 551 ? 0 \
552 : XINT (WVAR (W, left_margin_cols))) 552 : XINT (W->left_margin_cols))
553 553
554/* Width of right marginal area in columns. */ 554/* Width of right marginal area in columns. */
555 555
556#define WINDOW_RIGHT_MARGIN_COLS(W) \ 556#define WINDOW_RIGHT_MARGIN_COLS(W) \
557 (NILP (WVAR (W, right_margin_cols)) \ 557 (NILP (W->right_margin_cols) \
558 ? 0 \ 558 ? 0 \
559 : XINT (WVAR (W, right_margin_cols))) 559 : XINT (W->right_margin_cols))
560 560
561/* Width of left margin area in pixels. */ 561/* Width of left margin area in pixels. */
562 562
563#define WINDOW_LEFT_MARGIN_WIDTH(W) \ 563#define WINDOW_LEFT_MARGIN_WIDTH(W) \
564 (NILP (WVAR (W, left_margin_cols)) \ 564 (NILP (W->left_margin_cols) \
565 ? 0 \ 565 ? 0 \
566 : (XINT (WVAR (W, left_margin_cols)) \ 566 : (XINT (W->left_margin_cols) \
567 * WINDOW_FRAME_COLUMN_WIDTH (W))) 567 * WINDOW_FRAME_COLUMN_WIDTH (W)))
568 568
569/* Width of right marginal area in pixels. */ 569/* Width of right marginal area in pixels. */
570 570
571#define WINDOW_RIGHT_MARGIN_WIDTH(W) \ 571#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
572 (NILP (WVAR (W, right_margin_cols)) \ 572 (NILP (W->right_margin_cols) \
573 ? 0 \ 573 ? 0 \
574 : (XINT (WVAR (W, right_margin_cols)) \ 574 : (XINT (W->right_margin_cols) \
575 * WINDOW_FRAME_COLUMN_WIDTH (W))) 575 * WINDOW_FRAME_COLUMN_WIDTH (W)))
576 576
577/* Total width of fringes reserved for drawing truncation bitmaps, 577/* Total width of fringes reserved for drawing truncation bitmaps,
@@ -580,37 +580,37 @@ struct window
580 sizes aren't pixel values. If it weren't the case, we wouldn't be 580 sizes aren't pixel values. If it weren't the case, we wouldn't be
581 able to split windows horizontally nicely. */ 581 able to split windows horizontally nicely. */
582 582
583#define WINDOW_FRINGE_COLS(W) \ 583#define WINDOW_FRINGE_COLS(W) \
584 ((INTEGERP (WVAR (W, left_fringe_width)) \ 584 ((INTEGERP (W->left_fringe_width) \
585 || INTEGERP (WVAR (W, right_fringe_width))) \ 585 || INTEGERP (W->right_fringe_width)) \
586 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ 586 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \
587 + WINDOW_RIGHT_FRINGE_WIDTH (W) \ 587 + WINDOW_RIGHT_FRINGE_WIDTH (W) \
588 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 588 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
589 / WINDOW_FRAME_COLUMN_WIDTH (W)) \ 589 / WINDOW_FRAME_COLUMN_WIDTH (W)) \
590 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W))) 590 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W)))
591 591
592/* Column-width of the left and right fringe. */ 592/* Column-width of the left and right fringe. */
593 593
594#define WINDOW_LEFT_FRINGE_COLS(W) \ 594#define WINDOW_LEFT_FRINGE_COLS(W) \
595 ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \ 595 ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \
596 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 596 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
597 / WINDOW_FRAME_COLUMN_WIDTH (W)) 597 / WINDOW_FRAME_COLUMN_WIDTH (W))
598 598
599#define WINDOW_RIGHT_FRINGE_COLS(W) \ 599#define WINDOW_RIGHT_FRINGE_COLS(W) \
600 ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \ 600 ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \
601 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 601 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
602 / WINDOW_FRAME_COLUMN_WIDTH (W)) 602 / WINDOW_FRAME_COLUMN_WIDTH (W))
603 603
604/* Pixel-width of the left and right fringe. */ 604/* Pixel-width of the left and right fringe. */
605 605
606#define WINDOW_LEFT_FRINGE_WIDTH(W) \ 606#define WINDOW_LEFT_FRINGE_WIDTH(W) \
607 (INTEGERP (WVAR (W, left_fringe_width)) \ 607 (INTEGERP (W->left_fringe_width) \
608 ? XFASTINT (WVAR (W, left_fringe_width)) \ 608 ? XFASTINT (W->left_fringe_width) \
609 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 609 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
610 610
611#define WINDOW_RIGHT_FRINGE_WIDTH(W) \ 611#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
612 (INTEGERP (WVAR (W, right_fringe_width)) \ 612 (INTEGERP (W->right_fringe_width) \
613 ? XFASTINT (WVAR (W, right_fringe_width)) \ 613 ? XFASTINT (W->right_fringe_width) \
614 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 614 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
615 615
616/* Total width of fringes in pixels. */ 616/* Total width of fringes in pixels. */
@@ -627,36 +627,36 @@ struct window
627 and which side they are on. */ 627 and which side they are on. */
628 628
629#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ 629#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \
630 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 630 (EQ (w->vertical_scroll_bar_type, Qt) \
631 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ 631 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \
632 : EQ (WVAR (w, vertical_scroll_bar_type), Qleft) \ 632 : EQ (w->vertical_scroll_bar_type, Qleft) \
633 ? vertical_scroll_bar_left \ 633 ? vertical_scroll_bar_left \
634 : EQ (WVAR (w, vertical_scroll_bar_type), Qright) \ 634 : EQ (w->vertical_scroll_bar_type, Qright) \
635 ? vertical_scroll_bar_right \ 635 ? vertical_scroll_bar_right \
636 : vertical_scroll_bar_none) \ 636 : vertical_scroll_bar_none) \
637 637
638#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ 638#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \
639 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 639 (EQ (w->vertical_scroll_bar_type, Qt) \
640 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ 640 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \
641 : !NILP (WVAR (w, vertical_scroll_bar_type))) 641 : !NILP (w->vertical_scroll_bar_type))
642 642
643#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ 643#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \
644 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 644 (EQ (w->vertical_scroll_bar_type, Qt) \
645 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ 645 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \
646 : EQ (WVAR (w, vertical_scroll_bar_type), Qleft)) 646 : EQ (w->vertical_scroll_bar_type, Qleft))
647 647
648#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ 648#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \
649 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 649 (EQ (w->vertical_scroll_bar_type, Qt) \
650 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ 650 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w)) \
651 : EQ (WVAR (w, vertical_scroll_bar_type), Qright)) 651 : EQ (w->vertical_scroll_bar_type, Qright))
652 652
653/* Width that a scroll bar in window W should have, if there is one. 653/* Width that a scroll bar in window W should have, if there is one.
654 Measured in pixels. If scroll bars are turned off, this is still 654 Measured in pixels. If scroll bars are turned off, this is still
655 nonzero. */ 655 nonzero. */
656 656
657#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \ 657#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \
658 (INTEGERP (WVAR (w, scroll_bar_width)) \ 658 (INTEGERP (w->scroll_bar_width) \
659 ? XFASTINT (WVAR (w, scroll_bar_width)) \ 659 ? XFASTINT (w->scroll_bar_width) \
660 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))) 660 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
661 661
662/* Width that a scroll bar in window W should have, if there is one. 662/* Width that a scroll bar in window W should have, if there is one.
@@ -664,8 +664,8 @@ struct window
664 this is still nonzero. */ 664 this is still nonzero. */
665 665
666#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ 666#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \
667 (INTEGERP (WVAR (w, scroll_bar_width)) \ 667 (INTEGERP (w->scroll_bar_width) \
668 ? ((XFASTINT (WVAR (w, scroll_bar_width)) \ 668 ? ((XFASTINT (w->scroll_bar_width) \
669 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ 669 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \
670 / WINDOW_FRAME_COLUMN_WIDTH (w)) \ 670 / WINDOW_FRAME_COLUMN_WIDTH (w)) \
671 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) 671 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
@@ -675,14 +675,14 @@ struct window
675 the right in this frame, or there are no scroll bars, value is 0. */ 675 the right in this frame, or there are no scroll bars, value is 0. */
676 676
677#define WINDOW_LEFT_SCROLL_BAR_COLS(w) \ 677#define WINDOW_LEFT_SCROLL_BAR_COLS(w) \
678 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ 678 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
679 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \ 679 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \
680 : 0) 680 : 0)
681 681
682/* Width of a left scroll bar area in window W , measured in pixels. */ 682/* Width of a left scroll bar area in window W , measured in pixels. */
683 683
684#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \ 684#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \
685 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ 685 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
686 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ 686 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
687 : 0) 687 : 0)
688 688
@@ -691,7 +691,7 @@ struct window
691 the left in this frame, or there are no scroll bars, value is 0. */ 691 the left in this frame, or there are no scroll bars, value is 0. */
692 692
693#define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \ 693#define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \
694 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \ 694 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \
695 ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \ 695 ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \
696 : 0) 696 : 0)
697 697
@@ -713,7 +713,7 @@ struct window
713/* Width of a left scroll bar area in window W , measured in pixels. */ 713/* Width of a left scroll bar area in window W , measured in pixels. */
714 714
715#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \ 715#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \
716 (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \ 716 (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \
717 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ 717 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
718 : 0) 718 : 0)
719 719
@@ -734,7 +734,7 @@ struct window
734 ? CURRENT_MODE_LINE_HEIGHT (W) \ 734 ? CURRENT_MODE_LINE_HEIGHT (W) \
735 : 0) 735 : 0)
736 736
737#define WINDOW_MODE_LINE_LINES(W) \ 737#define WINDOW_MODE_LINE_LINES(W) \
738 (!! WINDOW_WANTS_MODELINE_P ((W))) 738 (!! WINDOW_WANTS_MODELINE_P ((W)))
739 739
740/* Height in pixels, and in lines, of the header line. 740/* Height in pixels, and in lines, of the header line.
@@ -745,7 +745,7 @@ struct window
745 ? CURRENT_HEADER_LINE_HEIGHT (W) \ 745 ? CURRENT_HEADER_LINE_HEIGHT (W) \
746 : 0) 746 : 0)
747 747
748#define WINDOW_HEADER_LINE_LINES(W) \ 748#define WINDOW_HEADER_LINE_LINES(W) \
749 (!! WINDOW_WANTS_HEADER_LINE_P ((W))) 749 (!! WINDOW_WANTS_HEADER_LINE_P ((W)))
750 750
751/* Pixel height of window W without mode line. */ 751/* Pixel height of window W without mode line. */
@@ -756,36 +756,36 @@ struct window
756 756
757/* Pixel height of window W without mode and header line. */ 757/* Pixel height of window W without mode and header line. */
758 758
759#define WINDOW_BOX_TEXT_HEIGHT(W) \ 759#define WINDOW_BOX_TEXT_HEIGHT(W) \
760 (WINDOW_TOTAL_HEIGHT ((W)) \ 760 (WINDOW_TOTAL_HEIGHT ((W)) \
761 - WINDOW_MODE_LINE_HEIGHT ((W)) \ 761 - WINDOW_MODE_LINE_HEIGHT ((W)) \
762 - WINDOW_HEADER_LINE_HEIGHT ((W))) 762 - WINDOW_HEADER_LINE_HEIGHT ((W)))
763 763
764 764
765/* Convert window W relative pixel X to frame pixel coordinates. */ 765/* Convert window W relative pixel X to frame pixel coordinates. */
766 766
767#define WINDOW_TO_FRAME_PIXEL_X(W, X) \ 767#define WINDOW_TO_FRAME_PIXEL_X(W, X) \
768 ((X) + WINDOW_BOX_LEFT_EDGE_X ((W))) 768 ((X) + WINDOW_BOX_LEFT_EDGE_X ((W)))
769 769
770/* Convert window W relative pixel Y to frame pixel coordinates. */ 770/* Convert window W relative pixel Y to frame pixel coordinates. */
771 771
772#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ 772#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \
773 ((Y) + WINDOW_TOP_EDGE_Y ((W))) 773 ((Y) + WINDOW_TOP_EDGE_Y ((W)))
774 774
775/* Convert frame relative pixel X to window relative pixel X. */ 775/* Convert frame relative pixel X to window relative pixel X. */
776 776
777#define FRAME_TO_WINDOW_PIXEL_X(W, X) \ 777#define FRAME_TO_WINDOW_PIXEL_X(W, X) \
778 ((X) - WINDOW_BOX_LEFT_EDGE_X ((W))) 778 ((X) - WINDOW_BOX_LEFT_EDGE_X ((W)))
779 779
780/* Convert frame relative pixel Y to window relative pixel Y. */ 780/* Convert frame relative pixel Y to window relative pixel Y. */
781 781
782#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ 782#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \
783 ((Y) - WINDOW_TOP_EDGE_Y ((W))) 783 ((Y) - WINDOW_TOP_EDGE_Y ((W)))
784 784
785/* Convert a text area relative x-position in window W to frame X 785/* Convert a text area relative x-position in window W to frame X
786 pixel coordinates. */ 786 pixel coordinates. */
787 787
788#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ 788#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \
789 (window_box_left ((W), TEXT_AREA) + (X)) 789 (window_box_left ((W), TEXT_AREA) + (X))
790 790
791/* This is the window in which the terminal's cursor should 791/* This is the window in which the terminal's cursor should
@@ -887,9 +887,8 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
887 887
888/* Value is non-zero if WINDOW is a live window. */ 888/* Value is non-zero if WINDOW is a live window. */
889 889
890#define WINDOW_LIVE_P(WINDOW) \ 890#define WINDOW_LIVE_P(WINDOW) \
891 (WINDOWP ((WINDOW)) && !NILP (WVAR (XWINDOW ((WINDOW)), buffer))) 891 (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer))
892
893 892
894/* These used to be in lisp.h. */ 893/* These used to be in lisp.h. */
895 894