Mercurial > emacs
comparison src/frame.h @ 83716:a73440d2f146 merge-multi-tty-to-trunk
Merge multi-tty branch
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-866
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 29 Aug 2007 05:28:10 +0000 |
parents | 65663fcd2caa |
children | ddf7869d045b |
comparison
equal
deleted
inserted
replaced
82950:ed8435ec5652 | 83716:a73440d2f146 |
---|---|
27 #define EMACS_FRAME_H | 27 #define EMACS_FRAME_H |
28 | 28 |
29 | 29 |
30 /* Miscellanea. */ | 30 /* Miscellanea. */ |
31 | 31 |
32 /* Nonzero means don't assume anything about current contents of | 32 /* Nonzero means there is at least one garbaged frame. */ |
33 actual terminal frame */ | |
34 | |
35 extern int frame_garbaged; | 33 extern int frame_garbaged; |
36 | 34 |
37 /* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by | 35 /* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by |
38 print. */ | 36 print. */ |
39 | 37 |
42 | 40 |
43 /* The structure representing a frame. */ | 41 /* The structure representing a frame. */ |
44 | 42 |
45 enum output_method | 43 enum output_method |
46 { | 44 { |
45 output_initial, | |
47 output_termcap, | 46 output_termcap, |
48 output_x_window, | 47 output_x_window, |
49 output_msdos_raw, | 48 output_msdos_raw, |
50 output_w32, | 49 output_w32, |
51 output_mac | 50 output_mac |
66 HOLLOW_BOX_CURSOR, | 65 HOLLOW_BOX_CURSOR, |
67 BAR_CURSOR, | 66 BAR_CURSOR, |
68 HBAR_CURSOR | 67 HBAR_CURSOR |
69 }; | 68 }; |
70 | 69 |
71 #if !defined(MSDOS) && !defined(WINDOWSNT) && !defined(MAC_OS) | 70 #define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel) |
72 | 71 #define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel) |
73 #if !defined(HAVE_X_WINDOWS) | 72 |
74 | 73 struct terminal; |
75 #define PIX_TYPE unsigned long | |
76 | |
77 /* A (mostly empty) x_output structure definition for building Emacs | |
78 on Unix and GNU/Linux without X support. */ | |
79 struct x_output | |
80 { | |
81 PIX_TYPE background_pixel; | |
82 PIX_TYPE foreground_pixel; | |
83 }; | |
84 | |
85 #endif /* ! HAVE_X_WINDOWS */ | |
86 | |
87 | |
88 #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) | |
89 #define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel) | |
90 | |
91 /* A structure describing a termcap frame display. */ | |
92 extern struct x_output tty_display; | |
93 | |
94 #endif /* ! MSDOS && ! WINDOWSNT && ! MAC_OS */ | |
95 | 74 |
96 struct frame | 75 struct frame |
97 { | 76 { |
98 EMACS_INT size; | 77 EMACS_INT size; |
99 struct Lisp_Vector *next; | 78 struct Lisp_Vector *next; |
151 | 130 |
152 /* List of scroll bars on this frame. | 131 /* List of scroll bars on this frame. |
153 Actually, we don't specify exactly what is stored here at all; the | 132 Actually, we don't specify exactly what is stored here at all; the |
154 scroll bar implementation code can use it to store anything it likes. | 133 scroll bar implementation code can use it to store anything it likes. |
155 This field is marked by the garbage collector. It is here | 134 This field is marked by the garbage collector. It is here |
156 instead of in the `display' structure so that the garbage | 135 instead of in the `device' structure so that the garbage |
157 collector doesn't need to look inside the window-system-dependent | 136 collector doesn't need to look inside the window-system-dependent |
158 structure. */ | 137 structure. */ |
159 Lisp_Object scroll_bars; | 138 Lisp_Object scroll_bars; |
160 Lisp_Object condemned_scroll_bars; | 139 Lisp_Object condemned_scroll_bars; |
161 | 140 |
180 Lisp_Object buffer_predicate; | 159 Lisp_Object buffer_predicate; |
181 | 160 |
182 /* List of buffers viewed in this frame, for other-buffer. */ | 161 /* List of buffers viewed in this frame, for other-buffer. */ |
183 Lisp_Object buffer_list; | 162 Lisp_Object buffer_list; |
184 | 163 |
164 /* List of buffers that were viewed, then buried in this frame. The | |
165 most recently buried buffer is first. For last-buffer. */ | |
166 Lisp_Object buried_buffer_list; | |
167 | |
185 /* A dummy window used to display menu bars under X when no X | 168 /* A dummy window used to display menu bars under X when no X |
186 toolkit support is available. */ | 169 toolkit support is available. */ |
187 Lisp_Object menu_bar_window; | 170 Lisp_Object menu_bar_window; |
188 | 171 |
189 /* A window used to display the tool-bar of a frame. */ | 172 /* A window used to display the tool-bar of a frame. */ |
281 int space_width; | 264 int space_width; |
282 | 265 |
283 /* Canonical Y unit. Height of a line, in pixels. */ | 266 /* Canonical Y unit. Height of a line, in pixels. */ |
284 int line_height; | 267 int line_height; |
285 | 268 |
286 /* The output method says how the contents of this frame | 269 /* The output method says how the contents of this frame are |
287 are displayed. It could be using termcap, or using an X window. */ | 270 displayed. It could be using termcap, or using an X window. |
271 This must be the same as the terminal->type. */ | |
288 enum output_method output_method; | 272 enum output_method output_method; |
289 | 273 |
290 /* A structure of auxiliary data used for displaying the contents. | 274 /* The terminal device that this frame uses. If this is NULL, then |
291 struct x_output is used for X window frames; | 275 the frame has been deleted. */ |
292 it is defined in xterm.h. | 276 struct terminal *terminal; |
293 struct w32_output is used for W32 window frames; | 277 |
294 it is defined in w32term.h. */ | 278 /* Device-dependent, frame-local auxiliary data used for displaying |
279 the contents. When the frame is deleted, this data is deleted as | |
280 well. */ | |
295 union output_data | 281 union output_data |
296 { | 282 { |
297 struct x_output *x; | 283 struct tty_output *tty; /* termchar.h */ |
298 struct w32_output *w32; | 284 struct x_output *x; /* xterm.h */ |
299 struct mac_output *mac; | 285 struct w32_output *w32; /* w32term.h */ |
286 struct mac_output *mac; /* macterm.h */ | |
300 EMACS_INT nothing; | 287 EMACS_INT nothing; |
301 } | 288 } |
302 output_data; | 289 output_data; |
303 | 290 |
304 /* Total width of fringes reserved for drawing truncation bitmaps, | 291 /* Total width of fringes reserved for drawing truncation bitmaps, |
309 int fringe_cols; | 296 int fringe_cols; |
310 | 297 |
311 /* The extra width (in pixels) currently allotted for fringes. */ | 298 /* The extra width (in pixels) currently allotted for fringes. */ |
312 int left_fringe_width, right_fringe_width; | 299 int left_fringe_width, right_fringe_width; |
313 | 300 |
314 #ifdef MULTI_KBOARD | |
315 /* A pointer to the kboard structure associated with this frame. | |
316 For termcap frames, this points to initial_kboard. For X frames, | |
317 it will be the same as display.x->display_info->kboard. */ | |
318 struct kboard *kboard; | |
319 #endif | |
320 | |
321 /* See FULLSCREEN_ enum below */ | 301 /* See FULLSCREEN_ enum below */ |
322 int want_fullscreen; | 302 int want_fullscreen; |
323 | 303 |
324 /* Number of lines of menu bar. */ | 304 /* Number of lines of menu bar. */ |
325 int menu_bar_lines; | 305 int menu_bar_lines; |
339 | 319 |
340 Note that, since invisible frames aren't updated, whenever a | 320 Note that, since invisible frames aren't updated, whenever a |
341 frame becomes visible again, it must be marked as garbaged. The | 321 frame becomes visible again, it must be marked as garbaged. The |
342 FRAME_SAMPLE_VISIBILITY macro takes care of this. | 322 FRAME_SAMPLE_VISIBILITY macro takes care of this. |
343 | 323 |
344 On Windows NT/9X, to avoid wasting effort updating visible frames | 324 On ttys and on Windows NT/9X, to avoid wasting effort updating |
345 that are actually completely obscured by other windows on the | 325 visible frames that are actually completely obscured by other |
346 display, we bend the meaning of visible slightly: if greater than | 326 windows on the display, we bend the meaning of visible slightly: |
347 1, then the frame is obscured - we still consider it to be | 327 if greater than 1, then the frame is obscured - we still consider |
348 "visible" as seen from lisp, but we don't bother updating it. We | 328 it to be "visible" as seen from lisp, but we don't bother |
349 must take care to garbage the frame when it ceaces to be obscured | 329 updating it. We must take care to garbage the frame when it |
350 though. Note that these semantics are only used on NT/9X. | 330 ceaces to be obscured though. |
351 | 331 |
352 iconified is nonzero if the frame is currently iconified. | 332 iconified is nonzero if the frame is currently iconified. |
353 | 333 |
354 Asynchronous input handlers should NOT change these directly; | 334 Asynchronous input handlers should NOT change these directly; |
355 instead, they should change async_visible or async_iconified, and | 335 instead, they should change async_visible or async_iconified, and |
439 int scroll_bar_actual_width; | 419 int scroll_bar_actual_width; |
440 | 420 |
441 /* The baud rate that was used to calculate costs for this frame. */ | 421 /* The baud rate that was used to calculate costs for this frame. */ |
442 int cost_calculation_baud_rate; | 422 int cost_calculation_baud_rate; |
443 | 423 |
444 /* Nonzero if the mouse has moved on this display | 424 /* Nonzero if the mouse has moved on this display device |
445 since the last time we checked. */ | 425 since the last time we checked. */ |
446 char mouse_moved; | 426 char mouse_moved; |
447 | 427 |
448 /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA * | 428 /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA * |
449 SCREEN_GAMMA) where viewing_gamma is 0.4545 and SCREEN_GAMMA is a | 429 SCREEN_GAMMA) where viewing_gamma is 0.4545 and SCREEN_GAMMA is a |
458 unsigned resized_p : 1; | 438 unsigned resized_p : 1; |
459 | 439 |
460 /* Set to non-zero in when we want for force a flush_display in | 440 /* Set to non-zero in when we want for force a flush_display in |
461 update_frame, usually after resizing the frame. */ | 441 update_frame, usually after resizing the frame. */ |
462 unsigned force_flush_display_p : 1; | 442 unsigned force_flush_display_p : 1; |
463 | 443 |
444 /* All display backends seem to need these two pixel values. */ | |
445 unsigned long background_pixel; | |
446 unsigned long foreground_pixel; | |
447 | |
464 /* Set to non-zero if the default face for the frame has been | 448 /* Set to non-zero if the default face for the frame has been |
465 realized. Reset to zero whenever the default face changes. | 449 realized. Reset to zero whenever the default face changes. |
466 Used to see the difference between a font change and face change. */ | 450 Used to see the difference between a font change and face change. */ |
467 unsigned default_face_done_p : 1; | 451 unsigned default_face_done_p : 1; |
468 | 452 |
477 auto-resize-tool-bar is set to grow-only. */ | 461 auto-resize-tool-bar is set to grow-only. */ |
478 unsigned minimize_tool_bar_window_p : 1; | 462 unsigned minimize_tool_bar_window_p : 1; |
479 }; | 463 }; |
480 | 464 |
481 #ifdef MULTI_KBOARD | 465 #ifdef MULTI_KBOARD |
482 #define FRAME_KBOARD(f) ((f)->kboard) | 466 #define FRAME_KBOARD(f) ((f)->terminal->kboard) |
483 #else | 467 #else |
484 #define FRAME_KBOARD(f) (&the_only_kboard) | 468 #define FRAME_KBOARD(f) (&the_only_kboard) |
485 #endif | 469 #endif |
486 | 470 |
487 typedef struct frame *FRAME_PTR; | 471 typedef struct frame *FRAME_PTR; |
491 | 475 |
492 /* Given a window, return its frame as a Lisp_Object. */ | 476 /* Given a window, return its frame as a Lisp_Object. */ |
493 #define WINDOW_FRAME(w) (w)->frame | 477 #define WINDOW_FRAME(w) (w)->frame |
494 | 478 |
495 /* Test a frame for particular kinds of display methods. */ | 479 /* Test a frame for particular kinds of display methods. */ |
480 #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) | |
496 #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap) | 481 #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap) |
497 #define FRAME_X_P(f) ((f)->output_method == output_x_window) | 482 #define FRAME_X_P(f) ((f)->output_method == output_x_window) |
498 #define FRAME_W32_P(f) ((f)->output_method == output_w32) | 483 #define FRAME_W32_P(f) ((f)->output_method == output_w32) |
499 #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw) | 484 #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw) |
500 #define FRAME_MAC_P(f) ((f)->output_method == output_mac) | 485 #define FRAME_MAC_P(f) ((f)->output_method == output_mac) |
514 #ifndef FRAME_WINDOW_P | 499 #ifndef FRAME_WINDOW_P |
515 #define FRAME_WINDOW_P(f) (0) | 500 #define FRAME_WINDOW_P(f) (0) |
516 #endif | 501 #endif |
517 | 502 |
518 /* Nonzero if frame F is still alive (not deleted). */ | 503 /* Nonzero if frame F is still alive (not deleted). */ |
519 #define FRAME_LIVE_P(f) ((f)->output_data.nothing != 0) | 504 #define FRAME_LIVE_P(f) ((f)->terminal != 0) |
520 | 505 |
521 /* Nonzero if frame F is a minibuffer-only frame. */ | 506 /* Nonzero if frame F is a minibuffer-only frame. */ |
522 #define FRAME_MINIBUF_ONLY_P(f) \ | 507 #define FRAME_MINIBUF_ONLY_P(f) \ |
523 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f)) | 508 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f)) |
524 | 509 |
754 | 739 |
755 Synchronous code must use the FRAME_SET_VISIBLE macro. | 740 Synchronous code must use the FRAME_SET_VISIBLE macro. |
756 | 741 |
757 Also, if a frame used to be invisible, but has just become visible, | 742 Also, if a frame used to be invisible, but has just become visible, |
758 it must be marked as garbaged, since redisplay hasn't been keeping | 743 it must be marked as garbaged, since redisplay hasn't been keeping |
759 up its contents. */ | 744 up its contents. |
745 | |
746 Note that a tty frame is visible if and only if it is the topmost | |
747 frame. */ | |
760 | 748 |
761 #define FRAME_SAMPLE_VISIBILITY(f) \ | 749 #define FRAME_SAMPLE_VISIBILITY(f) \ |
762 (((f)->async_visible && (f)->visible != (f)->async_visible) ? \ | 750 (((f)->async_visible && (f)->visible != (f)->async_visible) ? \ |
763 SET_FRAME_GARBAGED (f) : 0, \ | 751 SET_FRAME_GARBAGED (f) : 0, \ |
764 (f)->visible = (f)->async_visible, \ | 752 (f)->visible = (f)->async_visible, \ |
787 && (frame_var = XCAR (list_var), 1)); \ | 775 && (frame_var = XCAR (list_var), 1)); \ |
788 list_var = XCDR (list_var)) | 776 list_var = XCDR (list_var)) |
789 | 777 |
790 | 778 |
791 extern Lisp_Object Qframep, Qframe_live_p; | 779 extern Lisp_Object Qframep, Qframe_live_p; |
780 extern Lisp_Object Qtty, Qtty_type; | |
781 extern Lisp_Object Qterminal, Qterminal_live_p; | |
782 extern Lisp_Object Qenvironment; | |
783 extern Lisp_Object Qterm_environment_variable; | |
784 extern Lisp_Object Qdisplay_environment_variable; | |
792 | 785 |
793 extern struct frame *last_nonminibuf_frame; | 786 extern struct frame *last_nonminibuf_frame; |
794 | 787 |
795 extern struct frame *make_terminal_frame P_ ((void)); | 788 extern struct frame *make_initial_frame P_ ((void)); |
789 extern struct frame *make_terminal_frame P_ ((struct terminal *)); | |
796 extern struct frame *make_frame P_ ((int)); | 790 extern struct frame *make_frame P_ ((int)); |
797 #ifdef HAVE_WINDOW_SYSTEM | 791 #ifdef HAVE_WINDOW_SYSTEM |
798 extern struct frame *make_minibuffer_frame P_ ((void)); | 792 extern struct frame *make_minibuffer_frame P_ ((void)); |
799 extern struct frame *make_frame_without_minibuffer P_ ((Lisp_Object, | 793 extern struct frame *make_frame_without_minibuffer P_ ((Lisp_Object, |
800 struct kboard *, | 794 struct kboard *, |
990 Frame Parameters | 984 Frame Parameters |
991 ***********************************************************************/ | 985 ***********************************************************************/ |
992 | 986 |
993 extern Lisp_Object Qauto_raise, Qauto_lower; | 987 extern Lisp_Object Qauto_raise, Qauto_lower; |
994 extern Lisp_Object Qborder_color, Qborder_width; | 988 extern Lisp_Object Qborder_color, Qborder_width; |
995 extern Lisp_Object Qbuffer_predicate, Qbuffer_list; | 989 extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; |
996 extern Lisp_Object Qcursor_color, Qcursor_type; | 990 extern Lisp_Object Qcursor_color, Qcursor_type; |
997 extern Lisp_Object Qfont; | 991 extern Lisp_Object Qfont; |
998 extern Lisp_Object Qbackground_color, Qforeground_color; | 992 extern Lisp_Object Qbackground_color, Qforeground_color; |
999 extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top; | 993 extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top; |
1000 extern Lisp_Object Qinternal_border_width; | 994 extern Lisp_Object Qinternal_border_width; |
1022 extern Lisp_Object Qx_resource_name; | 1016 extern Lisp_Object Qx_resource_name; |
1023 | 1017 |
1024 extern Lisp_Object Qleft, Qright, Qtop, Qbox; | 1018 extern Lisp_Object Qleft, Qright, Qtop, Qbox; |
1025 extern Lisp_Object Qdisplay; | 1019 extern Lisp_Object Qdisplay; |
1026 | 1020 |
1021 extern Lisp_Object Qwindow_system; | |
1022 | |
1027 #ifdef HAVE_WINDOW_SYSTEM | 1023 #ifdef HAVE_WINDOW_SYSTEM |
1028 | 1024 |
1029 /* The class of this X application. */ | 1025 /* The class of this X application. */ |
1030 #define EMACS_CLASS "Emacs" | 1026 #define EMACS_CLASS "Emacs" |
1031 | 1027 |