comparison src/frame.h @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 0293115a14e9
comparison
equal deleted inserted replaced
-1:000000000000 0:376386a54a3c
1 /* Define frame-object for XEmacs.
2 Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc.
3
4 This file is part of XEmacs.
5
6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
10
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* Synched up with: FSF 19.30. */
22
23 #ifndef _XEMACS_FRAME_H_
24 #define _XEMACS_FRAME_H_
25
26 #include "scrollbar.h"
27 #include "toolbar.h"
28 #include "device.h"
29
30 #define FRAME_TYPE_NAME(f) ((f)->framemeths->name)
31 #define FRAME_TYPE(f) ((f)->framemeths->symbol)
32
33 /******** Accessing / calling a frame method *********/
34
35 #define HAS_FRAMEMETH_P(f, m) HAS_CONTYPE_METH_P ((f)->framemeths, m)
36 #define FRAMEMETH(f, m, args) CONTYPE_METH ((f)->framemeths, m, args)
37 #define MAYBE_FRAMEMETH(f, m, args) \
38 MAYBE_CONTYPE_METH ((f)->framemeths, m, args)
39 #define FRAMEMETH_OR_GIVEN(f, m, args, given) \
40 CONTYPE_METH_OR_GIVEN((f)->framemeths, m, args, given)
41 #define MAYBE_INT_FRAMEMETH(f, m, args) \
42 MAYBE_INT_CONTYPE_METH ((f)->framemeths, m, args)
43 #define MAYBE_LISP_FRAMEMETH(f, m, args) \
44 MAYBE_LISP_CONTYPE_METH ((f)->framemeths, m, args)
45
46 struct frame
47 {
48 struct lcrecord_header header;
49
50 /* Methods for this frame's console. This can also be retrieved
51 through frame->device->console, but it's faster this way. */
52 struct console_methods *framemeths;
53
54 /* Size of this frame, in units of characters. */
55 int height;
56 int width;
57
58 /* Size of this frame, in units of pixels. */
59 int pixheight;
60 int pixwidth;
61
62 /* Width of the internal border. This is a line of background color
63 just inside the window's border. It is normally only non-zero on
64 X frames, but we put it here to avoid introducing window system
65 dependencies. */
66 int internal_border_width;
67
68 /* New height and width for pending size change. 0 if no change pending. */
69 int new_height, new_width;
70
71 /* This frame's root window mirror. This structure exactly mirrors
72 the frame's window structure but contains only pointers to the
73 display structures. */
74 struct window_mirror *root_mirror;
75
76 int modiff;
77
78 #ifdef HAVE_SCROLLBARS
79 /* frame-local scrollbar information. See scrollbar.c. */
80 int scrollbar_y_offset;
81 int scrollbar_on_left;
82 int scrollbar_on_top;
83
84 /* cache of created scrollbars */
85 struct scrollbar_instance *sb_vcache;
86 struct scrollbar_instance *sb_hcache;
87 #endif
88
89 #ifdef HAVE_TOOLBARS
90 /* We handle these specially rather than putting them in
91 frameslots.h because we want them to be arrays. */
92
93 /* Data representing each currently displayed toolbar. See
94 toolbar.c */
95 Lisp_Object toolbar_data[4];
96
97 /* Cached specifiers: */
98
99 /* Size of the toolbars. The frame-local toolbar space is
100 subtracted before the windows are arranged. Window and buffer
101 local toolbars overlay their windows. */
102 Lisp_Object toolbar_size[4];
103 /* Visibility of the toolbars. This acts as a valve for toolbar_size. */
104 Lisp_Object toolbar_visible_p[4];
105 #endif
106
107 /* A structure of auxiliary data specific to the device type.
108 struct x_frame is used for X window frames; defined in console-x.h */
109 void *frame_data;
110
111 #define MARKED_SLOT(x) Lisp_Object x
112 #include "frameslots.h"
113 #undef MARKED_SLOT
114
115 /* one-bit flags: */
116
117 /* Are we finished initializing? */
118 unsigned int init_finished :1;
119
120 /* Is frame marked for deletion? This is used in XSetErrorHandler(). */
121 unsigned int being_deleted :1;
122
123 /* Nonzero if this frame has been destroyed. */
124 unsigned int dead :1;
125
126 /* Nonzero if last attempt at redisplay on this frame was preempted. */
127 unsigned int display_preempted :1;
128
129 /* Nonzero if frame is currently displayed. */
130 unsigned int visible :1;
131
132 /* Nonzero if window is currently iconified.
133 This and visible are mutually exclusive. */
134 unsigned int iconified :1;
135
136 /* Nonzero if this frame should be cleared and then redrawn.
137 Setting this will also effectively set frame_changed. */
138 unsigned int clear :1;
139
140 /* True if frame actually has a minibuffer window on it.
141 0 if using a minibuffer window that isn't on this frame. */
142 unsigned int has_minibuffer :1;
143
144 /* True if frame's root window can't be split. */
145 unsigned int no_split :1;
146
147 unsigned int top_toolbar_was_visible :1;
148 unsigned int bottom_toolbar_was_visible :1;
149 unsigned int left_toolbar_was_visible :1;
150 unsigned int right_toolbar_was_visible :1;
151
152 /* redisplay flags */
153 unsigned int buffers_changed :1;
154 unsigned int clip_changed :1;
155 unsigned int extents_changed :1;
156 unsigned int faces_changed :1;
157 unsigned int frame_changed :1;
158 unsigned int icon_changed :1;
159 unsigned int menubar_changed :1;
160 unsigned int modeline_changed :1;
161 unsigned int point_changed :1;
162 unsigned int size_changed :1;
163 unsigned int toolbar_changed :1;
164 unsigned int windows_changed :1;
165 unsigned int windows_structure_changed :1;
166 unsigned int window_face_cache_reset :1; /* used by expose handler */
167
168 unsigned int size_change_pending :1;
169 unsigned int mirror_dirty :1;
170
171 /* flag indicating if any window on this frame is displaying a subwindow */
172 int subwindows_being_displayed :1;
173 };
174
175 /* If this is non-nil, it is the frame that make-frame is currently
176 creating. We can't set the current frame to this in case the
177 debugger goes off because it would try and display to it. However,
178 there are some places which need to reference it which have no
179 other way of getting it if it isn't the selected frame. */
180 extern Lisp_Object Vframe_being_created;
181
182 DECLARE_LRECORD (frame, struct frame);
183 #define XFRAME(x) XRECORD (x, frame, struct frame)
184 #define XSETFRAME(x, p) XSETRECORD (x, p, frame)
185 #define FRAMEP(x) RECORDP (x, frame)
186 #define GC_FRAMEP(x) GC_RECORDP (x, frame)
187 #define CHECK_FRAME(x) CHECK_RECORD (x, frame)
188 #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame)
189
190 #define CHECK_LIVE_FRAME(x) \
191 do { CHECK_FRAME (x); \
192 if (! FRAMEP (x) \
193 || ! FRAME_LIVE_P (XFRAME (x))) \
194 dead_wrong_type_argument (Qframe_live_p, (x)); } while (0)
195 #define CONCHECK_LIVE_FRAME(x) \
196 do { CONCHECK_FRAME (x); \
197 if (! FRAMEP (x) \
198 || ! FRAME_LIVE_P (XFRAME (x))) \
199 x = wrong_type_argument (Qframe_live_p, (x)); } while (0)
200
201 #define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type)
202
203 #ifdef ERROR_CHECK_TYPECHECK
204 MAC_DECLARE_EXTERN (struct frame *, MTframe_data)
205 # define FRAME_TYPE_DATA(f, type) \
206 MAC_BEGIN \
207 MAC_DECLARE (struct frame *, MTframe_data, f) \
208 assert (FRAME_TYPE_P (MTframe_data, type)) \
209 MAC_SEP \
210 (struct type##_frame *) MTframe_data->frame_data \
211 MAC_END
212 #else
213 # define FRAME_TYPE_DATA(f, type) \
214 ((struct type##_frame *) (f)->frame_data)
215 #endif
216
217 #define CHECK_FRAME_TYPE(x, type) \
218 do { \
219 CHECK_FRAME (x); \
220 if (!FRAME_TYPE_P (XFRAME (x), type)) \
221 dead_wrong_type_argument \
222 (type##_console_methods->predicate_symbol, x); \
223 } while (0)
224 #define CONCHECK_FRAME_TYPE(x, type) \
225 do { \
226 CONCHECK_FRAME (x); \
227 if (!FRAME_TYPE_P (XFRAME (x), type)) \
228 x = wrong_type_argument \
229 (type##_console_methods->predicate_symbol, x); \
230 } while (0)
231
232 /* #### These should be in the frame-*.h files but there are
233 too many places where the abstraction is broken. Need to
234 fix. */
235
236 #define FRAME_X_P(frm) CONSOLE_TYPESYM_X_P (FRAME_TYPE (frm))
237 #define CHECK_X_FRAME(z) CHECK_FRAME_TYPE (z, x)
238 #define CONCHECK_X_FRAME(z) CONCHECK_FRAME_TYPE (z, x)
239
240 #define FRAME_NS_P(frm) CONSOLE_TYPESYM_NS_P (FRAME_TYPE (frm))
241 #define CHECK_NS_FRAME(z) CHECK_FRAME_TYPE (z, ns)
242 #define CONCHECK_NS_FRAME(z) CONCHECK_FRAME_TYPE (z, ns)
243
244 #define FRAME_TTY_P(frm) CONSOLE_TYPESYM_TTY_P (FRAME_TYPE (frm))
245 #define CHECK_TTY_FRAME(z) CHECK_FRAME_TYPE (z, tty)
246 #define CONCHECK_TTY_FRAME(z) CONCHECK_FRAME_TYPE (z, tty)
247
248 #define FRAME_STREAM_P(frm) CONSOLE_TYPESYM_STREAM_P (FRAME_TYPE (frm))
249 #define CHECK_STREAM_FRAME(z) CHECK_FRAME_TYPE (z, stream)
250 #define CONCHECK_STREAM_FRAME(z) CONCHECK_FRAME_TYPE (z, stream)
251
252 #define FRAME_WIN_P(frm) CONSOLE_TYPESYM_WIN_P (FRAME_TYPE (frm))
253
254 extern Lisp_Object Qframe_live_p;
255 extern Lisp_Object Qframe_x_p, Qframe_tty_p;
256 extern Lisp_Object Vframe_title_format, Vframe_icon_title_format;
257
258 extern int frame_changed;
259
260 #define MARK_FRAME_FACES_CHANGED(f) do { \
261 (f)->faces_changed = 1; \
262 (f)->modiff++; \
263 if (!NILP ((f)->device)) \
264 MARK_DEVICE_FACES_CHANGED (XDEVICE ((f)->device)); \
265 else \
266 faces_changed = 1; } while (0)
267
268 #define MARK_FRAME_TOOLBARS_CHANGED(f) do { \
269 (f)->toolbar_changed = 1; \
270 (f)->modiff++; \
271 if (!NILP ((f)->device)) \
272 MARK_DEVICE_TOOLBARS_CHANGED (XDEVICE ((f)->device)); \
273 else \
274 toolbar_changed = 1; } while (0)
275
276 #define MARK_FRAME_SIZE_CHANGED(f) do { \
277 (f)->size_changed = 1; \
278 (f)->size_change_pending = 1; \
279 (f)->modiff++; \
280 if (!NILP ((f)->device)) \
281 MARK_DEVICE_SIZE_CHANGED (XDEVICE ((f)->device)); \
282 else \
283 size_changed = 1; } while (0)
284
285 #define MARK_FRAME_CHANGED(f) do { \
286 (f)->frame_changed = 1; \
287 (f)->modiff++; \
288 if (!NILP ((f)->device)) \
289 MARK_DEVICE_FRAME_CHANGED (XDEVICE ((f)->device)); \
290 else \
291 frame_changed = 1; } while (0)
292
293 #define MARK_FRAME_WINDOWS_CHANGED(f) do { \
294 (f)->windows_changed = 1; \
295 (f)->modiff++; \
296 if (!NILP ((f)->device)) \
297 MARK_DEVICE_WINDOWS_CHANGED (XDEVICE ((f)->device)); \
298 else \
299 windows_changed = 1; } while (0)
300
301 #define MARK_FRAME_WINDOWS_STRUCTURE_CHANGED(f) do { \
302 (f)->windows_structure_changed = 1; \
303 (f)->modiff++; \
304 if (!NILP ((f)->device)) \
305 MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED (XDEVICE ((f)->device)); \
306 else \
307 windows_structure_changed = 1; } while (0)
308
309
310 #define SET_FRAME_CLEAR(f) MARK_FRAME_CHANGED (f); (f)->clear = 1
311 #define FRAME_DEVICE(f) ((f)->device)
312 #define FRAME_CONSOLE(f) DEVICE_CONSOLE (XDEVICE (FRAME_DEVICE (f)))
313 #define FRAME_LIVE_P(f) (!(f)->dead)
314
315 #define FRAME_MINIBUF_ONLY_P(f) \
316 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
317 #define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer)
318 #define FRAME_HEIGHT(f) ((f)->height)
319 #define FRAME_WIDTH(f) ((f)->width)
320 #define FRAME_PIXHEIGHT(f) ((f)->pixheight)
321 #define FRAME_PIXWIDTH(f) ((f)->pixwidth)
322 #ifdef HAVE_SCROLLBARS
323 #define FRAME_SCROLLBAR_WIDTH(f) XINT ((f)->scrollbar_width)
324 #define FRAME_SCROLLBAR_HEIGHT(f) XINT ((f)->scrollbar_height)
325 #else
326 #define FRAME_SCROLLBAR_WIDTH(f) 0
327 #define FRAME_SCROLLBAR_HEIGHT(f) 0
328 #endif
329
330 #define FRAME_NEW_HEIGHT(f) ((f)->new_height)
331 #define FRAME_NEW_WIDTH(f) ((f)->new_width)
332 #define FRAME_CURSOR_X(f) ((f)->cursor_x)
333 #define FRAME_CURSOR_Y(f) ((f)->cursor_y)
334 #define FRAME_VISIBLE_P(f) ((f)->visible)
335 #define FRAME_NO_SPLIT_P(f) ((f)->no_split)
336 #define FRAME_ICONIFIED_P(f) ((f)->iconified)
337 #define FRAME_FOCUS_FRAME(f) ((f)->focus_frame)
338 #define FRAME_MINIBUF_WINDOW(f) ((f)->minibuffer_window)
339 #define FRAME_ROOT_WINDOW(f) ((f)->root_window)
340 /* Catch people attempting to set this. */
341 #define FRAME_SELECTED_WINDOW(f) NON_LVALUE ((f)->selected_window)
342 #define FRAME_LAST_NONMINIBUF_WINDOW(f) \
343 NON_LVALUE ((f)->last_nonminibuf_window)
344 #define FRAME_SB_VCACHE(f) ((f)->sb_vcache)
345 #define FRAME_SB_HCACHE(f) ((f)->sb_hcache)
346
347 #if 0 /* FSFmacs */
348
349 #define FRAME_VISIBLE_P(f) ((f)->visible != 0)
350 #define FRAME_SET_VISIBLE(f,p) \
351 ((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f))
352
353 /* Emacs's redisplay code could become confused if a frame's
354 visibility changes at arbitrary times. For example, if a frame is
355 visible while the desired glyphs are being built, but becomes
356 invisible before they are updated, then some rows of the
357 desired_glyphs will be left marked as enabled after redisplay is
358 complete, which should never happen. The next time the frame
359 becomes visible, redisplay will probably barf.
360
361 Currently, there are no similar situations involving iconified, but
362 the principle is the same.
363
364 So instead of having asynchronous input handlers directly set and
365 clear the frame's visibility and iconification flags, they just set
366 the async_visible and async_iconified flags; the redisplay code
367 calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay,
368 which sets visible and iconified from their asynchronous
369 counterparts.
370
371 Synchronous code must use the FRAME_SET_VISIBLE macro.
372
373 Also, if a frame used to be invisible, but has just become visible,
374 it must be marked as garbaged, since redisplay hasn't been keeping
375 up its contents. */
376 #define FRAME_SAMPLE_VISIBILITY(f) \
377 (((f)->async_visible && ! (f)->visible) ? SET_FRAME_GARBAGED (f) : 0, \
378 (f)->visible = (f)->async_visible, \
379 (f)->iconified = (f)->async_iconified)
380
381 #endif /* FSFmacs */
382
383 #define FRAME_BORDER_WIDTH(f) ((f)->internal_border_width)
384 #define FRAME_BORDER_HEIGHT(f) ((f)->internal_border_width)
385
386 /* This returns the frame-local value; that tells you what you should
387 use when computing the frame size. It is *not* the actual toolbar
388 size because that depends on the selected window. Use the macros
389 below for that.
390 */
391
392 #ifdef HAVE_TOOLBARS
393 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \
394 (!NILP ((f)->toolbar_visible_p[pos]))
395 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \
396 (XINT ((f)->toolbar_size[pos]))
397 #else
398 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0
399 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) 0
400 #endif
401
402 #define FRAME_THEORETICAL_TOOLBAR_SIZE(f, pos) \
403 (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \
404 ? FRAME_RAW_THEORETICAL_TOOLBAR_SIZE (f, pos) \
405 : 0)
406
407 #define FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT(f) \
408 FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_TOOLBAR)
409 #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT(f) \
410 FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR)
411 #define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \
412 FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
413 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \
414 FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
415
416 /* This returns the window-local value rather than the frame-local value;
417 that tells you about what's actually visible rather than what should
418 be used when computing the frame size. */
419
420 #ifdef HAVE_TOOLBARS
421 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) \
422 (!NILP (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_visible_p[pos]))
423 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) \
424 (XINT (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos]))
425 #define FRAME_REAL_TOOLBAR(f, pos) \
426 (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar[pos])
427 #else
428 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) 0
429 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) 0
430 #define FRAME_REAL_TOOLBAR(f, pos) Qnil
431 #endif
432
433 /* Note to Chuck
434 Note to Chuck
435 Note to Chuck:
436
437 The former definitions of FRAME_REAL_FOO_TOOLBAR_VISIBLE
438 looked at the toolbar data to see what was there. The
439 current ones look at the current values of the specifiers.
440 This is a semantic change; the former definition returned
441 what was *actually* there right at the moment, while the
442 current one returns what *ought* to be there once redisplay
443 has run to completion. I think this new definition is more
444 correct in almost all circumstances and is much less likely
445 to lead to strange race conditions. I'm not completely
446 sure that there aren't some places in the redisplay code
447 that use these macros and expect the former semantics, so
448 if you encounter some odd toolbar behavior, you might want
449 to look into this. --ben */
450
451 #define FRAME_REAL_TOOLBAR_VISIBLE(f, pos) \
452 (FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0 \
453 && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \
454 ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \
455 : 0)
456 #define FRAME_REAL_TOOLBAR_SIZE(f, pos) \
457 (FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \
458 && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \
459 ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \
460 : 0)
461
462 #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \
463 FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR)
464 #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \
465 FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR)
466 #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \
467 FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
468 #define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \
469 FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
470
471 #define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \
472 FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR)
473 #define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \
474 FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR)
475 #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \
476 FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR)
477 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \
478 FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR)
479
480 #define FRAME_TOP_BORDER_START(f) (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f))
481 #define FRAME_TOP_BORDER_END(f) \
482 (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f))
483
484 #define FRAME_BOTTOM_BORDER_START(f) \
485 (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \
486 FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f))
487 #define FRAME_BOTTOM_BORDER_END(f) \
488 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f))
489
490 #define FRAME_LEFT_BORDER_START(f) (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f))
491 #define FRAME_LEFT_BORDER_END(f) \
492 (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f))
493
494 #define FRAME_RIGHT_BORDER_START(f) \
495 (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \
496 FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f))
497 #define FRAME_RIGHT_BORDER_END(f) \
498 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f))
499
500 /* Equivalent in FSF Emacs:
501
502 FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
503 `for' loop which iterates over the elements of Vframe_list. The
504 loop will set FRAME_VAR, a Lisp_Object, to each frame in
505 Vframe_list in succession and execute the statement. LIST_VAR
506 should be a Lisp_Object too; it is used to iterate through the
507 Vframe_list.
508 */
509
510 /* NO_BREAK means that "break" doesn't do what you think it does!
511 Use goto instead. "continue" is OK, though. */
512 #define FRAME_LOOP_NO_BREAK(frmcons, devcons, concons) \
513 DEVICE_LOOP_NO_BREAK (devcons, concons) \
514 DEVICE_FRAME_LOOP (frmcons, XDEVICE (XCAR (devcons)))
515
516 extern Lisp_Object Vdefault_frame_name;
517
518 void update_frame_title (struct frame *f);
519 Lisp_Object next_frame (Lisp_Object f, Lisp_Object frametype,
520 Lisp_Object console);
521 Lisp_Object prev_frame (Lisp_Object f, Lisp_Object frametype,
522 Lisp_Object console);
523 void store_in_alist (Lisp_Object *alistptr,
524 CONST char *propname,
525 Lisp_Object val);
526 void pixel_to_char_size (struct frame *f, int pixel_width, int pixel_height,
527 int *char_width, int *char_height);
528 void char_to_pixel_size (struct frame *f, int char_width, int char_height,
529 int *pixel_width, int *pixel_height);
530 void round_size_to_char (struct frame *f, int in_width, int in_height,
531 int *out_width, int *out_height);
532 void change_frame_size (struct frame *frame,
533 int newlength, int newwidth,
534 int delay);
535 void hold_frame_size_changes (void);
536 void unhold_one_frame_size_changes (struct frame *f);
537 void unhold_frame_size_changes (void);
538 void select_frame_1 (Lisp_Object frame);
539 struct frame *selected_frame (void);
540 struct frame *device_selected_frame (struct device *d);
541 struct frame *decode_frame (Lisp_Object frame);
542 struct frame *decode_frame_or_selected (Lisp_Object cdf);
543 Lisp_Object make_frame (struct frame *f);
544 int other_visible_frames (struct frame *f);
545 void delete_frame_internal (struct frame *f, int force,
546 int called_from_delete_device,
547 int from_io_error);
548 void io_error_delete_frame (Lisp_Object frame);
549 Lisp_Object find_some_frame (int (*predicate) (Lisp_Object, void *),
550 void *closure);
551 int device_matches_console_spec (Lisp_Object frame, Lisp_Object device,
552 Lisp_Object console);
553 Lisp_Object frame_first_window (struct frame *f);
554 int show_gc_cursor (struct frame *f, Lisp_Object cursor);
555 void set_frame_selected_window (struct frame *f, Lisp_Object window);
556 int is_surrogate_for_selected_frame (struct frame *f);
557 void update_frame_icon (struct frame *f);
558
559 #endif /* _XEMACS_FRAME_H_ */