diff options
| author | Martin Rudalics | 2011-06-08 10:35:20 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-06-08 10:35:20 +0200 |
| commit | 496e208ef95f8c691f4fe36d6ad6adbe3dedcd15 (patch) | |
| tree | ec79ee5d45bf8d20ab71c75c366c69e5f2e43fe6 /src/window.h | |
| parent | 2c5871045a2b87432ad62ebf13672abe81fae0ba (diff) | |
| download | emacs-496e208ef95f8c691f4fe36d6ad6adbe3dedcd15.tar.gz emacs-496e208ef95f8c691f4fe36d6ad6adbe3dedcd15.zip | |
Add some new members to window structure in window.h.
* window.h (window): Add some new members to window structure -
normal_lines, normal_cols, new_total, new_normal, clone_number,
splits, nest, prev_buffers, next_buffers.
(WINDOW_TOTAL_SIZE): Move here from window.c.
(MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define.
* window.c (WINDOW_TOTAL_SIZE): Move to window.h.
(make_dummy_parent): Set new members of windows structure.
(make_window): Move down in code. Handle new members of window
structure.
(Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
(Fwindow_nest, Fset_window_nest, Fwindow_new_total)
(Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
(Fset_window_prev_buffers, Fwindow_next_buffers)
(Fset_window_next_buffers, Fset_window_clone_number): New
functions.
(Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
(Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
Doc-string fixes.
(Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
Argument WINDOW can be now internal window too.
(Fwindow_use_time): Move up in code.
(Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
Rewrite doc-string.
(Fset_window_configuration, saved_window)
(Fcurrent_window_configuration, save_window_save): Handle new
members of window structure.
Diffstat (limited to 'src/window.h')
| -rw-r--r-- | src/window.h | 117 |
1 files changed, 91 insertions, 26 deletions
diff --git a/src/window.h b/src/window.h index 37d22bd7a76..c33179de9ba 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -93,38 +93,57 @@ struct window | |||
| 93 | 93 | ||
| 94 | /* The frame this window is on. */ | 94 | /* The frame this window is on. */ |
| 95 | Lisp_Object frame; | 95 | Lisp_Object frame; |
| 96 | |||
| 96 | /* t if this window is a minibuffer window. */ | 97 | /* t if this window is a minibuffer window. */ |
| 97 | Lisp_Object mini_p; | 98 | Lisp_Object mini_p; |
| 98 | /* Following child (to right or down) at same level of tree */ | 99 | |
| 99 | Lisp_Object next; | 100 | /* Following (to right or down) and preceding (to left or up) child |
| 100 | /* Preceding child (to left or up) at same level of tree */ | 101 | at same level of tree. */ |
| 101 | Lisp_Object prev; | 102 | Lisp_Object next, prev; |
| 102 | /* First child of this window. */ | 103 | |
| 103 | /* vchild is used if this is a vertical combination, | 104 | /* First child of this window: vchild is used if this is a vertical |
| 104 | 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. */ | ||
| 105 | Lisp_Object hchild, vchild; | 108 | Lisp_Object hchild, vchild; |
| 106 | /* The window this one is a child of. */ | 109 | |
| 110 | /* The window this one is a child of. */ | ||
| 107 | Lisp_Object parent; | 111 | Lisp_Object parent; |
| 108 | /* The upper left corner coordinates of this window, | 112 | |
| 109 | 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. */ | ||
| 110 | Lisp_Object left_col; | 115 | Lisp_Object left_col; |
| 111 | Lisp_Object top_line; | 116 | Lisp_Object top_line; |
| 112 | /* The size of the window */ | 117 | |
| 118 | /* The size of the window. */ | ||
| 113 | Lisp_Object total_lines; | 119 | Lisp_Object total_lines; |
| 114 | Lisp_Object total_cols; | 120 | Lisp_Object total_cols; |
| 115 | /* The buffer displayed in this window */ | 121 | |
| 116 | /* 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. */ | ||
| 117 | Lisp_Object buffer; | 133 | Lisp_Object buffer; |
| 134 | |||
| 118 | /* A marker pointing to where in the text to start displaying. | 135 | /* A marker pointing to where in the text to start displaying. |
| 119 | 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 |
| 120 | buffer position visible in the window, not necessarily the | 137 | buffer position visible in the window, not necessarily the |
| 121 | character displayed in the top left corner of the window. */ | 138 | character displayed in the top left corner of the window. */ |
| 122 | Lisp_Object start; | 139 | Lisp_Object start; |
| 140 | |||
| 123 | /* 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, |
| 124 | used only when the window is not selected. | 142 | used only when the window is not selected. |
| 125 | This exists so that when multiple windows show one buffer | 143 | This exists so that when multiple windows show one buffer |
| 126 | each one can have its own value of point. */ | 144 | each one can have its own value of point. */ |
| 127 | Lisp_Object pointm; | 145 | Lisp_Object pointm; |
| 146 | |||
| 128 | /* Non-nil means next redisplay must use the value of start | 147 | /* Non-nil means next redisplay must use the value of start |
| 129 | set up for it in advance. Set by scrolling commands. */ | 148 | set up for it in advance. Set by scrolling commands. */ |
| 130 | Lisp_Object force_start; | 149 | Lisp_Object force_start; |
| @@ -133,26 +152,38 @@ struct window | |||
| 133 | 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 |
| 134 | Vwindow_scroll_functions; also by Frecenter with argument. */ | 153 | Vwindow_scroll_functions; also by Frecenter with argument. */ |
| 135 | Lisp_Object optional_new_start; | 154 | Lisp_Object optional_new_start; |
| 155 | |||
| 136 | /* 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. */ |
| 137 | Lisp_Object hscroll; | 157 | Lisp_Object hscroll; |
| 138 | /* Minimum hscroll for automatic hscrolling. This is the value | 158 | /* Minimum hscroll for automatic hscrolling. This is the value |
| 139 | the user has set, by set-window-hscroll for example. */ | 159 | the user has set, by set-window-hscroll for example. */ |
| 140 | Lisp_Object min_hscroll; | 160 | Lisp_Object min_hscroll; |
| 141 | /* Number saying how recently window was selected */ | 161 | |
| 162 | /* Number saying how recently window was selected. */ | ||
| 142 | Lisp_Object use_time; | 163 | Lisp_Object use_time; |
| 143 | /* Unique number of window assigned when it was created */ | 164 | |
| 165 | /* Unique number of window assigned when it was created. */ | ||
| 144 | Lisp_Object sequence_number; | 166 | Lisp_Object sequence_number; |
| 145 | /* 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. */ | ||
| 146 | Lisp_Object temslot; | 174 | Lisp_Object temslot; |
| 147 | /* 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. */ | ||
| 148 | Lisp_Object last_modified; | 178 | Lisp_Object last_modified; |
| 149 | /* BUF_OVERLAY_MODIFIED of displayed buffer as of last complete update. */ | 179 | /* BUF_OVERLAY_MODIFIED of displayed buffer as of last complete update. */ |
| 150 | Lisp_Object last_overlay_modified; | 180 | Lisp_Object last_overlay_modified; |
| 151 | /* Value of point at that time */ | 181 | /* Value of point at that time. */ |
| 152 | Lisp_Object last_point; | 182 | Lisp_Object last_point; |
| 153 | /* Non-nil if the buffer was "modified" when the window | 183 | /* Non-nil if the buffer was "modified" when the window |
| 154 | was last updated. */ | 184 | was last updated. */ |
| 155 | Lisp_Object last_had_star; | 185 | Lisp_Object last_had_star; |
| 186 | |||
| 156 | /* 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 |
| 157 | by the window-system-dependent code which implements the | 188 | by the window-system-dependent code which implements the |
| 158 | scroll bars; it can store anything it likes here. If this | 189 | scroll bars; it can store anything it likes here. If this |
| @@ -167,14 +198,14 @@ struct window | |||
| 167 | /* Width of left and right fringes. | 198 | /* Width of left and right fringes. |
| 168 | A value of nil or t means use frame values. */ | 199 | A value of nil or t means use frame values. */ |
| 169 | Lisp_Object left_fringe_width, right_fringe_width; | 200 | Lisp_Object left_fringe_width, right_fringe_width; |
| 170 | 201 | /* Non-nil means fringes are drawn outside display margins; | |
| 171 | /* Non-nil means fringes are drawn outside display margins; | 202 | othersize draw them between margin areas and text. */ |
| 172 | othersize draw them between margin areas and text. */ | ||
| 173 | Lisp_Object fringes_outside_margins; | 203 | Lisp_Object fringes_outside_margins; |
| 174 | 204 | ||
| 175 | /* Pixel width of scroll bars. | 205 | /* Pixel width of scroll bars. |
| 176 | A value of nil or t means use frame values. */ | 206 | A value of nil or t means use frame values. */ |
| 177 | Lisp_Object scroll_bar_width; | 207 | Lisp_Object scroll_bar_width; |
| 208 | |||
| 178 | /* Type of vertical scroll bar. A value of nil means | 209 | /* Type of vertical scroll bar. A value of nil means |
| 179 | no scroll bar. A value of t means use frame value. */ | 210 | no scroll bar. A value of t means use frame value. */ |
| 180 | Lisp_Object vertical_scroll_bar_type; | 211 | Lisp_Object vertical_scroll_bar_type; |
| @@ -183,6 +214,7 @@ struct window | |||
| 183 | /* 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 */ |
| 184 | Lisp_Object last_mark_x; | 215 | Lisp_Object last_mark_x; |
| 185 | Lisp_Object last_mark_y; | 216 | Lisp_Object last_mark_y; |
| 217 | |||
| 186 | /* 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 |
| 187 | of W. Only valid if WINDOW_END_VALID is not nil. */ | 219 | of W. Only valid if WINDOW_END_VALID is not nil. */ |
| 188 | Lisp_Object window_end_pos; | 220 | Lisp_Object window_end_pos; |
| @@ -194,30 +226,38 @@ struct window | |||
| 194 | since in that case the frame image that window_end_pos | 226 | since in that case the frame image that window_end_pos |
| 195 | did not get onto the frame. */ | 227 | did not get onto the frame. */ |
| 196 | Lisp_Object window_end_valid; | 228 | Lisp_Object window_end_valid; |
| 229 | |||
| 197 | /* Non-nil means must regenerate mode line of this window */ | 230 | /* Non-nil means must regenerate mode line of this window */ |
| 198 | Lisp_Object update_mode_line; | 231 | Lisp_Object update_mode_line; |
| 232 | |||
| 199 | /* Non-nil means current value of `start' | 233 | /* Non-nil means current value of `start' |
| 200 | was the beginning of a line when it was chosen. */ | 234 | was the beginning of a line when it was chosen. */ |
| 201 | Lisp_Object start_at_line_beg; | 235 | Lisp_Object start_at_line_beg; |
| 236 | |||
| 202 | /* Display-table to use for displaying chars in this window. | 237 | /* Display-table to use for displaying chars in this window. |
| 203 | Nil means use the buffer's own display-table. */ | 238 | Nil means use the buffer's own display-table. */ |
| 204 | Lisp_Object display_table; | 239 | Lisp_Object display_table; |
| 240 | |||
| 205 | /* Non-nil means window is marked as dedicated. */ | 241 | /* Non-nil means window is marked as dedicated. */ |
| 206 | Lisp_Object dedicated; | 242 | Lisp_Object dedicated; |
| 207 | /* Line number and position of a line somewhere above the | 243 | |
| 208 | top of the screen. */ | 244 | /* Line number and position of a line somewhere above the top of the |
| 209 | /* 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. */ | ||
| 210 | Lisp_Object base_line_number; | 247 | Lisp_Object base_line_number; |
| 211 | /* 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. |
| 212 | 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 |
| 213 | as long as the window shows that buffer. */ | 250 | as long as the window shows that buffer. */ |
| 214 | Lisp_Object base_line_pos; | 251 | Lisp_Object base_line_pos; |
| 252 | |||
| 215 | /* If we have highlighted the region (or any part of it), | 253 | /* If we have highlighted the region (or any part of it), |
| 216 | this is the mark position that we used, as an integer. */ | 254 | this is the mark position that we used, as an integer. */ |
| 217 | Lisp_Object region_showing; | 255 | Lisp_Object region_showing; |
| 256 | |||
| 218 | /* The column number currently displayed in this window's mode line, | 257 | /* The column number currently displayed in this window's mode line, |
| 219 | or nil if column numbers are not being displayed. */ | 258 | or nil if column numbers are not being displayed. */ |
| 220 | Lisp_Object column_number_displayed; | 259 | Lisp_Object column_number_displayed; |
| 260 | |||
| 221 | /* If redisplay in this window goes beyond this buffer position, | 261 | /* If redisplay in this window goes beyond this buffer position, |
| 222 | must run the redisplay-end-trigger-hook. */ | 262 | must run the redisplay-end-trigger-hook. */ |
| 223 | Lisp_Object redisplay_end_trigger; | 263 | Lisp_Object redisplay_end_trigger; |
| @@ -228,6 +268,21 @@ struct window | |||
| 228 | /* Original window height and top before mini-window was enlarged. */ | 268 | /* Original window height and top before mini-window was enlarged. */ |
| 229 | Lisp_Object orig_total_lines, orig_top_line; | 269 | Lisp_Object orig_total_lines, orig_top_line; |
| 230 | 270 | ||
| 271 | /* Non-nil means deleting or resizing this window distributes | ||
| 272 | space among all windows in the same combination. */ | ||
| 273 | Lisp_Object splits; | ||
| 274 | |||
| 275 | /* Non-nil means this window's child windows are never | ||
| 276 | (re-)combined. */ | ||
| 277 | Lisp_Object nest; | ||
| 278 | |||
| 279 | /* Alist of <buffer, window-start, window-point> triples listing | ||
| 280 | buffers previously shown in this window. */ | ||
| 281 | Lisp_Object prev_buffers; | ||
| 282 | |||
| 283 | /* List of buffers re-shown in this window. */ | ||
| 284 | Lisp_Object next_buffers; | ||
| 285 | |||
| 231 | /* An alist with parameteres. */ | 286 | /* An alist with parameteres. */ |
| 232 | Lisp_Object window_parameters; | 287 | Lisp_Object window_parameters; |
| 233 | 288 | ||
| @@ -361,6 +416,17 @@ struct window | |||
| 361 | #define WINDOW_TOTAL_HEIGHT(W) \ | 416 | #define WINDOW_TOTAL_HEIGHT(W) \ |
| 362 | (WINDOW_TOTAL_LINES (W) * WINDOW_FRAME_LINE_HEIGHT (W)) | 417 | (WINDOW_TOTAL_LINES (W) * WINDOW_FRAME_LINE_HEIGHT (W)) |
| 363 | 418 | ||
| 419 | /* For HORFLAG non-zero the total number of columns of window W. Otherwise | ||
| 420 | the total number of lines of W. */ | ||
| 421 | |||
| 422 | #define WINDOW_TOTAL_SIZE(w, horflag) \ | ||
| 423 | (horflag ? WINDOW_TOTAL_COLS (w) : WINDOW_TOTAL_LINES (w)) | ||
| 424 | |||
| 425 | /* The smallest acceptable dimensions for a window. Anything smaller | ||
| 426 | might crash Emacs. */ | ||
| 427 | |||
| 428 | #define MIN_SAFE_WINDOW_WIDTH (2) | ||
| 429 | #define MIN_SAFE_WINDOW_HEIGHT (1) | ||
| 364 | 430 | ||
| 365 | /* Return the canonical frame column at which window W starts. | 431 | /* Return the canonical frame column at which window W starts. |
| 366 | This includes a left-hand scroll bar, if any. */ | 432 | This includes a left-hand scroll bar, if any. */ |
| @@ -859,6 +925,7 @@ extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); | |||
| 859 | EXFUN (Fpos_visible_in_window_p, 3); | 925 | EXFUN (Fpos_visible_in_window_p, 3); |
| 860 | extern void mark_window_cursors_off (struct window *); | 926 | extern void mark_window_cursors_off (struct window *); |
| 861 | extern int window_internal_height (struct window *); | 927 | extern int window_internal_height (struct window *); |
| 928 | extern int window_body_cols (struct window *w); | ||
| 862 | EXFUN (Frecenter, 1); | 929 | EXFUN (Frecenter, 1); |
| 863 | extern void temp_output_buffer_show (Lisp_Object); | 930 | extern void temp_output_buffer_show (Lisp_Object); |
| 864 | extern void replace_buffer_in_all_windows (Lisp_Object); | 931 | extern void replace_buffer_in_all_windows (Lisp_Object); |
| @@ -867,6 +934,4 @@ extern void init_window (void); | |||
| 867 | extern void syms_of_window (void); | 934 | extern void syms_of_window (void); |
| 868 | extern void keys_of_window (void); | 935 | extern void keys_of_window (void); |
| 869 | 936 | ||
| 870 | extern int window_body_cols (struct window *w); | ||
| 871 | |||
| 872 | #endif /* not WINDOW_H_INCLUDED */ | 937 | #endif /* not WINDOW_H_INCLUDED */ |