$TERM is now set to dumb.
[bpt/emacs.git] / src / frame.h
CommitLineData
ff11dfa1 1/* Define frame-object for GNU Emacs.
0b5538bd 2 Copyright (C) 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004,
4e6835db 3 2005, 2006, 2007 Free Software Foundation, Inc.
efa4ce8b
JB
4
5This file is part of GNU Emacs.
6
7GNU Emacs is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
684d6f5b 9the Free Software Foundation; either version 3, or (at your option)
efa4ce8b
JB
10any later version.
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs; see the file COPYING. If not, write to
4fc5845f
LK
19the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */
efa4ce8b 21
843c9999
GM
22/* Don't multiply include: dispextern.h includes macterm.h which
23 includes frame.h some emacs source includes both dispextern.h and
24 frame.h */
25
84e01749
GM
26#ifndef EMACS_FRAME_H
27#define EMACS_FRAME_H
1f922834 28
20a6c8d7
JB
29\f
30/* Miscellanea. */
31
9628b887 32/* Nonzero means there is at least one garbaged frame. */
20a6c8d7
JB
33extern int frame_garbaged;
34
35/* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by
36 print. */
3b83d631 37
20a6c8d7 38extern int message_buf_print;
efa4ce8b 39
20a6c8d7 40\f
e3678b64 41/* The structure representing a frame. */
efa4ce8b
JB
42
43enum output_method
3b83d631 44{
3224dac1 45 output_initial,
3b83d631
GM
46 output_termcap,
47 output_x_window,
48 output_msdos_raw,
0e015153
RS
49 output_w32,
50 output_mac
3b83d631 51};
efa4ce8b 52
a3211441 53enum vertical_scroll_bar_type
3b83d631
GM
54{
55 vertical_scroll_bar_none,
56 vertical_scroll_bar_left,
57 vertical_scroll_bar_right
58};
a3211441 59
4d418fcc
KS
60enum text_cursor_kinds
61{
62 DEFAULT_CURSOR = -2,
63 NO_CURSOR = -1,
64 FILLED_BOX_CURSOR,
65 HOLLOW_BOX_CURSOR,
66 BAR_CURSOR,
67 HBAR_CURSOR
68};
69
28d7d09f
KL
70#define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
71#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
2d764c78 72
6ed8eeff 73struct terminal;
2d764c78 74
ff11dfa1 75struct frame
efa4ce8b 76{
0c38c2f9 77 EMACS_INT size;
efa4ce8b
JB
78 struct Lisp_Vector *next;
79
21015f9c
RS
80 /* All Lisp_Object components must come first.
81 Only EMACS_INT values can be intermixed with them.
82 That ensures they are all aligned normally. */
efa4ce8b 83
fa5d1baa
RS
84 /* Name of this frame: a Lisp string. It is used for looking up resources,
85 as well as for the title in some cases. */
efa4ce8b
JB
86 Lisp_Object name;
87
e7f79a67
RS
88 /* The name to use for the icon, the last time
89 it was refreshed. nil means not explicitly specified. */
90 Lisp_Object icon_name;
91
fa5d1baa
RS
92 /* This is the frame title specified explicitly, if any.
93 Usually it is nil. */
94 Lisp_Object title;
95
eb8c3be9 96 /* The frame which should receive keystrokes that occur in this
46a5c487
JB
97 frame, or nil if they should go to the frame itself. This is
98 usually nil, but if the frame is minibufferless, we can use this
99 to redirect keystrokes to a surrogate minibuffer frame when
100 needed.
101
102 Note that a value of nil is different than having the field point
103 to the frame itself. Whenever the Fselect_frame function is used
104 to shift from one frame to the other, any redirections to the
105 original frame are shifted to the newly selected frame; if
106 focus_frame is nil, Fselect_frame will leave it alone. */
ff11dfa1 107 Lisp_Object focus_frame;
0f79a4ae 108
ff11dfa1
JB
109 /* This frame's root window. Every frame has one.
110 If the frame has only a minibuffer window, this is it.
111 Otherwise, if the frame has a minibuffer window, this is its sibling. */
efa4ce8b
JB
112 Lisp_Object root_window;
113
ff11dfa1
JB
114 /* This frame's selected window.
115 Each frame has its own window hierarchy
116 and one of the windows in it is selected within the frame.
117 The selected window of the selected frame is Emacs's selected window. */
efa4ce8b
JB
118 Lisp_Object selected_window;
119
ff11dfa1
JB
120 /* This frame's minibuffer window.
121 Most frames have their own minibuffer windows,
122 but only the selected frame's minibuffer window
efa4ce8b
JB
123 can actually appear to exist. */
124 Lisp_Object minibuffer_window;
125
ff11dfa1
JB
126 /* Parameter alist of this frame.
127 These are the parameters specified when creating the frame
128 or modified with modify-frame-parameters. */
efa4ce8b
JB
129 Lisp_Object param_alist;
130
177c0ea7 131 /* List of scroll bars on this frame.
20a6c8d7 132 Actually, we don't specify exactly what is stored here at all; the
a3c87d4e 133 scroll bar implementation code can use it to store anything it likes.
20a6c8d7 134 This field is marked by the garbage collector. It is here
7e59217d 135 instead of in the `device' structure so that the garbage
20a6c8d7
JB
136 collector doesn't need to look inside the window-system-dependent
137 structure. */
a3c87d4e
JB
138 Lisp_Object scroll_bars;
139 Lisp_Object condemned_scroll_bars;
20a6c8d7 140
ad6cd733
RS
141 /* Vector describing the items to display in the menu bar.
142 Each item has four elements in this vector.
143 They are KEY, STRING, SUBMAP, and HPOS.
144 (HPOS is not used in when the X toolkit is in use.)
145 There are four additional elements of nil at the end, to terminate. */
6d05db81
RS
146 Lisp_Object menu_bar_items;
147
fb63ba7d
RS
148 /* Alist of elements (FACE-NAME . FACE-VECTOR-DATA). */
149 Lisp_Object face_alist;
150
21015f9c
RS
151 /* A vector that records the entire structure of this frame's menu bar.
152 For the format of the data, see extensive comments in xmenu.c.
153 Only the X toolkit version uses this. */
154 Lisp_Object menu_bar_vector;
155 /* Number of elements in the vector that have meaningful data. */
156 EMACS_INT menu_bar_items_used;
157
158 /* Predicate for selecting buffers for other-buffer. */
159 Lisp_Object buffer_predicate;
160
375ff4f1
RS
161 /* List of buffers viewed in this frame, for other-buffer. */
162 Lisp_Object buffer_list;
163
a18b8cb5
KL
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
3b83d631
GM
168 /* A dummy window used to display menu bars under X when no X
169 toolkit support is available. */
170 Lisp_Object menu_bar_window;
171
9ea173e8
GM
172 /* A window used to display the tool-bar of a frame. */
173 Lisp_Object tool_bar_window;
3b83d631 174
9ea173e8 175 /* Desired and current tool-bar items. */
e3303a23 176 Lisp_Object tool_bar_items;
3b83d631 177
9ea173e8
GM
178 /* Desired and current contents displayed in tool_bar_window. */
179 Lisp_Object desired_tool_bar_string, current_tool_bar_string;
3b83d631 180
375ff4f1 181 /* beyond here, there should be no more Lisp_Object components. */
21015f9c 182
3b83d631
GM
183 /* Cache of realized faces. */
184 struct face_cache *face_cache;
21015f9c 185
3b83d631
GM
186 /* A buffer to hold the frame's name. We can't use the Lisp
187 string's pointer (`name', above) because it might get relocated. */
bd601e2a
KH
188 char *namebuf;
189
3b83d631
GM
190 /* Glyph pool and matrix. */
191 struct glyph_pool *current_pool;
192 struct glyph_pool *desired_pool;
193 struct glyph_matrix *desired_matrix;
194 struct glyph_matrix *current_matrix;
195
196 /* 1 means that glyphs on this frame have been initialized so it can
197 be used for output. */
198 unsigned glyphs_initialized_p : 1;
21015f9c 199
66d8c489 200#if defined (USE_GTK) || defined (MAC_OS)
488dd4c4
JD
201 /* Nonzero means using a tool bar that comes from the toolkit. */
202 int external_tool_bar;
203#endif
204
9ea173e8
GM
205 /* Margin at the top of the frame. Used to display the tool-bar. */
206 int tool_bar_lines;
3b83d631 207
045cff16 208 int n_tool_bar_rows;
e3303a23 209 int n_tool_bar_items;
177c0ea7 210
3b83d631
GM
211 /* A buffer for decode_mode_line. */
212 char *decode_mode_spec_buffer;
21015f9c
RS
213
214 /* See do_line_insertion_deletion_costs for info on these arrays. */
215 /* Cost of inserting 1 line on this frame */
216 int *insert_line_cost;
217 /* Cost of deleting 1 line on this frame */
218 int *delete_line_cost;
219 /* Cost of inserting n lines on this frame */
220 int *insert_n_lines_cost;
221 /* Cost of deleting n lines on this frame */
222 int *delete_n_lines_cost;
223
b45afe99
KS
224 /* Size of this frame, excluding fringes, scroll bars etc.,
225 in units of canonical characters. */
226 EMACS_INT text_lines, text_cols;
227
228 /* Total size of this frame (i.e. its native window), in units of
229 canonical characters. */
230 EMACS_INT total_lines, total_cols;
231
232 /* New text height and width for pending size change.
233 0 if no change pending. */
234 int new_text_lines, new_text_cols;
235
236 /* Pixel position of the frame window (x and y offsets in root window). */
237 int left_pos, top_pos;
238
239 /* Size of the frame window in pixels. */
240 int pixel_height, pixel_width;
241
242 /* These many pixels are the difference between the outer window (i.e. the
243 left and top of the window manager decoration) and FRAME_X_WINDOW. */
244 int x_pixels_diff, y_pixels_diff;
245
246 /* This is the gravity value for the specified window position. */
247 int win_gravity;
248
249 /* The geometry flags for this window. */
250 int size_hint_flags;
21015f9c 251
b45afe99
KS
252 /* Border width of the frame window as known by the (X) window system. */
253 int border_width;
254
255 /* Width of the internal border. This is a line of background color
256 just inside the window's border. When the frame is selected,
257 a highlighting is displayed inside the internal border. */
258 int internal_border_width;
259
260 /* Canonical X unit. Width of default font, in pixels. */
261 int column_width;
262
0fc63cc4
KH
263 /* Widht of space glyph of default font, in pixels. */
264 int space_width;
265
b45afe99
KS
266 /* Canonical Y unit. Height of a line, in pixels. */
267 int line_height;
21015f9c 268
428a555e
KL
269 /* The output method says how the contents of this frame are
270 displayed. It could be using termcap, or using an X window.
6ed8eeff 271 This must be the same as the terminal->type. */
efa4ce8b
JB
272 enum output_method output_method;
273
6ed8eeff 274 /* The terminal device that this frame uses. If this is NULL, then
7e59217d 275 the frame has been deleted. */
6ed8eeff 276 struct terminal *terminal;
428a555e 277
7e59217d 278 /* Device-dependent, frame-local auxiliary data used for displaying
428a555e
KL
279 the contents. When the frame is deleted, this data is deleted as
280 well. */
3b83d631
GM
281 union output_data
282 {
428a555e
KL
283 struct tty_output *tty; /* termchar.h */
284 struct x_output *x; /* xterm.h */
285 struct w32_output *w32; /* w32term.h */
286 struct mac_output *mac; /* macterm.h */
cf0fb540 287 EMACS_INT nothing;
3b83d631
GM
288 }
289 output_data;
efa4ce8b 290
b45afe99
KS
291 /* Total width of fringes reserved for drawing truncation bitmaps,
292 continuation bitmaps and alike. The width is in canonical char
293 units of the frame. This must currently be the case because window
294 sizes aren't pixel values. If it weren't the case, we wouldn't be
295 able to split windows horizontally nicely. */
296 int fringe_cols;
297
298 /* The extra width (in pixels) currently allotted for fringes. */
299 int left_fringe_width, right_fringe_width;
300
b45afe99
KS
301 /* See FULLSCREEN_ enum below */
302 int want_fullscreen;
303
6d05db81
RS
304 /* Number of lines of menu bar. */
305 int menu_bar_lines;
306
488dd4c4
JD
307#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) \
308 || defined (USE_GTK)
9c95189b
RS
309 /* Nonzero means using a menu bar that comes from the X toolkit. */
310 int external_menu_bar;
311#endif
312
ff11dfa1 313 /* Nonzero if last attempt at redisplay on this frame was preempted. */
efa4ce8b
JB
314 char display_preempted;
315
a4659527
JB
316 /* visible is nonzero if the frame is currently displayed; we check
317 it to see if we should bother updating the frame's contents.
46a5c487 318 DON'T SET IT DIRECTLY; instead, use FRAME_SET_VISIBLE.
efa4ce8b 319
20a6c8d7
JB
320 Note that, since invisible frames aren't updated, whenever a
321 frame becomes visible again, it must be marked as garbaged. The
322 FRAME_SAMPLE_VISIBILITY macro takes care of this.
323
6548cf00
KL
324 On ttys and on Windows NT/9X, to avoid wasting effort updating
325 visible frames that are actually completely obscured by other
326 windows on the display, we bend the meaning of visible slightly:
327 if greater than 1, then the frame is obscured - we still consider
328 it to be "visible" as seen from lisp, but we don't bother
329 updating it. We must take care to garbage the frame when it
330 ceaces to be obscured though.
0969b893 331
a4659527
JB
332 iconified is nonzero if the frame is currently iconified.
333
334 Asynchronous input handlers should NOT change these directly;
335 instead, they should change async_visible or async_iconified, and
336 let the FRAME_SAMPLE_VISIBILITY macro set visible and iconified
337 at the next redisplay.
338
339 These should probably be considered read-only by everyone except
340 FRAME_SAMPLE_VISIBILITY.
341
74cc2959 342 These two are mutually exclusive. They might both be zero, if the
a4659527
JB
343 frame has been made invisible without an icon. */
344 char visible, iconified;
345
346 /* Asynchronous input handlers change these, and
347 FRAME_SAMPLE_VISIBILITY copies them into visible and iconified.
348 See FRAME_SAMPLE_VISIBILITY, below. */
b975254e 349 volatile char async_visible, async_iconified;
efa4ce8b 350
ff11dfa1 351 /* Nonzero if this frame should be redrawn. */
b975254e 352 volatile char garbaged;
efa4ce8b 353
ff11dfa1
JB
354 /* True if frame actually has a minibuffer window on it.
355 0 if using a minibuffer window that isn't on this frame. */
efa4ce8b 356 char has_minibuffer;
177c0ea7 357
ff11dfa1 358 /* 0 means, if this frame has just one window,
efa4ce8b
JB
359 show no modeline for that window. */
360 char wants_modeline;
361
46a5c487 362 /* Non-zero if the hardware device this frame is displaying on can
a3c87d4e
JB
363 support scroll bars. */
364 char can_have_scroll_bars;
46a5c487 365
a3c87d4e 366 /* If can_have_scroll_bars is non-zero, this is non-zero if we should
46a5c487 367 actually display them on this frame. */
a3211441 368 enum vertical_scroll_bar_type vertical_scroll_bar_type;
46a5c487 369
4d418fcc
KS
370 /* What kind of text cursor should we draw in the future?
371 This should always be filled_box_cursor or bar_cursor. */
372 enum text_cursor_kinds desired_cursor;
373
374 /* Width of bar cursor (if we are using that). */
375 int cursor_width;
376
377 /* What kind of text cursor should we draw when the cursor blinks off?
378 This can be filled_box_cursor or bar_cursor or no_cursor. */
379 enum text_cursor_kinds blink_off_cursor;
380
381 /* Width of bar cursor (if we are using that) for blink-off state. */
382 int blink_off_cursor_width;
383
ff11dfa1 384 /* Non-0 means raise this frame to the top of the heap when selected. */
efa4ce8b
JB
385 char auto_raise;
386
ff11dfa1 387 /* Non-0 means lower this frame to the bottom of the stack when left. */
efa4ce8b
JB
388 char auto_lower;
389
ff11dfa1 390 /* True if frame's root window can't be split. */
efa4ce8b
JB
391 char no_split;
392
fbfed6f0
JB
393 /* If this is set, then Emacs won't change the frame name to indicate
394 the current buffer, etcetera. If the user explicitly sets the frame
395 name, this gets set. If the user sets the name to Qnil, this is
396 cleared. */
397 char explicit_name;
398
adc12f0f
RS
399 /* Nonzero if size of some window on this frame has changed. */
400 char window_sizes_changed;
401
ff11dfa1 402 /* Storage for messages to this frame. */
efa4ce8b
JB
403 char *message_buf;
404
405 /* Nonnegative if current redisplay should not do scroll computation
406 for lines beyond a certain vpos. This is the vpos. */
407 int scroll_bottom_vpos;
8d6de7ce 408
b45afe99
KS
409 /* Configured width of the scroll bar, in pixels and in characters.
410 config_scroll_bar_cols tracks config_scroll_bar_width if the
411 latter is positive; a zero value in config_scroll_bar_width means
412 to compute the actual width on the fly, using config_scroll_bar_cols
413 and the current font width. */
414 int config_scroll_bar_width;
415 int config_scroll_bar_cols;
416
417 /* The size of the extra width currently allotted for vertical
418 scroll bars in this frame, in pixels. */
419 int scroll_bar_actual_width;
95b999aa
RS
420
421 /* The baud rate that was used to calculate costs for this frame. */
422 int cost_calculation_baud_rate;
6462918c 423
7e59217d 424 /* Nonzero if the mouse has moved on this display device
6462918c
KH
425 since the last time we checked. */
426 char mouse_moved;
b61cbba3
GM
427
428 /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA *
429 SCREEN_GAMMA) where viewing_gamma is 0.4545 and SCREEN_GAMMA is a
430 frame parameter. 0 means don't do gamma correction. */
431 double gamma;
d1738c45
GM
432
433 /* Additional space to put between text lines on this frame. */
434 int extra_line_spacing;
f1c69c61
GM
435
436 /* Set to non-zero in change_frame_size when size of frame changed
437 Clear the frame in clear_garbaged_frames if set. */
438 unsigned resized_p : 1;
a5f696ac 439
21fb8f56
KS
440 /* Set to non-zero in when we want for force a flush_display in
441 update_frame, usually after resizing the frame. */
442 unsigned force_flush_display_p : 1;
e581a466 443
28d7d09f
KL
444 /* All display backends seem to need these two pixel values. */
445 unsigned long background_pixel;
446 unsigned long foreground_pixel;
447
a5f696ac
JD
448 /* Set to non-zero if the default face for the frame has been
449 realized. Reset to zero whenever the default face changes.
450 Used to see the difference between a font change and face change. */
451 unsigned default_face_done_p : 1;
d3378f02
KS
452
453 /* Set to non-zero if this frame has already been hscrolled during
454 current redisplay. */
455 unsigned already_hscrolled_p : 1;
06a9bc2a
KS
456
457 /* Set to non-zero when current redisplay has updated frame. */
458 unsigned updated_p : 1;
6d7944e0
KS
459
460 /* Set to non-zero to minimize tool-bar height even when
461 auto-resize-tool-bar is set to grow-only. */
462 unsigned minimize_tool_bar_window_p : 1;
efa4ce8b
JB
463};
464
e3678b64 465#ifdef MULTI_KBOARD
6ed8eeff 466#define FRAME_KBOARD(f) ((f)->terminal->kboard)
37ea66e1
KH
467#else
468#define FRAME_KBOARD(f) (&the_only_kboard)
469#endif
470
ff11dfa1
JB
471typedef struct frame *FRAME_PTR;
472
8801a864 473#define XFRAME(p) (eassert (GC_FRAMEP(p)),(struct frame *) XPNTR (p))
aac03cca 474#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
ff11dfa1 475
cea6021b 476/* Given a window, return its frame as a Lisp_Object. */
ff11dfa1
JB
477#define WINDOW_FRAME(w) (w)->frame
478
cea6021b 479/* Test a frame for particular kinds of display methods. */
3224dac1 480#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
cea6021b 481#define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap)
efa7f0f9 482#define FRAME_X_P(f) ((f)->output_method == output_x_window)
fbd6baed 483#define FRAME_W32_P(f) ((f)->output_method == output_w32)
6f181713 484#define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw)
0e015153 485#define FRAME_MAC_P(f) ((f)->output_method == output_mac)
efa7f0f9
GV
486
487/* FRAME_WINDOW_P tests whether the frame is a window, and is
488 defined to be the predicate for the window system being used. */
3b83d631 489
efa7f0f9
GV
490#ifdef HAVE_X_WINDOWS
491#define FRAME_WINDOW_P(f) FRAME_X_P (f)
492#endif
493#ifdef HAVE_NTGUI
fbd6baed 494#define FRAME_WINDOW_P(f) FRAME_W32_P (f)
efa7f0f9 495#endif
e0f712ba 496#ifdef MAC_OS
0e015153
RS
497#define FRAME_WINDOW_P(f) FRAME_MAC_P (f)
498#endif
7651b07e
RS
499#ifndef FRAME_WINDOW_P
500#define FRAME_WINDOW_P(f) (0)
501#endif
efa7f0f9 502
cea6021b 503/* Nonzero if frame F is still alive (not deleted). */
6ed8eeff 504#define FRAME_LIVE_P(f) ((f)->terminal != 0)
cea6021b
RS
505
506/* Nonzero if frame F is a minibuffer-only frame. */
ff11dfa1
JB
507#define FRAME_MINIBUF_ONLY_P(f) \
508 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
cea6021b
RS
509
510/* Nonzero if frame F contains a minibuffer window.
511 (If this is 0, F must use some other minibuffer window.) */
10a4cc63 512#define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer)
cea6021b 513
b45afe99
KS
514/* Pixel height of frame F, including non-toolkit menu bar and
515 non-toolkit tool bar lines. */
516#define FRAME_PIXEL_HEIGHT(f) ((f)->pixel_height)
517
518/* Pixel width of frame F. */
519#define FRAME_PIXEL_WIDTH(f) ((f)->pixel_width)
520
521/* Height of frame F, measured in canonical lines, including
522 non-toolkit menu bar and non-toolkit tool bar lines. */
523#define FRAME_LINES(f) (f)->text_lines
524
525/* Width of frame F, measured in canonical character columns,
cea6021b 526 not including scroll bars if any. */
b45afe99 527#define FRAME_COLS(f) (f)->text_cols
cea6021b
RS
528
529/* Number of lines of frame F used for menu bar.
530 This is relevant on terminal frames and on
531 X Windows when not using the X toolkit.
b45afe99 532 These lines are counted in FRAME_LINES. */
6d05db81 533#define FRAME_MENU_BAR_LINES(f) (f)->menu_bar_lines
cea6021b 534
488dd4c4
JD
535/* Nonzero if this frame should display a tool bar
536 in a way that does not use any text lines. */
66d8c489 537#if defined (USE_GTK) || defined (MAC_OS)
488dd4c4
JD
538#define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar
539#else
540#define FRAME_EXTERNAL_TOOL_BAR(f) 0
541#endif
542
9ea173e8 543/* Number of lines of frame F used for the tool-bar. */
3b83d631 544
9ea173e8 545#define FRAME_TOOL_BAR_LINES(f) (f)->tool_bar_lines
3b83d631 546
488dd4c4 547
3b83d631
GM
548/* Lines above the top-most window in frame F. */
549
550#define FRAME_TOP_MARGIN(F) \
9ea173e8 551 (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F))
3b83d631 552
cea6021b
RS
553/* Nonzero if this frame should display a menu bar
554 in a way that does not use any text lines. */
488dd4c4
JD
555#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) \
556 || defined (USE_GTK)
9c95189b 557#define FRAME_EXTERNAL_MENU_BAR(f) (f)->external_menu_bar
4c8888a0
RS
558#else
559#define FRAME_EXTERNAL_MENU_BAR(f) 0
560#endif
46a5c487 561#define FRAME_VISIBLE_P(f) ((f)->visible != 0)
cea6021b
RS
562
563/* Nonzero if frame F is currently visible but hidden. */
0969b893 564#define FRAME_OBSCURED_P(f) ((f)->visible > 1)
cea6021b
RS
565
566/* Nonzero if frame F is currently iconified. */
567#define FRAME_ICONIFIED_P(f) (f)->iconified
568
46a5c487
JB
569#define FRAME_SET_VISIBLE(f,p) \
570 ((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f))
ff11dfa1
JB
571#define SET_FRAME_GARBAGED(f) (frame_garbaged = 1, f->garbaged = 1)
572#define FRAME_GARBAGED_P(f) (f)->garbaged
cea6021b
RS
573
574/* Nonzero means do not allow splitting this frame's window. */
ff11dfa1 575#define FRAME_NO_SPLIT_P(f) (f)->no_split
cea6021b
RS
576
577/* Not really implemented. */
ff11dfa1 578#define FRAME_WANTS_MODELINE_P(f) (f)->wants_modeline
cea6021b
RS
579
580/* Nonzero if a size change has been requested for frame F
581 but not yet really put into effect. This can be true temporarily
582 when an X event comes in at a bad time. */
adc12f0f 583#define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed
cea6021b
RS
584
585/* The minibuffer window of frame F, if it has one; otherwise nil. */
ff11dfa1 586#define FRAME_MINIBUF_WINDOW(f) (f)->minibuffer_window
cea6021b
RS
587
588/* The root window of the window tree of frame F. */
ff11dfa1 589#define FRAME_ROOT_WINDOW(f) (f)->root_window
cea6021b
RS
590
591/* The currently selected window of the window tree of frame F. */
ff11dfa1 592#define FRAME_SELECTED_WINDOW(f) (f)->selected_window
cea6021b 593
177c0ea7
JB
594#define FRAME_INSERT_COST(f) (f)->insert_line_cost
595#define FRAME_DELETE_COST(f) (f)->delete_line_cost
ff11dfa1
JB
596#define FRAME_INSERTN_COST(f) (f)->insert_n_lines_cost
597#define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
598#define FRAME_MESSAGE_BUF(f) (f)->message_buf
599#define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
600#define FRAME_FOCUS_FRAME(f) (f)->focus_frame
cea6021b
RS
601
602/* Nonzero if frame F supports scroll bars.
603 If this is zero, then it is impossible to enable scroll bars
604 on frame F. */
a3c87d4e 605#define FRAME_CAN_HAVE_SCROLL_BARS(f) ((f)->can_have_scroll_bars)
cea6021b
RS
606
607/* This frame slot says whether scroll bars are currently enabled for frame F,
608 and which side they are on. */
a3211441
RS
609#define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
610#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
611 ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
612#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
613 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
614#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
615 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
cea6021b
RS
616
617/* Width that a scroll bar in frame F should have, if there is one.
618 Measured in pixels.
619 If scroll bars are turned off, this is still nonzero. */
b45afe99 620#define FRAME_CONFIG_SCROLL_BAR_WIDTH(f) ((f)->config_scroll_bar_width)
cea6021b
RS
621
622/* Width that a scroll bar in frame F should have, if there is one.
623 Measured in columns (characters).
624 If scroll bars are turned off, this is still nonzero. */
b45afe99 625#define FRAME_CONFIG_SCROLL_BAR_COLS(f) ((f)->config_scroll_bar_cols)
cea6021b
RS
626
627/* Width of a scroll bar in frame F, measured in columns (characters),
7d81cf83
GM
628 but only if scroll bars are on the left. If scroll bars are on
629 the right in this frame, or there are no scroll bars, value is 0. */
630
b45afe99 631#define FRAME_LEFT_SCROLL_BAR_COLS(f) \
7d81cf83 632 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
b45afe99 633 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
7d81cf83
GM
634 : 0)
635
b45afe99
KS
636/* Width of a left scroll bar in frame F, measured in pixels */
637
638#define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \
639 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
640 ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
641 : 0)
642
7d81cf83
GM
643/* Width of a scroll bar in frame F, measured in columns (characters),
644 but only if scroll bars are on the right. If scroll bars are on
645 the left in this frame, or there are no scroll bars, value is 0. */
646
b45afe99 647#define FRAME_RIGHT_SCROLL_BAR_COLS(f) \
7d81cf83 648 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \
b45afe99 649 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
a3211441 650 : 0)
cea6021b 651
b45afe99
KS
652/* Width of a right scroll bar area in frame F, measured in pixels */
653
654#define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \
655 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \
656 ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
657 : 0)
658
659/* Actual width of a scroll bar in frame F, measured in columns. */
660
661#define FRAME_SCROLL_BAR_COLS(f) \
662 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
663 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
a3211441 664 : 0)
cea6021b 665
b45afe99
KS
666/* Actual width of a scroll bar area in frame F, measured in pixels. */
667
668#define FRAME_SCROLL_BAR_AREA_WIDTH(f) \
669 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
670 ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
671 : 0)
672
cea6021b
RS
673/* Total width of frame F, in columns (characters),
674 including the width used by scroll bars if any. */
b45afe99
KS
675
676#define FRAME_TOTAL_COLS(f) ((f)->total_cols)
cea6021b
RS
677
678/* Set the width of frame F to VAL.
679 VAL is the width of a full-frame window,
b45afe99
KS
680 not including scroll bars and fringes. */
681
682#define SET_FRAME_COLS(f, val) \
683 (FRAME_COLS (f) = (val), \
684 (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f)))
cea6021b
RS
685
686/* Given a value WIDTH for frame F's nominal width,
b45afe99
KS
687 return the value that FRAME_TOTAL_COLS should have. */
688
689#define FRAME_TOTAL_COLS_ARG(f, width) \
3b83d631 690 ((width) \
b45afe99 691 + FRAME_SCROLL_BAR_COLS (f) \
986f10ad 692 + FRAME_FRINGE_COLS (f))
cea6021b 693
4ff34795 694/* Maximum + 1 legitimate value for FRAME_CURSOR_X. */
b45afe99 695
4ff34795 696#define FRAME_CURSOR_X_LIMIT(f) \
b45afe99 697 (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f))
cea6021b
RS
698
699/* Nonzero if frame F has scroll bars. */
b45afe99 700
a3c87d4e 701#define FRAME_SCROLL_BARS(f) ((f)->scroll_bars)
cea6021b 702
a3c87d4e 703#define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars)
6d05db81 704#define FRAME_MENU_BAR_ITEMS(f) ((f)->menu_bar_items)
95b999aa 705#define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
81d00831 706
4d418fcc
KS
707#define FRAME_DESIRED_CURSOR(f) ((f)->desired_cursor)
708#define FRAME_BLINK_OFF_CURSOR(f) ((f)->blink_off_cursor)
709#define FRAME_CURSOR_WIDTH(f) ((f)->cursor_width)
710#define FRAME_BLINK_OFF_CURSOR_WIDTH(f) ((f)->blink_off_cursor_width)
711
3b83d631
GM
712/* Return a pointer to the face cache of frame F. */
713
714#define FRAME_FACE_CACHE(F) (F)->face_cache
715
81d00831
KH
716/* Return the size of message_buf of the frame F. We multiply the
717 width of the frame by 4 because multi-byte form may require at most
718 4-byte for a character. */
177c0ea7 719
b45afe99 720#define FRAME_MESSAGE_BUF_SIZE(f) (((int) FRAME_COLS (f)) * 4)
ff11dfa1 721
a4659527
JB
722/* Emacs's redisplay code could become confused if a frame's
723 visibility changes at arbitrary times. For example, if a frame is
724 visible while the desired glyphs are being built, but becomes
725 invisible before they are updated, then some rows of the
726 desired_glyphs will be left marked as enabled after redisplay is
727 complete, which should never happen. The next time the frame
728 becomes visible, redisplay will probably barf.
729
730 Currently, there are no similar situations involving iconified, but
731 the principle is the same.
732
733 So instead of having asynchronous input handlers directly set and
734 clear the frame's visibility and iconification flags, they just set
735 the async_visible and async_iconified flags; the redisplay code
736 calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay,
737 which sets visible and iconified from their asynchronous
46a5c487
JB
738 counterparts.
739
20a6c8d7
JB
740 Synchronous code must use the FRAME_SET_VISIBLE macro.
741
742 Also, if a frame used to be invisible, but has just become visible,
743 it must be marked as garbaged, since redisplay hasn't been keeping
9628b887
KL
744 up its contents.
745
746 Note that a tty frame is visible if and only if it is the topmost
747 frame. */
177c0ea7 748
a4659527 749#define FRAME_SAMPLE_VISIBILITY(f) \
0969b893
GV
750 (((f)->async_visible && (f)->visible != (f)->async_visible) ? \
751 SET_FRAME_GARBAGED (f) : 0, \
20a6c8d7 752 (f)->visible = (f)->async_visible, \
a4659527
JB
753 (f)->iconified = (f)->async_iconified)
754
915a3e00
KS
755#define CHECK_FRAME(x) \
756 CHECK_TYPE (FRAMEP (x), Qframep, x)
757
758#define CHECK_LIVE_FRAME(x) \
759 CHECK_TYPE (FRAMEP (x) && FRAME_LIVE_P (XFRAME (x)), Qframe_live_p, x)
265a9e55 760
ff11dfa1
JB
761/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
762 `for' loop which iterates over the elements of Vframe_list. The
35f56f96 763 loop will set FRAME_VAR, a Lisp_Object, to each frame in
ff11dfa1 764 Vframe_list in succession and execute the statement. LIST_VAR
35f56f96 765 should be a Lisp_Object too; it is used to iterate through the
177c0ea7 766 Vframe_list.
e5d77022 767
e3678b64
KH
768 This macro is a holdover from a time when multiple frames weren't always
769 supported. An alternate definition of the macro would expand to
770 something which executes the statement once. */
3b83d631 771
ff11dfa1
JB
772#define FOR_EACH_FRAME(list_var, frame_var) \
773 for ((list_var) = Vframe_list; \
e5d77022 774 (CONSP (list_var) \
ee88f64d
KR
775 && (frame_var = XCAR (list_var), 1)); \
776 list_var = XCDR (list_var))
e5d77022
JB
777
778
5e02ce11 779extern Lisp_Object Qframep, Qframe_live_p;
2666355c 780extern Lisp_Object Qtty, Qtty_type;
6ed8eeff 781extern Lisp_Object Qterminal, Qterminal_live_p;
da8e8fc1 782extern Lisp_Object Qenvironment;
de87fb59
DN
783extern Lisp_Object Qterm_environment_variable;
784extern Lisp_Object Qdisplay_environment_variable;
efa4ce8b 785
ff11dfa1 786extern struct frame *last_nonminibuf_frame;
efa4ce8b 787
3224dac1 788extern struct frame *make_initial_frame P_ ((void));
6ed8eeff 789extern struct frame *make_terminal_frame P_ ((struct terminal *));
fd6a330f 790extern struct frame *make_frame P_ ((int));
c9e5d3d1 791#ifdef HAVE_WINDOW_SYSTEM
fd6a330f
AS
792extern struct frame *make_minibuffer_frame P_ ((void));
793extern struct frame *make_frame_without_minibuffer P_ ((Lisp_Object,
794 struct kboard *,
795 Lisp_Object));
c9e5d3d1 796#endif /* HAVE_WINDOW_SYSTEM */
fd6a330f 797extern int other_visible_frames P_ ((struct frame *));
efa4ce8b 798
ff11dfa1
JB
799extern Lisp_Object Vframe_list;
800extern Lisp_Object Vdefault_frame_alist;
efa4ce8b 801
daf01701
KL
802extern Lisp_Object Vterminal_frame;
803
0349c9af 804extern Lisp_Object Vmouse_highlight;
efa4ce8b 805\f
650afd94
GM
806/* The currently selected frame. */
807
808extern Lisp_Object selected_frame;
809
810/* Value is a pointer to the selected frame. If the selected frame
b975254e 811 isn't live, abort. */
650afd94
GM
812
813#define SELECTED_FRAME() \
814 ((FRAMEP (selected_frame) \
815 && FRAME_LIVE_P (XFRAME (selected_frame))) \
816 ? XFRAME (selected_frame) \
e1ef1fb2 817 : (abort (), (struct frame *) 0))
3b83d631
GM
818
819\f
820/***********************************************************************
821 Display-related Macros
822 ***********************************************************************/
823
d3378f02 824/* Canonical y-unit on frame F.
b45afe99
KS
825 This value currently equals the line height of the frame (which is
826 the height of the default font of F). */
827
828#define FRAME_LINE_HEIGHT(F) ((F)->line_height)
3b83d631 829
d3378f02 830/* Canonical x-unit on frame F.
0fc63cc4 831 This value currently equals the average width of the default font of F. */
3b83d631 832
b45afe99 833#define FRAME_COLUMN_WIDTH(F) ((F)->column_width)
3b83d631 834
0fc63cc4
KH
835/* Space glyph width of the default font of frame F. */
836
837#define FRAME_SPACE_WIDTH(F) ((F)->space_width)
838
3b83d631
GM
839
840/* Pixel width of areas used to display truncation marks, continuation
5cb26370 841 marks, overlay arrows. This is 0 for terminal frames. */
3b83d631
GM
842
843#ifdef HAVE_WINDOW_SYSTEM
aa5b8e15 844
b45afe99
KS
845/* Total width of fringes reserved for drawing truncation bitmaps,
846 continuation bitmaps and alike. The width is in canonical char
847 units of the frame. This must currently be the case because window
848 sizes aren't pixel values. If it weren't the case, we wouldn't be
849 able to split windows horizontally nicely. */
850
851#define FRAME_FRINGE_COLS(F) ((F)->fringe_cols)
852
853/* Pixel-width of the left and right fringe. */
854
855#define FRAME_LEFT_FRINGE_WIDTH(F) ((F)->left_fringe_width)
856#define FRAME_RIGHT_FRINGE_WIDTH(F) ((F)->right_fringe_width)
857
858/* Total width of fringes in pixels. */
859
860#define FRAME_TOTAL_FRINGE_WIDTH(F) \
861 (FRAME_LEFT_FRINGE_WIDTH (F) + FRAME_RIGHT_FRINGE_WIDTH (F))
862
863
864/* Pixel-width of internal border lines */
865
866#define FRAME_INTERNAL_BORDER_WIDTH(F) ((F)->internal_border_width)
177c0ea7 867
aa5b8e15
GM
868#else /* not HAVE_WINDOW_SYSTEM */
869
986f10ad 870#define FRAME_FRINGE_COLS(F) 0
b45afe99 871#define FRAME_TOTAL_FRINGE_WIDTH(F) 0
986f10ad 872#define FRAME_LEFT_FRINGE_WIDTH(F) 0
8432bb78 873#define FRAME_RIGHT_FRINGE_WIDTH(F) 0
b45afe99 874#define FRAME_INTERNAL_BORDER_WIDTH(F) 0
aa5b8e15
GM
875
876#endif /* not HAVE_WINDOW_SYSTEM */
177c0ea7 877
3b83d631
GM
878
879
880\f
881/***********************************************************************
882 Conversion between canonical units and pixels
883 ***********************************************************************/
884
b45afe99
KS
885/* Canonical x-values are fractions of FRAME_COLUMN_WIDTH, canonical
886 y-unit are fractions of FRAME_LINE_HEIGHT of a frame. Both are
887 represented as Lisp numbers, i.e. integers or floats. */
3b83d631
GM
888
889/* Convert canonical value X to pixels. F is the frame whose
890 canonical char width is to be used. X must be a Lisp integer or
891 float. Value is a C integer. */
177c0ea7 892
b45afe99 893#define FRAME_PIXEL_X_FROM_CANON_X(F, X) \
3b83d631 894 (INTEGERP (X) \
b45afe99
KS
895 ? XINT (X) * FRAME_COLUMN_WIDTH (F) \
896 : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F)))
177c0ea7 897
3b83d631
GM
898/* Convert canonical value Y to pixels. F is the frame whose
899 canonical character height is to be used. X must be a Lisp integer
900 or float. Value is a C integer. */
177c0ea7 901
b45afe99 902#define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \
3b83d631 903 (INTEGERP (Y) \
b45afe99
KS
904 ? XINT (Y) * FRAME_LINE_HEIGHT (F) \
905 : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F)))
3b83d631
GM
906
907/* Convert pixel-value X to canonical units. F is the frame whose
908 canonical character width is to be used. X is a C integer. Result
909 is a Lisp float if X is not a multiple of the canon width,
910 otherwise it's a Lisp integer. */
911
b45afe99
KS
912#define FRAME_CANON_X_FROM_PIXEL_X(F, X) \
913 ((X) % FRAME_COLUMN_WIDTH (F) != 0 \
914 ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \
915 : make_number ((X) / FRAME_COLUMN_WIDTH (F)))
3b83d631
GM
916
917/* Convert pixel-value Y to canonical units. F is the frame whose
918 canonical character height is to be used. Y is a C integer.
919 Result is a Lisp float if Y is not a multiple of the canon width,
920 otherwise it's a Lisp integer. */
921
b45afe99
KS
922#define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \
923 ((Y) % FRAME_LINE_HEIGHT (F) \
924 ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \
925 : make_number ((Y) / FRAME_LINE_HEIGHT (F)))
926
927
928\f
929/* Manipulating pixel sizes and character sizes.
930 Knowledge of which factors affect the overall size of the window should
931 be hidden in these macros, if that's possible.
932
933 Return the upper/left pixel position of the character cell on frame F
934 at ROW/COL. */
935
936#define FRAME_LINE_TO_PIXEL_Y(f, row) \
937 (FRAME_INTERNAL_BORDER_WIDTH (f) \
938 + (row) * FRAME_LINE_HEIGHT (f))
939
940#define FRAME_COL_TO_PIXEL_X(f, col) \
941 (FRAME_INTERNAL_BORDER_WIDTH (f) \
942 + (col) * FRAME_COLUMN_WIDTH (f))
943
944/* Return the pixel width/height of frame F if it has
945 COLS columns/LINES rows. */
946
947#define FRAME_TEXT_COLS_TO_PIXEL_WIDTH(f, cols) \
948 (FRAME_COL_TO_PIXEL_X (f, cols) \
949 + (f)->scroll_bar_actual_width \
950 + FRAME_TOTAL_FRINGE_WIDTH (f) \
951 + FRAME_INTERNAL_BORDER_WIDTH (f))
952
953#define FRAME_TEXT_LINES_TO_PIXEL_HEIGHT(f, lines) \
954 (FRAME_LINE_TO_PIXEL_Y (f, lines) \
955 + FRAME_INTERNAL_BORDER_WIDTH (f))
956
957
958/* Return the row/column (zero-based) of the character cell containing
959 the pixel on FRAME at Y/X. */
960
961#define FRAME_PIXEL_Y_TO_LINE(f, y) \
962 (((y) - FRAME_INTERNAL_BORDER_WIDTH (f)) \
963 / FRAME_LINE_HEIGHT (f))
964
965#define FRAME_PIXEL_X_TO_COL(f, x) \
966 (((x) - FRAME_INTERNAL_BORDER_WIDTH (f)) \
967 / FRAME_COLUMN_WIDTH (f))
968
969/* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
970 frame F? */
971
972#define FRAME_PIXEL_WIDTH_TO_TEXT_COLS(f, width) \
973 (FRAME_PIXEL_X_TO_COL (f, ((width) \
974 - FRAME_INTERNAL_BORDER_WIDTH (f) \
975 - FRAME_TOTAL_FRINGE_WIDTH (f) \
976 - (f)->scroll_bar_actual_width)))
977
978#define FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(f, height) \
979 (FRAME_PIXEL_Y_TO_LINE (f, ((height) \
980 - FRAME_INTERNAL_BORDER_WIDTH (f))))
177c0ea7 981
5e02ce11
KS
982
983/***********************************************************************
984 Frame Parameters
985 ***********************************************************************/
986
987extern Lisp_Object Qauto_raise, Qauto_lower;
988extern Lisp_Object Qborder_color, Qborder_width;
a18b8cb5 989extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
5e02ce11
KS
990extern Lisp_Object Qcursor_color, Qcursor_type;
991extern Lisp_Object Qfont;
992extern Lisp_Object Qbackground_color, Qforeground_color;
993extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top;
994extern Lisp_Object Qinternal_border_width;
995extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
996extern Lisp_Object Qmouse_color;
997extern Lisp_Object Qname, Qtitle;
998extern Lisp_Object Qparent_id;
999extern Lisp_Object Qunsplittable, Qvisibility;
1000extern Lisp_Object Qscroll_bar_width, Qvertical_scroll_bars;
1001extern Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
1002extern Lisp_Object Qscreen_gamma;
1003extern Lisp_Object Qline_spacing;
1004extern Lisp_Object Qwait_for_wm;
1005extern Lisp_Object Qfullscreen;
1006
1007extern Lisp_Object Qleft_fringe, Qright_fringe;
1008extern Lisp_Object Qheight, Qwidth;
1009extern Lisp_Object Qminibuffer, Qmodeline;
1010extern Lisp_Object Qonly;
1011extern Lisp_Object Qx, Qw32, Qmac, Qpc;
1012extern Lisp_Object Qvisible;
1013extern Lisp_Object Qdisplay_type;
1014extern Lisp_Object Qbackground_mode;
1015
1016extern Lisp_Object Qx_resource_name;
1017
1018extern Lisp_Object Qleft, Qright, Qtop, Qbox;
1019extern Lisp_Object Qdisplay;
1020
7f19e125
KL
1021extern Lisp_Object Qwindow_system;
1022
5e02ce11
KS
1023#ifdef HAVE_WINDOW_SYSTEM
1024
1025/* The class of this X application. */
1026#define EMACS_CLASS "Emacs"
1027
1028enum
1029{
1030 /* Values used as a bit mask, BOTH == WIDTH | HEIGHT. */
1031 FULLSCREEN_NONE = 0,
1032 FULLSCREEN_WIDTH = 1,
1033 FULLSCREEN_HEIGHT = 2,
1034 FULLSCREEN_BOTH = 3,
1035 FULLSCREEN_WAIT = 4,
5e02ce11
KS
1036};
1037
1038
1039/* These are in xterm.c, w32term.c, etc. */
1040
1041extern void x_set_scroll_bar_default_width P_ ((struct frame *));
1042extern void x_set_offset P_ ((struct frame *, int, int, int));
1043extern void x_wm_set_icon_position P_ ((struct frame *, int, int));
1044
1045extern Lisp_Object x_new_font P_ ((struct frame *, char *));
1046extern Lisp_Object x_new_fontset P_ ((struct frame *, char *));
1047
1048
1049/* These are in frame.c */
1050
1051extern Lisp_Object Vx_resource_name;
1052extern Lisp_Object Vx_resource_class;
1053
1054
1055extern Lisp_Object Qface_set_after_frame_default;
1056
1057extern void x_fullscreen_adjust P_ ((struct frame *f, int *, int *,
1058 int *, int *));
1059
1060extern void x_set_frame_parameters P_ ((struct frame *, Lisp_Object));
1061extern void x_report_frame_params P_ ((struct frame *, Lisp_Object *));
1062
1063extern void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object));
1064extern void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
1065extern void x_set_screen_gamma P_ ((struct frame *, Lisp_Object, Lisp_Object));
1066extern void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object));
1067extern void x_set_fringe_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
1068extern void x_set_border_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
1069extern void x_set_internal_border_width P_ ((struct frame *, Lisp_Object,
1070 Lisp_Object));
1071extern void x_set_visibility P_ ((struct frame *, Lisp_Object, Lisp_Object));
1072extern void x_set_autoraise P_ ((struct frame *, Lisp_Object, Lisp_Object));
1073extern void x_set_autolower P_ ((struct frame *, Lisp_Object, Lisp_Object));
1074extern void x_set_unsplittable P_ ((struct frame *, Lisp_Object, Lisp_Object));
1075extern void x_set_vertical_scroll_bars P_ ((struct frame *, Lisp_Object,
1076 Lisp_Object));
1077extern void x_set_scroll_bar_width P_ ((struct frame *, Lisp_Object,
1078 Lisp_Object));
1079
1080extern Lisp_Object x_icon_type P_ ((struct frame *));
1081
1082extern int x_figure_window_size P_ ((struct frame *, Lisp_Object, int));
1083
1084
1085extern void validate_x_resource_name P_ ((void));
1086
1087#endif /* HAVE_WINDOW_SYSTEM */
1088
84e01749 1089#endif /* not EMACS_FRAME_H */
ab5796a9
MB
1090
1091/* arch-tag: 0df048ee-e6bf-4f48-bd56-e3cd055dd8c4
1092 (do not change this comment) */