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