]> code.delx.au - gnu-emacs/blob - src/frame.h
Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca
[gnu-emacs] / src / frame.h
1 /* Define frame-object for GNU Emacs.
2 Copyright (C) 1993-1994, 1999-2013 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18
19 /* Don't multiply include: dispextern.h includes macterm.h which
20 includes frame.h some emacs source includes both dispextern.h and
21 frame.h */
22
23 #ifndef EMACS_FRAME_H
24 #define EMACS_FRAME_H
25
26 #include "dispextern.h"
27
28 INLINE_HEADER_BEGIN
29 #ifndef FRAME_INLINE
30 # define FRAME_INLINE INLINE
31 #endif
32
33 \f
34 /* Miscellanea. */
35
36 /* Nonzero means there is at least one garbaged frame. */
37 extern bool frame_garbaged;
38
39 \f
40 /* The structure representing a frame. */
41
42 enum output_method
43 {
44 output_initial,
45 output_termcap,
46 output_x_window,
47 output_msdos_raw,
48 output_w32,
49 output_ns
50 };
51
52 enum vertical_scroll_bar_type
53 {
54 vertical_scroll_bar_none,
55 vertical_scroll_bar_left,
56 vertical_scroll_bar_right
57 };
58
59 enum text_cursor_kinds
60 {
61 DEFAULT_CURSOR = -2,
62 NO_CURSOR = -1,
63 FILLED_BOX_CURSOR,
64 HOLLOW_BOX_CURSOR,
65 BAR_CURSOR,
66 HBAR_CURSOR
67 };
68
69 enum fullscreen_type
70 {
71 FULLSCREEN_NONE,
72 FULLSCREEN_WIDTH = 0x001,
73 FULLSCREEN_HEIGHT = 0x002,
74 FULLSCREEN_BOTH = 0x003,
75 FULLSCREEN_MAXIMIZED = 0x013,
76 FULLSCREEN_WAIT = 0x100
77 };
78
79
80 #define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
81 #define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
82
83
84 struct frame
85 {
86 struct vectorlike_header header;
87
88 /* All Lisp_Object components must come first.
89 That ensures they are all aligned normally. */
90
91 /* Name of this frame: a Lisp string. It is used for looking up resources,
92 as well as for the title in some cases. */
93 Lisp_Object name;
94
95 /* The name to use for the icon, the last time
96 it was refreshed. nil means not explicitly specified. */
97 Lisp_Object icon_name;
98
99 /* This is the frame title specified explicitly, if any.
100 Usually it is nil. */
101 Lisp_Object title;
102
103 /* The frame which should receive keystrokes that occur in this
104 frame, or nil if they should go to the frame itself. This is
105 usually nil, but if the frame is minibufferless, we can use this
106 to redirect keystrokes to a surrogate minibuffer frame when
107 needed.
108
109 Note that a value of nil is different than having the field point
110 to the frame itself. Whenever the Fselect_frame function is used
111 to shift from one frame to the other, any redirections to the
112 original frame are shifted to the newly selected frame; if
113 focus_frame is nil, Fselect_frame will leave it alone. */
114 Lisp_Object focus_frame;
115
116 /* This frame's root window. Every frame has one.
117 If the frame has only a minibuffer window, this is it.
118 Otherwise, if the frame has a minibuffer window, this is its sibling. */
119 Lisp_Object root_window;
120
121 /* This frame's selected window.
122 Each frame has its own window hierarchy
123 and one of the windows in it is selected within the frame.
124 The selected window of the selected frame is Emacs's selected window. */
125 Lisp_Object selected_window;
126
127 /* This frame's minibuffer window.
128 Most frames have their own minibuffer windows,
129 but only the selected frame's minibuffer window
130 can actually appear to exist. */
131 Lisp_Object minibuffer_window;
132
133 /* Parameter alist of this frame.
134 These are the parameters specified when creating the frame
135 or modified with modify-frame-parameters. */
136 Lisp_Object param_alist;
137
138 /* List of scroll bars on this frame.
139 Actually, we don't specify exactly what is stored here at all; the
140 scroll bar implementation code can use it to store anything it likes.
141 This field is marked by the garbage collector. It is here
142 instead of in the `device' structure so that the garbage
143 collector doesn't need to look inside the window-system-dependent
144 structure. */
145 Lisp_Object scroll_bars;
146 Lisp_Object condemned_scroll_bars;
147
148 /* Vector describing the items to display in the menu bar.
149 Each item has four elements in this vector.
150 They are KEY, STRING, SUBMAP, and HPOS.
151 (HPOS is not used in when the X toolkit is in use.)
152 There are four additional elements of nil at the end, to terminate. */
153 Lisp_Object menu_bar_items;
154
155 /* Alist of elements (FACE-NAME . FACE-VECTOR-DATA). */
156 Lisp_Object face_alist;
157
158 /* A vector that records the entire structure of this frame's menu bar.
159 For the format of the data, see extensive comments in xmenu.c.
160 Only the X toolkit version uses this. */
161 Lisp_Object menu_bar_vector;
162
163 /* Predicate for selecting buffers for other-buffer. */
164 Lisp_Object buffer_predicate;
165
166 /* List of buffers viewed in this frame, for other-buffer. */
167 Lisp_Object buffer_list;
168
169 /* List of buffers that were viewed, then buried in this frame. The
170 most recently buried buffer is first. For last-buffer. */
171 Lisp_Object buried_buffer_list;
172
173 /* A dummy window used to display menu bars under X when no X
174 toolkit support is available. */
175 Lisp_Object menu_bar_window;
176
177 /* A window used to display the tool-bar of a frame. */
178 Lisp_Object tool_bar_window;
179
180 /* Desired and current tool-bar items. */
181 Lisp_Object tool_bar_items;
182
183 /* Where tool bar is, can be left, right, top or bottom. The native
184 tool bar only supports top. */
185 Lisp_Object tool_bar_position;
186
187 /* Desired and current contents displayed in tool_bar_window. */
188 Lisp_Object desired_tool_bar_string;
189 Lisp_Object current_tool_bar_string;
190
191 /* Beyond here, there should be no more Lisp_Object components. */
192
193 /* Cache of realized faces. */
194 struct face_cache *face_cache;
195
196 /* Number of elements in `menu_bar_vector' that have meaningful data. */
197 int menu_bar_items_used;
198
199 /* A buffer to hold the frame's name. We can't use the Lisp
200 string's pointer (`name', above) because it might get relocated. */
201 char *namebuf;
202
203 /* Glyph pool and matrix. */
204 struct glyph_pool *current_pool;
205 struct glyph_pool *desired_pool;
206 struct glyph_matrix *desired_matrix;
207 struct glyph_matrix *current_matrix;
208
209 /* 1 means that glyphs on this frame have been initialized so it can
210 be used for output. */
211 unsigned glyphs_initialized_p : 1;
212
213 /* Set to non-zero in change_frame_size when size of frame changed
214 Clear the frame in clear_garbaged_frames if set. */
215 unsigned resized_p : 1;
216
217 /* Set to non-zero in when we want for force a flush_display in
218 update_frame, usually after resizing the frame. */
219 unsigned force_flush_display_p : 1;
220
221 /* Set to non-zero if the default face for the frame has been
222 realized. Reset to zero whenever the default face changes.
223 Used to see the difference between a font change and face change. */
224 unsigned default_face_done_p : 1;
225
226 /* Set to non-zero if this frame has already been hscrolled during
227 current redisplay. */
228 unsigned already_hscrolled_p : 1;
229
230 /* Set to non-zero when current redisplay has updated frame. */
231 unsigned updated_p : 1;
232
233 /* Set to non-zero to minimize tool-bar height even when
234 auto-resize-tool-bar is set to grow-only. */
235 unsigned minimize_tool_bar_window_p : 1;
236
237 #if defined (USE_GTK) || defined (HAVE_NS)
238 /* Nonzero means using a tool bar that comes from the toolkit. */
239 unsigned external_tool_bar : 1;
240 #endif
241
242 /* Margin at the top of the frame. Used to display the tool-bar. */
243 int tool_bar_lines;
244
245 int n_tool_bar_rows;
246 int n_tool_bar_items;
247
248 /* A buffer for decode_mode_line. */
249 char *decode_mode_spec_buffer;
250
251 /* See do_line_insertion_deletion_costs for info on these arrays. */
252 /* Cost of inserting 1 line on this frame */
253 int *insert_line_cost;
254 /* Cost of deleting 1 line on this frame */
255 int *delete_line_cost;
256 /* Cost of inserting n lines on this frame */
257 int *insert_n_lines_cost;
258 /* Cost of deleting n lines on this frame */
259 int *delete_n_lines_cost;
260
261 /* Size of this frame, excluding fringes, scroll bars etc.,
262 in units of canonical characters. */
263 int text_lines, text_cols;
264
265 /* Total size of this frame (i.e. its native window), in units of
266 canonical characters. */
267 int total_lines, total_cols;
268
269 /* New text height and width for pending size change.
270 0 if no change pending. */
271 int new_text_lines, new_text_cols;
272
273 /* Pixel position of the frame window (x and y offsets in root window). */
274 int left_pos, top_pos;
275
276 /* Size of the frame window in pixels. */
277 int pixel_height, pixel_width;
278
279 /* Dots per inch of the screen the frame is on. */
280 double resx, resy;
281
282 /* These many pixels are the difference between the outer window (i.e. the
283 left and top of the window manager decoration) and FRAME_X_WINDOW. */
284 int x_pixels_diff, y_pixels_diff;
285
286 /* This is the gravity value for the specified window position. */
287 int win_gravity;
288
289 /* The geometry flags for this window. */
290 int size_hint_flags;
291
292 /* Border width of the frame window as known by the (X) window system. */
293 int border_width;
294
295 /* Width of the internal border. This is a line of background color
296 just inside the window's border. When the frame is selected,
297 a highlighting is displayed inside the internal border. */
298 int internal_border_width;
299
300 /* Canonical X unit. Width of default font, in pixels. */
301 int column_width;
302
303 /* Canonical Y unit. Height of a line, in pixels. */
304 int line_height;
305
306 /* The output method says how the contents of this frame are
307 displayed. It could be using termcap, or using an X window.
308 This must be the same as the terminal->type. */
309 enum output_method output_method;
310
311 /* The terminal device that this frame uses. If this is NULL, then
312 the frame has been deleted. */
313 struct terminal *terminal;
314
315 /* Device-dependent, frame-local auxiliary data used for displaying
316 the contents. When the frame is deleted, this data is deleted as
317 well. */
318 union output_data
319 {
320 struct tty_output *tty; /* termchar.h */
321 struct x_output *x; /* xterm.h */
322 struct w32_output *w32; /* w32term.h */
323 struct ns_output *ns; /* nsterm.h */
324 intptr_t nothing;
325 }
326 output_data;
327
328 /* List of font-drivers available on the frame. */
329 struct font_driver_list *font_driver_list;
330 /* List of data specific to font-driver and frame, but common to
331 faces. */
332 struct font_data_list *font_data_list;
333
334 /* Total width of fringes reserved for drawing truncation bitmaps,
335 continuation bitmaps and alike. The width is in canonical char
336 units of the frame. This must currently be the case because window
337 sizes aren't pixel values. If it weren't the case, we wouldn't be
338 able to split windows horizontally nicely. */
339 int fringe_cols;
340
341 /* The extra width (in pixels) currently allotted for fringes. */
342 int left_fringe_width, right_fringe_width;
343
344 /* See FULLSCREEN_ enum below */
345 enum fullscreen_type want_fullscreen;
346
347 /* Number of lines of menu bar. */
348 int menu_bar_lines;
349
350 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
351 || defined (HAVE_NS) || defined (USE_GTK)
352 /* Nonzero means using a menu bar that comes from the X toolkit. */
353 unsigned int external_menu_bar : 1;
354 #endif
355
356 /* visible is nonzero if the frame is currently displayed; we check
357 it to see if we should bother updating the frame's contents.
358 DON'T SET IT DIRECTLY; instead, use FRAME_SET_VISIBLE.
359
360 Note that, since invisible frames aren't updated, whenever a
361 frame becomes visible again, it must be marked as garbaged. The
362 FRAME_SAMPLE_VISIBILITY macro takes care of this.
363
364 On ttys and on Windows NT/9X, to avoid wasting effort updating
365 visible frames that are actually completely obscured by other
366 windows on the display, we bend the meaning of visible slightly:
367 if greater than 1, then the frame is obscured - we still consider
368 it to be "visible" as seen from lisp, but we don't bother
369 updating it. We must take care to garbage the frame when it
370 ceases to be obscured though.
371
372 iconified is nonzero if the frame is currently iconified.
373
374 Asynchronous input handlers should NOT change these directly;
375 instead, they should change async_visible or async_iconified, and
376 let the FRAME_SAMPLE_VISIBILITY macro set visible and iconified
377 at the next redisplay.
378
379 These should probably be considered read-only by everyone except
380 FRAME_SAMPLE_VISIBILITY.
381
382 These two are mutually exclusive. They might both be zero, if the
383 frame has been made invisible without an icon. */
384 unsigned visible : 2;
385 unsigned iconified : 1;
386
387 /* Let's not use bitfields for volatile variables. */
388
389 /* Asynchronous input handlers change these, and
390 FRAME_SAMPLE_VISIBILITY copies them into visible and iconified.
391 See FRAME_SAMPLE_VISIBILITY, below. */
392 volatile char async_visible, async_iconified;
393
394 /* Nonzero if this frame should be redrawn. */
395 volatile char garbaged;
396
397 /* True if frame actually has a minibuffer window on it.
398 0 if using a minibuffer window that isn't on this frame. */
399 unsigned has_minibuffer : 1;
400
401 /* 0 means, if this frame has just one window,
402 show no modeline for that window. */
403 unsigned wants_modeline : 1;
404
405 /* Non-0 means raise this frame to the top of the heap when selected. */
406 unsigned auto_raise : 1;
407
408 /* Non-0 means lower this frame to the bottom of the stack when left. */
409 unsigned auto_lower : 1;
410
411 /* True if frame's root window can't be split. */
412 unsigned no_split : 1;
413
414 /* If this is set, then Emacs won't change the frame name to indicate
415 the current buffer, etcetera. If the user explicitly sets the frame
416 name, this gets set. If the user sets the name to Qnil, this is
417 cleared. */
418 unsigned explicit_name : 1;
419
420 /* Nonzero if size of some window on this frame has changed. */
421 unsigned window_sizes_changed : 1;
422
423 /* Nonzero if the mouse has moved on this display device
424 since the last time we checked. */
425 unsigned mouse_moved :1;
426
427 /* Nonzero means that the pointer is invisible. */
428 unsigned pointer_invisible :1;
429
430 /* Nonzero if we should actually display the scroll bars on this frame. */
431 enum vertical_scroll_bar_type vertical_scroll_bar_type;
432
433 /* What kind of text cursor should we draw in the future?
434 This should always be filled_box_cursor or bar_cursor. */
435 enum text_cursor_kinds desired_cursor;
436
437 /* Width of bar cursor (if we are using that). */
438 int cursor_width;
439
440 /* What kind of text cursor should we draw when the cursor blinks off?
441 This can be filled_box_cursor or bar_cursor or no_cursor. */
442 enum text_cursor_kinds blink_off_cursor;
443
444 /* Width of bar cursor (if we are using that) for blink-off state. */
445 int blink_off_cursor_width;
446
447 /* Storage for messages to this frame. */
448 char *message_buf;
449
450 /* Nonnegative if current redisplay should not do scroll computation
451 for lines beyond a certain vpos. This is the vpos. */
452 int scroll_bottom_vpos;
453
454 /* Configured width of the scroll bar, in pixels and in characters.
455 config_scroll_bar_cols tracks config_scroll_bar_width if the
456 latter is positive; a zero value in config_scroll_bar_width means
457 to compute the actual width on the fly, using config_scroll_bar_cols
458 and the current font width. */
459 int config_scroll_bar_width;
460 int config_scroll_bar_cols;
461
462 /* The size of the extra width currently allotted for vertical
463 scroll bars in this frame, in pixels. */
464 int scroll_bar_actual_width;
465
466 /* The baud rate that was used to calculate costs for this frame. */
467 int cost_calculation_baud_rate;
468
469 /* frame opacity
470 alpha[0]: alpha transparency of the active frame
471 alpha[1]: alpha transparency of inactive frames
472 Negative values mean not to change alpha. */
473 double alpha[2];
474
475 /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA *
476 SCREEN_GAMMA) where viewing_gamma is 0.4545 and SCREEN_GAMMA is a
477 frame parameter. 0 means don't do gamma correction. */
478 double gamma;
479
480 /* Additional space to put between text lines on this frame. */
481 int extra_line_spacing;
482
483 /* All display backends seem to need these two pixel values. */
484 unsigned long background_pixel;
485 unsigned long foreground_pixel;
486 };
487
488 /* Most code should use these functions to set Lisp fields in struct frame. */
489
490 FRAME_INLINE void
491 fset_buffer_list (struct frame *f, Lisp_Object val)
492 {
493 f->buffer_list = val;
494 }
495 FRAME_INLINE void
496 fset_buried_buffer_list (struct frame *f, Lisp_Object val)
497 {
498 f->buried_buffer_list = val;
499 }
500 FRAME_INLINE void
501 fset_condemned_scroll_bars (struct frame *f, Lisp_Object val)
502 {
503 f->condemned_scroll_bars = val;
504 }
505 FRAME_INLINE void
506 fset_current_tool_bar_string (struct frame *f, Lisp_Object val)
507 {
508 f->current_tool_bar_string = val;
509 }
510 FRAME_INLINE void
511 fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
512 {
513 f->desired_tool_bar_string = val;
514 }
515 FRAME_INLINE void
516 fset_face_alist (struct frame *f, Lisp_Object val)
517 {
518 f->face_alist = val;
519 }
520 FRAME_INLINE void
521 fset_focus_frame (struct frame *f, Lisp_Object val)
522 {
523 f->focus_frame = val;
524 }
525 FRAME_INLINE void
526 fset_icon_name (struct frame *f, Lisp_Object val)
527 {
528 f->icon_name = val;
529 }
530 FRAME_INLINE void
531 fset_menu_bar_items (struct frame *f, Lisp_Object val)
532 {
533 f->menu_bar_items = val;
534 }
535 FRAME_INLINE void
536 fset_menu_bar_vector (struct frame *f, Lisp_Object val)
537 {
538 f->menu_bar_vector = val;
539 }
540 FRAME_INLINE void
541 fset_menu_bar_window (struct frame *f, Lisp_Object val)
542 {
543 f->menu_bar_window = val;
544 }
545 FRAME_INLINE void
546 fset_name (struct frame *f, Lisp_Object val)
547 {
548 f->name = val;
549 }
550 FRAME_INLINE void
551 fset_param_alist (struct frame *f, Lisp_Object val)
552 {
553 f->param_alist = val;
554 }
555 FRAME_INLINE void
556 fset_root_window (struct frame *f, Lisp_Object val)
557 {
558 f->root_window = val;
559 }
560 FRAME_INLINE void
561 fset_scroll_bars (struct frame *f, Lisp_Object val)
562 {
563 f->scroll_bars = val;
564 }
565 FRAME_INLINE void
566 fset_selected_window (struct frame *f, Lisp_Object val)
567 {
568 f->selected_window = val;
569 }
570 FRAME_INLINE void
571 fset_title (struct frame *f, Lisp_Object val)
572 {
573 f->title = val;
574 }
575 FRAME_INLINE void
576 fset_tool_bar_items (struct frame *f, Lisp_Object val)
577 {
578 f->tool_bar_items = val;
579 }
580 FRAME_INLINE void
581 fset_tool_bar_position (struct frame *f, Lisp_Object val)
582 {
583 f->tool_bar_position = val;
584 }
585 FRAME_INLINE void
586 fset_tool_bar_window (struct frame *f, Lisp_Object val)
587 {
588 f->tool_bar_window = val;
589 }
590
591 #define FRAME_KBOARD(f) ((f)->terminal->kboard)
592
593 /* Return a pointer to the image cache of frame F. */
594 #define FRAME_IMAGE_CACHE(F) ((F)->terminal->image_cache)
595
596 typedef struct frame *FRAME_PTR;
597
598 #define XFRAME(p) \
599 (eassert (FRAMEP (p)), (struct frame *) XUNTAG (p, Lisp_Vectorlike))
600 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
601
602 /* Given a window, return its frame as a Lisp_Object. */
603 #define WINDOW_FRAME(w) w->frame
604
605 /* Test a frame for particular kinds of display methods. */
606 #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
607 #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap)
608 #define FRAME_X_P(f) ((f)->output_method == output_x_window)
609 #ifndef HAVE_NTGUI
610 #define FRAME_W32_P(f) (0)
611 #else
612 #define FRAME_W32_P(f) ((f)->output_method == output_w32)
613 #endif
614 #ifndef MSDOS
615 #define FRAME_MSDOS_P(f) (0)
616 #else
617 #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw)
618 #endif
619 #ifndef HAVE_NS
620 #define FRAME_NS_P(f) (0)
621 #else
622 #define FRAME_NS_P(f) ((f)->output_method == output_ns)
623 #endif
624 /* FRAME_WINDOW_P tests whether the frame is a window, and is
625 defined to be the predicate for the window system being used. */
626
627 #ifdef HAVE_X_WINDOWS
628 #define FRAME_WINDOW_P(f) FRAME_X_P (f)
629 #endif
630 #ifdef HAVE_NTGUI
631 #define FRAME_WINDOW_P(f) FRAME_W32_P (f)
632 #endif
633 #ifdef HAVE_NS
634 #define FRAME_WINDOW_P(f) FRAME_NS_P(f)
635 #endif
636 #ifndef FRAME_WINDOW_P
637 #define FRAME_WINDOW_P(f) ((void) (f), 0)
638 #endif
639
640 /* Return a pointer to the structure holding information about the
641 region of text, if any, that is currently shown in mouse-face on
642 frame F. We need to define two versions because a TTY-only build
643 does not have FRAME_X_DISPLAY_INFO. */
644 #ifdef HAVE_WINDOW_SYSTEM
645 # define MOUSE_HL_INFO(F) \
646 (FRAME_WINDOW_P(F) \
647 ? &FRAME_X_DISPLAY_INFO(F)->mouse_highlight \
648 : &(F)->output_data.tty->display_info->mouse_highlight)
649 #else
650 # define MOUSE_HL_INFO(F) \
651 (&(F)->output_data.tty->display_info->mouse_highlight)
652 #endif
653
654 /* Nonzero if frame F is still alive (not deleted). */
655 #define FRAME_LIVE_P(f) ((f)->terminal != 0)
656
657 /* Nonzero if frame F is a minibuffer-only frame. */
658 #define FRAME_MINIBUF_ONLY_P(f) \
659 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
660
661 /* Nonzero if frame F contains a minibuffer window.
662 (If this is 0, F must use some other minibuffer window.) */
663 #define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer)
664
665 /* Pixel height of frame F, including non-toolkit menu bar and
666 non-toolkit tool bar lines. */
667 #define FRAME_PIXEL_HEIGHT(f) ((f)->pixel_height)
668
669 /* Pixel width of frame F. */
670 #define FRAME_PIXEL_WIDTH(f) ((f)->pixel_width)
671
672 /* Height of frame F, measured in canonical lines, including
673 non-toolkit menu bar and non-toolkit tool bar lines. */
674 #define FRAME_LINES(f) (f)->text_lines
675
676 /* Width of frame F, measured in canonical character columns,
677 not including scroll bars if any. */
678 #define FRAME_COLS(f) (f)->text_cols
679
680 /* Number of lines of frame F used for menu bar.
681 This is relevant on terminal frames and on
682 X Windows when not using the X toolkit.
683 These lines are counted in FRAME_LINES. */
684 #define FRAME_MENU_BAR_LINES(f) (f)->menu_bar_lines
685
686 /* Nonzero if this frame should display a tool bar
687 in a way that does not use any text lines. */
688 #if defined (USE_GTK) || defined (HAVE_NS)
689 #define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar
690 #else
691 #define FRAME_EXTERNAL_TOOL_BAR(f) 0
692 #endif
693
694 /* Number of lines of frame F used for the tool-bar. */
695
696 #define FRAME_TOOL_BAR_LINES(f) (f)->tool_bar_lines
697
698
699 /* Lines above the top-most window in frame F. */
700
701 #define FRAME_TOP_MARGIN(F) \
702 (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F))
703
704 /* Pixel height of the top margin above. */
705
706 #define FRAME_TOP_MARGIN_HEIGHT(f) \
707 (FRAME_TOP_MARGIN (f) * FRAME_LINE_HEIGHT (f))
708
709 /* Nonzero if this frame should display a menu bar
710 in a way that does not use any text lines. */
711 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
712 || defined (HAVE_NS) || defined (USE_GTK)
713 #define FRAME_EXTERNAL_MENU_BAR(f) (f)->external_menu_bar
714 #else
715 #define FRAME_EXTERNAL_MENU_BAR(f) 0
716 #endif
717 #define FRAME_VISIBLE_P(f) ((f)->visible != 0)
718
719 /* Nonzero if frame F is currently visible but hidden. */
720 #define FRAME_OBSCURED_P(f) ((f)->visible > 1)
721
722 /* Nonzero if frame F is currently iconified. */
723 #define FRAME_ICONIFIED_P(f) (f)->iconified
724
725 #define FRAME_SET_VISIBLE(f,p) \
726 ((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f))
727 #define SET_FRAME_GARBAGED(f) (frame_garbaged = 1, f->garbaged = 1)
728 #define FRAME_GARBAGED_P(f) (f)->garbaged
729
730 /* Nonzero means do not allow splitting this frame's window. */
731 #define FRAME_NO_SPLIT_P(f) (f)->no_split
732
733 /* Not really implemented. */
734 #define FRAME_WANTS_MODELINE_P(f) (f)->wants_modeline
735
736 /* Nonzero if a size change has been requested for frame F
737 but not yet really put into effect. This can be true temporarily
738 when an X event comes in at a bad time. */
739 #define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed
740
741 /* The minibuffer window of frame F, if it has one; otherwise nil. */
742 #define FRAME_MINIBUF_WINDOW(f) f->minibuffer_window
743
744 /* The root window of the window tree of frame F. */
745 #define FRAME_ROOT_WINDOW(f) f->root_window
746
747 /* The currently selected window of the window tree of frame F. */
748 #define FRAME_SELECTED_WINDOW(f) f->selected_window
749
750 #define FRAME_INSERT_COST(f) (f)->insert_line_cost
751 #define FRAME_DELETE_COST(f) (f)->delete_line_cost
752 #define FRAME_INSERTN_COST(f) (f)->insert_n_lines_cost
753 #define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
754 #define FRAME_MESSAGE_BUF(f) (f)->message_buf
755 #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
756 #define FRAME_FOCUS_FRAME(f) f->focus_frame
757
758 /* This frame slot says whether scroll bars are currently enabled for frame F,
759 and which side they are on. */
760 #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
761 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
762 ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
763 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
764 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
765 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
766 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
767
768 /* Width that a scroll bar in frame F should have, if there is one.
769 Measured in pixels.
770 If scroll bars are turned off, this is still nonzero. */
771 #define FRAME_CONFIG_SCROLL_BAR_WIDTH(f) ((f)->config_scroll_bar_width)
772
773 /* Width that a scroll bar in frame F should have, if there is one.
774 Measured in columns (characters).
775 If scroll bars are turned off, this is still nonzero. */
776 #define FRAME_CONFIG_SCROLL_BAR_COLS(f) ((f)->config_scroll_bar_cols)
777
778 /* Width of a scroll bar in frame F, measured in columns (characters),
779 but only if scroll bars are on the left. If scroll bars are on
780 the right in this frame, or there are no scroll bars, value is 0. */
781
782 #define FRAME_LEFT_SCROLL_BAR_COLS(f) \
783 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
784 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
785 : 0)
786
787 /* Width of a left scroll bar in frame F, measured in pixels */
788
789 #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \
790 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
791 ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
792 : 0)
793
794 /* Width of a scroll bar in frame F, measured in columns (characters),
795 but only if scroll bars are on the right. If scroll bars are on
796 the left in this frame, or there are no scroll bars, value is 0. */
797
798 #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \
799 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \
800 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
801 : 0)
802
803 /* Width of a right scroll bar area in frame F, measured in pixels */
804
805 #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \
806 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \
807 ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
808 : 0)
809
810 /* Actual width of a scroll bar in frame F, measured in columns. */
811
812 #define FRAME_SCROLL_BAR_COLS(f) \
813 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
814 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
815 : 0)
816
817 /* Actual width of a scroll bar area in frame F, measured in pixels. */
818
819 #define FRAME_SCROLL_BAR_AREA_WIDTH(f) \
820 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
821 ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
822 : 0)
823
824 /* Total width of frame F, in columns (characters),
825 including the width used by scroll bars if any. */
826
827 #define FRAME_TOTAL_COLS(f) ((f)->total_cols)
828
829 /* Set the width of frame F to VAL.
830 VAL is the width of a full-frame window,
831 not including scroll bars and fringes. */
832
833 #define SET_FRAME_COLS(f, val) \
834 (FRAME_COLS (f) = (val), \
835 (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f)))
836
837 /* Given a value WIDTH for frame F's nominal width,
838 return the value that FRAME_TOTAL_COLS should have. */
839
840 #define FRAME_TOTAL_COLS_ARG(f, width) \
841 ((width) \
842 + FRAME_SCROLL_BAR_COLS (f) \
843 + FRAME_FRINGE_COLS (f))
844
845 /* Maximum + 1 legitimate value for FRAME_CURSOR_X. */
846
847 #define FRAME_CURSOR_X_LIMIT(f) \
848 (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f))
849
850 /* Nonzero if frame F has scroll bars. */
851
852 #define FRAME_SCROLL_BARS(f) (f->scroll_bars)
853
854 #define FRAME_CONDEMNED_SCROLL_BARS(f) (f->condemned_scroll_bars)
855 #define FRAME_MENU_BAR_ITEMS(f) (f->menu_bar_items)
856 #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
857
858 #define FRAME_DESIRED_CURSOR(f) ((f)->desired_cursor)
859 #define FRAME_BLINK_OFF_CURSOR(f) ((f)->blink_off_cursor)
860 #define FRAME_CURSOR_WIDTH(f) ((f)->cursor_width)
861 #define FRAME_BLINK_OFF_CURSOR_WIDTH(f) ((f)->blink_off_cursor_width)
862
863 /* Return a pointer to the face cache of frame F. */
864
865 #define FRAME_FACE_CACHE(F) (F)->face_cache
866
867 /* Return the size of message_buf of the frame F. We multiply the
868 width of the frame by 4 because multi-byte form may require at most
869 4-byte for a character. */
870
871 #define FRAME_MESSAGE_BUF_SIZE(f) (((int) FRAME_COLS (f)) * 4)
872
873 /* Emacs's redisplay code could become confused if a frame's
874 visibility changes at arbitrary times. For example, if a frame is
875 visible while the desired glyphs are being built, but becomes
876 invisible before they are updated, then some rows of the
877 desired_glyphs will be left marked as enabled after redisplay is
878 complete, which should never happen. The next time the frame
879 becomes visible, redisplay will probably barf.
880
881 Currently, there are no similar situations involving iconified, but
882 the principle is the same.
883
884 So instead of having asynchronous input handlers directly set and
885 clear the frame's visibility and iconification flags, they just set
886 the async_visible and async_iconified flags; the redisplay code
887 calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay,
888 which sets visible and iconified from their asynchronous
889 counterparts.
890
891 Synchronous code must use the FRAME_SET_VISIBLE macro.
892
893 Also, if a frame used to be invisible, but has just become visible,
894 it must be marked as garbaged, since redisplay hasn't been keeping
895 up its contents.
896
897 Note that a tty frame is visible if and only if it is the topmost
898 frame. */
899
900 #define FRAME_SAMPLE_VISIBILITY(f) \
901 (((f)->async_visible && (f)->visible != (f)->async_visible) ? \
902 SET_FRAME_GARBAGED (f) : 0, \
903 (f)->visible = (f)->async_visible, \
904 (f)->iconified = (f)->async_iconified)
905
906 #define CHECK_FRAME(x) \
907 CHECK_TYPE (FRAMEP (x), Qframep, x)
908
909 #define CHECK_LIVE_FRAME(x) \
910 CHECK_TYPE (FRAMEP (x) && FRAME_LIVE_P (XFRAME (x)), Qframe_live_p, x)
911
912 /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
913 `for' loop which iterates over the elements of Vframe_list. The
914 loop will set FRAME_VAR, a Lisp_Object, to each frame in
915 Vframe_list in succession and execute the statement. LIST_VAR
916 should be a Lisp_Object too; it is used to iterate through the
917 Vframe_list.
918
919 This macro is a holdover from a time when multiple frames weren't always
920 supported. An alternate definition of the macro would expand to
921 something which executes the statement once. */
922
923 #define FOR_EACH_FRAME(list_var, frame_var) \
924 for ((list_var) = Vframe_list; \
925 (CONSP (list_var) \
926 && (frame_var = XCAR (list_var), 1)); \
927 list_var = XCDR (list_var))
928
929 /* Reflect mouse movement when a complete frame update is performed. */
930
931 #define FRAME_MOUSE_UPDATE(frame) \
932 do { \
933 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (frame); \
934 if (frame == hlinfo->mouse_face_mouse_frame) \
935 { \
936 block_input (); \
937 if (hlinfo->mouse_face_mouse_frame) \
938 note_mouse_highlight (hlinfo->mouse_face_mouse_frame, \
939 hlinfo->mouse_face_mouse_x, \
940 hlinfo->mouse_face_mouse_y); \
941 unblock_input (); \
942 } \
943 } while (0)
944
945 extern Lisp_Object Qframep, Qframe_live_p;
946 extern Lisp_Object Qtty, Qtty_type;
947 extern Lisp_Object Qtty_color_mode;
948 extern Lisp_Object Qterminal, Qterminal_live_p;
949 extern Lisp_Object Qnoelisp;
950
951 extern struct frame *last_nonminibuf_frame;
952
953 extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
954 extern struct frame *decode_live_frame (Lisp_Object);
955 extern struct frame *decode_any_frame (Lisp_Object);
956 extern struct frame *make_initial_frame (void);
957 extern struct frame *make_frame (int);
958 #ifdef HAVE_WINDOW_SYSTEM
959 extern struct frame *make_minibuffer_frame (void);
960 extern struct frame *make_frame_without_minibuffer (Lisp_Object,
961 struct kboard *,
962 Lisp_Object);
963 #endif /* HAVE_WINDOW_SYSTEM */
964 extern void frame_make_pointer_invisible (void);
965 extern void frame_make_pointer_visible (void);
966 extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
967
968 extern Lisp_Object Vframe_list;
969 \f
970 /* The currently selected frame. */
971
972 extern Lisp_Object selected_frame;
973
974 /* Value is a pointer to the selected frame. If the selected frame
975 isn't live, abort. */
976
977 #define SELECTED_FRAME() \
978 ((FRAMEP (selected_frame) \
979 && FRAME_LIVE_P (XFRAME (selected_frame))) \
980 ? XFRAME (selected_frame) \
981 : (emacs_abort (), (struct frame *) 0))
982
983 \f
984 /***********************************************************************
985 Display-related Macros
986 ***********************************************************************/
987
988 /* Canonical y-unit on frame F.
989 This value currently equals the line height of the frame (which is
990 the height of the default font of F). */
991
992 #define FRAME_LINE_HEIGHT(F) ((F)->line_height)
993
994 /* Canonical x-unit on frame F.
995 This value currently equals the average width of the default font of F. */
996
997 #define FRAME_COLUMN_WIDTH(F) ((F)->column_width)
998
999 /* Pixel width of areas used to display truncation marks, continuation
1000 marks, overlay arrows. This is 0 for terminal frames. */
1001
1002 #ifdef HAVE_WINDOW_SYSTEM
1003
1004 /* Total width of fringes reserved for drawing truncation bitmaps,
1005 continuation bitmaps and alike. The width is in canonical char
1006 units of the frame. This must currently be the case because window
1007 sizes aren't pixel values. If it weren't the case, we wouldn't be
1008 able to split windows horizontally nicely. */
1009
1010 #define FRAME_FRINGE_COLS(F) ((F)->fringe_cols)
1011
1012 /* Pixel-width of the left and right fringe. */
1013
1014 #define FRAME_LEFT_FRINGE_WIDTH(F) ((F)->left_fringe_width)
1015 #define FRAME_RIGHT_FRINGE_WIDTH(F) ((F)->right_fringe_width)
1016
1017 /* Total width of fringes in pixels. */
1018
1019 #define FRAME_TOTAL_FRINGE_WIDTH(F) \
1020 (FRAME_LEFT_FRINGE_WIDTH (F) + FRAME_RIGHT_FRINGE_WIDTH (F))
1021
1022
1023 /* Pixel-width of internal border lines */
1024
1025 #define FRAME_INTERNAL_BORDER_WIDTH(F) ((F)->internal_border_width)
1026
1027 #else /* not HAVE_WINDOW_SYSTEM */
1028
1029 #define FRAME_FRINGE_COLS(F) 0
1030 #define FRAME_TOTAL_FRINGE_WIDTH(F) 0
1031 #define FRAME_LEFT_FRINGE_WIDTH(F) 0
1032 #define FRAME_RIGHT_FRINGE_WIDTH(F) 0
1033 #define FRAME_INTERNAL_BORDER_WIDTH(F) 0
1034
1035 #endif /* not HAVE_WINDOW_SYSTEM */
1036
1037
1038
1039 \f
1040 /***********************************************************************
1041 Conversion between canonical units and pixels
1042 ***********************************************************************/
1043
1044 /* Canonical x-values are fractions of FRAME_COLUMN_WIDTH, canonical
1045 y-unit are fractions of FRAME_LINE_HEIGHT of a frame. Both are
1046 represented as Lisp numbers, i.e. integers or floats. */
1047
1048 /* Convert canonical value X to pixels. F is the frame whose
1049 canonical char width is to be used. X must be a Lisp integer or
1050 float. Value is a C integer. */
1051
1052 #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \
1053 (INTEGERP (X) \
1054 ? XINT (X) * FRAME_COLUMN_WIDTH (F) \
1055 : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F)))
1056
1057 /* Convert canonical value Y to pixels. F is the frame whose
1058 canonical character height is to be used. X must be a Lisp integer
1059 or float. Value is a C integer. */
1060
1061 #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \
1062 (INTEGERP (Y) \
1063 ? XINT (Y) * FRAME_LINE_HEIGHT (F) \
1064 : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F)))
1065
1066 /* Convert pixel-value X to canonical units. F is the frame whose
1067 canonical character width is to be used. X is a C integer. Result
1068 is a Lisp float if X is not a multiple of the canon width,
1069 otherwise it's a Lisp integer. */
1070
1071 #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \
1072 ((X) % FRAME_COLUMN_WIDTH (F) != 0 \
1073 ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \
1074 : make_number ((X) / FRAME_COLUMN_WIDTH (F)))
1075
1076 /* Convert pixel-value Y to canonical units. F is the frame whose
1077 canonical character height is to be used. Y is a C integer.
1078 Result is a Lisp float if Y is not a multiple of the canon width,
1079 otherwise it's a Lisp integer. */
1080
1081 #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \
1082 ((Y) % FRAME_LINE_HEIGHT (F) \
1083 ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \
1084 : make_number ((Y) / FRAME_LINE_HEIGHT (F)))
1085
1086
1087 \f
1088 /* Manipulating pixel sizes and character sizes.
1089 Knowledge of which factors affect the overall size of the window should
1090 be hidden in these macros, if that's possible.
1091
1092 Return the upper/left pixel position of the character cell on frame F
1093 at ROW/COL. */
1094
1095 #define FRAME_LINE_TO_PIXEL_Y(f, row) \
1096 (((row) < FRAME_TOP_MARGIN (f) ? 0 : FRAME_INTERNAL_BORDER_WIDTH (f)) \
1097 + (row) * FRAME_LINE_HEIGHT (f))
1098
1099 #define FRAME_COL_TO_PIXEL_X(f, col) \
1100 (FRAME_INTERNAL_BORDER_WIDTH (f) \
1101 + (col) * FRAME_COLUMN_WIDTH (f))
1102
1103 /* Return the pixel width/height of frame F if it has
1104 COLS columns/LINES rows. */
1105
1106 #define FRAME_TEXT_COLS_TO_PIXEL_WIDTH(f, cols) \
1107 (FRAME_COL_TO_PIXEL_X (f, cols) \
1108 + (f)->scroll_bar_actual_width \
1109 + FRAME_TOTAL_FRINGE_WIDTH (f) \
1110 + FRAME_INTERNAL_BORDER_WIDTH (f))
1111
1112 #define FRAME_TEXT_LINES_TO_PIXEL_HEIGHT(f, lines) \
1113 ((lines) * FRAME_LINE_HEIGHT (f) \
1114 + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1115
1116
1117 /* Return the row/column (zero-based) of the character cell containing
1118 the pixel on FRAME at Y/X. */
1119
1120 #define FRAME_PIXEL_Y_TO_LINE(f, y) \
1121 (((y) < FRAME_TOP_MARGIN_HEIGHT (f) \
1122 ? (y) \
1123 : ((y) < FRAME_TOP_MARGIN_HEIGHT (f) + FRAME_INTERNAL_BORDER_WIDTH (f) \
1124 ? (y) - (FRAME_TOP_MARGIN_HEIGHT (f) + FRAME_INTERNAL_BORDER_WIDTH (f) \
1125 /* Arrange for the division to round down. */ \
1126 + FRAME_LINE_HEIGHT (f) - 1) \
1127 : (y) - FRAME_INTERNAL_BORDER_WIDTH (f))) \
1128 / FRAME_LINE_HEIGHT (f))
1129
1130 #define FRAME_PIXEL_X_TO_COL(f, x) \
1131 (((x) - FRAME_INTERNAL_BORDER_WIDTH (f)) \
1132 / FRAME_COLUMN_WIDTH (f))
1133
1134 /* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
1135 frame F? */
1136
1137 #define FRAME_PIXEL_WIDTH_TO_TEXT_COLS(f, width) \
1138 (FRAME_PIXEL_X_TO_COL (f, ((width) \
1139 - FRAME_INTERNAL_BORDER_WIDTH (f) \
1140 - FRAME_TOTAL_FRINGE_WIDTH (f) \
1141 - (f)->scroll_bar_actual_width)))
1142
1143 #define FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(f, height) \
1144 (FRAME_PIXEL_Y_TO_LINE (f, ((height) \
1145 - FRAME_INTERNAL_BORDER_WIDTH (f))))
1146
1147
1148 /***********************************************************************
1149 Frame Parameters
1150 ***********************************************************************/
1151
1152 extern Lisp_Object Qauto_raise, Qauto_lower;
1153 extern Lisp_Object Qborder_color, Qborder_width;
1154 extern Lisp_Object Qbuffer_predicate;
1155 extern Lisp_Object Qcursor_color, Qcursor_type;
1156 extern Lisp_Object Qfont;
1157 extern Lisp_Object Qbackground_color, Qforeground_color;
1158 extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top;
1159 extern Lisp_Object Qinternal_border_width;
1160 extern Lisp_Object Qtooltip;
1161 extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position;
1162 extern Lisp_Object Qmouse_color;
1163 extern Lisp_Object Qname, Qtitle;
1164 extern Lisp_Object Qparent_id;
1165 extern Lisp_Object Qunsplittable, Qvisibility;
1166 extern Lisp_Object Qscroll_bar_width, Qvertical_scroll_bars;
1167 extern Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
1168 extern Lisp_Object Qscreen_gamma;
1169 extern Lisp_Object Qline_spacing;
1170 extern Lisp_Object Qwait_for_wm;
1171 extern Lisp_Object Qfullscreen;
1172 extern Lisp_Object Qfullwidth, Qfullheight, Qfullboth, Qmaximized;
1173 extern Lisp_Object Qsticky;
1174 extern Lisp_Object Qfont_backend;
1175 extern Lisp_Object Qalpha;
1176
1177 extern Lisp_Object Qleft_fringe, Qright_fringe;
1178 extern Lisp_Object Qheight, Qwidth;
1179 extern Lisp_Object Qminibuffer, Qmodeline;
1180 extern Lisp_Object Qx, Qw32, Qpc, Qns;
1181 extern Lisp_Object Qvisible;
1182 extern Lisp_Object Qdisplay_type;
1183
1184 extern Lisp_Object Qx_resource_name;
1185
1186 extern Lisp_Object Qleft, Qright, Qtop, Qbox, Qbottom;
1187 extern Lisp_Object Qdisplay;
1188
1189 extern Lisp_Object Qrun_hook_with_args;
1190
1191 #ifdef HAVE_WINDOW_SYSTEM
1192
1193 /* The class of this X application. */
1194 #define EMACS_CLASS "Emacs"
1195
1196 /* These are in xterm.c, w32term.c, etc. */
1197
1198 extern void x_set_scroll_bar_default_width (struct frame *);
1199 extern void x_set_offset (struct frame *, int, int, int);
1200 extern void x_wm_set_icon_position (struct frame *, int, int);
1201 extern void x_wm_set_size_hint (FRAME_PTR f, long flags, bool user_position);
1202
1203 extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
1204
1205
1206 extern Lisp_Object Qface_set_after_frame_default;
1207
1208 #ifdef HAVE_NTGUI
1209 extern void x_fullscreen_adjust (struct frame *f, int *, int *,
1210 int *, int *);
1211 #endif
1212
1213 extern void x_set_frame_parameters (struct frame *, Lisp_Object);
1214
1215 extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
1216 extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
1217 extern void x_set_screen_gamma (struct frame *, Lisp_Object, Lisp_Object);
1218 extern void x_set_font (struct frame *, Lisp_Object, Lisp_Object);
1219 extern void x_set_font_backend (struct frame *, Lisp_Object, Lisp_Object);
1220 extern void x_set_fringe_width (struct frame *, Lisp_Object, Lisp_Object);
1221 extern void x_set_border_width (struct frame *, Lisp_Object, Lisp_Object);
1222 extern void x_set_internal_border_width (struct frame *, Lisp_Object,
1223 Lisp_Object);
1224 extern void x_set_visibility (struct frame *, Lisp_Object, Lisp_Object);
1225 extern void x_set_autoraise (struct frame *, Lisp_Object, Lisp_Object);
1226 extern void x_set_autolower (struct frame *, Lisp_Object, Lisp_Object);
1227 extern void x_set_unsplittable (struct frame *, Lisp_Object, Lisp_Object);
1228 extern void x_set_vertical_scroll_bars (struct frame *, Lisp_Object,
1229 Lisp_Object);
1230 extern void x_set_scroll_bar_width (struct frame *, Lisp_Object,
1231 Lisp_Object);
1232
1233 extern Lisp_Object x_icon_type (struct frame *);
1234
1235 extern int x_figure_window_size (struct frame *, Lisp_Object, int);
1236
1237 extern void x_set_alpha (struct frame *, Lisp_Object, Lisp_Object);
1238
1239 extern void validate_x_resource_name (void);
1240
1241 extern Lisp_Object display_x_get_resource (Display_Info *,
1242 Lisp_Object attribute,
1243 Lisp_Object class,
1244 Lisp_Object component,
1245 Lisp_Object subclass);
1246
1247 extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
1248 extern void x_set_window_size (struct frame *f, int change_grav,
1249 int cols, int rows);
1250 extern void x_sync (struct frame *);
1251 extern Lisp_Object x_get_focus_frame (struct frame *);
1252 extern void x_set_mouse_position (struct frame *f, int h, int v);
1253 extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
1254 extern void x_make_frame_visible (struct frame *f);
1255 extern void x_make_frame_invisible (struct frame *f);
1256 extern void x_iconify_frame (struct frame *f);
1257 extern int x_pixel_width (struct frame *f);
1258 extern int x_pixel_height (struct frame *f);
1259 extern void x_set_frame_alpha (struct frame *f);
1260 extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
1261 extern void x_set_tool_bar_lines (struct frame *f,
1262 Lisp_Object value,
1263 Lisp_Object oldval);
1264 extern void x_activate_menubar (struct frame *);
1265 extern void x_real_positions (struct frame *, int *, int *);
1266 extern int x_bitmap_icon (struct frame *, Lisp_Object);
1267 extern void x_set_menu_bar_lines (struct frame *,
1268 Lisp_Object,
1269 Lisp_Object);
1270 extern void free_frame_menubar (struct frame *);
1271 extern void x_free_frame_resources (struct frame *);
1272
1273 #if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
1274 extern char *x_get_resource_string (const char *, const char *);
1275 #endif
1276
1277 extern void x_query_colors (struct frame *f, XColor *, int);
1278 extern void x_query_color (struct frame *f, XColor *);
1279
1280 #endif /* HAVE_WINDOW_SYSTEM */
1281
1282 INLINE_HEADER_END
1283
1284 #endif /* not EMACS_FRAME_H */