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