diff options
| author | Joakim Verona | 2012-08-19 02:44:11 +0200 |
|---|---|---|
| committer | Joakim Verona | 2012-08-19 02:44:11 +0200 |
| commit | 5436d1df5e2ba0b4d4f72b03a1cd09b20403654b (patch) | |
| tree | 532faa27319b3bb199d414dc85e63a58246d30b0 /src/window.h | |
| parent | d02344322b0d2fea8dd9ad9dd0a6c70e058f967b (diff) | |
| parent | e757f1c6f393cf82057dbee0a4325b07f0fd55c4 (diff) | |
| download | emacs-5436d1df5e2ba0b4d4f72b03a1cd09b20403654b.tar.gz emacs-5436d1df5e2ba0b4d4f72b03a1cd09b20403654b.zip | |
upstream
Diffstat (limited to 'src/window.h')
| -rw-r--r-- | src/window.h | 91 |
1 files changed, 86 insertions, 5 deletions
diff --git a/src/window.h b/src/window.h index 3e6f4f82b0a..28b9678b667 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -22,6 +22,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 22 | 22 | ||
| 23 | #include "dispextern.h" | 23 | #include "dispextern.h" |
| 24 | 24 | ||
| 25 | INLINE_HEADER_BEGIN | ||
| 26 | #ifndef WINDOW_INLINE | ||
| 27 | # define WINDOW_INLINE INLINE | ||
| 28 | #endif | ||
| 29 | |||
| 25 | extern Lisp_Object Qleft, Qright; | 30 | extern Lisp_Object Qleft, Qright; |
| 26 | 31 | ||
| 27 | /* Windows are allocated as if they were vectors, but then the | 32 | /* Windows are allocated as if they were vectors, but then the |
| @@ -86,10 +91,6 @@ struct cursor_pos | |||
| 86 | int hpos, vpos; | 91 | int hpos, vpos; |
| 87 | }; | 92 | }; |
| 88 | 93 | ||
| 89 | /* Most code should use this macro to set Lisp fields in struct window. */ | ||
| 90 | |||
| 91 | #define WSET(w, field, value) ((w)->field = (value)) | ||
| 92 | |||
| 93 | struct window | 94 | struct window |
| 94 | { | 95 | { |
| 95 | /* This is for Lisp; the terminal code does not refer to it. */ | 96 | /* This is for Lisp; the terminal code does not refer to it. */ |
| @@ -348,6 +349,75 @@ struct window | |||
| 348 | ptrdiff_t window_end_bytepos; | 349 | ptrdiff_t window_end_bytepos; |
| 349 | }; | 350 | }; |
| 350 | 351 | ||
| 352 | /* Most code should use these functions to set Lisp fields in struct | ||
| 353 | window. */ | ||
| 354 | WINDOW_INLINE void | ||
| 355 | wset_buffer (struct window *w, Lisp_Object val) | ||
| 356 | { | ||
| 357 | w->buffer = val; | ||
| 358 | } | ||
| 359 | WINDOW_INLINE void | ||
| 360 | wset_frame (struct window *w, Lisp_Object val) | ||
| 361 | { | ||
| 362 | w->frame = val; | ||
| 363 | } | ||
| 364 | WINDOW_INLINE void | ||
| 365 | wset_left_col (struct window *w, Lisp_Object val) | ||
| 366 | { | ||
| 367 | w->left_col = val; | ||
| 368 | } | ||
| 369 | WINDOW_INLINE void | ||
| 370 | wset_next (struct window *w, Lisp_Object val) | ||
| 371 | { | ||
| 372 | w->next = val; | ||
| 373 | } | ||
| 374 | WINDOW_INLINE void | ||
| 375 | wset_prev (struct window *w, Lisp_Object val) | ||
| 376 | { | ||
| 377 | w->prev = val; | ||
| 378 | } | ||
| 379 | WINDOW_INLINE void | ||
| 380 | wset_redisplay_end_trigger (struct window *w, Lisp_Object val) | ||
| 381 | { | ||
| 382 | w->redisplay_end_trigger = val; | ||
| 383 | } | ||
| 384 | WINDOW_INLINE void | ||
| 385 | wset_top_line (struct window *w, Lisp_Object val) | ||
| 386 | { | ||
| 387 | w->top_line = val; | ||
| 388 | } | ||
| 389 | WINDOW_INLINE void | ||
| 390 | wset_total_cols (struct window *w, Lisp_Object val) | ||
| 391 | { | ||
| 392 | w->total_cols = val; | ||
| 393 | } | ||
| 394 | WINDOW_INLINE void | ||
| 395 | wset_total_lines (struct window *w, Lisp_Object val) | ||
| 396 | { | ||
| 397 | w->total_lines = val; | ||
| 398 | } | ||
| 399 | WINDOW_INLINE void | ||
| 400 | wset_vertical_scroll_bar (struct window *w, Lisp_Object val) | ||
| 401 | { | ||
| 402 | w->vertical_scroll_bar = val; | ||
| 403 | } | ||
| 404 | WINDOW_INLINE void | ||
| 405 | wset_window_end_pos (struct window *w, Lisp_Object val) | ||
| 406 | { | ||
| 407 | w->window_end_pos = val; | ||
| 408 | } | ||
| 409 | WINDOW_INLINE void | ||
| 410 | wset_window_end_valid (struct window *w, Lisp_Object val) | ||
| 411 | { | ||
| 412 | w->window_end_valid = val; | ||
| 413 | } | ||
| 414 | WINDOW_INLINE void | ||
| 415 | wset_window_end_vpos (struct window *w, Lisp_Object val) | ||
| 416 | { | ||
| 417 | w->window_end_vpos = val; | ||
| 418 | } | ||
| 419 | |||
| 420 | |||
| 351 | /* 1 if W is a minibuffer window. */ | 421 | /* 1 if W is a minibuffer window. */ |
| 352 | 422 | ||
| 353 | #define MINI_WINDOW_P(W) ((W)->mini) | 423 | #define MINI_WINDOW_P(W) ((W)->mini) |
| @@ -885,8 +955,15 @@ extern void check_frame_size (struct frame *frame, int *rows, int *cols); | |||
| 885 | 955 | ||
| 886 | struct glyph *get_phys_cursor_glyph (struct window *w); | 956 | struct glyph *get_phys_cursor_glyph (struct window *w); |
| 887 | 957 | ||
| 888 | /* Value is non-zero if WINDOW is a live window. */ | 958 | /* Value is non-zero if WINDOW is a valid window. */ |
| 959 | #define WINDOW_VALID_P(WINDOW) \ | ||
| 960 | (WINDOWP (WINDOW) \ | ||
| 961 | && (!NILP (XWINDOW (WINDOW)->buffer) \ | ||
| 962 | || !NILP (XWINDOW (WINDOW)->vchild) \ | ||
| 963 | || !NILP (XWINDOW (WINDOW)->hchild))) | ||
| 964 | |||
| 889 | 965 | ||
| 966 | /* Value is non-zero if WINDOW is a live window. */ | ||
| 890 | #define WINDOW_LIVE_P(WINDOW) \ | 967 | #define WINDOW_LIVE_P(WINDOW) \ |
| 891 | (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer)) | 968 | (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer)) |
| 892 | 969 | ||
| @@ -895,6 +972,8 @@ struct glyph *get_phys_cursor_glyph (struct window *w); | |||
| 895 | extern Lisp_Object Qwindowp, Qwindow_live_p; | 972 | extern Lisp_Object Qwindowp, Qwindow_live_p; |
| 896 | extern Lisp_Object Vwindow_list; | 973 | extern Lisp_Object Vwindow_list; |
| 897 | 974 | ||
| 975 | extern struct window *decode_valid_window (Lisp_Object); | ||
| 976 | extern struct window *decode_live_window (Lisp_Object); | ||
| 898 | extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); | 977 | extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); |
| 899 | extern void mark_window_cursors_off (struct window *); | 978 | extern void mark_window_cursors_off (struct window *); |
| 900 | extern int window_internal_height (struct window *); | 979 | extern int window_internal_height (struct window *); |
| @@ -907,4 +986,6 @@ extern void init_window (void); | |||
| 907 | extern void syms_of_window (void); | 986 | extern void syms_of_window (void); |
| 908 | extern void keys_of_window (void); | 987 | extern void keys_of_window (void); |
| 909 | 988 | ||
| 989 | INLINE_HEADER_END | ||
| 990 | |||
| 910 | #endif /* not WINDOW_H_INCLUDED */ | 991 | #endif /* not WINDOW_H_INCLUDED */ |