Changeset 1707
- Timestamp:
- 02/17/98 01:45:19 (11 years ago)
- Files:
-
- branches/GNU/src/window.h (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/GNU/src/window.h
r1693 r1707 1 1 /* Window definitions for GNU Emacs. 2 Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001 3 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1993, 1995 Free Software Foundation, Inc. 4 3 5 4 This file is part of GNU Emacs. … … 20 19 Boston, MA 02111-1307, USA. */ 21 20 22 #ifndef WINDOW_H_INCLUDED23 #define WINDOW_H_INCLUDED24 25 #include "dispextern.h"26 21 27 22 /* Windows are allocated as if they were vectors, but then the … … 77 72 78 73 A dead window has its buffer, hchild, and vchild windows all nil. */ 79 80 struct cursor_pos81 {82 /* Pixel position. These are always window relative. */83 int x, y;84 85 /* Glyph matrix position. */86 int hpos, vpos;87 };88 74 89 75 struct window … … 128 114 Lisp_Object force_start; 129 115 /* Non-nil means we have explicitly changed the value of start, 130 but that the next redisplay is not obliged to use the new value. 131 This is used in Fdelete_other_windows to force a call to 132 Vwindow_scroll_functions. */ 116 but that the next redisplay is not obliged to use the new value. */ 133 117 Lisp_Object optional_new_start; 134 118 /* Number of columns display within the window is scrolled to the left. */ 135 119 Lisp_Object hscroll; 136 /* Minimum hscroll for automatic hscrolling. This is the value137 the user has set, by set-window-hscroll for example. */138 Lisp_Object min_hscroll;139 120 /* Number saying how recently window was selected */ 140 121 Lisp_Object use_time; … … 159 140 Lisp_Object vertical_scroll_bar; 160 141 161 /* Width of left and right marginal areas. A value of nil means 162 no margin. */ 163 Lisp_Object left_margin_width; 164 Lisp_Object right_margin_width; 165 166 /* The rest are currently not used or only half used */ 142 /* Some of these are currently not used or only half used */ 143 /* Frame coords of point at that time */ 144 Lisp_Object last_point_x; 145 Lisp_Object last_point_y; 167 146 /* Frame coords of mark as of last time display completed */ 168 147 /* May be nil if mark does not exist or was not on frame */ 169 148 Lisp_Object last_mark_x; 170 149 Lisp_Object last_mark_y; 171 /* Z - the buffer position of the last glyph in the current matrix 172 of W. Only valid if WINDOW_END_VALID is not nil. */ 150 151 /* Number of characters in buffer past bottom of window, 152 as of last redisplay that finished. */ 173 153 Lisp_Object window_end_pos; 174 /* Glyph matrix row of the last glyph in the current matrix175 of W. Only valid if WINDOW_END_VALID is not nil. */176 Lisp_Object window_end_vpos;177 154 /* t if window_end_pos is truly valid. 178 155 This is nil if nontrivial redisplay is preempted … … 180 157 did not get onto the frame. */ 181 158 Lisp_Object window_end_valid; 159 /* Vertical position (relative to window top) of that buffer position 160 of the first of those characters */ 161 Lisp_Object window_end_vpos; 182 162 /* Non-nil means must regenerate mode line of this window */ 183 163 Lisp_Object update_mode_line; … … 209 189 /* Non-nil means don't delete this window for becoming "too small". */ 210 190 Lisp_Object too_small_ok; 211 212 /* Original window height and top before mini-window was 213 enlarged. */ 214 Lisp_Object orig_height, orig_top; 215 216 /* No Lisp data may follow below this point without changing 217 mark_object in alloc.c. The member current_matrix must be the 218 first non-Lisp member. */ 219 220 /* Glyph matrices. */ 221 struct glyph_matrix *current_matrix; 222 struct glyph_matrix *desired_matrix; 223 224 /* Cursor position as of last update that completed without 225 pause. This is the position of last_point. */ 226 struct cursor_pos last_cursor; 227 228 /* Intended cursor position. This is a position within the 229 glyph matrix. */ 230 struct cursor_pos cursor; 231 232 /* Where the cursor actually is. */ 233 struct cursor_pos phys_cursor; 234 235 /* Cursor type last drawn on the window. Used for X frames; -1 236 initially. */ 237 int phys_cursor_type; 238 239 /* This is handy for undrawing the cursor. */ 240 int phys_cursor_ascent, phys_cursor_height; 241 242 /* Non-zero means the cursor is currently displayed. This can be 243 set to zero by functions overpainting the cursor image. */ 244 unsigned phys_cursor_on_p : 1; 245 246 /* 0 means cursor is logically on, 1 means it's off. Used for 247 blinking cursor. */ 248 unsigned cursor_off_p : 1; 249 250 /* Value of cursor_off_p as of the last redisplay. */ 251 unsigned last_cursor_off_p : 1; 252 253 /* 1 means desired matrix has been build and window must be 254 updated in update_frame. */ 255 unsigned must_be_updated_p : 1; 256 257 /* Flag indicating that this window is not a real one. 258 Currently only used for menu bar windows of frames. */ 259 unsigned pseudo_window_p : 1; 260 261 /* Amount by which lines of this window are scrolled in 262 y-direction (smooth scrolling). */ 263 int vscroll; 264 265 /* Z_BYTE - the buffer position of the last glyph in the current matrix 266 of W. Only valid if WINDOW_END_VALID is not nil. */ 267 int window_end_bytepos; 268 269 /* 1 means the window start of this window is frozen and may not 270 be changed during redisplay. If point is not in the window, 271 accept that. */ 272 unsigned frozen_window_start_p : 1; 273 274 /* 1 means that this window's height is temporarily fixed. Used 275 in resize_mini_window to precent resizing selected_window, if 276 possible. */ 277 unsigned height_fixed_p : 1; 278 }; 191 }; 279 192 280 193 /* 1 if W is a minibuffer window. */ 281 194 282 #define MINI_WINDOW_P(W) (!EQ ((W)->mini_p, Qnil))283 284 /* Return the windowcolumn at which the text in window W starts.195 #define MINI_WINDOW_P(W) (!EQ ((W)->mini_p, Qnil)) 196 197 /* Return the frame column at which the text in window W starts. 285 198 This is different from the `left' field because it does not include 286 199 a left-hand scroll bar if any. */ … … 290 203 + FRAME_LEFT_SCROLL_BAR_WIDTH (XFRAME (WINDOW_FRAME (W)))) 291 204 292 /* Return the window column before whichwindow W ends.205 /* Return the frame column before window W ends. 293 206 This includes a right-hand scroll bar, if any. */ 294 207 … … 296 209 (XFASTINT ((W)->left) + XFASTINT ((W)->width)) 297 210 298 /* Return the windowcolumn before which the text in window W ends.211 /* Return the frame column before which the text in window W ends. 299 212 This is different from WINDOW_RIGHT_EDGE because it does not include 300 213 a scroll bar or window-separating line on the right edge. */ 301 214 302 #define WINDOW_RIGHT_MARGIN(W) \ 303 (WINDOW_RIGHT_EDGE (W) \ 304 - (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (W))) \ 305 ? FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (W))) \ 306 : 0)) 215 #define WINDOW_RIGHT_MARGIN(W) \ 216 (WINDOW_RIGHT_EDGE (W) \ 217 - (! FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (W))) \ 218 ? ((WINDOW_RIGHTMOST_P (W)) ? 0 : 1) \ 219 : FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (W))) \ 220 ? FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (W))) \ 221 : 0)) 307 222 308 223 /* 1 if window W takes up the full width of its frame. */ … … 316 231 (WINDOW_RIGHT_EDGE (W) == FRAME_WINDOW_WIDTH (XFRAME (WINDOW_FRAME (W)))) 317 232 318 319 233 /* This is the window in which the terminal's cursor should 320 234 be left when nothing is being done with it. This must … … 339 253 extern Lisp_Object minibuf_window; 340 254 341 /* Non-nil => window to for C-M-v to scroll when the minibuffer is 342 selected. */ 343 255 /* Non-nil => window to for C-M-v to scroll 256 when the minibuffer is selected. */ 344 257 extern Lisp_Object Vminibuf_scroll_window; 345 258 346 /* Nil or a symbol naming the window system under which emacs is347 running ('x is the only current possibility) */348 259 /* nil or a symbol naming the window system 260 under which emacs is running 261 ('x is the only current possibility) */ 349 262 extern Lisp_Object Vwindow_system; 350 263 351 264 /* Version number of X windows: 10, 11 or nil. */ 352 353 265 extern Lisp_Object Vwindow_system_version; 354 266 355 267 /* Window that the mouse is over (nil if no mouse support). */ 356 357 268 extern Lisp_Object Vmouse_window; 358 269 359 270 /* Last mouse-click event (nil if no mouse support). */ 360 361 271 extern Lisp_Object Vmouse_event; 362 272 … … 365 275 EXFUN (Fdisplay_buffer, 3); 366 276 EXFUN (Fset_window_buffer, 2); 367 EXFUN (Fset_window_hscroll, 2);368 EXFUN (Fwindow_hscroll, 1);369 EXFUN (Fset_window_vscroll, 2);370 EXFUN (Fwindow_vscroll, 1);371 EXFUN (Fset_window_margins, 3);372 EXFUN (Fwindow_live_p, 1);373 EXFUN (Fset_window_point, 2);374 277 extern Lisp_Object make_window P_ ((void)); 375 278 extern void delete_window P_ ((Lisp_Object)); 376 extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int, int * , int));279 extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int, int *)); 377 280 EXFUN (Fwindow_dedicated_p, 1); 378 281 extern int window_height P_ ((Lisp_Object)); … … 380 283 extern void set_window_height P_ ((Lisp_Object, int, int)); 381 284 extern void set_window_width P_ ((Lisp_Object, int, int)); 285 extern void change_window_height P_ ((int, int)); 382 286 extern void delete_all_subwindows P_ ((struct window *)); 383 extern void freeze_window_starts P_ ((struct frame *, int));384 extern void foreach_window P_ ((struct frame *,385 int (* fn) (struct window *, void *),386 void *));387 extern void grow_mini_window P_ ((struct window *, int));388 extern void shrink_mini_window P_ ((struct window *));389 390 391 /* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero392 means it's allowed to run hooks. See make_frame for a case where393 it's not allowed. */394 395 void set_window_buffer P_ ((Lisp_Object window, Lisp_Object buffer,396 int run_hooks_p));397 287 398 288 /* Prompt to display in front of the minibuffer contents. */ 399 400 289 extern Lisp_Object minibuf_prompt; 401 290 402 291 /* The visual width of the above. */ 403 404 292 extern int minibuf_prompt_width; 405 293 406 /* This is the window where the echo area message was displayed. It 407 is always a minibuffer window, but it may not be the same window 408 currently active as a minibuffer. */ 409 294 /* Message to display instead of minibuffer contents. 295 This is what the functions error and message make, 296 and command echoing uses it as well. It overrides the 297 minibuf_prompt as well as the buffer. */ 298 extern char *echo_area_glyphs; 299 300 /* This is the length of the message in echo_area_glyphs. */ 301 extern int echo_area_glyphs_length; 302 303 /* Value of echo_area_glyphs when it was last acted on. 304 If this is nonzero, there is a message on the frame 305 in the minibuffer and it should be erased as soon 306 as it is no longer requested to appear. */ 307 extern char *previous_echo_glyphs; 308 309 /* This is the window where the echo area message was displayed. 310 It is always a minibuffer window, but it may not be the 311 same window currently active as a minibuffer. */ 410 312 extern Lisp_Object echo_area_window; 411 313 412 314 /* Depth in recursive edits. */ 413 414 315 extern int command_loop_level; 415 316 416 317 /* Depth in minibuffer invocations. */ 417 418 318 extern int minibuf_level; 419 319 420 320 /* true iff we should redraw the mode lines on the next redisplay. */ 421 422 321 extern int update_mode_lines; 423 322 424 /* Nonzero if BEGV - BEG or Z - ZV of current buffer has changed since 425 last redisplay that finished. */ 426 323 /* Minimum value of GPT - BEG since last redisplay that finished. */ 324 325 extern int beg_unchanged; 326 327 /* Minimum value of Z - GPT since last redisplay that finished. */ 328 329 extern int end_unchanged; 330 331 /* MODIFF as of last redisplay that finished; 332 if it matches MODIFF, beg_unchanged and end_unchanged 333 contain no useful information. */ 334 extern int unchanged_modified; 335 336 /* BUF_OVERLAY_MODIFF of current buffer, as of last redisplay that finished; 337 if it matches BUF_OVERLAY_MODIFF, beg_unchanged and end_unchanged 338 contain no useful information. */ 339 extern int overlay_unchanged_modified; 340 341 /* Nonzero if BEGV - BEG or Z - ZV of current buffer has changed 342 since last redisplay that finished. */ 427 343 extern int clip_changed; 428 344 429 /* Nonzero if window sizes or contents have changed since last 430 redisplay that finished */ 431 345 /* Nonzero if window sizes or contents have changed 346 since last redisplay that finished */ 432 347 extern int windows_or_buffers_changed; 433 348 434 /* Number of windows displaying the selected buffer. Normally this is 435 1, but it can be more. */ 436 349 /* Number of windows displaying the selected buffer. 350 Normally this is 1, but it can be more. */ 437 351 extern int buffer_shared; 438 352 439 353 /* If *ROWS or *COLS are too small a size for FRAME, set them to the 440 354 minimum allowable size. */ 441 442 355 extern void check_frame_size P_ ((struct frame *frame, int *rows, int *cols)); 443 444 /* Return a pointer to the glyph W's physical cursor is on. Value is445 null if W's current matrix is invalid, so that no meaningfull glyph446 can be returned. */447 448 struct glyph *get_phys_cursor_glyph P_ ((struct window *w));449 450 /* Value is non-zero if WINDOW is a live window. */451 452 #define WINDOW_LIVE_P(WINDOW) \453 (WINDOWP ((WINDOW)) && !NILP (XWINDOW ((WINDOW))->buffer))454 455 #endif /* not WINDOW_H_INCLUDED */
