0
|
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
|
|
42 struct frame
|
|
43 {
|
|
44 struct lcrecord_header header;
|
|
45
|
|
46 /* Methods for this frame's console. This can also be retrieved
|
|
47 through frame->device->console, but it's faster this way. */
|
|
48 struct console_methods *framemeths;
|
|
49
|
|
50 /* Size of this frame, in units of characters. */
|
|
51 int height;
|
|
52 int width;
|
|
53
|
|
54 /* Size of this frame, in units of pixels. */
|
|
55 int pixheight;
|
|
56 int pixwidth;
|
|
57
|
149
|
58 #ifdef HAVE_TTY
|
|
59 /* The count of frame number. This applies to TTY frames only. */
|
|
60 int order_count;
|
|
61 #endif
|
|
62
|
0
|
63 /* Width of the internal border. This is a line of background color
|
|
64 just inside the window's border. It is normally only non-zero on
|
|
65 X frames, but we put it here to avoid introducing window system
|
|
66 dependencies. */
|
|
67 int internal_border_width;
|
|
68
|
|
69 /* New height and width for pending size change. 0 if no change pending. */
|
|
70 int new_height, new_width;
|
|
71
|
|
72 /* This frame's root window mirror. This structure exactly mirrors
|
|
73 the frame's window structure but contains only pointers to the
|
|
74 display structures. */
|
|
75 struct window_mirror *root_mirror;
|
|
76
|
|
77 int modiff;
|
|
78
|
|
79 #ifdef HAVE_SCROLLBARS
|
|
80 /* frame-local scrollbar information. See scrollbar.c. */
|
|
81 int scrollbar_y_offset;
|
|
82 int scrollbar_on_left;
|
|
83 int scrollbar_on_top;
|
|
84
|
|
85 /* cache of created scrollbars */
|
|
86 struct scrollbar_instance *sb_vcache;
|
|
87 struct scrollbar_instance *sb_hcache;
|
|
88 #endif
|
|
89
|
|
90 #ifdef HAVE_TOOLBARS
|
|
91 /* We handle these specially rather than putting them in
|
|
92 frameslots.h because we want them to be arrays. */
|
|
93
|
|
94 /* Data representing each currently displayed toolbar. See
|
|
95 toolbar.c */
|
|
96 Lisp_Object toolbar_data[4];
|
|
97
|
|
98 /* Cached specifiers: */
|
|
99
|
|
100 /* Size of the toolbars. The frame-local toolbar space is
|
|
101 subtracted before the windows are arranged. Window and buffer
|
|
102 local toolbars overlay their windows. */
|
|
103 Lisp_Object toolbar_size[4];
|
|
104 /* Visibility of the toolbars. This acts as a valve for toolbar_size. */
|
|
105 Lisp_Object toolbar_visible_p[4];
|
215
|
106 /* Thickness of the border around the toolbar. */
|
|
107 Lisp_Object toolbar_border_width[4];
|
0
|
108 #endif
|
|
109
|
|
110 /* A structure of auxiliary data specific to the device type.
|
|
111 struct x_frame is used for X window frames; defined in console-x.h */
|
|
112 void *frame_data;
|
|
113
|
|
114 #define MARKED_SLOT(x) Lisp_Object x
|
|
115 #include "frameslots.h"
|
|
116 #undef MARKED_SLOT
|
|
117
|
108
|
118 /* Nonzero if frame is currently displayed.
|
|
119 Mutally exclusive with iconfied
|
|
120 JV: This now a tristate flag:
|
|
121 Value : Emacs meaning :f-v-p : X meaning
|
|
122 0 : not displayed : nil : unmapped
|
|
123 >0 : user can access it,needs repainting : t : mapped and visible
|
|
124 <0 : user can access it,needs no repainting : hidden :mapped and invisible
|
|
125 where f-v-p is the return value of frame-visible-p */
|
|
126 int visible;
|
|
127
|
0
|
128 /* one-bit flags: */
|
|
129
|
|
130 /* Are we finished initializing? */
|
|
131 unsigned int init_finished :1;
|
|
132
|
|
133 /* Is frame marked for deletion? This is used in XSetErrorHandler(). */
|
|
134 unsigned int being_deleted :1;
|
|
135
|
|
136 /* Nonzero if this frame has been destroyed. */
|
|
137 unsigned int dead :1;
|
|
138
|
|
139 /* Nonzero if last attempt at redisplay on this frame was preempted. */
|
|
140 unsigned int display_preempted :1;
|
|
141
|
|
142 /* Nonzero if window is currently iconified.
|
|
143 This and visible are mutually exclusive. */
|
|
144 unsigned int iconified :1;
|
|
145
|
|
146 /* Nonzero if this frame should be cleared and then redrawn.
|
|
147 Setting this will also effectively set frame_changed. */
|
|
148 unsigned int clear :1;
|
|
149
|
|
150 /* True if frame actually has a minibuffer window on it.
|
|
151 0 if using a minibuffer window that isn't on this frame. */
|
|
152 unsigned int has_minibuffer :1;
|
185
|
153
|
0
|
154 /* True if frame's root window can't be split. */
|
|
155 unsigned int no_split :1;
|
|
156
|
|
157 unsigned int top_toolbar_was_visible :1;
|
|
158 unsigned int bottom_toolbar_was_visible :1;
|
|
159 unsigned int left_toolbar_was_visible :1;
|
|
160 unsigned int right_toolbar_was_visible :1;
|
|
161
|
|
162 /* redisplay flags */
|
|
163 unsigned int buffers_changed :1;
|
|
164 unsigned int clip_changed :1;
|
|
165 unsigned int extents_changed :1;
|
|
166 unsigned int faces_changed :1;
|
|
167 unsigned int frame_changed :1;
|
269
|
168 unsigned int glyphs_changed :1;
|
0
|
169 unsigned int icon_changed :1;
|
|
170 unsigned int menubar_changed :1;
|
|
171 unsigned int modeline_changed :1;
|
|
172 unsigned int point_changed :1;
|
|
173 unsigned int size_changed :1;
|
|
174 unsigned int toolbar_changed :1;
|
|
175 unsigned int windows_changed :1;
|
|
176 unsigned int windows_structure_changed :1;
|
|
177 unsigned int window_face_cache_reset :1; /* used by expose handler */
|
217
|
178 unsigned int echo_area_garbaged :1; /* used by Fredisplay_echo_area */
|
0
|
179
|
|
180 unsigned int size_change_pending :1;
|
|
181 unsigned int mirror_dirty :1;
|
|
182
|
|
183 /* flag indicating if any window on this frame is displaying a subwindow */
|
74
|
184 unsigned int subwindows_being_displayed :1;
|
0
|
185 };
|
|
186
|
272
|
187 EXFUN (Fdelete_frame, 2);
|
|
188 EXFUN (Fframe_iconified_p, 1);
|
|
189 EXFUN (Fframe_name, 1);
|
|
190 EXFUN (Fframe_property, 3);
|
|
191 EXFUN (Fmake_frame, 2);
|
|
192 EXFUN (Fmake_frame_visible, 1);
|
|
193 EXFUN (Fraise_frame, 1);
|
|
194 EXFUN (Fselect_frame, 1);
|
|
195 EXFUN (Fset_frame_pointer, 2);
|
|
196 EXFUN (Fset_frame_position, 3);
|
|
197 EXFUN (Fset_frame_size, 4);
|
|
198
|
|
199 extern Lisp_Object Qbackground_toolbar_color, Qbell_volume, Qborder_color;
|
|
200 extern Lisp_Object Qborder_width, Qbottom_toolbar_shadow_color;
|
|
201 extern Lisp_Object Qbottom_toolbar_shadow_pixmap, Qdelete_frame;
|
|
202 extern Lisp_Object Qdeselect_frame_hook, Qdrag_and_drop_functions, Qgc_pointer;
|
|
203 extern Lisp_Object Qiconic, Qinitially_unmapped, Qinter_line_space;
|
|
204 extern Lisp_Object Qinternal_border_width, Qinvisible, Qmap_frame_hook;
|
|
205 extern Lisp_Object Qminibuffer, Qmodeline_pointer, Qmouse_enter_frame_hook;
|
|
206 extern Lisp_Object Qmouse_leave_frame_hook, Qpointer_background;
|
|
207 extern Lisp_Object Qpointer_color, Qpopup, Qscrollbar_placement;
|
|
208 extern Lisp_Object Qselect_frame_hook, Qspace_pointer;
|
|
209 extern Lisp_Object Qsynchronize_minibuffers, Qtext_pointer;
|
|
210 extern Lisp_Object Qtoolbar_shadow_thickness, Qtop_toolbar_shadow_color;
|
|
211 extern Lisp_Object Qtop_toolbar_shadow_pixmap, Qunmap_frame_hook;
|
|
212 extern Lisp_Object Qunsplittable, Quse_backing_store, Qvisible, Qvisual_bell;
|
|
213 extern Lisp_Object Vframe_icon_title_format, Vframe_title_format;
|
|
214 extern Lisp_Object Vmouse_motion_handler;
|
|
215
|
0
|
216
|
|
217 DECLARE_LRECORD (frame, struct frame);
|
|
218 #define XFRAME(x) XRECORD (x, frame, struct frame)
|
|
219 #define XSETFRAME(x, p) XSETRECORD (x, p, frame)
|
|
220 #define FRAMEP(x) RECORDP (x, frame)
|
|
221 #define GC_FRAMEP(x) GC_RECORDP (x, frame)
|
|
222 #define CHECK_FRAME(x) CHECK_RECORD (x, frame)
|
|
223 #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame)
|
|
224
|
272
|
225 #define CHECK_LIVE_FRAME(x) do { \
|
|
226 CHECK_FRAME (x); \
|
|
227 if (! FRAME_LIVE_P (XFRAME (x))) \
|
|
228 dead_wrong_type_argument (Qframe_live_p, (x)); \
|
|
229 } while (0)
|
|
230 #define CONCHECK_LIVE_FRAME(x) do { \
|
|
231 CONCHECK_FRAME (x); \
|
|
232 if (! FRAME_LIVE_P (XFRAME (x))) \
|
|
233 x = wrong_type_argument (Qframe_live_p, (x)); \
|
|
234 } while (0)
|
0
|
235
|
|
236 #define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type)
|
|
237
|
|
238 #ifdef ERROR_CHECK_TYPECHECK
|
272
|
239 INLINE struct frame *
|
|
240 error_check_frame_type (struct frame * f, Lisp_Object sym);
|
|
241 INLINE struct frame *
|
|
242 error_check_frame_type (struct frame * f, Lisp_Object sym)
|
|
243 {
|
|
244 assert (EQ (FRAME_TYPE (f), sym));
|
|
245 return f;
|
|
246 }
|
0
|
247 # define FRAME_TYPE_DATA(f, type) \
|
272
|
248 ((struct type##_frame *) (error_check_frame_type (f, Q##type))->frame_data)
|
0
|
249 #else
|
|
250 # define FRAME_TYPE_DATA(f, type) \
|
|
251 ((struct type##_frame *) (f)->frame_data)
|
|
252 #endif
|
|
253
|
|
254 #define CHECK_FRAME_TYPE(x, type) \
|
|
255 do { \
|
|
256 CHECK_FRAME (x); \
|
|
257 if (!FRAME_TYPE_P (XFRAME (x), type)) \
|
|
258 dead_wrong_type_argument \
|
|
259 (type##_console_methods->predicate_symbol, x); \
|
|
260 } while (0)
|
|
261 #define CONCHECK_FRAME_TYPE(x, type) \
|
|
262 do { \
|
|
263 CONCHECK_FRAME (x); \
|
|
264 if (!FRAME_TYPE_P (XFRAME (x), type)) \
|
|
265 x = wrong_type_argument \
|
|
266 (type##_console_methods->predicate_symbol, x); \
|
|
267 } while (0)
|
|
268
|
|
269 /* #### These should be in the frame-*.h files but there are
|
|
270 too many places where the abstraction is broken. Need to
|
|
271 fix. */
|
|
272
|
|
273 #define FRAME_X_P(frm) CONSOLE_TYPESYM_X_P (FRAME_TYPE (frm))
|
|
274 #define CHECK_X_FRAME(z) CHECK_FRAME_TYPE (z, x)
|
|
275 #define CONCHECK_X_FRAME(z) CONCHECK_FRAME_TYPE (z, x)
|
|
276
|
|
277 #define FRAME_TTY_P(frm) CONSOLE_TYPESYM_TTY_P (FRAME_TYPE (frm))
|
|
278 #define CHECK_TTY_FRAME(z) CHECK_FRAME_TYPE (z, tty)
|
|
279 #define CONCHECK_TTY_FRAME(z) CONCHECK_FRAME_TYPE (z, tty)
|
|
280
|
|
281 #define FRAME_STREAM_P(frm) CONSOLE_TYPESYM_STREAM_P (FRAME_TYPE (frm))
|
|
282 #define CHECK_STREAM_FRAME(z) CHECK_FRAME_TYPE (z, stream)
|
|
283 #define CONCHECK_STREAM_FRAME(z) CONCHECK_FRAME_TYPE (z, stream)
|
|
284
|
|
285 #define FRAME_WIN_P(frm) CONSOLE_TYPESYM_WIN_P (FRAME_TYPE (frm))
|
|
286
|
|
287 extern int frame_changed;
|
|
288
|
272
|
289 #define MARK_FRAME_FACES_CHANGED(f) do { \
|
|
290 struct frame *mffc_f = (f); \
|
|
291 mffc_f->faces_changed = 1; \
|
|
292 mffc_f->modiff++; \
|
|
293 if (!NILP (mffc_f->device)) \
|
|
294 { \
|
|
295 struct device *mffc_d = XDEVICE (mffc_f->device); \
|
|
296 MARK_DEVICE_FACES_CHANGED (mffc_d); \
|
|
297 } \
|
|
298 else \
|
|
299 faces_changed = 1; \
|
|
300 } while (0)
|
0
|
301
|
272
|
302 #define MARK_FRAME_GLYPHS_CHANGED(f) do { \
|
|
303 struct frame *mfgc_f = (f); \
|
|
304 mfgc_f->glyphs_changed = 1; \
|
|
305 mfgc_f->modiff++; \
|
|
306 if (!NILP (mfgc_f->device)) \
|
|
307 { \
|
|
308 struct device *mfgc_d = XDEVICE (mfgc_f->device); \
|
|
309 MARK_DEVICE_GLYPHS_CHANGED (mfgc_d); \
|
|
310 } \
|
|
311 else \
|
|
312 glyphs_changed = 1; \
|
|
313 } while (0)
|
269
|
314
|
272
|
315 #define MARK_FRAME_TOOLBARS_CHANGED(f) do { \
|
|
316 struct frame *mftc_f = (f); \
|
|
317 mftc_f->toolbar_changed = 1; \
|
|
318 mftc_f->modiff++; \
|
|
319 if (!NILP (mftc_f->device)) \
|
|
320 { \
|
|
321 struct device *mftc_d = XDEVICE (mftc_f->device); \
|
|
322 MARK_DEVICE_TOOLBARS_CHANGED (mftc_d); \
|
|
323 } \
|
|
324 else \
|
|
325 toolbar_changed = 1; \
|
|
326 } while (0)
|
0
|
327
|
272
|
328 #define MARK_FRAME_SIZE_CHANGED(f) do { \
|
|
329 struct frame *mfsc_f = (f); \
|
|
330 mfsc_f->size_changed = 1; \
|
|
331 mfsc_f->size_change_pending = 1; \
|
|
332 mfsc_f->modiff++; \
|
|
333 if (!NILP (mfsc_f->device)) \
|
|
334 { \
|
|
335 struct device *mfsc_d = XDEVICE (mfsc_f->device); \
|
|
336 MARK_DEVICE_SIZE_CHANGED (mfsc_d); \
|
|
337 } \
|
|
338 else \
|
|
339 size_changed = 1; \
|
|
340 } while (0)
|
0
|
341
|
272
|
342 #define MARK_FRAME_CHANGED(f) do { \
|
|
343 struct frame *mfc_f = (f); \
|
|
344 mfc_f->frame_changed = 1; \
|
|
345 mfc_f->modiff++; \
|
|
346 if (!NILP (mfc_f->device)) \
|
|
347 { \
|
|
348 struct device *mfc_d = XDEVICE (mfc_f->device); \
|
|
349 MARK_DEVICE_FRAME_CHANGED (mfc_d); \
|
|
350 } \
|
|
351 else \
|
|
352 frame_changed = 1; \
|
|
353 } while (0)
|
0
|
354
|
272
|
355 #define MARK_FRAME_WINDOWS_CHANGED(f) do { \
|
|
356 struct frame *mfwc_f = (f); \
|
|
357 mfwc_f->windows_changed = 1; \
|
|
358 mfwc_f->modiff++; \
|
|
359 if (!NILP (mfwc_f->device)) \
|
|
360 { \
|
|
361 struct device *mfwc_d = XDEVICE (mfwc_f->device); \
|
|
362 MARK_DEVICE_WINDOWS_CHANGED (mfwc_d); \
|
|
363 } \
|
|
364 else \
|
|
365 windows_changed = 1; \
|
|
366 } while (0)
|
0
|
367
|
272
|
368 #define MARK_FRAME_WINDOWS_STRUCTURE_CHANGED(f) do { \
|
|
369 struct frame *fwsc_f = (f); \
|
|
370 fwsc_f->windows_structure_changed = 1; \
|
|
371 fwsc_f->modiff++; \
|
|
372 if (!NILP (fwsc_f->device)) \
|
|
373 { \
|
|
374 struct device *fwsc_d = XDEVICE (fwsc_f->device); \
|
|
375 MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED (fwsc_d); \
|
|
376 } \
|
|
377 else \
|
|
378 windows_structure_changed = 1; \
|
|
379 } while (0)
|
0
|
380
|
|
381 #define SET_FRAME_CLEAR(f) MARK_FRAME_CHANGED (f); (f)->clear = 1
|
|
382 #define FRAME_DEVICE(f) ((f)->device)
|
|
383 #define FRAME_CONSOLE(f) DEVICE_CONSOLE (XDEVICE (FRAME_DEVICE (f)))
|
|
384 #define FRAME_LIVE_P(f) (!(f)->dead)
|
|
385
|
|
386 #define FRAME_MINIBUF_ONLY_P(f) \
|
|
387 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
|
|
388 #define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer)
|
|
389 #define FRAME_HEIGHT(f) ((f)->height)
|
|
390 #define FRAME_WIDTH(f) ((f)->width)
|
|
391 #define FRAME_PIXHEIGHT(f) ((f)->pixheight)
|
|
392 #define FRAME_PIXWIDTH(f) ((f)->pixwidth)
|
|
393 #ifdef HAVE_SCROLLBARS
|
|
394 #define FRAME_SCROLLBAR_WIDTH(f) XINT ((f)->scrollbar_width)
|
|
395 #define FRAME_SCROLLBAR_HEIGHT(f) XINT ((f)->scrollbar_height)
|
|
396 #else
|
|
397 #define FRAME_SCROLLBAR_WIDTH(f) 0
|
|
398 #define FRAME_SCROLLBAR_HEIGHT(f) 0
|
|
399 #endif
|
|
400
|
|
401 #define FRAME_NEW_HEIGHT(f) ((f)->new_height)
|
|
402 #define FRAME_NEW_WIDTH(f) ((f)->new_width)
|
|
403 #define FRAME_CURSOR_X(f) ((f)->cursor_x)
|
|
404 #define FRAME_CURSOR_Y(f) ((f)->cursor_y)
|
|
405 #define FRAME_VISIBLE_P(f) ((f)->visible)
|
185
|
406 #define FRAME_REPAINT_P(f) ((f)->visible>0)
|
0
|
407 #define FRAME_NO_SPLIT_P(f) ((f)->no_split)
|
|
408 #define FRAME_ICONIFIED_P(f) ((f)->iconified)
|
|
409 #define FRAME_FOCUS_FRAME(f) ((f)->focus_frame)
|
|
410 #define FRAME_MINIBUF_WINDOW(f) ((f)->minibuffer_window)
|
|
411 #define FRAME_ROOT_WINDOW(f) ((f)->root_window)
|
|
412 /* Catch people attempting to set this. */
|
|
413 #define FRAME_SELECTED_WINDOW(f) NON_LVALUE ((f)->selected_window)
|
|
414 #define FRAME_LAST_NONMINIBUF_WINDOW(f) \
|
|
415 NON_LVALUE ((f)->last_nonminibuf_window)
|
|
416 #define FRAME_SB_VCACHE(f) ((f)->sb_vcache)
|
|
417 #define FRAME_SB_HCACHE(f) ((f)->sb_hcache)
|
|
418
|
|
419 #if 0 /* FSFmacs */
|
|
420
|
|
421 #define FRAME_VISIBLE_P(f) ((f)->visible != 0)
|
|
422 #define FRAME_SET_VISIBLE(f,p) \
|
|
423 ((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f))
|
|
424
|
|
425 /* Emacs's redisplay code could become confused if a frame's
|
|
426 visibility changes at arbitrary times. For example, if a frame is
|
|
427 visible while the desired glyphs are being built, but becomes
|
|
428 invisible before they are updated, then some rows of the
|
|
429 desired_glyphs will be left marked as enabled after redisplay is
|
|
430 complete, which should never happen. The next time the frame
|
|
431 becomes visible, redisplay will probably barf.
|
|
432
|
|
433 Currently, there are no similar situations involving iconified, but
|
|
434 the principle is the same.
|
|
435
|
|
436 So instead of having asynchronous input handlers directly set and
|
|
437 clear the frame's visibility and iconification flags, they just set
|
|
438 the async_visible and async_iconified flags; the redisplay code
|
|
439 calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay,
|
|
440 which sets visible and iconified from their asynchronous
|
|
441 counterparts.
|
|
442
|
|
443 Synchronous code must use the FRAME_SET_VISIBLE macro.
|
|
444
|
|
445 Also, if a frame used to be invisible, but has just become visible,
|
|
446 it must be marked as garbaged, since redisplay hasn't been keeping
|
|
447 up its contents. */
|
|
448 #define FRAME_SAMPLE_VISIBILITY(f) \
|
|
449 (((f)->async_visible && ! (f)->visible) ? SET_FRAME_GARBAGED (f) : 0, \
|
|
450 (f)->visible = (f)->async_visible, \
|
|
451 (f)->iconified = (f)->async_iconified)
|
|
452
|
|
453 #endif /* FSFmacs */
|
|
454
|
|
455 #define FRAME_BORDER_WIDTH(f) ((f)->internal_border_width)
|
|
456 #define FRAME_BORDER_HEIGHT(f) ((f)->internal_border_width)
|
|
457
|
|
458 /* This returns the frame-local value; that tells you what you should
|
|
459 use when computing the frame size. It is *not* the actual toolbar
|
|
460 size because that depends on the selected window. Use the macros
|
|
461 below for that.
|
|
462 */
|
|
463
|
|
464 #ifdef HAVE_TOOLBARS
|
|
465 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \
|
263
|
466 (!NILP((f)->toolbar_data[pos]) && !NILP ((f)->toolbar_visible_p[pos]))
|
0
|
467 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \
|
269
|
468 (!NILP ((f)->toolbar_data[pos]) && INTP((f)->toolbar_size[pos]) ? \
|
263
|
469 (XINT ((f)->toolbar_size[pos])) : 0)
|
215
|
470 #define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \
|
269
|
471 (!NILP ((f)->toolbar_data[pos]) && INTP((f)->toolbar_border_width[pos]) ? \
|
263
|
472 (XINT ((f)->toolbar_border_width[pos])) : 0)
|
0
|
473 #else
|
|
474 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0
|
|
475 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) 0
|
215
|
476 #define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) 0
|
0
|
477 #endif
|
|
478
|
|
479 #define FRAME_THEORETICAL_TOOLBAR_SIZE(f, pos) \
|
|
480 (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \
|
|
481 ? FRAME_RAW_THEORETICAL_TOOLBAR_SIZE (f, pos) \
|
|
482 : 0)
|
|
483
|
|
484 #define FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT(f) \
|
|
485 FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_TOOLBAR)
|
|
486 #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT(f) \
|
|
487 FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR)
|
|
488 #define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \
|
|
489 FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
|
|
490 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \
|
|
491 FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
|
|
492
|
215
|
493 #define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \
|
|
494 (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \
|
|
495 ? FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, pos) \
|
|
496 : 0)
|
|
497
|
|
498 #define FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH(f) \
|
|
499 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR)
|
|
500 #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \
|
|
501 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR)
|
|
502 #define FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \
|
|
503 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR)
|
|
504 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \
|
|
505 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR)
|
|
506
|
0
|
507 /* This returns the window-local value rather than the frame-local value;
|
|
508 that tells you about what's actually visible rather than what should
|
|
509 be used when computing the frame size. */
|
|
510
|
|
511 #ifdef HAVE_TOOLBARS
|
|
512 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) \
|
267
|
513 (HAS_DEVMETH_P (XDEVICE (FRAME_DEVICE (f)), initialize_frame_toolbars) \
|
|
514 && !NILP (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_visible_p[pos]))
|
215
|
515 #define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \
|
269
|
516 ((INTP (XWINDOW \
|
|
517 (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) ? \
|
|
518 (XINT (XWINDOW \
|
|
519 (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) \
|
|
520 : 0)
|
0
|
521 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) \
|
269
|
522 ((INTP (XWINDOW \
|
|
523 (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) ? \
|
|
524 (XINT (XWINDOW \
|
|
525 (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) : 0)
|
0
|
526 #define FRAME_REAL_TOOLBAR(f, pos) \
|
|
527 (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar[pos])
|
|
528 #else
|
|
529 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) 0
|
215
|
530 #define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) 0
|
0
|
531 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) 0
|
|
532 #define FRAME_REAL_TOOLBAR(f, pos) Qnil
|
|
533 #endif
|
|
534
|
|
535 /* Note to Chuck
|
|
536 Note to Chuck
|
|
537 Note to Chuck:
|
|
538
|
|
539 The former definitions of FRAME_REAL_FOO_TOOLBAR_VISIBLE
|
|
540 looked at the toolbar data to see what was there. The
|
|
541 current ones look at the current values of the specifiers.
|
|
542 This is a semantic change; the former definition returned
|
|
543 what was *actually* there right at the moment, while the
|
|
544 current one returns what *ought* to be there once redisplay
|
|
545 has run to completion. I think this new definition is more
|
|
546 correct in almost all circumstances and is much less likely
|
|
547 to lead to strange race conditions. I'm not completely
|
|
548 sure that there aren't some places in the redisplay code
|
|
549 that use these macros and expect the former semantics, so
|
|
550 if you encounter some odd toolbar behavior, you might want
|
|
551 to look into this. --ben */
|
|
552
|
|
553 #define FRAME_REAL_TOOLBAR_VISIBLE(f, pos) \
|
263
|
554 ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \
|
|
555 && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0) \
|
0
|
556 ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \
|
|
557 : 0)
|
|
558 #define FRAME_REAL_TOOLBAR_SIZE(f, pos) \
|
263
|
559 ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \
|
|
560 && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \
|
0
|
561 ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \
|
|
562 : 0)
|
215
|
563 #define FRAME_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \
|
263
|
564 ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \
|
|
565 && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \
|
215
|
566 ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \
|
|
567 : 0)
|
0
|
568
|
|
569 #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \
|
|
570 FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR)
|
|
571 #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \
|
|
572 FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR)
|
|
573 #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \
|
|
574 FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
|
|
575 #define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \
|
|
576 FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
|
|
577
|
215
|
578 #define FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH(f) \
|
|
579 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR)
|
|
580 #define FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \
|
|
581 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR)
|
|
582 #define FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \
|
|
583 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR)
|
|
584 #define FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \
|
|
585 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR)
|
|
586
|
0
|
587 #define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \
|
|
588 FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR)
|
|
589 #define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \
|
|
590 FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR)
|
|
591 #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \
|
|
592 FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR)
|
|
593 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \
|
|
594 FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR)
|
|
595
|
215
|
596 #define FRAME_TOP_BORDER_START(f) \
|
|
597 (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \
|
|
598 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f))
|
0
|
599 #define FRAME_TOP_BORDER_END(f) \
|
|
600 (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f))
|
|
601
|
|
602 #define FRAME_BOTTOM_BORDER_START(f) \
|
|
603 (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \
|
215
|
604 FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \
|
|
605 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f))
|
0
|
606 #define FRAME_BOTTOM_BORDER_END(f) \
|
215
|
607 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \
|
|
608 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f))
|
0
|
609
|
215
|
610 #define FRAME_LEFT_BORDER_START(f) \
|
|
611 (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \
|
|
612 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f))
|
0
|
613 #define FRAME_LEFT_BORDER_END(f) \
|
|
614 (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f))
|
|
615
|
|
616 #define FRAME_RIGHT_BORDER_START(f) \
|
|
617 (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \
|
235
|
618 FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) - \
|
|
619 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f))
|
0
|
620 #define FRAME_RIGHT_BORDER_END(f) \
|
215
|
621 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \
|
|
622 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f))
|
0
|
623
|
|
624 /* Equivalent in FSF Emacs:
|
|
625
|
|
626 FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
|
|
627 `for' loop which iterates over the elements of Vframe_list. The
|
|
628 loop will set FRAME_VAR, a Lisp_Object, to each frame in
|
|
629 Vframe_list in succession and execute the statement. LIST_VAR
|
|
630 should be a Lisp_Object too; it is used to iterate through the
|
|
631 Vframe_list.
|
|
632 */
|
|
633
|
|
634 /* NO_BREAK means that "break" doesn't do what you think it does!
|
|
635 Use goto instead. "continue" is OK, though. */
|
|
636 #define FRAME_LOOP_NO_BREAK(frmcons, devcons, concons) \
|
|
637 DEVICE_LOOP_NO_BREAK (devcons, concons) \
|
|
638 DEVICE_FRAME_LOOP (frmcons, XDEVICE (XCAR (devcons)))
|
|
639
|
|
640 void update_frame_title (struct frame *f);
|
|
641 Lisp_Object next_frame (Lisp_Object f, Lisp_Object frametype,
|
|
642 Lisp_Object console);
|
|
643 Lisp_Object prev_frame (Lisp_Object f, Lisp_Object frametype,
|
|
644 Lisp_Object console);
|
185
|
645 void store_in_alist (Lisp_Object *alistptr,
|
|
646 CONST char *propname,
|
0
|
647 Lisp_Object val);
|
|
648 void pixel_to_char_size (struct frame *f, int pixel_width, int pixel_height,
|
|
649 int *char_width, int *char_height);
|
|
650 void char_to_pixel_size (struct frame *f, int char_width, int char_height,
|
|
651 int *pixel_width, int *pixel_height);
|
|
652 void round_size_to_char (struct frame *f, int in_width, int in_height,
|
|
653 int *out_width, int *out_height);
|
269
|
654 void pixel_to_real_char_size (struct frame *f, int pixel_width, int pixel_height,
|
|
655 int *char_width, int *char_height);
|
|
656 void char_to_real_pixel_size (struct frame *f, int char_width, int char_height,
|
|
657 int *pixel_width, int *pixel_height);
|
|
658 void round_size_to_real_char (struct frame *f, int in_width, int in_height,
|
|
659 int *out_width, int *out_height);
|
0
|
660 void change_frame_size (struct frame *frame,
|
185
|
661 int newlength, int newwidth,
|
0
|
662 int delay);
|
|
663 void hold_frame_size_changes (void);
|
|
664 void unhold_one_frame_size_changes (struct frame *f);
|
|
665 void unhold_frame_size_changes (void);
|
|
666 void select_frame_1 (Lisp_Object frame);
|
149
|
667 void select_frame_2 (Lisp_Object frame);
|
0
|
668 struct frame *selected_frame (void);
|
|
669 struct frame *device_selected_frame (struct device *d);
|
|
670 struct frame *decode_frame (Lisp_Object frame);
|
|
671 struct frame *decode_frame_or_selected (Lisp_Object cdf);
|
|
672 Lisp_Object make_frame (struct frame *f);
|
|
673 int other_visible_frames (struct frame *f);
|
|
674 void delete_frame_internal (struct frame *f, int force,
|
|
675 int called_from_delete_device,
|
|
676 int from_io_error);
|
|
677 void io_error_delete_frame (Lisp_Object frame);
|
|
678 Lisp_Object find_some_frame (int (*predicate) (Lisp_Object, void *),
|
|
679 void *closure);
|
|
680 int device_matches_console_spec (Lisp_Object frame, Lisp_Object device,
|
|
681 Lisp_Object console);
|
|
682 Lisp_Object frame_first_window (struct frame *f);
|
|
683 int show_gc_cursor (struct frame *f, Lisp_Object cursor);
|
|
684 void set_frame_selected_window (struct frame *f, Lisp_Object window);
|
|
685 int is_surrogate_for_selected_frame (struct frame *f);
|
|
686 void update_frame_icon (struct frame *f);
|
|
687
|
|
688 #endif /* _XEMACS_FRAME_H_ */
|