aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.h
diff options
context:
space:
mode:
authorJoakim Verona2011-06-16 00:22:07 +0200
committerJoakim Verona2011-06-16 00:22:07 +0200
commita7513ade3bc0fe79430d5541d88c9dcda0932bec (patch)
tree4383951ba698a11e9f8933a9d8c72e00aa872a10 /src/window.h
parent4bd51ad5c3445b644dfb017d5b57b10a90aa325f (diff)
parent4bba86e6210a74326e843a8fdc8409127105e1fe (diff)
downloademacs-a7513ade3bc0fe79430d5541d88c9dcda0932bec.tar.gz
emacs-a7513ade3bc0fe79430d5541d88c9dcda0932bec.zip
merge from upstream
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h157
1 files changed, 102 insertions, 55 deletions
diff --git a/src/window.h b/src/window.h
index 491ffa30bd1..c3f59e4b116 100644
--- a/src/window.h
+++ b/src/window.h
@@ -88,44 +88,62 @@ struct cursor_pos
88 88
89struct window 89struct window
90 { 90 {
91 /* The first two fields are really the header of a vector */ 91 /* This is for Lisp; the terminal code does not refer to it. */
92 /* The window code does not refer to them. */ 92 struct vectorlike_header header;
93 EMACS_UINT size; 93
94 struct Lisp_Vector *vec_next;
95 /* The frame this window is on. */ 94 /* The frame this window is on. */
96 Lisp_Object frame; 95 Lisp_Object frame;
96
97 /* t if this window is a minibuffer window. */ 97 /* t if this window is a minibuffer window. */
98 Lisp_Object mini_p; 98 Lisp_Object mini_p;
99 /* Following child (to right or down) at same level of tree */ 99
100 Lisp_Object next; 100 /* Following (to right or down) and preceding (to left or up) child
101 /* Preceding child (to left or up) at same level of tree */ 101 at same level of tree. */
102 Lisp_Object prev; 102 Lisp_Object next, prev;
103 /* First child of this window. */ 103
104 /* vchild is used if this is a vertical combination, 104 /* First child of this window: vchild is used if this is a vertical
105 hchild if this is a horizontal combination. */ 105 combination, hchild if this is a horizontal combination. Of the
106 fields vchild, hchild and buffer, one and only one is non-nil
107 unless the window is dead. */
106 Lisp_Object hchild, vchild; 108 Lisp_Object hchild, vchild;
107 /* The window this one is a child of. */ 109
110 /* The window this one is a child of. */
108 Lisp_Object parent; 111 Lisp_Object parent;
109 /* The upper left corner coordinates of this window, 112
110 as integers relative to upper left corner of frame = 0, 0 */ 113 /* The upper left corner coordinates of this window, as integers
114 relative to upper left corner of frame = 0, 0. */
111 Lisp_Object left_col; 115 Lisp_Object left_col;
112 Lisp_Object top_line; 116 Lisp_Object top_line;
113 /* The size of the window */ 117
118 /* The size of the window. */
114 Lisp_Object total_lines; 119 Lisp_Object total_lines;
115 Lisp_Object total_cols; 120 Lisp_Object total_cols;
116 /* The buffer displayed in this window */ 121
117 /* Of the fields vchild, hchild and buffer, only one is non-nil. */ 122 /* The normal size of the window. */
123 Lisp_Object normal_lines;
124 Lisp_Object normal_cols;
125
126 /* New sizes of the window. */
127 Lisp_Object new_total;
128 Lisp_Object new_normal;
129
130 /* The buffer displayed in this window. Of the fields vchild,
131 hchild and buffer, one and only one is non-nil unless the window
132 is dead. */
118 Lisp_Object buffer; 133 Lisp_Object buffer;
134
119 /* A marker pointing to where in the text to start displaying. 135 /* A marker pointing to where in the text to start displaying.
120 BIDI Note: This is the _logical-order_ start, i.e. the smallest 136 BIDI Note: This is the _logical-order_ start, i.e. the smallest
121 buffer position visible in the window, not necessarily the 137 buffer position visible in the window, not necessarily the
122 character displayed in the top left corner of the window. */ 138 character displayed in the top left corner of the window. */
123 Lisp_Object start; 139 Lisp_Object start;
140
124 /* A marker pointing to where in the text point is in this window, 141 /* A marker pointing to where in the text point is in this window,
125 used only when the window is not selected. 142 used only when the window is not selected.
126 This exists so that when multiple windows show one buffer 143 This exists so that when multiple windows show one buffer
127 each one can have its own value of point. */ 144 each one can have its own value of point. */
128 Lisp_Object pointm; 145 Lisp_Object pointm;
146
129 /* Non-nil means next redisplay must use the value of start 147 /* Non-nil means next redisplay must use the value of start
130 set up for it in advance. Set by scrolling commands. */ 148 set up for it in advance. Set by scrolling commands. */
131 Lisp_Object force_start; 149 Lisp_Object force_start;
@@ -134,26 +152,38 @@ struct window
134 This is used in Fdelete_other_windows to force a call to 152 This is used in Fdelete_other_windows to force a call to
135 Vwindow_scroll_functions; also by Frecenter with argument. */ 153 Vwindow_scroll_functions; also by Frecenter with argument. */
136 Lisp_Object optional_new_start; 154 Lisp_Object optional_new_start;
155
137 /* Number of columns display within the window is scrolled to the left. */ 156 /* Number of columns display within the window is scrolled to the left. */
138 Lisp_Object hscroll; 157 Lisp_Object hscroll;
139 /* Minimum hscroll for automatic hscrolling. This is the value 158 /* Minimum hscroll for automatic hscrolling. This is the value
140 the user has set, by set-window-hscroll for example. */ 159 the user has set, by set-window-hscroll for example. */
141 Lisp_Object min_hscroll; 160 Lisp_Object min_hscroll;
142 /* Number saying how recently window was selected */ 161
162 /* Number saying how recently window was selected. */
143 Lisp_Object use_time; 163 Lisp_Object use_time;
144 /* Unique number of window assigned when it was created */ 164
165 /* Unique number of window assigned when it was created. */
145 Lisp_Object sequence_number; 166 Lisp_Object sequence_number;
146 /* No permanent meaning; used by save-window-excursion's bookkeeping */ 167
168 /* Sequence number of window this window was cloned from. Identic
169 to sequence number if window was not cloned. */
170 Lisp_Object clone_number;
171
172 /* No permanent meaning; used by save-window-excursion's
173 bookkeeping. */
147 Lisp_Object temslot; 174 Lisp_Object temslot;
148 /* text.modified of displayed buffer as of last time display completed */ 175
176 /* text.modified of displayed buffer as of last time display
177 completed. */
149 Lisp_Object last_modified; 178 Lisp_Object last_modified;
150 /* BUF_OVERLAY_MODIFIED of displayed buffer as of last complete update. */ 179 /* BUF_OVERLAY_MODIFIED of displayed buffer as of last complete update. */
151 Lisp_Object last_overlay_modified; 180 Lisp_Object last_overlay_modified;
152 /* Value of point at that time */ 181 /* Value of point at that time. */
153 Lisp_Object last_point; 182 Lisp_Object last_point;
154 /* Non-nil if the buffer was "modified" when the window 183 /* Non-nil if the buffer was "modified" when the window
155 was last updated. */ 184 was last updated. */
156 Lisp_Object last_had_star; 185 Lisp_Object last_had_star;
186
157 /* This window's vertical scroll bar. This field is only for use 187 /* This window's vertical scroll bar. This field is only for use
158 by the window-system-dependent code which implements the 188 by the window-system-dependent code which implements the
159 scroll bars; it can store anything it likes here. If this 189 scroll bars; it can store anything it likes here. If this
@@ -168,14 +198,14 @@ struct window
168 /* Width of left and right fringes. 198 /* Width of left and right fringes.
169 A value of nil or t means use frame values. */ 199 A value of nil or t means use frame values. */
170 Lisp_Object left_fringe_width, right_fringe_width; 200 Lisp_Object left_fringe_width, right_fringe_width;
171 201 /* Non-nil means fringes are drawn outside display margins;
172 /* Non-nil means fringes are drawn outside display margins; 202 othersize draw them between margin areas and text. */
173 othersize draw them between margin areas and text. */
174 Lisp_Object fringes_outside_margins; 203 Lisp_Object fringes_outside_margins;
175 204
176 /* Pixel width of scroll bars. 205 /* Pixel width of scroll bars.
177 A value of nil or t means use frame values. */ 206 A value of nil or t means use frame values. */
178 Lisp_Object scroll_bar_width; 207 Lisp_Object scroll_bar_width;
208
179 /* Type of vertical scroll bar. A value of nil means 209 /* Type of vertical scroll bar. A value of nil means
180 no scroll bar. A value of t means use frame value. */ 210 no scroll bar. A value of t means use frame value. */
181 Lisp_Object vertical_scroll_bar_type; 211 Lisp_Object vertical_scroll_bar_type;
@@ -184,6 +214,7 @@ struct window
184 /* May be nil if mark does not exist or was not on frame */ 214 /* May be nil if mark does not exist or was not on frame */
185 Lisp_Object last_mark_x; 215 Lisp_Object last_mark_x;
186 Lisp_Object last_mark_y; 216 Lisp_Object last_mark_y;
217
187 /* Z - the buffer position of the last glyph in the current matrix 218 /* Z - the buffer position of the last glyph in the current matrix
188 of W. Only valid if WINDOW_END_VALID is not nil. */ 219 of W. Only valid if WINDOW_END_VALID is not nil. */
189 Lisp_Object window_end_pos; 220 Lisp_Object window_end_pos;
@@ -195,39 +226,56 @@ struct window
195 since in that case the frame image that window_end_pos 226 since in that case the frame image that window_end_pos
196 did not get onto the frame. */ 227 did not get onto the frame. */
197 Lisp_Object window_end_valid; 228 Lisp_Object window_end_valid;
229
198 /* Non-nil means must regenerate mode line of this window */ 230 /* Non-nil means must regenerate mode line of this window */
199 Lisp_Object update_mode_line; 231 Lisp_Object update_mode_line;
232
200 /* Non-nil means current value of `start' 233 /* Non-nil means current value of `start'
201 was the beginning of a line when it was chosen. */ 234 was the beginning of a line when it was chosen. */
202 Lisp_Object start_at_line_beg; 235 Lisp_Object start_at_line_beg;
236
203 /* Display-table to use for displaying chars in this window. 237 /* Display-table to use for displaying chars in this window.
204 Nil means use the buffer's own display-table. */ 238 Nil means use the buffer's own display-table. */
205 Lisp_Object display_table; 239 Lisp_Object display_table;
240
206 /* Non-nil means window is marked as dedicated. */ 241 /* Non-nil means window is marked as dedicated. */
207 Lisp_Object dedicated; 242 Lisp_Object dedicated;
208 /* Line number and position of a line somewhere above the 243
209 top of the screen. */ 244 /* Line number and position of a line somewhere above the top of the
210 /* If this field is nil, it means we don't have a base line. */ 245 screen. If this field is nil, it means we don't have a base
246 line. */
211 Lisp_Object base_line_number; 247 Lisp_Object base_line_number;
212 /* If this field is nil, it means we don't have a base line. 248 /* If this field is nil, it means we don't have a base line.
213 If it is a buffer, it means don't display the line number 249 If it is a buffer, it means don't display the line number
214 as long as the window shows that buffer. */ 250 as long as the window shows that buffer. */
215 Lisp_Object base_line_pos; 251 Lisp_Object base_line_pos;
252
216 /* If we have highlighted the region (or any part of it), 253 /* If we have highlighted the region (or any part of it),
217 this is the mark position that we used, as an integer. */ 254 this is the mark position that we used, as an integer. */
218 Lisp_Object region_showing; 255 Lisp_Object region_showing;
256
219 /* The column number currently displayed in this window's mode line, 257 /* The column number currently displayed in this window's mode line,
220 or nil if column numbers are not being displayed. */ 258 or nil if column numbers are not being displayed. */
221 Lisp_Object column_number_displayed; 259 Lisp_Object column_number_displayed;
260
222 /* If redisplay in this window goes beyond this buffer position, 261 /* If redisplay in this window goes beyond this buffer position,
223 must run the redisplay-end-trigger-hook. */ 262 must run the redisplay-end-trigger-hook. */
224 Lisp_Object redisplay_end_trigger; 263 Lisp_Object redisplay_end_trigger;
225 /* Non-nil means resizing windows will attempt to resize this window
226 proportionally. */
227 Lisp_Object resize_proportionally;
228 264
229 /* Original window height and top before mini-window was enlarged. */ 265 /* Non-nil means deleting or resizing this window distributes
230 Lisp_Object orig_total_lines, orig_top_line; 266 space among all windows in the same combination. */
267 Lisp_Object splits;
268
269 /* Non-nil means this window's child windows are never
270 (re-)combined. */
271 Lisp_Object nest;
272
273 /* Alist of <buffer, window-start, window-point> triples listing
274 buffers previously shown in this window. */
275 Lisp_Object prev_buffers;
276
277 /* List of buffers re-shown in this window. */
278 Lisp_Object next_buffers;
231 279
232 /* An alist with parameteres. */ 280 /* An alist with parameteres. */
233 Lisp_Object window_parameters; 281 Lisp_Object window_parameters;
@@ -362,6 +410,17 @@ struct window
362#define WINDOW_TOTAL_HEIGHT(W) \ 410#define WINDOW_TOTAL_HEIGHT(W) \
363 (WINDOW_TOTAL_LINES (W) * WINDOW_FRAME_LINE_HEIGHT (W)) 411 (WINDOW_TOTAL_LINES (W) * WINDOW_FRAME_LINE_HEIGHT (W))
364 412
413/* For HORFLAG non-zero the total number of columns of window W. Otherwise
414 the total number of lines of W. */
415
416#define WINDOW_TOTAL_SIZE(w, horflag) \
417 (horflag ? WINDOW_TOTAL_COLS (w) : WINDOW_TOTAL_LINES (w))
418
419/* The smallest acceptable dimensions for a window. Anything smaller
420 might crash Emacs. */
421
422#define MIN_SAFE_WINDOW_WIDTH (2)
423#define MIN_SAFE_WINDOW_HEIGHT (1)
365 424
366/* Return the canonical frame column at which window W starts. 425/* Return the canonical frame column at which window W starts.
367 This includes a left-hand scroll bar, if any. */ 426 This includes a left-hand scroll bar, if any. */
@@ -763,17 +822,13 @@ extern Lisp_Object Vmouse_event;
763EXFUN (Fnext_window, 3); 822EXFUN (Fnext_window, 3);
764EXFUN (Fselect_window, 2); 823EXFUN (Fselect_window, 2);
765EXFUN (Fset_window_buffer, 3); 824EXFUN (Fset_window_buffer, 3);
766EXFUN (Fset_window_vscroll, 3);
767EXFUN (Fset_window_margins, 3);
768EXFUN (Fset_window_point, 2); 825EXFUN (Fset_window_point, 2);
769extern Lisp_Object make_window (void); 826extern Lisp_Object make_window (void);
770extern Lisp_Object window_from_coordinates (struct frame *, int, int, 827extern Lisp_Object window_from_coordinates (struct frame *, int, int,
771 enum window_part *, int); 828 enum window_part *, int);
772EXFUN (Fwindow_dedicated_p, 1); 829EXFUN (Fwindow_dedicated_p, 1);
773extern void set_window_height (Lisp_Object, int, int); 830extern void resize_frame_windows (struct frame *, int, int);
774extern void set_window_width (Lisp_Object, int, int); 831extern void delete_all_subwindows (Lisp_Object);
775extern void change_window_heights (Lisp_Object, int);
776extern void delete_all_subwindows (struct window *);
777extern void freeze_window_starts (struct frame *, int); 832extern void freeze_window_starts (struct frame *, int);
778extern void grow_mini_window (struct window *, int); 833extern void grow_mini_window (struct window *, int);
779extern void shrink_mini_window (struct window *); 834extern void shrink_mini_window (struct window *);
@@ -788,14 +843,6 @@ void run_window_configuration_change_hook (struct frame *f);
788void set_window_buffer (Lisp_Object window, Lisp_Object buffer, 843void set_window_buffer (Lisp_Object window, Lisp_Object buffer,
789 int run_hooks_p, int keep_margins_p); 844 int run_hooks_p, int keep_margins_p);
790 845
791/* Prompt to display in front of the minibuffer contents. */
792
793extern Lisp_Object minibuf_prompt;
794
795/* The visual width of the above. */
796
797extern int minibuf_prompt_width;
798
799/* This is the window where the echo area message was displayed. It 846/* This is the window where the echo area message was displayed. It
800 is always a minibuffer window, but it may not be the same window 847 is always a minibuffer window, but it may not be the same window
801 currently active as a minibuffer. */ 848 currently active as a minibuffer. */
@@ -855,27 +902,27 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
855extern Lisp_Object Qwindowp, Qwindow_live_p; 902extern Lisp_Object Qwindowp, Qwindow_live_p;
856extern Lisp_Object Vwindow_list; 903extern Lisp_Object Vwindow_list;
857 904
858EXFUN (Fselected_window, 0);
859EXFUN (Fwindow_minibuffer_p, 1);
860EXFUN (Fdelete_window, 1);
861EXFUN (Fwindow_buffer, 1); 905EXFUN (Fwindow_buffer, 1);
862EXFUN (Fget_buffer_window, 2); 906EXFUN (Fget_buffer_window, 2);
863EXFUN (Fsave_window_excursion, UNEVALLED); 907EXFUN (Fwindow_minibuffer_p, 1);
908EXFUN (Fselected_window, 0);
909EXFUN (Fframe_root_window, 1);
910EXFUN (Fframe_first_window, 1);
911EXFUN (Fset_frame_selected_window, 3);
864EXFUN (Fset_window_configuration, 1); 912EXFUN (Fset_window_configuration, 1);
865EXFUN (Fcurrent_window_configuration, 1); 913EXFUN (Fcurrent_window_configuration, 1);
866extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); 914extern int compare_window_configurations (Lisp_Object, Lisp_Object, int);
867EXFUN (Fpos_visible_in_window_p, 3); 915EXFUN (Fpos_visible_in_window_p, 3);
868extern void mark_window_cursors_off (struct window *); 916extern void mark_window_cursors_off (struct window *);
869extern int window_internal_height (struct window *); 917extern int window_internal_height (struct window *);
918extern int window_body_cols (struct window *w);
870EXFUN (Frecenter, 1); 919EXFUN (Frecenter, 1);
871extern void temp_output_buffer_show (Lisp_Object); 920extern void temp_output_buffer_show (Lisp_Object);
872extern void replace_buffer_in_all_windows (Lisp_Object); 921extern void replace_buffer_in_windows (Lisp_Object);
922extern void replace_buffer_in_windows_safely (Lisp_Object);
873extern void init_window_once (void); 923extern void init_window_once (void);
874extern void init_window (void); 924extern void init_window (void);
875extern void syms_of_window (void); 925extern void syms_of_window (void);
876extern void keys_of_window (void); 926extern void keys_of_window (void);
877 927
878extern int window_box_text_cols (struct window *w);
879
880#endif /* not WINDOW_H_INCLUDED */ 928#endif /* not WINDOW_H_INCLUDED */
881