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