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