428
|
1 /* Generic frame functions.
|
|
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
771
|
3 Copyright (C) 1995, 1996, 2002 Ben Wing.
|
428
|
4 Copyright (C) 1995 Sun Microsystems, Inc.
|
|
5
|
|
6 This file is part of XEmacs.
|
|
7
|
|
8 XEmacs is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published by the
|
|
10 Free Software Foundation; either version 2, or (at your option) any
|
|
11 later version.
|
|
12
|
|
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with XEmacs; see the file COPYING. If not, write to
|
|
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 Boston, MA 02111-1307, USA. */
|
|
22
|
|
23 /* Synched up with: FSF 19.30. */
|
|
24
|
|
25 /* This file has been Mule-ized. */
|
|
26
|
|
27 #include <config.h>
|
|
28 #include "lisp.h"
|
|
29
|
|
30 #include "buffer.h" /* for Vbuffer_alist */
|
|
31 #include "console.h"
|
800
|
32 #include "device.h"
|
428
|
33 #include "events.h"
|
|
34 #include "extents.h"
|
|
35 #include "faces.h"
|
|
36 #include "frame.h"
|
|
37 #include "glyphs.h"
|
|
38 #include "gutter.h"
|
|
39 #include "menubar.h"
|
|
40 #include "redisplay.h"
|
|
41 #include "scrollbar.h"
|
800
|
42 #include "toolbar.h"
|
428
|
43 #include "window.h"
|
|
44
|
|
45 Lisp_Object Vselect_frame_hook, Qselect_frame_hook;
|
|
46 Lisp_Object Vdeselect_frame_hook, Qdeselect_frame_hook;
|
|
47 Lisp_Object Vcreate_frame_hook, Qcreate_frame_hook;
|
|
48 Lisp_Object Vdelete_frame_hook, Qdelete_frame_hook;
|
|
49 Lisp_Object Vmouse_enter_frame_hook, Qmouse_enter_frame_hook;
|
|
50 Lisp_Object Vmouse_leave_frame_hook, Qmouse_leave_frame_hook;
|
|
51 Lisp_Object Vmap_frame_hook, Qmap_frame_hook;
|
|
52 Lisp_Object Vunmap_frame_hook, Qunmap_frame_hook;
|
|
53 int allow_deletion_of_last_visible_frame;
|
|
54 Lisp_Object Vadjust_frame_function;
|
|
55 Lisp_Object Vmouse_motion_handler;
|
|
56 Lisp_Object Vsynchronize_minibuffers;
|
|
57 Lisp_Object Qsynchronize_minibuffers;
|
|
58 Lisp_Object Qbuffer_predicate;
|
|
59 Lisp_Object Qmake_initial_minibuffer_frame;
|
|
60 Lisp_Object Qcustom_initialize_frame;
|
|
61
|
|
62 /* We declare all these frame properties here even though many of them
|
|
63 are currently only used in frame-x.c, because we should generalize
|
|
64 them. */
|
|
65
|
|
66 Lisp_Object Qminibuffer;
|
|
67 Lisp_Object Qunsplittable;
|
|
68 Lisp_Object Qinternal_border_width;
|
|
69 Lisp_Object Qtop_toolbar_shadow_color;
|
|
70 Lisp_Object Qbottom_toolbar_shadow_color;
|
|
71 Lisp_Object Qbackground_toolbar_color;
|
|
72 Lisp_Object Qtop_toolbar_shadow_pixmap;
|
|
73 Lisp_Object Qbottom_toolbar_shadow_pixmap;
|
|
74 Lisp_Object Qtoolbar_shadow_thickness;
|
|
75 Lisp_Object Qscrollbar_placement;
|
|
76 Lisp_Object Qinter_line_space;
|
|
77 Lisp_Object Qvisual_bell;
|
|
78 Lisp_Object Qbell_volume;
|
|
79 Lisp_Object Qpointer_background;
|
|
80 Lisp_Object Qpointer_color;
|
|
81 Lisp_Object Qtext_pointer;
|
|
82 Lisp_Object Qspace_pointer;
|
|
83 Lisp_Object Qmodeline_pointer;
|
|
84 Lisp_Object Qgc_pointer;
|
|
85 Lisp_Object Qinitially_unmapped;
|
|
86 Lisp_Object Quse_backing_store;
|
|
87 Lisp_Object Qborder_color;
|
|
88 Lisp_Object Qborder_width;
|
|
89
|
|
90 Lisp_Object Qframep, Qframe_live_p;
|
|
91 Lisp_Object Qdelete_frame;
|
|
92
|
|
93 Lisp_Object Qframe_title_format, Vframe_title_format;
|
|
94 Lisp_Object Qframe_icon_title_format, Vframe_icon_title_format;
|
|
95
|
|
96 Lisp_Object Vdefault_frame_name;
|
|
97 Lisp_Object Vdefault_frame_plist;
|
|
98
|
|
99 Lisp_Object Vframe_icon_glyph;
|
|
100
|
|
101 Lisp_Object Qhidden;
|
|
102
|
|
103 Lisp_Object Qvisible, Qiconic, Qinvisible, Qvisible_iconic, Qinvisible_iconic;
|
|
104 Lisp_Object Qnomini, Qvisible_nomini, Qiconic_nomini, Qinvisible_nomini;
|
|
105 Lisp_Object Qvisible_iconic_nomini, Qinvisible_iconic_nomini;
|
|
106
|
442
|
107 Lisp_Object Qset_specifier, Qset_face_property;
|
428
|
108 Lisp_Object Qface_property_instance;
|
|
109
|
|
110 Lisp_Object Qframe_property_alias;
|
|
111
|
|
112 /* If this is non-nil, it is the frame that make-frame is currently
|
|
113 creating. We can't set the current frame to this in case the
|
|
114 debugger goes off because it would try and display to it. However,
|
|
115 there are some places which need to reference it which have no
|
|
116 other way of getting it if it isn't the selected frame. */
|
|
117 Lisp_Object Vframe_being_created;
|
|
118 Lisp_Object Qframe_being_created;
|
|
119
|
|
120 static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val);
|
438
|
121 static struct display_line title_string_display_line;
|
|
122 /* Used by generate_title_string. Global because they get used so much that
|
|
123 the dynamic allocation time adds up. */
|
|
124 static Emchar_dynarr *title_string_emchar_dynarr;
|
428
|
125
|
|
126
|
|
127 static Lisp_Object
|
|
128 mark_frame (Lisp_Object obj)
|
|
129 {
|
|
130 struct frame *f = XFRAME (obj);
|
|
131
|
|
132 #define MARKED_SLOT(x) mark_object (f->x)
|
|
133 #include "frameslots.h"
|
|
134
|
|
135 if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */
|
|
136 MAYBE_FRAMEMETH (f, mark_frame, (f));
|
|
137
|
617
|
138 #ifdef HAVE_SCROLLBARS
|
|
139 if (f->sb_vcache)
|
|
140 mark_object (wrap_scrollbar_instance (f->sb_vcache));
|
|
141 if (f->sb_hcache)
|
|
142 mark_object (wrap_scrollbar_instance (f->sb_hcache));
|
|
143 #endif
|
|
144
|
|
145 mark_gutters (f);
|
|
146
|
428
|
147 return Qnil;
|
|
148 }
|
|
149
|
|
150 static void
|
|
151 print_frame (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
|
|
152 {
|
|
153 struct frame *frm = XFRAME (obj);
|
|
154
|
|
155 if (print_readably)
|
563
|
156 printing_unreadable_object ("#<frame %s 0x%x>",
|
|
157 XSTRING_DATA (frm->name), frm->header.uid);
|
428
|
158
|
800
|
159 write_fmt_string (printcharfun, "#<%s-frame ", !FRAME_LIVE_P (frm) ? "dead" :
|
|
160 FRAME_TYPE_NAME (frm));
|
428
|
161 print_internal (frm->name, printcharfun, 1);
|
800
|
162 write_fmt_string (printcharfun, " 0x%x>", frm->header.uid);
|
428
|
163 }
|
|
164
|
|
165 DEFINE_LRECORD_IMPLEMENTATION ("frame", frame,
|
|
166 mark_frame, print_frame, 0, 0, 0, 0,
|
|
167 struct frame);
|
|
168
|
|
169 static void
|
|
170 nuke_all_frame_slots (struct frame *f)
|
|
171 {
|
617
|
172 zero_lcrecord (f);
|
|
173
|
428
|
174 #define MARKED_SLOT(x) f->x = Qnil
|
|
175 #include "frameslots.h"
|
|
176 }
|
|
177
|
|
178 /* Allocate a new frame object and set all its fields to reasonable
|
|
179 values. The root window is created but the minibuffer will be done
|
|
180 later. */
|
|
181
|
|
182 static struct frame *
|
|
183 allocate_frame_core (Lisp_Object device)
|
|
184 {
|
|
185 /* This function can GC */
|
|
186 Lisp_Object frame;
|
|
187 Lisp_Object root_window;
|
|
188 struct frame *f = alloc_lcrecord_type (struct frame, &lrecord_frame);
|
|
189
|
|
190 nuke_all_frame_slots (f);
|
793
|
191 frame = wrap_frame (f);
|
428
|
192
|
|
193 f->device = device;
|
|
194 f->framemeths = XDEVICE (device)->devmeths;
|
|
195 f->buffer_alist = Fcopy_sequence (Vbuffer_alist);
|
|
196
|
|
197 root_window = allocate_window ();
|
|
198 XWINDOW (root_window)->frame = frame;
|
|
199
|
|
200 /* 10 is arbitrary,
|
|
201 Just so that there is "something there."
|
|
202 Correct size will be set up later with change_frame_size. */
|
|
203
|
|
204 f->width = 10;
|
|
205 f->height = 10;
|
|
206
|
|
207 XWINDOW (root_window)->pixel_width = 10;
|
|
208 XWINDOW (root_window)->pixel_height = 9;
|
|
209
|
|
210 f->root_window = root_window;
|
|
211 f->selected_window = root_window;
|
|
212 f->last_nonminibuf_window = root_window;
|
|
213
|
|
214 /* cache of subwindows visible on frame */
|
442
|
215 f->subwindow_instance_cache = make_weak_list (WEAK_LIST_SIMPLE);
|
428
|
216
|
|
217 /* associated exposure ignore list */
|
|
218 f->subwindow_exposures = 0;
|
|
219 f->subwindow_exposures_tail = 0;
|
|
220
|
442
|
221 FRAME_SET_PAGENUMBER (f, 1);
|
|
222
|
428
|
223 /* Choose a buffer for the frame's root window. */
|
|
224 XWINDOW (root_window)->buffer = Qt;
|
|
225 {
|
|
226 Lisp_Object buf;
|
|
227
|
|
228 buf = Fcurrent_buffer ();
|
|
229 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
|
|
230 a space), try to find another one. */
|
826
|
231 if (string_emchar (Fbuffer_name (buf), 0) == ' ')
|
428
|
232 buf = Fother_buffer (buf, Qnil, Qnil);
|
440
|
233 Fset_window_buffer (root_window, buf, Qnil);
|
428
|
234 }
|
|
235
|
|
236 return f;
|
|
237 }
|
|
238
|
|
239 static void
|
|
240 setup_normal_frame (struct frame *f)
|
|
241 {
|
|
242 Lisp_Object mini_window;
|
793
|
243 Lisp_Object frame = wrap_frame (f);
|
|
244
|
428
|
245
|
|
246 mini_window = allocate_window ();
|
|
247 XWINDOW (f->root_window)->next = mini_window;
|
|
248 XWINDOW (mini_window)->prev = f->root_window;
|
|
249 XWINDOW (mini_window)->mini_p = Qt;
|
|
250 XWINDOW (mini_window)->frame = frame;
|
|
251 f->minibuffer_window = mini_window;
|
|
252 f->has_minibuffer = 1;
|
|
253
|
|
254 XWINDOW (mini_window)->buffer = Qt;
|
440
|
255 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
|
428
|
256 }
|
|
257
|
|
258 /* Make a frame using a separate minibuffer window on another frame.
|
|
259 MINI_WINDOW is the minibuffer window to use. nil means use the
|
|
260 default-minibuffer-frame. */
|
|
261
|
|
262 static void
|
|
263 setup_frame_without_minibuffer (struct frame *f, Lisp_Object mini_window)
|
|
264 {
|
|
265 /* This function can GC */
|
|
266 Lisp_Object device = f->device;
|
|
267
|
|
268 if (!NILP (mini_window))
|
|
269 CHECK_LIVE_WINDOW (mini_window);
|
|
270
|
|
271 if (!NILP (mini_window)
|
|
272 && !EQ (DEVICE_CONSOLE (XDEVICE (device)),
|
|
273 FRAME_CONSOLE (XFRAME (XWINDOW (mini_window)->frame))))
|
563
|
274 invalid_argument ("frame and minibuffer must be on the same console", Qunbound);
|
428
|
275
|
442
|
276 /* Do not create a default minibuffer frame on printer devices. */
|
|
277 if (NILP (mini_window)
|
|
278 && DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (f))))
|
428
|
279 {
|
|
280 struct console *con = XCONSOLE (FRAME_CONSOLE (f));
|
|
281 /* Use default-minibuffer-frame if possible. */
|
|
282 if (!FRAMEP (con->default_minibuffer_frame)
|
|
283 || ! FRAME_LIVE_P (XFRAME (con->default_minibuffer_frame)))
|
|
284 {
|
|
285 /* If there's no minibuffer frame to use, create one. */
|
|
286 con->default_minibuffer_frame
|
|
287 = call1 (Qmake_initial_minibuffer_frame, device);
|
|
288 }
|
|
289 mini_window = XFRAME (con->default_minibuffer_frame)->minibuffer_window;
|
|
290 }
|
|
291
|
|
292 /* Install the chosen minibuffer window, with proper buffer. */
|
442
|
293 if (!NILP (mini_window))
|
|
294 {
|
|
295 store_minibuf_frame_prop (f, mini_window);
|
|
296 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
|
|
297 }
|
|
298 else
|
|
299 f->minibuffer_window = Qnil;
|
428
|
300 }
|
|
301
|
|
302 /* Make a frame containing only a minibuffer window. */
|
|
303
|
|
304 static void
|
|
305 setup_minibuffer_frame (struct frame *f)
|
|
306 {
|
|
307 /* This function can GC */
|
|
308 /* First make a frame containing just a root window, no minibuffer. */
|
|
309 Lisp_Object mini_window;
|
793
|
310 Lisp_Object frame = wrap_frame (f);
|
|
311
|
428
|
312
|
|
313 f->no_split = 1;
|
|
314 f->has_minibuffer = 1;
|
|
315
|
|
316 /* Now label the root window as also being the minibuffer.
|
|
317 Avoid infinite looping on the window chain by marking next pointer
|
|
318 as nil. */
|
|
319
|
|
320 mini_window = f->minibuffer_window = f->root_window;
|
|
321 XWINDOW (mini_window)->mini_p = Qt;
|
|
322 XWINDOW (mini_window)->next = Qnil;
|
|
323 XWINDOW (mini_window)->prev = Qnil;
|
|
324 XWINDOW (mini_window)->frame = frame;
|
|
325
|
|
326 /* Put the proper buffer in that window. */
|
|
327
|
440
|
328 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
|
428
|
329 }
|
|
330
|
|
331 static Lisp_Object
|
|
332 make_sure_its_a_fresh_plist (Lisp_Object foolist)
|
|
333 {
|
|
334 if (CONSP (Fcar (foolist)))
|
|
335 {
|
|
336 /* looks like an alist to me. */
|
|
337 foolist = Fcopy_alist (foolist);
|
|
338 foolist = Fdestructive_alist_to_plist (foolist);
|
|
339 }
|
|
340 else
|
|
341 foolist = Fcopy_sequence (foolist);
|
|
342
|
|
343 return foolist;
|
|
344 }
|
|
345
|
558
|
346 static Lisp_Object
|
546
|
347 restore_frame_list_to_its_unbesmirched_state (Lisp_Object kawnz)
|
|
348 {
|
|
349 Lisp_Object lissed = XCDR (kawnz);
|
|
350 if (!EQ (lissed, Qunbound))
|
|
351 DEVICE_FRAME_LIST (XDEVICE (XCAR (kawnz))) = lissed;
|
|
352 return Qnil;
|
|
353 }
|
|
354
|
428
|
355 DEFUN ("make-frame", Fmake_frame, 0, 2, "", /*
|
|
356 Create and return a new frame, displaying the current buffer.
|
|
357 Runs the functions listed in `create-frame-hook' after frame creation.
|
|
358
|
|
359 Optional argument PROPS is a property list (a list of alternating
|
|
360 keyword-value specifications) of properties for the new frame.
|
|
361 \(An alist is accepted for backward compatibility but should not
|
|
362 be passed in.)
|
|
363
|
|
364 See `set-frame-properties', `default-x-frame-plist', and
|
|
365 `default-tty-frame-plist' for the specially-recognized properties.
|
|
366 */
|
|
367 (props, device))
|
|
368 {
|
|
369 struct frame *f;
|
|
370 struct device *d;
|
|
371 Lisp_Object frame = Qnil, name = Qnil, minibuf;
|
|
372 struct gcpro gcpro1, gcpro2, gcpro3;
|
546
|
373 int speccount = specpdl_depth (), speccount2;
|
428
|
374 int first_frame_on_device = 0;
|
|
375 int first_frame_on_console = 0;
|
546
|
376 Lisp_Object besmirched_cons = Qnil;
|
771
|
377 int frame_name_is_defaulted = 1;
|
428
|
378
|
|
379 d = decode_device (device);
|
793
|
380 device = wrap_device (d);
|
428
|
381
|
|
382 /* PROPS and NAME may be freshly-created, so make sure to GCPRO. */
|
|
383 GCPRO3 (frame, props, name);
|
|
384
|
|
385 props = make_sure_its_a_fresh_plist (props);
|
|
386 if (DEVICE_SPECIFIC_FRAME_PROPS (d))
|
|
387 /* Put the device-specific props before the more general ones so
|
|
388 that they override them. */
|
|
389 props = nconc2 (props,
|
|
390 make_sure_its_a_fresh_plist
|
|
391 (*DEVICE_SPECIFIC_FRAME_PROPS (d)));
|
|
392 props = nconc2 (props, make_sure_its_a_fresh_plist (Vdefault_frame_plist));
|
|
393 Fcanonicalize_lax_plist (props, Qnil);
|
|
394
|
|
395 name = Flax_plist_get (props, Qname, Qnil);
|
|
396 if (!NILP (name))
|
771
|
397 {
|
|
398 CHECK_STRING (name);
|
|
399 frame_name_is_defaulted = 0;
|
|
400 }
|
428
|
401 else if (STRINGP (Vdefault_frame_name))
|
|
402 name = Vdefault_frame_name;
|
|
403 else
|
|
404 name = build_string ("emacs");
|
|
405
|
665
|
406 if (!NILP (Fstring_match (make_string ((const Intbyte *) "\\.", 2), name,
|
428
|
407 Qnil, Qnil)))
|
563
|
408 syntax_error (". not allowed in frame names", name);
|
428
|
409
|
|
410 f = allocate_frame_core (device);
|
793
|
411 frame = wrap_frame (f);
|
428
|
412
|
|
413 specbind (Qframe_being_created, name);
|
|
414 f->name = name;
|
|
415
|
771
|
416 FRAMEMETH (f, init_frame_1, (f, props, frame_name_is_defaulted));
|
428
|
417
|
|
418 minibuf = Flax_plist_get (props, Qminibuffer, Qunbound);
|
|
419 if (UNBOUNDP (minibuf))
|
|
420 {
|
|
421 /* If minibuf is unspecified, then look for a minibuffer X resource. */
|
|
422 /* #### Not implemented any more. We need to fix things up so
|
|
423 that we search out all X resources and append them to the end of
|
|
424 props, above. This is the only way in general to assure
|
|
425 coherent behavior for all frame properties/resources/etc. */
|
|
426 }
|
|
427 else
|
|
428 props = Flax_plist_remprop (props, Qminibuffer);
|
|
429
|
|
430 if (EQ (minibuf, Qnone) || NILP (minibuf))
|
|
431 setup_frame_without_minibuffer (f, Qnil);
|
|
432 else if (EQ (minibuf, Qonly))
|
|
433 setup_minibuffer_frame (f);
|
|
434 else if (WINDOWP (minibuf))
|
|
435 setup_frame_without_minibuffer (f, minibuf);
|
|
436 else if (EQ (minibuf, Qt) || UNBOUNDP (minibuf))
|
|
437 setup_normal_frame (f);
|
|
438 else
|
563
|
439 invalid_argument ("Invalid value for `minibuffer'", minibuf);
|
428
|
440
|
|
441 update_frame_window_mirror (f);
|
|
442
|
|
443 if (initialized && !DEVICE_STREAM_P (d))
|
|
444 {
|
|
445 if (!NILP (f->minibuffer_window))
|
|
446 reset_face_cachels (XWINDOW (f->minibuffer_window));
|
|
447 reset_face_cachels (XWINDOW (f->root_window));
|
|
448 }
|
|
449
|
|
450 /* If no frames on this device formerly existed, say this is the
|
|
451 first frame. It kind of assumes that frameless devices don't
|
|
452 exist, but it shouldn't be too harmful. */
|
|
453 if (NILP (DEVICE_FRAME_LIST (d)))
|
|
454 first_frame_on_device = 1;
|
|
455
|
546
|
456 /* It's possible for one of the init methods below to signal an error;
|
|
457 in that case, let's make sure the device isn't besmirched by
|
|
458 having a half-initialized frame attached to it */
|
|
459 speccount2 = specpdl_depth ();
|
|
460 record_unwind_protect (restore_frame_list_to_its_unbesmirched_state,
|
|
461 besmirched_cons =
|
|
462 Fcons (device, DEVICE_FRAME_LIST (d)));
|
|
463
|
428
|
464 /* This *must* go before the init_*() methods. Those functions
|
|
465 call Lisp code, and if any of them causes a warning to be displayed
|
|
466 and the *Warnings* buffer to be created, it won't get added to
|
|
467 the frame-specific version of the buffer-alist unless the frame
|
|
468 is accessible from the device. */
|
|
469
|
|
470 #if 0
|
|
471 DEVICE_FRAME_LIST (d) = nconc2 (DEVICE_FRAME_LIST (d), Fcons (frame, Qnil));
|
|
472 #endif
|
|
473 DEVICE_FRAME_LIST (d) = Fcons (frame, DEVICE_FRAME_LIST (d));
|
|
474 RESET_CHANGED_SET_FLAGS;
|
|
475
|
|
476 /* Now make sure that the initial cached values are set correctly.
|
|
477 Do this after the init_frame method is called because that may
|
|
478 do things (e.g. create widgets) that are necessary for the
|
|
479 specifier value-changed methods to work OK. */
|
|
480 recompute_all_cached_specifiers_in_frame (f);
|
|
481
|
|
482 if (!DEVICE_STREAM_P (d))
|
|
483 {
|
|
484 init_frame_faces (f);
|
|
485
|
|
486 #ifdef HAVE_SCROLLBARS
|
|
487 /* Finish up resourcing the scrollbars. */
|
|
488 init_frame_scrollbars (f);
|
|
489 #endif
|
|
490
|
|
491 #ifdef HAVE_TOOLBARS
|
|
492 /* Create the initial toolbars. We have to do this after the frame
|
|
493 methods are called because it may potentially call some things itself
|
|
494 which depend on the normal frame methods having initialized
|
|
495 things. */
|
|
496 init_frame_toolbars (f);
|
|
497 #endif
|
|
498 reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
|
|
499 reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
|
442
|
500
|
428
|
501 change_frame_size (f, f->height, f->width, 0);
|
|
502 }
|
|
503
|
|
504 MAYBE_FRAMEMETH (f, init_frame_2, (f, props));
|
|
505 Fset_frame_properties (frame, props);
|
|
506 MAYBE_FRAMEMETH (f, init_frame_3, (f));
|
|
507
|
|
508 /* Hallelujah, praise the lord. */
|
|
509 f->init_finished = 1;
|
|
510
|
546
|
511 XCDR (besmirched_cons) = Qunbound;
|
|
512
|
771
|
513 unbind_to (speccount2);
|
546
|
514
|
428
|
515 /* If this is the first frame on the device, make it the selected one. */
|
|
516 if (first_frame_on_device && NILP (DEVICE_SELECTED_FRAME (d)))
|
|
517 set_device_selected_frame (d, frame);
|
|
518
|
|
519 /* If at startup or if the current console is a stream console
|
|
520 (usually also at startup), make this console the selected one
|
|
521 so that messages show up on it. */
|
|
522 if (NILP (Fselected_console ()) ||
|
|
523 CONSOLE_STREAM_P (XCONSOLE (Fselected_console ())))
|
|
524 Fselect_console (DEVICE_CONSOLE (d));
|
|
525
|
|
526 first_frame_on_console =
|
|
527 (first_frame_on_device &&
|
|
528 XINT (Flength (CONSOLE_DEVICE_LIST (XCONSOLE (DEVICE_CONSOLE (d)))))
|
|
529 == 1);
|
|
530
|
|
531 /* #### all this calling of frame methods at various odd times
|
|
532 is somewhat of a mess. It's necessary to do it this way due
|
|
533 to strange console-type-specific things that need to be done. */
|
|
534 MAYBE_FRAMEMETH (f, after_init_frame, (f, first_frame_on_device,
|
|
535 first_frame_on_console));
|
|
536
|
442
|
537 if (!DEVICE_STREAM_P (d))
|
|
538 {
|
|
539 /* Now initialise the gutters. This won't change the frame size,
|
|
540 but is needed as input to the layout that change_frame_size
|
|
541 will eventually do. Unfortunately gutter sizing code relies
|
|
542 on the frame in question being visible so we can't do this
|
|
543 earlier. */
|
|
544 init_frame_gutters (f);
|
|
545
|
|
546 change_frame_size (f, f->height, f->width, 0);
|
|
547 }
|
|
548
|
428
|
549 if (first_frame_on_device)
|
|
550 {
|
|
551 if (first_frame_on_console)
|
|
552 va_run_hook_with_args (Qcreate_console_hook, 1, DEVICE_CONSOLE (d));
|
|
553 va_run_hook_with_args (Qcreate_device_hook, 1, device);
|
|
554 }
|
|
555 va_run_hook_with_args (Qcreate_frame_hook, 1, frame);
|
|
556
|
|
557 /* Initialize custom-specific stuff. */
|
|
558 if (!UNBOUNDP (symbol_function (XSYMBOL (Qcustom_initialize_frame))))
|
|
559 call1 (Qcustom_initialize_frame, frame);
|
|
560
|
771
|
561 unbind_to (speccount);
|
428
|
562
|
|
563 UNGCPRO;
|
|
564 return frame;
|
|
565 }
|
|
566
|
|
567
|
|
568 /* this function should be used in most cases when a Lisp function is passed
|
|
569 a FRAME argument. Use this unless you don't accept nil == current frame
|
|
570 (in which case, do a CHECK_LIVE_FRAME() and then an XFRAME()) or you
|
|
571 allow dead frames. Note that very few functions should accept dead
|
|
572 frames. It could be argued that functions should just do nothing when
|
|
573 given a dead frame, but the presence of a dead frame usually indicates
|
|
574 an oversight in the Lisp code that could potentially lead to strange
|
|
575 results and so it is better to catch the error early.
|
|
576
|
|
577 If you only accept X frames, use decode_x_frame(), which does what this
|
|
578 function does but also makes sure the frame is an X frame. */
|
|
579
|
|
580 struct frame *
|
|
581 decode_frame (Lisp_Object frame)
|
|
582 {
|
|
583 if (NILP (frame))
|
|
584 return selected_frame ();
|
|
585
|
|
586 CHECK_LIVE_FRAME (frame);
|
|
587 return XFRAME (frame);
|
|
588 }
|
|
589
|
|
590 struct frame *
|
|
591 decode_frame_or_selected (Lisp_Object cdf)
|
|
592 {
|
|
593 if (CONSOLEP (cdf))
|
|
594 cdf = CONSOLE_SELECTED_DEVICE (decode_console (cdf));
|
|
595 if (DEVICEP (cdf))
|
|
596 cdf = DEVICE_SELECTED_FRAME (decode_device (cdf));
|
|
597 return decode_frame (cdf);
|
|
598 }
|
|
599
|
|
600
|
|
601 /*
|
|
602 * window size changes are held up during critical regions. Afterwards,
|
|
603 * we want to deal with any delayed changes.
|
|
604 */
|
|
605 void
|
|
606 hold_frame_size_changes (void)
|
|
607 {
|
|
608 in_display = 1;
|
|
609 }
|
|
610
|
|
611 void
|
|
612 unhold_one_frame_size_changes (struct frame *f)
|
|
613 {
|
|
614 in_display = 0;
|
|
615
|
|
616 if (f->size_change_pending)
|
|
617 change_frame_size (f, f->new_height, f->new_width, 0);
|
|
618 }
|
|
619
|
|
620 void
|
|
621 unhold_frame_size_changes (void)
|
|
622 {
|
|
623 Lisp_Object frmcons, devcons, concons;
|
|
624
|
|
625 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
|
|
626 unhold_one_frame_size_changes (XFRAME (XCAR (frmcons)));
|
|
627 }
|
|
628
|
|
629 void
|
|
630 invalidate_vertical_divider_cache_in_frame (struct frame *f)
|
|
631 {
|
|
632 /* Invalidate cached value of needs_vertical_divider_p in
|
|
633 every and all windows */
|
|
634 map_windows (f, invalidate_vertical_divider_cache_in_window, 0);
|
|
635 }
|
|
636
|
|
637 /*
|
|
638 * Frame size may change due to changes in scrollbars, toolbars,
|
|
639 * default font etc. These changes are applied early in redisplay
|
|
640 * frame.
|
|
641 */
|
|
642 void
|
|
643 adjust_frame_size (struct frame *f)
|
|
644 {
|
|
645 int keep_char_size = 0;
|
793
|
646 Lisp_Object frame = wrap_frame (f);
|
|
647
|
428
|
648
|
|
649 if (!f->size_slipped)
|
|
650 return;
|
|
651
|
|
652 /* Don't adjust tty frames. #### May break when TTY have menubars.
|
|
653 Then, write an Vadjust_frame_function which will return t for TTY
|
|
654 frames. Another solution is frame_size_fixed_p method for TTYs,
|
|
655 which always returned yes it's fixed.
|
|
656 */
|
|
657 if (!FRAME_WIN_P (f))
|
|
658 {
|
|
659 CLEAR_FRAME_SIZE_SLIPPED (f);
|
|
660 return;
|
|
661 }
|
|
662
|
|
663 /* frame_size_fixed_p tells that frame size cannot currently
|
|
664 be changed change due to external conditions */
|
|
665 if (!FRAMEMETH_OR_GIVEN (f, frame_size_fixed_p, (f), 0))
|
|
666 {
|
|
667 if (NILP (Vadjust_frame_function))
|
|
668 keep_char_size = 1;
|
|
669 else if (EQ (Vadjust_frame_function, Qt))
|
|
670 keep_char_size = 0;
|
|
671 else
|
|
672 keep_char_size =
|
|
673 NILP (call1_trapping_errors ("Error in adjust-frame-function",
|
|
674 Vadjust_frame_function, frame));
|
|
675
|
|
676 if (keep_char_size)
|
|
677 Fset_frame_size (frame, make_int (FRAME_CHARWIDTH(f)),
|
|
678 make_int (FRAME_CHARHEIGHT(f)), Qnil);
|
|
679 }
|
|
680
|
|
681 if (!keep_char_size)
|
|
682 {
|
|
683 int height, width;
|
|
684 pixel_to_char_size (f, FRAME_PIXWIDTH(f), FRAME_PIXHEIGHT(f),
|
|
685 &width, &height);
|
|
686 change_frame_size (f, height, width, 0);
|
|
687 CLEAR_FRAME_SIZE_SLIPPED (f);
|
|
688 }
|
|
689 }
|
|
690
|
|
691 /*
|
|
692 * This is a "specifier changed in frame" handler for various specifiers
|
|
693 * changing which causes frame size adjustment
|
|
694 */
|
|
695 void
|
|
696 frame_size_slipped (Lisp_Object specifier, struct frame *f,
|
|
697 Lisp_Object oldval)
|
|
698 {
|
|
699 MARK_FRAME_SIZE_SLIPPED(f);
|
|
700 }
|
|
701
|
|
702 DEFUN ("framep", Fframep, 1, 1, 0, /*
|
|
703 Return non-nil if OBJECT is a frame.
|
|
704 Also see `frame-live-p'.
|
|
705 Note that FSF Emacs kludgily returns a value indicating what type of
|
|
706 frame this is. Use the cleaner function `frame-type' for that.
|
|
707 */
|
|
708 (object))
|
|
709 {
|
|
710 return FRAMEP (object) ? Qt : Qnil;
|
|
711 }
|
|
712
|
|
713 DEFUN ("frame-live-p", Fframe_live_p, 1, 1, 0, /*
|
|
714 Return non-nil if OBJECT is a frame which has not been deleted.
|
|
715 */
|
|
716 (object))
|
|
717 {
|
|
718 return FRAMEP (object) && FRAME_LIVE_P (XFRAME (object)) ? Qt : Qnil;
|
|
719 }
|
|
720
|
|
721
|
|
722 DEFUN ("focus-frame", Ffocus_frame, 1, 1, 0, /*
|
|
723 Select FRAME and give it the window system focus.
|
|
724 This function is not affected by the value of `focus-follows-mouse'.
|
|
725 */
|
|
726 (frame))
|
|
727 {
|
|
728 CHECK_LIVE_FRAME (frame);
|
|
729
|
|
730 MAYBE_DEVMETH (XDEVICE (FRAME_DEVICE (XFRAME (frame))), focus_on_frame,
|
|
731 (XFRAME (frame)));
|
|
732 /* FRAME will be selected by the time we receive the next event.
|
|
733 However, it is better to select it explicitly now, in case the
|
|
734 Lisp code depends on frame being selected. */
|
|
735 Fselect_frame (frame);
|
|
736 return Qnil;
|
|
737 }
|
|
738
|
|
739 /* Called from Fselect_window() */
|
|
740 void
|
|
741 select_frame_1 (Lisp_Object frame)
|
|
742 {
|
|
743 struct frame *f = XFRAME (frame);
|
|
744 Lisp_Object old_selected_frame = Fselected_frame (Qnil);
|
|
745
|
|
746 if (EQ (frame, old_selected_frame))
|
|
747 return;
|
|
748
|
|
749 /* now select the frame's device */
|
|
750 set_device_selected_frame (XDEVICE (FRAME_DEVICE (f)), frame);
|
|
751 select_device_1 (FRAME_DEVICE (f));
|
|
752
|
|
753 update_frame_window_mirror (f);
|
|
754 }
|
|
755
|
|
756 DEFUN ("select-frame", Fselect_frame, 1, 1, 0, /*
|
|
757 Select the frame FRAME.
|
|
758 Subsequent editing commands apply to its selected window.
|
|
759 The selection of FRAME lasts until the next time the user does
|
|
760 something to select a different frame, or until the next time this
|
|
761 function is called.
|
|
762
|
|
763 Note that this does not actually cause the window-system focus to be
|
|
764 set to this frame, or the `select-frame-hook' or `deselect-frame-hook'
|
|
765 to be run, until the next time that XEmacs is waiting for an event.
|
|
766
|
|
767 Also note that when focus-follows-mouse is non-nil, the frame
|
|
768 selection is temporary and is reverted when the current command
|
|
769 terminates, much like the buffer selected by `set-buffer'. In order
|
|
770 to effect a permanent focus change, use `focus-frame'.
|
|
771 */
|
|
772 (frame))
|
|
773 {
|
|
774 CHECK_LIVE_FRAME (frame);
|
|
775
|
|
776 /* select the frame's selected window. This will call
|
|
777 selected_frame_1(). */
|
|
778 Fselect_window (FRAME_SELECTED_WINDOW (XFRAME (frame)), Qnil);
|
|
779
|
|
780 /* Nothing should be depending on the return value of this function.
|
|
781 But, of course, there is stuff out there which is. */
|
|
782 return frame;
|
|
783 }
|
|
784
|
|
785 /* use this to retrieve the currently selected frame. You should use
|
|
786 this in preference to Fselected_frame (Qnil) unless you are prepared
|
|
787 to handle the possibility of there being no selected frame (this
|
|
788 happens at some points during startup). */
|
|
789
|
|
790 struct frame *
|
|
791 selected_frame (void)
|
|
792 {
|
|
793 Lisp_Object device = Fselected_device (Qnil);
|
|
794 Lisp_Object frame = DEVICE_SELECTED_FRAME (XDEVICE (device));
|
|
795 if (NILP (frame))
|
563
|
796 gui_error ("No frames exist on device", device);
|
428
|
797 return XFRAME (frame);
|
|
798 }
|
|
799
|
|
800 /* use this instead of XFRAME (DEVICE_SELECTED_FRAME (d)) to catch
|
|
801 the possibility of there being no frames on the device (just created).
|
|
802 There is no point doing this inside of redisplay because errors
|
|
803 cause an abort(), indicating a flaw in the logic, and error_check_frame()
|
|
804 will catch this just as well. */
|
|
805
|
|
806 struct frame *
|
|
807 device_selected_frame (struct device *d)
|
|
808 {
|
|
809 Lisp_Object frame = DEVICE_SELECTED_FRAME (d);
|
|
810 if (NILP (frame))
|
|
811 {
|
793
|
812 Lisp_Object device = wrap_device (d);
|
|
813
|
563
|
814 gui_error ("No frames exist on device", device);
|
428
|
815 }
|
|
816 return XFRAME (frame);
|
|
817 }
|
|
818
|
|
819 #if 0 /* FSFmacs */
|
|
820
|
826
|
821 DEFUN ("handle-switch-frame", Fhandle_switch_frame, 1, 2, "e", /*
|
428
|
822 Handle a switch-frame event EVENT.
|
|
823 Switch-frame events are usually bound to this function.
|
|
824 A switch-frame event tells Emacs that the window manager has requested
|
|
825 that the user's events be directed to the frame mentioned in the event.
|
|
826 This function selects the selected window of the frame of EVENT.
|
|
827
|
|
828 If EVENT is frame object, handle it as if it were a switch-frame event
|
|
829 to that frame.
|
|
830 */
|
|
831 (frame, no_enter))
|
|
832 {
|
|
833 /* Preserve prefix arg that the command loop just cleared. */
|
|
834 XCONSOLE (Vselected_console)->prefix_arg = Vcurrent_prefix_arg;
|
|
835 #if 0 /* unclean! */
|
|
836 run_hook (Qmouse_leave_buffer_hook);
|
|
837 #endif
|
|
838 return do_switch_frame (frame, no_enter, 0);
|
|
839 }
|
|
840
|
|
841 /* A load of garbage. */
|
826
|
842 DEFUN ("ignore-event", Fignore_event, 0, 0, "", /*
|
428
|
843 Do nothing, but preserve any prefix argument already specified.
|
|
844 This is a suitable binding for iconify-frame and make-frame-visible.
|
|
845 */
|
|
846 ())
|
|
847 {
|
|
848 struct console *c = XCONSOLE (Vselected_console);
|
|
849
|
|
850 c->prefix_arg = Vcurrent_prefix_arg;
|
|
851 return Qnil;
|
|
852 }
|
|
853
|
|
854 #endif /* 0 */
|
|
855
|
|
856 DEFUN ("selected-frame", Fselected_frame, 0, 1, 0, /*
|
|
857 Return the frame that is now selected on device DEVICE.
|
|
858 If DEVICE is not specified, the selected device will be used.
|
|
859 If no frames exist on the device, nil is returned.
|
|
860 */
|
|
861 (device))
|
|
862 {
|
|
863 if (NILP (device) && NILP (Fselected_device (Qnil)))
|
|
864 return Qnil; /* happens early in temacs */
|
|
865 return DEVICE_SELECTED_FRAME (decode_device (device));
|
|
866 }
|
|
867
|
|
868 Lisp_Object
|
|
869 frame_first_window (struct frame *f)
|
|
870 {
|
|
871 Lisp_Object w = f->root_window;
|
|
872
|
|
873 while (1)
|
|
874 {
|
|
875 if (! NILP (XWINDOW (w)->hchild))
|
|
876 w = XWINDOW (w)->hchild;
|
|
877 else if (! NILP (XWINDOW (w)->vchild))
|
|
878 w = XWINDOW (w)->vchild;
|
|
879 else
|
|
880 break;
|
|
881 }
|
|
882
|
|
883 return w;
|
|
884 }
|
|
885
|
|
886 DEFUN ("active-minibuffer-window", Factive_minibuffer_window, 0, 0, 0, /*
|
|
887 Return the currently active minibuffer window, or nil if none.
|
|
888 */
|
|
889 ())
|
|
890 {
|
|
891 return minibuf_level ? minibuf_window : Qnil;
|
|
892 }
|
|
893
|
|
894 DEFUN ("last-nonminibuf-frame", Flast_nonminibuf_frame, 0, 1, 0, /*
|
|
895 Return the most-recently-selected non-minibuffer-only frame on CONSOLE.
|
|
896 This will always be the same as (selected-frame device) unless the
|
|
897 selected frame is a minibuffer-only frame.
|
|
898 CONSOLE defaults to the selected console if omitted.
|
|
899 */
|
|
900 (console))
|
|
901 {
|
|
902 Lisp_Object result;
|
|
903
|
793
|
904 console = wrap_console (decode_console (console));
|
428
|
905 /* Just in case the machinations in delete_frame_internal() resulted
|
|
906 in the last-nonminibuf-frame getting out of sync, make sure and
|
|
907 return the selected frame if it's acceptable. */
|
|
908 result = Fselected_frame (CONSOLE_SELECTED_DEVICE (XCONSOLE (console)));
|
|
909 if (!NILP (result) && !FRAME_MINIBUF_ONLY_P (XFRAME (result)))
|
|
910 return result;
|
|
911 return CONSOLE_LAST_NONMINIBUF_FRAME (XCONSOLE (console));
|
|
912 }
|
|
913
|
|
914 DEFUN ("frame-root-window", Fframe_root_window, 0, 1, 0, /*
|
|
915 Return the root-window of FRAME.
|
|
916 If omitted, FRAME defaults to the currently selected frame.
|
|
917 */
|
|
918 (frame))
|
|
919 {
|
|
920 struct frame *f = decode_frame (frame);
|
|
921 return FRAME_ROOT_WINDOW (f);
|
|
922 }
|
|
923
|
|
924 DEFUN ("frame-selected-window", Fframe_selected_window, 0, 1, 0, /*
|
|
925 Return the selected window of frame object FRAME.
|
|
926 If omitted, FRAME defaults to the currently selected frame.
|
|
927 */
|
|
928 (frame))
|
|
929 {
|
|
930 struct frame *f = decode_frame (frame);
|
|
931 return FRAME_SELECTED_WINDOW (f);
|
|
932 }
|
|
933
|
|
934 void
|
|
935 set_frame_selected_window (struct frame *f, Lisp_Object window)
|
|
936 {
|
|
937 assert (XFRAME (WINDOW_FRAME (XWINDOW (window))) == f);
|
|
938 f->selected_window = window;
|
|
939 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f))
|
|
940 {
|
|
941 if (!EQ (f->last_nonminibuf_window, window))
|
|
942 {
|
442
|
943 #ifdef HAVE_TOOLBARS
|
428
|
944 MARK_TOOLBAR_CHANGED;
|
442
|
945 #endif
|
428
|
946 MARK_GUTTER_CHANGED;
|
|
947 }
|
|
948 f->last_nonminibuf_window = window;
|
|
949 }
|
|
950 }
|
|
951
|
|
952 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /*
|
460
|
953 Set the selected window of FRAME to WINDOW.
|
428
|
954 If FRAME is nil, the selected frame is used.
|
|
955 If FRAME is the selected frame, this makes WINDOW the selected window.
|
|
956 */
|
|
957 (frame, window))
|
|
958 {
|
793
|
959 frame = wrap_frame (decode_frame (frame));
|
428
|
960 CHECK_LIVE_WINDOW (window);
|
|
961
|
|
962 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
|
563
|
963 invalid_argument ("In `set-frame-selected-window', WINDOW is not on FRAME", Qunbound);
|
428
|
964
|
|
965 if (XFRAME (frame) == selected_frame ())
|
|
966 return Fselect_window (window, Qnil);
|
|
967
|
|
968 set_frame_selected_window (XFRAME (frame), window);
|
|
969 return window;
|
|
970 }
|
|
971
|
|
972
|
|
973 DEFUN ("frame-device", Fframe_device, 0, 1, 0, /*
|
|
974 Return the device that FRAME is on.
|
|
975 If omitted, FRAME defaults to the currently selected frame.
|
|
976 */
|
|
977 (frame))
|
|
978 {
|
|
979 return FRAME_DEVICE (decode_frame (frame));
|
|
980 }
|
|
981
|
|
982 int
|
|
983 is_surrogate_for_selected_frame (struct frame *f)
|
|
984 {
|
|
985 struct device *d = XDEVICE (f->device);
|
|
986 struct frame *dsf = device_selected_frame (d);
|
|
987
|
|
988 /* Can't be a surrogate for ourselves. */
|
|
989 if (f == dsf)
|
|
990 return 0;
|
|
991
|
|
992 if (!FRAME_HAS_MINIBUF_P (dsf) &&
|
|
993 f == XFRAME (WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (dsf)))))
|
|
994 return 1;
|
|
995 else
|
|
996 return 0;
|
|
997 }
|
|
998
|
|
999 static int
|
444
|
1000 frame_matches_frame_spec (Lisp_Object frame, Lisp_Object type)
|
428
|
1001 {
|
|
1002 struct frame *f = XFRAME (frame);
|
|
1003
|
|
1004 if (WINDOWP (type))
|
|
1005 {
|
|
1006 CHECK_LIVE_WINDOW (type);
|
|
1007
|
|
1008 if (EQ (FRAME_MINIBUF_WINDOW (f), type)
|
|
1009 /* Check that F either is, or has forwarded
|
|
1010 its focus to, TYPE's frame. */
|
|
1011 && (EQ (WINDOW_FRAME (XWINDOW (type)), frame)
|
|
1012 || EQ (WINDOW_FRAME (XWINDOW (type)),
|
|
1013 FRAME_FOCUS_FRAME (f))))
|
|
1014 return 1;
|
|
1015 else
|
|
1016 return 0;
|
|
1017 }
|
|
1018
|
|
1019 #if 0 /* FSFmacs */
|
|
1020 if (EQ (type, Qvisible) || EQ (type, Qiconic) || EQ (type, Qvisible_iconic)
|
|
1021 || EQ (type, Qvisible_nomini) || EQ (type, Qiconic_nomini)
|
|
1022 || EQ (type, Qvisible_iconic_nomini))
|
|
1023 FRAME_SAMPLE_VISIBILITY (f);
|
|
1024 #endif
|
|
1025
|
|
1026 if (NILP (type))
|
|
1027 type = Qnomini;
|
|
1028 if (ZEROP (type))
|
|
1029 type = Qvisible_iconic;
|
|
1030
|
|
1031 if (EQ (type, Qvisible))
|
|
1032 return FRAME_VISIBLE_P (f);
|
|
1033 if (EQ (type, Qiconic))
|
|
1034 return FRAME_ICONIFIED_P (f);
|
|
1035 if (EQ (type, Qinvisible))
|
|
1036 return !FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f);
|
|
1037 if (EQ (type, Qvisible_iconic))
|
|
1038 return FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f);
|
|
1039 if (EQ (type, Qinvisible_iconic))
|
|
1040 return !FRAME_VISIBLE_P (f);
|
|
1041
|
|
1042 if (EQ (type, Qnomini))
|
|
1043 return !FRAME_MINIBUF_ONLY_P (f);
|
|
1044 if (EQ (type, Qvisible_nomini))
|
|
1045 return FRAME_VISIBLE_P (f) && !FRAME_MINIBUF_ONLY_P (f);
|
|
1046 if (EQ (type, Qiconic_nomini))
|
|
1047 return FRAME_ICONIFIED_P (f) && !FRAME_MINIBUF_ONLY_P (f);
|
|
1048 if (EQ (type, Qinvisible_nomini))
|
|
1049 return !FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f) &&
|
|
1050 !FRAME_MINIBUF_ONLY_P (f);
|
|
1051 if (EQ (type, Qvisible_iconic_nomini))
|
|
1052 return ((FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
|
|
1053 && !FRAME_MINIBUF_ONLY_P (f));
|
|
1054 if (EQ (type, Qinvisible_iconic_nomini))
|
|
1055 return !FRAME_VISIBLE_P (f) && !FRAME_MINIBUF_ONLY_P (f);
|
|
1056
|
|
1057 return 1;
|
|
1058 }
|
|
1059
|
|
1060 int
|
444
|
1061 device_matches_device_spec (Lisp_Object device, Lisp_Object device_spec)
|
428
|
1062 {
|
444
|
1063 if (EQ (device_spec, Qwindow_system))
|
428
|
1064 return DEVICE_WIN_P (XDEVICE (device));
|
444
|
1065 if (DEVICEP (device_spec))
|
|
1066 return EQ (device, device_spec);
|
|
1067 if (CONSOLEP (device_spec))
|
|
1068 return EQ (DEVICE_CONSOLE (XDEVICE (device)), device_spec);
|
|
1069 if (valid_console_type_p (device_spec))
|
|
1070 return EQ (DEVICE_TYPE (XDEVICE (device)), device_spec);
|
428
|
1071 return 1;
|
|
1072 }
|
|
1073
|
|
1074 /* Return the next frame in the frame list after FRAME.
|
444
|
1075 WHICH-FRAMES and WHICH-DEVICES control which frames and devices
|
428
|
1076 are considered; see `next-frame'. */
|
|
1077
|
|
1078 Lisp_Object
|
444
|
1079 next_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices)
|
428
|
1080 {
|
442
|
1081 Lisp_Object first = Qnil;
|
|
1082 Lisp_Object devcons, concons;
|
|
1083 int passed = 0;
|
|
1084
|
|
1085 CHECK_LIVE_FRAME (frame);
|
|
1086
|
|
1087 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
1088 {
|
|
1089 Lisp_Object device = XCAR (devcons);
|
|
1090 Lisp_Object frmcons;
|
|
1091
|
444
|
1092 if (!device_matches_device_spec (device, which_devices))
|
442
|
1093 {
|
|
1094 if (EQ (device, FRAME_DEVICE (XFRAME (frame))))
|
|
1095 passed = 1;
|
|
1096 continue;
|
|
1097 }
|
|
1098
|
|
1099 DEVICE_FRAME_LOOP (frmcons, XDEVICE (device))
|
|
1100 {
|
|
1101 Lisp_Object f = XCAR (frmcons);
|
|
1102
|
|
1103 if (passed)
|
|
1104 {
|
444
|
1105 if (frame_matches_frame_spec (f, which_frames))
|
442
|
1106 return f;
|
|
1107 }
|
|
1108 else
|
|
1109 {
|
|
1110 if (EQ (frame, f))
|
|
1111 {
|
|
1112 passed = 1;
|
|
1113 }
|
|
1114 else
|
|
1115 {
|
444
|
1116 if (NILP (first) && frame_matches_frame_spec (f, which_frames))
|
442
|
1117 first = f;
|
|
1118 }
|
|
1119 }
|
|
1120 }
|
|
1121 }
|
|
1122
|
|
1123 if (NILP (first))
|
|
1124 /* We went through the whole frame list without finding a single
|
|
1125 acceptable frame. Return the original frame. */
|
|
1126 return frame;
|
|
1127 else
|
|
1128 /* There were no acceptable frames in the list after FRAME; otherwise,
|
|
1129 we would have returned directly from the loop. Since FIRST is the last
|
|
1130 acceptable frame in the list, return it. */
|
|
1131 return first;
|
428
|
1132 }
|
|
1133
|
|
1134 /* Return the previous frame in the frame list before FRAME.
|
444
|
1135 WHICH-FRAMES and WHICH-DEVICES control which frames and devices
|
428
|
1136 are considered; see `next-frame'. */
|
|
1137
|
|
1138 Lisp_Object
|
444
|
1139 previous_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices)
|
428
|
1140 {
|
|
1141 Lisp_Object devcons, concons;
|
442
|
1142 Lisp_Object last = Qnil;
|
|
1143
|
428
|
1144 CHECK_LIVE_FRAME (frame);
|
|
1145
|
|
1146 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
1147 {
|
|
1148 Lisp_Object device = XCAR (devcons);
|
|
1149 Lisp_Object frmcons;
|
|
1150
|
444
|
1151 if (!device_matches_device_spec (device, which_devices))
|
442
|
1152 {
|
|
1153 if (EQ (device, FRAME_DEVICE (XFRAME (frame)))
|
|
1154 && !NILP (last))
|
|
1155 return last;
|
|
1156 continue;
|
|
1157 }
|
428
|
1158
|
|
1159 DEVICE_FRAME_LOOP (frmcons, XDEVICE (device))
|
|
1160 {
|
|
1161 Lisp_Object f = XCAR (frmcons);
|
|
1162
|
442
|
1163 if (EQ (frame, f))
|
|
1164 {
|
|
1165 if (!NILP (last))
|
|
1166 return last;
|
|
1167 }
|
|
1168 else
|
|
1169 {
|
444
|
1170 if (frame_matches_frame_spec (f, which_frames))
|
442
|
1171 last = f;
|
|
1172 }
|
428
|
1173 }
|
|
1174 }
|
|
1175
|
442
|
1176 if (NILP (last))
|
428
|
1177 /* We went through the whole frame list without finding a single
|
|
1178 acceptable frame. Return the original frame. */
|
|
1179 return frame;
|
|
1180 else
|
|
1181 /* There were no acceptable frames in the list before FRAME; otherwise,
|
442
|
1182 we would have returned directly from the loop. Since LAST is the last
|
428
|
1183 acceptable frame in the list, return it. */
|
442
|
1184 return last;
|
428
|
1185 }
|
|
1186
|
|
1187 DEFUN ("next-frame", Fnext_frame, 0, 3, 0, /*
|
|
1188 Return the next frame of the right type in the frame list after FRAME.
|
444
|
1189 WHICH-FRAMES controls which frames are eligible to be returned; all
|
428
|
1190 others will be skipped. Note that if there is only one eligible
|
|
1191 frame, then `next-frame' called repeatedly will always return
|
|
1192 the same frame, and if there is no eligible frame, then FRAME is
|
|
1193 returned.
|
|
1194
|
444
|
1195 Possible values for WHICH-FRAMES are
|
428
|
1196
|
|
1197 'visible Consider only frames that are visible.
|
|
1198 'iconic Consider only frames that are iconic.
|
|
1199 'invisible Consider only frames that are invisible
|
|
1200 (this is different from iconic).
|
|
1201 'visible-iconic Consider frames that are visible or iconic.
|
|
1202 'invisible-iconic Consider frames that are invisible or iconic.
|
|
1203 'nomini Consider all frames except minibuffer-only ones.
|
|
1204 'visible-nomini Like `visible' but omits minibuffer-only frames.
|
|
1205 'iconic-nomini Like `iconic' but omits minibuffer-only frames.
|
|
1206 'invisible-nomini Like `invisible' but omits minibuffer-only frames.
|
|
1207 'visible-iconic-nomini Like `visible-iconic' but omits minibuffer-only
|
|
1208 frames.
|
|
1209 'invisible-iconic-nomini Like `invisible-iconic' but omits minibuffer-only
|
|
1210 frames.
|
|
1211 any other value Consider all frames.
|
|
1212
|
444
|
1213 If WHICH-FRAMES is omitted, 'nomini is used. A value for WHICH-FRAMES
|
|
1214 of 0 (a number) is treated like 'iconic, for backwards compatibility.
|
|
1215
|
|
1216 If WHICH-FRAMES is a window, include only its own frame and any frame
|
|
1217 now using that window as the minibuffer.
|
|
1218
|
|
1219 The optional third argument WHICH-DEVICES further clarifies on which
|
|
1220 devices to search for frames as specified by WHICH-FRAMES.
|
|
1221 If nil or omitted, search all devices on FRAME's console.
|
|
1222 If a device, only search that device.
|
|
1223 If a console, search all devices on that console.
|
|
1224 If a device type, search all devices of that type.
|
|
1225 If `window-system', search all window-system devices.
|
|
1226 Any other non-nil value means search all devices.
|
428
|
1227 */
|
444
|
1228 (frame, which_frames, which_devices))
|
428
|
1229 {
|
793
|
1230 frame = wrap_frame (decode_frame (frame));
|
428
|
1231
|
444
|
1232 return next_frame (frame, which_frames, which_devices);
|
428
|
1233 }
|
|
1234
|
|
1235 DEFUN ("previous-frame", Fprevious_frame, 0, 3, 0, /*
|
|
1236 Return the next frame of the right type in the frame list after FRAME.
|
444
|
1237 WHICH-FRAMES controls which frames are eligible to be returned; all
|
428
|
1238 others will be skipped. Note that if there is only one eligible
|
|
1239 frame, then `previous-frame' called repeatedly will always return
|
|
1240 the same frame, and if there is no eligible frame, then FRAME is
|
|
1241 returned.
|
|
1242
|
444
|
1243 See `next-frame' for an explanation of the WHICH-FRAMES and WHICH-DEVICES
|
428
|
1244 arguments.
|
|
1245 */
|
444
|
1246 (frame, which_frames, which_devices))
|
428
|
1247 {
|
793
|
1248 frame = wrap_frame (decode_frame (frame));
|
428
|
1249
|
444
|
1250 return previous_frame (frame, which_frames, which_devices);
|
428
|
1251 }
|
|
1252
|
|
1253 /* Return any frame for which PREDICATE is non-zero, or return Qnil
|
|
1254 if there aren't any. */
|
|
1255
|
|
1256 Lisp_Object
|
|
1257 find_some_frame (int (*predicate) (Lisp_Object, void *),
|
|
1258 void *closure)
|
|
1259 {
|
|
1260 Lisp_Object framecons, devcons, concons;
|
|
1261
|
|
1262 FRAME_LOOP_NO_BREAK (framecons, devcons, concons)
|
|
1263 {
|
|
1264 Lisp_Object frame = XCAR (framecons);
|
|
1265
|
|
1266 if ((predicate) (frame, closure))
|
|
1267 return frame;
|
|
1268 }
|
|
1269
|
|
1270 return Qnil;
|
|
1271 }
|
|
1272
|
|
1273
|
|
1274
|
|
1275 /* extern void free_line_insertion_deletion_costs (struct frame *f); */
|
|
1276
|
|
1277 /* Return 1 if it is ok to delete frame F;
|
|
1278 0 if all frames aside from F are invisible.
|
|
1279 (Exception: if F is a stream frame, it's OK to delete if
|
|
1280 any other frames exist.) */
|
|
1281
|
442
|
1282 int
|
|
1283 other_visible_frames (struct frame *f)
|
428
|
1284 {
|
793
|
1285 Lisp_Object frame = wrap_frame (f);
|
|
1286
|
428
|
1287 if (FRAME_STREAM_P (f))
|
442
|
1288 return !EQ (frame, next_frame (frame, Qt, Qt));
|
|
1289 return !EQ (frame, next_frame (frame, Qvisible_iconic_nomini, Qt));
|
428
|
1290 }
|
|
1291
|
|
1292 /* Delete frame F.
|
|
1293
|
|
1294 If FORCE is non-zero, allow deletion of the only frame.
|
|
1295
|
|
1296 If CALLED_FROM_DELETE_DEVICE is non-zero, then, if
|
|
1297 deleting the last frame on a device, just delete it,
|
|
1298 instead of calling `delete-device'.
|
|
1299
|
|
1300 If FROM_IO_ERROR is non-zero, then the frame is gone due
|
|
1301 to an I/O error. This affects what happens if we exit
|
|
1302 (we do an emergency exit instead of `save-buffers-kill-emacs'.)
|
|
1303 */
|
|
1304
|
|
1305 void
|
|
1306 delete_frame_internal (struct frame *f, int force,
|
|
1307 int called_from_delete_device,
|
|
1308 int from_io_error)
|
|
1309 {
|
|
1310 /* This function can GC */
|
|
1311 int minibuffer_selected;
|
|
1312 struct device *d;
|
|
1313 struct console *con;
|
|
1314 Lisp_Object frame;
|
|
1315 Lisp_Object device;
|
|
1316 Lisp_Object console;
|
|
1317 struct gcpro gcpro1;
|
|
1318
|
|
1319 /* OK to delete an already deleted frame. */
|
|
1320 if (! FRAME_LIVE_P (f))
|
|
1321 return;
|
|
1322
|
793
|
1323 frame = wrap_frame (f);
|
428
|
1324 GCPRO1 (frame);
|
|
1325
|
|
1326 device = FRAME_DEVICE (f);
|
|
1327 d = XDEVICE (device);
|
|
1328 console = DEVICE_CONSOLE (d);
|
|
1329 con = XCONSOLE (console);
|
|
1330
|
545
|
1331 if (!called_from_delete_device
|
|
1332 && !DEVICE_IMPL_FLAG (d, XDEVIMPF_FRAMELESS_OK))
|
428
|
1333 {
|
|
1334 /* If we're deleting the only non-minibuffer frame on the
|
|
1335 device, delete the device. */
|
|
1336 if (EQ (frame, next_frame (frame, Qnomini, FRAME_DEVICE (f))))
|
|
1337 {
|
|
1338 delete_device_internal (d, force, 0, from_io_error);
|
|
1339 UNGCPRO;
|
|
1340 return;
|
|
1341 }
|
|
1342 }
|
|
1343
|
|
1344 /* In FSF, delete-frame will not normally allow you to delete the
|
|
1345 last visible frame. This was too annoying, so we changed it to the
|
|
1346 only frame. However, this would let people shoot themselves by
|
|
1347 deleting all frames which were either visible or iconified and thus
|
|
1348 losing any way of communicating with the still running XEmacs process.
|
|
1349 So we put it back. */
|
|
1350 if (!force && !allow_deletion_of_last_visible_frame &&
|
442
|
1351 !other_visible_frames (f))
|
563
|
1352 invalid_operation ("Attempt to delete the sole visible or iconified frame", Qunbound);
|
428
|
1353
|
|
1354 /* Does this frame have a minibuffer, and is it the surrogate
|
|
1355 minibuffer for any other frame? */
|
|
1356 if (FRAME_HAS_MINIBUF_P (f))
|
|
1357 {
|
|
1358 Lisp_Object frmcons, devcons, concons;
|
|
1359
|
|
1360 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
|
|
1361 {
|
|
1362 Lisp_Object this = XCAR (frmcons);
|
|
1363
|
|
1364 if (! EQ (this, frame)
|
|
1365 && EQ (frame, (WINDOW_FRAME
|
|
1366 (XWINDOW
|
|
1367 (FRAME_MINIBUF_WINDOW (XFRAME (this)))))))
|
|
1368 {
|
|
1369 /* We've found another frame whose minibuffer is on
|
|
1370 this frame. */
|
563
|
1371 gui_error
|
428
|
1372 ("Attempt to delete a surrogate minibuffer frame", frame);
|
|
1373 }
|
|
1374 }
|
|
1375 }
|
|
1376
|
|
1377 /* Test for popup frames hanging around. */
|
|
1378 /* Deletion of a parent frame with popups is deadly. */
|
|
1379 {
|
|
1380 Lisp_Object frmcons, devcons, concons;
|
|
1381
|
|
1382 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
|
|
1383 {
|
|
1384 Lisp_Object this = XCAR (frmcons);
|
|
1385
|
|
1386
|
|
1387 if (! EQ (this, frame))
|
|
1388 {
|
|
1389 struct device *devcons_d = XDEVICE (XCAR (devcons));
|
|
1390 if (EQ (frame, DEVMETH_OR_GIVEN (devcons_d, get_frame_parent,
|
|
1391 (XFRAME (this)),
|
|
1392 Qnil)))
|
|
1393 /* We've found a popup frame whose parent is this frame. */
|
563
|
1394 gui_error
|
428
|
1395 ("Attempt to delete a frame with live popups", frame);
|
|
1396 }
|
|
1397 }
|
|
1398 }
|
|
1399
|
|
1400 /* Before here, we haven't made any dangerous changes (just checked for
|
|
1401 error conditions). Now run the delete-frame-hook. Remember that
|
|
1402 user code there could do any number of dangerous things, including
|
|
1403 signalling an error. */
|
|
1404
|
|
1405 va_run_hook_with_args (Qdelete_frame_hook, 1, frame);
|
|
1406
|
|
1407 if (!FRAME_LIVE_P (f)) /* Make sure the delete-frame-hook didn't */
|
|
1408 { /* go ahead and delete anything. */
|
|
1409 UNGCPRO;
|
|
1410 return;
|
|
1411 }
|
|
1412
|
|
1413 /* Call the delete-device-hook and delete-console-hook now if
|
|
1414 appropriate, before we do any dangerous things -- they too could
|
|
1415 signal an error. */
|
|
1416 if (XINT (Flength (DEVICE_FRAME_LIST (d))) == 1)
|
|
1417 {
|
|
1418 va_run_hook_with_args (Qdelete_device_hook, 1, device);
|
|
1419 if (!FRAME_LIVE_P (f)) /* Make sure the delete-device-hook didn't */
|
|
1420 { /* go ahead and delete anything. */
|
|
1421 UNGCPRO;
|
|
1422 return;
|
|
1423 }
|
|
1424
|
|
1425 if (XINT (Flength (CONSOLE_DEVICE_LIST (con))) == 1)
|
|
1426 {
|
|
1427 va_run_hook_with_args (Qdelete_console_hook, 1, console);
|
|
1428 if (!FRAME_LIVE_P (f)) /* Make sure the delete-console-hook didn't */
|
|
1429 { /* go ahead and delete anything. */
|
|
1430 UNGCPRO;
|
|
1431 return;
|
|
1432 }
|
|
1433 }
|
|
1434 }
|
|
1435
|
|
1436 minibuffer_selected = EQ (minibuf_window, Fselected_window (Qnil));
|
|
1437
|
|
1438 /* If we were focused on this frame, then we're not any more.
|
|
1439 Assume that we lost the focus; that way, the call to
|
|
1440 Fselect_frame() below won't end up making us explicitly
|
|
1441 focus on another frame, which is generally undesirable in
|
|
1442 a point-to-type world. If our mouse ends up sitting over
|
|
1443 another frame, we will receive a FocusIn event and end up
|
|
1444 making that frame the selected frame.
|
|
1445
|
|
1446 #### This may not be an ideal solution in a click-to-type
|
|
1447 world (in that case, we might want to explicitly choose
|
|
1448 another frame to have the focus, rather than relying on
|
|
1449 the WM, which might focus on a frame in a different app
|
|
1450 or focus on nothing at all). But there's no easy way
|
|
1451 to detect which focus model we're running on, and the
|
|
1452 alternative is more heinous. */
|
|
1453
|
|
1454 if (EQ (frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)))
|
|
1455 DEVICE_FRAME_WITH_FOCUS_REAL (d) = Qnil;
|
|
1456 if (EQ (frame, DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d)))
|
|
1457 DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d) = Qnil;
|
|
1458 if (EQ (frame, DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS (d)))
|
|
1459 DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS (d) = Qnil;
|
|
1460
|
|
1461 /* Don't allow the deleted frame to remain selected.
|
|
1462 Note that in the former scheme of things, this would
|
|
1463 have caused us to regain the focus. This no longer
|
|
1464 applies (see above); I think the new behavior is more
|
|
1465 logical. If someone disagrees, it can always be
|
|
1466 changed (or a new user variable can be introduced, ugh.) */
|
|
1467 if (EQ (frame, DEVICE_SELECTED_FRAME (d)))
|
|
1468 {
|
|
1469 Lisp_Object next;
|
|
1470
|
|
1471 /* If this is a popup frame, select its parent if possible.
|
|
1472 Otherwise, find another visible frame; if none, just take any frame.
|
|
1473 First try the same device, then the same console. */
|
|
1474
|
|
1475 next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil);
|
|
1476 if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next)))
|
442
|
1477 next = next_frame (frame, Qvisible, device);
|
428
|
1478 if (NILP (next) || EQ (next, frame))
|
442
|
1479 next = next_frame (frame, Qvisible, console);
|
|
1480 if (NILP (next) || EQ (next, frame))
|
|
1481 next = next_frame (frame, Qvisible, Qt);
|
428
|
1482 if (NILP (next) || EQ (next, frame))
|
442
|
1483 next = next_frame (frame, Qt, device);
|
428
|
1484 if (NILP (next) || EQ (next, frame))
|
442
|
1485 next = next_frame (frame, Qt, console);
|
428
|
1486 if (NILP (next) || EQ (next, frame))
|
442
|
1487 next = next_frame (frame, Qt, Qt);
|
428
|
1488
|
|
1489 /* if we haven't found another frame at this point
|
|
1490 then there aren't any. */
|
|
1491 if (NILP (next) || EQ (next, frame))
|
|
1492 ;
|
|
1493 else
|
|
1494 {
|
|
1495 int did_select = 0;
|
|
1496 /* if this is the global selected frame, select another one. */
|
|
1497 if (EQ (frame, Fselected_frame (Qnil)))
|
|
1498 {
|
|
1499 Fselect_frame (next);
|
|
1500 did_select = 1;
|
|
1501 }
|
|
1502 /*
|
|
1503 * If the new frame we just selected is on a different
|
|
1504 * device then we still need to change DEVICE_SELECTED_FRAME(d)
|
|
1505 * to a live frame, if there are any left on this device.
|
|
1506 */
|
|
1507 if (!EQ (device, FRAME_DEVICE(XFRAME(next))))
|
|
1508 {
|
442
|
1509 Lisp_Object next_f = next_frame (frame, Qt, device);
|
428
|
1510 if (NILP (next_f) || EQ (next_f, frame))
|
440
|
1511 set_device_selected_frame (d, Qnil);
|
428
|
1512 else
|
|
1513 set_device_selected_frame (d, next_f);
|
|
1514 }
|
|
1515 else if (! did_select)
|
|
1516 set_device_selected_frame (d, next);
|
|
1517
|
|
1518 }
|
|
1519 }
|
|
1520
|
|
1521 /* Don't allow minibuf_window to remain on a deleted frame. */
|
|
1522 if (EQ (f->minibuffer_window, minibuf_window))
|
|
1523 {
|
|
1524 struct frame *sel_frame = selected_frame ();
|
|
1525 Fset_window_buffer (sel_frame->minibuffer_window,
|
440
|
1526 XWINDOW (minibuf_window)->buffer, Qt);
|
428
|
1527 minibuf_window = sel_frame->minibuffer_window;
|
|
1528
|
|
1529 /* If the dying minibuffer window was selected,
|
|
1530 select the new one. */
|
|
1531 if (minibuffer_selected)
|
|
1532 Fselect_window (minibuf_window, Qnil);
|
|
1533 }
|
|
1534
|
|
1535 /* After this point, no errors must be allowed to occur. */
|
|
1536
|
|
1537 #ifdef HAVE_MENUBARS
|
|
1538 free_frame_menubars (f);
|
|
1539 #endif
|
|
1540 #ifdef HAVE_SCROLLBARS
|
|
1541 free_frame_scrollbars (f);
|
|
1542 #endif
|
|
1543 #ifdef HAVE_TOOLBARS
|
|
1544 free_frame_toolbars (f);
|
|
1545 #endif
|
|
1546 free_frame_gutters (f);
|
442
|
1547 /* Unfortunately deleting the frame will also delete the parent of
|
|
1548 all of the subwindow instances current on the frame. I think this
|
|
1549 can lead to bad things when trying to finalize the
|
|
1550 instances. Thus we loop over all instance caches calling the
|
|
1551 finalize method for each instance. */
|
|
1552 free_frame_subwindow_instances (f);
|
428
|
1553
|
|
1554 /* This must be done before the window and window_mirror structures
|
|
1555 are freed. The scrollbar information is attached to them. */
|
|
1556 MAYBE_FRAMEMETH (f, delete_frame, (f));
|
|
1557
|
|
1558 /* Mark all the windows that used to be on FRAME as deleted, and then
|
|
1559 remove the reference to them. */
|
|
1560 delete_all_subwindows (XWINDOW (f->root_window));
|
|
1561 f->root_window = Qnil;
|
|
1562
|
|
1563 /* clear out the cached glyph information */
|
442
|
1564 f->subwindow_instance_cache = Qnil;
|
428
|
1565
|
|
1566 /* Remove the frame now from the list. This way, any events generated
|
|
1567 on this frame by the maneuvers below will disperse themselves. */
|
|
1568
|
|
1569 /* This used to be Fdelq(), but that will cause a seg fault if the
|
|
1570 QUIT checker happens to get invoked, because the frame list is in
|
|
1571 an inconsistent state. */
|
|
1572 d->frame_list = delq_no_quit (frame, d->frame_list);
|
|
1573 RESET_CHANGED_SET_FLAGS;
|
|
1574
|
|
1575 f->visible = 0;
|
|
1576
|
617
|
1577 free_window_mirror (XWINDOW_MIRROR (f->root_mirror));
|
428
|
1578 /* free_line_insertion_deletion_costs (f); */
|
|
1579
|
|
1580 /* If we've deleted the last non-minibuf frame, then try to find
|
|
1581 another one. */
|
|
1582 if (EQ (frame, CONSOLE_LAST_NONMINIBUF_FRAME (con)))
|
|
1583 {
|
|
1584 Lisp_Object frmcons, devcons;
|
|
1585
|
|
1586 set_console_last_nonminibuf_frame (con, Qnil);
|
|
1587
|
|
1588 CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, con)
|
|
1589 {
|
|
1590 Lisp_Object ecran = XCAR (frmcons);
|
|
1591 if (!FRAME_MINIBUF_ONLY_P (XFRAME (ecran)))
|
|
1592 {
|
|
1593 set_console_last_nonminibuf_frame (con, ecran);
|
|
1594 goto double_break_1;
|
|
1595 }
|
|
1596 }
|
|
1597 }
|
|
1598 double_break_1:
|
|
1599
|
|
1600 #if 0
|
|
1601 /* The following test is degenerate FALSE */
|
|
1602 if (called_from_delete_device < 0)
|
|
1603 /* then we're being called from delete-console, and we shouldn't
|
|
1604 try to find another default-minibuffer frame for the console.
|
|
1605 */
|
|
1606 con->default_minibuffer_frame = Qnil;
|
|
1607 #endif
|
|
1608
|
|
1609 /* If we've deleted this console's default_minibuffer_frame, try to
|
|
1610 find another one. Prefer minibuffer-only frames, but also notice
|
|
1611 frames with other windows. */
|
|
1612 if (EQ (frame, con->default_minibuffer_frame))
|
|
1613 {
|
|
1614 Lisp_Object frmcons, devcons;
|
|
1615 /* The last frame we saw with a minibuffer, minibuffer-only or not. */
|
|
1616 Lisp_Object frame_with_minibuf;
|
|
1617 /* Some frame we found on the same console, or nil if there are none. */
|
|
1618 Lisp_Object frame_on_same_console;
|
|
1619
|
|
1620 frame_on_same_console = Qnil;
|
|
1621 frame_with_minibuf = Qnil;
|
|
1622
|
|
1623 set_console_last_nonminibuf_frame (con, Qnil);
|
|
1624
|
|
1625 CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, con)
|
|
1626 {
|
|
1627 Lisp_Object this;
|
|
1628 struct frame *f1;
|
|
1629
|
|
1630 this = XCAR (frmcons);
|
|
1631 f1 = XFRAME (this);
|
|
1632
|
|
1633 /* Consider only frames on the same console
|
|
1634 and only those with minibuffers. */
|
|
1635 if (FRAME_HAS_MINIBUF_P (f1))
|
|
1636 {
|
|
1637 frame_with_minibuf = this;
|
|
1638 if (FRAME_MINIBUF_ONLY_P (f1))
|
|
1639 goto double_break_2;
|
|
1640 }
|
|
1641
|
|
1642 frame_on_same_console = this;
|
|
1643 }
|
|
1644 double_break_2:
|
|
1645
|
|
1646 if (!NILP (frame_on_same_console))
|
|
1647 {
|
|
1648 /* We know that there must be some frame with a minibuffer out
|
|
1649 there. If this were not true, all of the frames present
|
|
1650 would have to be minibuffer-less, which implies that at some
|
|
1651 point their minibuffer frames must have been deleted, but
|
|
1652 that is prohibited at the top; you can't delete surrogate
|
|
1653 minibuffer frames. */
|
|
1654 if (NILP (frame_with_minibuf))
|
|
1655 abort ();
|
|
1656
|
|
1657 con->default_minibuffer_frame = frame_with_minibuf;
|
|
1658 }
|
|
1659 else
|
|
1660 /* No frames left on this console--say no minibuffer either. */
|
|
1661 con->default_minibuffer_frame = Qnil;
|
|
1662 }
|
|
1663
|
617
|
1664 /* Nobody should be accessing anything in this object any more, and
|
|
1665 making all Lisp_Objects Qnil allows for better GC'ing in case a
|
|
1666 pointer to the dead frame continues to hang around. Zero all
|
|
1667 other structs in case someone tries to access something through
|
|
1668 them. */
|
|
1669
|
|
1670 nuke_all_frame_slots (f);
|
428
|
1671 f->framemeths = dead_console_methods;
|
617
|
1672
|
428
|
1673 UNGCPRO;
|
|
1674 }
|
|
1675
|
|
1676 void
|
|
1677 io_error_delete_frame (Lisp_Object frame)
|
|
1678 {
|
|
1679 delete_frame_internal (XFRAME (frame), 1, 0, 1);
|
|
1680 }
|
|
1681
|
|
1682 DEFUN ("delete-frame", Fdelete_frame, 0, 2, "", /*
|
|
1683 Delete FRAME, permanently eliminating it from use.
|
|
1684 If omitted, FRAME defaults to the selected frame.
|
|
1685 A frame may not be deleted if its minibuffer is used by other frames.
|
|
1686 Normally, you cannot delete the last non-minibuffer-only frame (you must
|
|
1687 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional
|
|
1688 second argument FORCE is non-nil, you can delete the last frame. (This
|
|
1689 will automatically call `save-buffers-kill-emacs'.)
|
|
1690 */
|
|
1691 (frame, force))
|
|
1692 {
|
|
1693 /* This function can GC */
|
|
1694 struct frame *f;
|
|
1695
|
|
1696 if (NILP (frame))
|
|
1697 {
|
|
1698 f = selected_frame ();
|
793
|
1699 frame = wrap_frame (f);
|
428
|
1700 }
|
|
1701 else
|
|
1702 {
|
|
1703 CHECK_FRAME (frame);
|
|
1704 f = XFRAME (frame);
|
|
1705 }
|
|
1706
|
|
1707 delete_frame_internal (f, !NILP (force), 0, 0);
|
|
1708 return Qnil;
|
|
1709 }
|
|
1710
|
|
1711
|
|
1712 /* Return mouse position in character cell units. */
|
|
1713
|
|
1714 static int
|
|
1715 mouse_pixel_position_1 (struct device *d, Lisp_Object *frame,
|
|
1716 int *x, int *y)
|
|
1717 {
|
|
1718 switch (DEVMETH_OR_GIVEN (d, get_mouse_position, (d, frame, x, y), -1))
|
|
1719 {
|
|
1720 case 1:
|
|
1721 return 1;
|
|
1722
|
|
1723 case 0:
|
|
1724 *frame = Qnil;
|
|
1725 break;
|
|
1726
|
|
1727 case -1:
|
|
1728 *frame = DEVICE_SELECTED_FRAME (d);
|
|
1729 break;
|
|
1730
|
|
1731 default:
|
|
1732 abort (); /* method is incorrectly written */
|
|
1733 }
|
|
1734
|
|
1735 return 0;
|
|
1736 }
|
|
1737
|
|
1738 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /*
|
|
1739 Return a list (WINDOW X . Y) giving the current mouse window and position.
|
442
|
1740 The position is given in pixel units, where (0, 0) is the upper-left corner
|
|
1741 of the window.
|
428
|
1742
|
|
1743 When the cursor is not over a window, the return value is a list (nil nil).
|
|
1744
|
|
1745 DEVICE specifies the device on which to read the mouse position, and
|
|
1746 defaults to the selected device. If the device is a mouseless terminal
|
442
|
1747 or XEmacs hasn't been programmed to read its mouse position, it returns
|
428
|
1748 the device's selected window for WINDOW and nil for X and Y.
|
|
1749 */
|
|
1750 (device))
|
|
1751 {
|
|
1752 struct device *d = decode_device (device);
|
|
1753 Lisp_Object frame;
|
|
1754 Lisp_Object window = Qnil;
|
|
1755 Lisp_Object x = Qnil;
|
|
1756 Lisp_Object y = Qnil;
|
|
1757 int intx, inty;
|
|
1758
|
|
1759 if (mouse_pixel_position_1 (d, &frame, &intx, &inty) > 0)
|
|
1760 {
|
|
1761 struct window *w =
|
|
1762 find_window_by_pixel_pos (intx, inty, XFRAME (frame)->root_window);
|
|
1763 if (w)
|
|
1764 {
|
793
|
1765 window = wrap_window (w);
|
428
|
1766
|
|
1767 /* Adjust the position to be relative to the window. */
|
|
1768 intx -= w->pixel_left;
|
|
1769 inty -= w->pixel_top;
|
793
|
1770 x = make_int (intx);
|
|
1771 y = make_int (inty);
|
428
|
1772 }
|
|
1773 }
|
|
1774 else if (FRAMEP (frame))
|
|
1775 window = FRAME_SELECTED_WINDOW (XFRAME (frame));
|
|
1776
|
|
1777 return Fcons (window, Fcons (x, y));
|
|
1778 }
|
|
1779
|
|
1780 DEFUN ("mouse-position", Fmouse_position, 0, 1, 0, /*
|
|
1781 Return a list (WINDOW X . Y) giving the current mouse window and position.
|
|
1782 The position is of a character under cursor, where (0, 0) is the upper-left
|
|
1783 corner of the window.
|
|
1784
|
|
1785 When the cursor is not over a character, or not over a window, the return
|
|
1786 value is a list (nil nil).
|
|
1787
|
|
1788 DEVICE specifies the device on which to read the mouse position, and
|
|
1789 defaults to the selected device. If the device is a mouseless terminal
|
|
1790 or Emacs hasn't been programmed to read its mouse position, it returns
|
|
1791 the device's selected window for WINDOW and nil for X and Y.
|
|
1792 */
|
|
1793 (device))
|
|
1794 {
|
|
1795 struct device *d = decode_device (device);
|
|
1796 struct window *w;
|
|
1797 Lisp_Object frame, window = Qnil, lisp_x = Qnil, lisp_y = Qnil;
|
|
1798 int x, y, obj_x, obj_y;
|
665
|
1799 Charbpos charbpos, closest;
|
428
|
1800 Charcount modeline_closest;
|
|
1801 Lisp_Object obj1, obj2;
|
|
1802
|
|
1803 if (mouse_pixel_position_1 (d, &frame, &x, &y) > 0)
|
|
1804 {
|
|
1805 int res = pixel_to_glyph_translation (XFRAME (frame), x, y, &x, &y,
|
665
|
1806 &obj_x, &obj_y, &w, &charbpos,
|
428
|
1807 &closest, &modeline_closest,
|
|
1808 &obj1, &obj2);
|
|
1809 if (res == OVER_TEXT)
|
|
1810 {
|
|
1811 lisp_x = make_int (x);
|
|
1812 lisp_y = make_int (y);
|
793
|
1813 window = wrap_window (w);
|
428
|
1814 }
|
|
1815 }
|
|
1816 else if (FRAMEP (frame))
|
|
1817 window = FRAME_SELECTED_WINDOW (XFRAME (frame));
|
|
1818
|
|
1819 return Fcons (window, Fcons (lisp_x, lisp_y));
|
|
1820 }
|
|
1821
|
|
1822 DEFUN ("mouse-position-as-motion-event", Fmouse_position_as_motion_event, 0, 1, 0, /*
|
|
1823 Return the current mouse position as a motion event.
|
|
1824 This allows you to call the standard event functions such as
|
|
1825 `event-over-toolbar-p' to determine where the mouse is.
|
|
1826
|
|
1827 DEVICE specifies the device on which to read the mouse position, and
|
|
1828 defaults to the selected device. If the mouse position can't be determined
|
|
1829 \(e.g. DEVICE is a TTY device), nil is returned instead of an event.
|
|
1830 */
|
|
1831 (device))
|
|
1832 {
|
|
1833 struct device *d = decode_device (device);
|
|
1834 Lisp_Object frame;
|
|
1835 int intx, inty;
|
|
1836
|
|
1837 if (mouse_pixel_position_1 (d, &frame, &intx, &inty))
|
|
1838 {
|
|
1839 Lisp_Object event = Fmake_event (Qnil, Qnil);
|
|
1840 XEVENT (event)->event_type = pointer_motion_event;
|
|
1841 XEVENT (event)->channel = frame;
|
|
1842 XEVENT (event)->event.motion.x = intx;
|
|
1843 XEVENT (event)->event.motion.y = inty;
|
|
1844 return event;
|
|
1845 }
|
|
1846 else
|
|
1847 return Qnil;
|
|
1848 }
|
|
1849
|
|
1850 DEFUN ("set-mouse-position", Fset_mouse_position, 3, 3, 0, /*
|
|
1851 Move the mouse pointer to the center of character cell (X,Y) in WINDOW.
|
|
1852 Note, this is a no-op for an X frame that is not visible.
|
|
1853 If you have just created a frame, you must wait for it to become visible
|
|
1854 before calling this function on it, like this.
|
|
1855 (while (not (frame-visible-p frame)) (sleep-for .5))
|
|
1856 Note also: Warping the mouse is contrary to the ICCCM, so be very sure
|
|
1857 that the behavior won't end up being obnoxious!
|
|
1858 */
|
|
1859 (window, x, y))
|
|
1860 {
|
|
1861 struct window *w;
|
|
1862 int pix_x, pix_y;
|
|
1863
|
|
1864 CHECK_LIVE_WINDOW (window);
|
|
1865 CHECK_INT (x);
|
|
1866 CHECK_INT (y);
|
|
1867
|
|
1868 /* Warping the mouse will cause EnterNotify and Focus events under X. */
|
|
1869 w = XWINDOW (window);
|
|
1870 glyph_to_pixel_translation (w, XINT (x), XINT (y), &pix_x, &pix_y);
|
|
1871
|
|
1872 MAYBE_FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, pix_x, pix_y));
|
|
1873
|
|
1874 return Qnil;
|
|
1875 }
|
|
1876
|
|
1877 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, 3, 3, 0, /*
|
|
1878 Move the mouse pointer to pixel position (X,Y) in WINDOW.
|
|
1879 Note, this is a no-op for an X frame that is not visible.
|
|
1880 If you have just created a frame, you must wait for it to become visible
|
|
1881 before calling this function on it, like this.
|
|
1882 (while (not (frame-visible-p frame)) (sleep-for .5))
|
|
1883 */
|
|
1884 (window, x, y))
|
|
1885 {
|
|
1886 struct window *w;
|
|
1887
|
|
1888 CHECK_LIVE_WINDOW (window);
|
|
1889 CHECK_INT (x);
|
|
1890 CHECK_INT (y);
|
|
1891
|
|
1892 /* Warping the mouse will cause EnterNotify and Focus events under X. */
|
|
1893 w = XWINDOW (window);
|
|
1894 FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, XINT (x), XINT (y)));
|
|
1895
|
|
1896 return Qnil;
|
|
1897 }
|
|
1898
|
|
1899 DEFUN ("make-frame-visible", Fmake_frame_visible, 0, 1, 0, /*
|
|
1900 Make the frame FRAME visible (assuming it is an X-window).
|
|
1901 If omitted, FRAME defaults to the currently selected frame.
|
|
1902 Also raises the frame so that nothing obscures it.
|
|
1903 */
|
|
1904 (frame))
|
|
1905 {
|
|
1906 struct frame *f = decode_frame (frame);
|
|
1907
|
|
1908 MAYBE_FRAMEMETH (f, make_frame_visible, (f));
|
|
1909 return frame;
|
|
1910 }
|
|
1911
|
|
1912 DEFUN ("make-frame-invisible", Fmake_frame_invisible, 0, 2, 0, /*
|
|
1913 Unconditionally removes frame from the display (assuming it is an X-window).
|
|
1914 If omitted, FRAME defaults to the currently selected frame.
|
|
1915 If what you want to do is iconify the frame (if the window manager uses
|
|
1916 icons) then you should call `iconify-frame' instead.
|
|
1917 Normally you may not make FRAME invisible if all other frames are invisible
|
|
1918 and uniconified, but if the second optional argument FORCE is non-nil,
|
|
1919 you may do so.
|
|
1920 */
|
|
1921 (frame, force))
|
|
1922 {
|
|
1923 struct frame *f, *sel_frame;
|
|
1924 struct device *d;
|
|
1925
|
|
1926 f = decode_frame (frame);
|
|
1927 d = XDEVICE (FRAME_DEVICE (f));
|
|
1928 sel_frame = XFRAME (DEVICE_SELECTED_FRAME (d));
|
|
1929
|
|
1930 if (NILP (force) && !other_visible_frames (f))
|
563
|
1931 invalid_operation ("Attempt to make invisible the sole visible or iconified frame", Qunbound);
|
428
|
1932
|
|
1933 /* Don't allow minibuf_window to remain on a deleted frame. */
|
|
1934 if (EQ (f->minibuffer_window, minibuf_window))
|
|
1935 {
|
|
1936 Fset_window_buffer (sel_frame->minibuffer_window,
|
440
|
1937 XWINDOW (minibuf_window)->buffer, Qt);
|
428
|
1938 minibuf_window = sel_frame->minibuffer_window;
|
|
1939 }
|
|
1940
|
|
1941 MAYBE_FRAMEMETH (f, make_frame_invisible, (f));
|
|
1942
|
|
1943 return Qnil;
|
|
1944 }
|
|
1945
|
|
1946 DEFUN ("iconify-frame", Ficonify_frame, 0, 1, "", /*
|
|
1947 Make the frame FRAME into an icon, if the window manager supports icons.
|
|
1948 If omitted, FRAME defaults to the currently selected frame.
|
|
1949 */
|
|
1950 (frame))
|
|
1951 {
|
|
1952 struct frame *f, *sel_frame;
|
|
1953 struct device *d;
|
|
1954
|
|
1955 f = decode_frame (frame);
|
|
1956 d = XDEVICE (FRAME_DEVICE (f));
|
|
1957 sel_frame = XFRAME (DEVICE_SELECTED_FRAME (d));
|
|
1958
|
|
1959 /* Don't allow minibuf_window to remain on a deleted frame. */
|
|
1960 if (EQ (f->minibuffer_window, minibuf_window))
|
|
1961 {
|
|
1962 Fset_window_buffer (sel_frame->minibuffer_window,
|
440
|
1963 XWINDOW (minibuf_window)->buffer, Qt);
|
428
|
1964 minibuf_window = sel_frame->minibuffer_window;
|
|
1965 }
|
|
1966
|
|
1967 MAYBE_FRAMEMETH (f, iconify_frame, (f));
|
|
1968
|
|
1969 return Qnil;
|
|
1970 }
|
|
1971
|
|
1972 DEFUN ("deiconify-frame", Fdeiconify_frame, 0, 1, 0, /*
|
|
1973 Open (de-iconify) the iconified frame FRAME.
|
|
1974 Under X, this is currently the same as `make-frame-visible'.
|
|
1975 If omitted, FRAME defaults to the currently selected frame.
|
|
1976 Also raises the frame so that nothing obscures it.
|
|
1977 */
|
|
1978 (frame))
|
|
1979 {
|
|
1980 return Fmake_frame_visible (frame);
|
|
1981 }
|
|
1982
|
|
1983 /* FSF returns 'icon for iconized frames. What a crock! */
|
|
1984
|
|
1985 DEFUN ("frame-visible-p", Fframe_visible_p, 0, 1, 0, /*
|
|
1986 Return non NIL if FRAME is now "visible" (actually in use for display).
|
|
1987 A frame that is not visible is not updated, and, if it works through a
|
|
1988 window system, may not show at all.
|
|
1989 N.B. Under X "visible" means Mapped. It the window is mapped but not
|
460
|
1990 actually visible on screen then `frame-visible-p' returns 'hidden.
|
428
|
1991 */
|
|
1992 (frame))
|
|
1993 {
|
|
1994 struct frame *f = decode_frame (frame);
|
|
1995 int visible = FRAMEMETH_OR_GIVEN (f, frame_visible_p, (f), f->visible);
|
|
1996 return visible ? ( visible > 0 ? Qt : Qhidden ) : Qnil;
|
|
1997 }
|
|
1998
|
|
1999 DEFUN ("frame-totally-visible-p", Fframe_totally_visible_p, 0, 1, 0, /*
|
|
2000 Return t if frame is not obscured by any other window system windows.
|
|
2001 Always returns t for tty frames.
|
|
2002 */
|
|
2003 (frame))
|
|
2004 {
|
|
2005 struct frame *f = decode_frame (frame);
|
|
2006 return (FRAMEMETH_OR_GIVEN (f, frame_totally_visible_p, (f), f->visible)
|
|
2007 ? Qt : Qnil);
|
|
2008 }
|
|
2009
|
|
2010 DEFUN ("frame-iconified-p", Fframe_iconified_p, 0, 1, 0, /*
|
|
2011 Return t if FRAME is iconified.
|
|
2012 Not all window managers use icons; some merely unmap the window, so this
|
|
2013 function is not the inverse of `frame-visible-p'. It is possible for a
|
|
2014 frame to not be visible and not be iconified either. However, if the
|
|
2015 frame is iconified, it will not be visible.
|
|
2016 */
|
|
2017 (frame))
|
|
2018 {
|
|
2019 struct frame *f = decode_frame (frame);
|
|
2020 if (f->visible)
|
|
2021 return Qnil;
|
|
2022 f->iconified = FRAMEMETH_OR_GIVEN (f, frame_iconified_p, (f), 0);
|
|
2023 return f->iconified ? Qt : Qnil;
|
|
2024 }
|
|
2025
|
|
2026 DEFUN ("visible-frame-list", Fvisible_frame_list, 0, 1, 0, /*
|
|
2027 Return a list of all frames now "visible" (being updated).
|
|
2028 If DEVICE is specified only frames on that device will be returned.
|
460
|
2029 Note that under virtual window managers not all these frames are
|
|
2030 necessarily really updated.
|
428
|
2031 */
|
|
2032 (device))
|
|
2033 {
|
|
2034 Lisp_Object devcons, concons;
|
|
2035 struct frame *f;
|
|
2036 Lisp_Object value;
|
|
2037
|
|
2038 value = Qnil;
|
|
2039
|
|
2040 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
2041 {
|
|
2042 assert (DEVICEP (XCAR (devcons)));
|
|
2043
|
|
2044 if (NILP (device) || EQ (device, XCAR (devcons)))
|
|
2045 {
|
|
2046 Lisp_Object frmcons;
|
|
2047
|
|
2048 DEVICE_FRAME_LOOP (frmcons, XDEVICE (XCAR (devcons)))
|
|
2049 {
|
|
2050 Lisp_Object frame = XCAR (frmcons);
|
|
2051 f = XFRAME (frame);
|
|
2052 if (FRAME_VISIBLE_P(f))
|
|
2053 value = Fcons (frame, value);
|
|
2054 }
|
|
2055 }
|
|
2056 }
|
|
2057
|
|
2058 return value;
|
|
2059 }
|
|
2060
|
|
2061
|
|
2062 DEFUN ("raise-frame", Fraise_frame, 0, 1, "", /*
|
|
2063 Bring FRAME to the front, so it occludes any frames it overlaps.
|
|
2064 If omitted, FRAME defaults to the currently selected frame.
|
|
2065 If FRAME is invisible, make it visible.
|
|
2066 If Emacs is displaying on an ordinary terminal or some other device which
|
|
2067 doesn't support multiple overlapping frames, this function does nothing.
|
|
2068 */
|
|
2069 (frame))
|
|
2070 {
|
|
2071 struct frame *f = decode_frame (frame);
|
|
2072
|
|
2073 /* Do like the documentation says. */
|
|
2074 Fmake_frame_visible (frame);
|
|
2075 MAYBE_FRAMEMETH (f, raise_frame, (f));
|
|
2076 return Qnil;
|
|
2077 }
|
|
2078
|
|
2079 DEFUN ("lower-frame", Flower_frame, 0, 1, "", /*
|
|
2080 Send FRAME to the back, so it is occluded by any frames that overlap it.
|
|
2081 If omitted, FRAME defaults to the currently selected frame.
|
|
2082 If Emacs is displaying on an ordinary terminal or some other device which
|
|
2083 doesn't support multiple overlapping frames, this function does nothing.
|
|
2084 */
|
|
2085 (frame))
|
|
2086 {
|
|
2087 struct frame *f = decode_frame (frame);
|
|
2088
|
|
2089 MAYBE_FRAMEMETH (f, lower_frame, (f));
|
|
2090 return Qnil;
|
|
2091 }
|
|
2092
|
442
|
2093
|
|
2094 DEFUN ("disable-frame", Fdisable_frame, 1, 1, 0, /*
|
|
2095 Disable frame FRAME, so that it cannot have the focus or receive user input.
|
|
2096 This is normally used during modal dialog boxes.
|
|
2097 WARNING: Be very careful not to wedge XEmacs!
|
|
2098 Use an `unwind-protect' that re-enables the frame to avoid this.
|
|
2099 */
|
|
2100 (frame))
|
|
2101 {
|
|
2102 struct frame *f = decode_frame (frame);
|
|
2103
|
|
2104 f->disabled = 1;
|
|
2105 MAYBE_FRAMEMETH (f, disable_frame, (f));
|
|
2106 return Qnil;
|
|
2107 }
|
|
2108
|
|
2109 DEFUN ("enable-frame", Fenable_frame, 1, 1, 0, /*
|
|
2110 Enable frame FRAME, so that it can have the focus and receive user input.
|
|
2111 Frames are normally enabled, unless explicitly disabled using `disable-frame'.
|
|
2112 */
|
|
2113 (frame))
|
|
2114 {
|
|
2115 struct frame *f = decode_frame (frame);
|
|
2116 f->disabled = 0;
|
|
2117 MAYBE_FRAMEMETH (f, enable_frame, (f));
|
|
2118 return Qnil;
|
|
2119 }
|
|
2120
|
428
|
2121 /* Ben thinks there is no need for `redirect-frame-focus' or `frame-focus',
|
|
2122 crockish FSFmacs functions. See summary on focus in event-stream.c. */
|
442
|
2123
|
|
2124 DEFUN ("print-job-page-number", Fprint_job_page_number, 1, 1, 0, /*
|
|
2125 Return current page number for the print job FRAME.
|
|
2126 */
|
|
2127 (frame))
|
|
2128 {
|
|
2129 CHECK_PRINTER_FRAME (frame);
|
|
2130 return make_int (FRAME_PAGENUMBER (XFRAME (frame)));
|
|
2131 }
|
|
2132
|
|
2133 DEFUN ("print-job-eject-page", Fprint_job_eject_page, 1, 1, 0, /*
|
|
2134 Eject page in the print job FRAME.
|
|
2135 */
|
|
2136 (frame))
|
|
2137 {
|
|
2138 struct frame *f;
|
|
2139
|
|
2140 CHECK_PRINTER_FRAME (frame);
|
|
2141 f = XFRAME (frame);
|
|
2142 FRAMEMETH (f, eject_page, (f));
|
|
2143 FRAME_SET_PAGENUMBER (f, 1 + FRAME_PAGENUMBER (f));
|
|
2144 f->clear = 1;
|
|
2145
|
|
2146 return Qnil;
|
|
2147 }
|
428
|
2148
|
|
2149
|
|
2150 /***************************************************************************/
|
|
2151 /* frame properties */
|
|
2152 /***************************************************************************/
|
|
2153
|
|
2154 static void internal_set_frame_size (struct frame *f, int cols, int rows,
|
|
2155 int pretend);
|
|
2156
|
|
2157 static void
|
|
2158 store_minibuf_frame_prop (struct frame *f, Lisp_Object val)
|
|
2159 {
|
793
|
2160 Lisp_Object frame = wrap_frame (f);
|
|
2161
|
428
|
2162
|
|
2163 if (WINDOWP (val))
|
|
2164 {
|
|
2165 if (! MINI_WINDOW_P (XWINDOW (val)))
|
563
|
2166 gui_error
|
428
|
2167 ("Surrogate minibuffer windows must be minibuffer windows",
|
|
2168 val);
|
|
2169
|
|
2170 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
|
563
|
2171 gui_error
|
428
|
2172 ("Can't change the surrogate minibuffer of a frame with its own minibuffer", frame);
|
|
2173
|
|
2174 /* Install the chosen minibuffer window, with proper buffer. */
|
|
2175 f->minibuffer_window = val;
|
|
2176 }
|
|
2177 else if (EQ (val, Qt))
|
|
2178 {
|
|
2179 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
|
563
|
2180 gui_error
|
428
|
2181 ("Frame already has its own minibuffer", frame);
|
|
2182 else
|
|
2183 {
|
|
2184 setup_normal_frame (f);
|
|
2185 f->mirror_dirty = 1;
|
|
2186
|
|
2187 update_frame_window_mirror (f);
|
|
2188 internal_set_frame_size (f, f->width, f->height, 1);
|
|
2189 }
|
|
2190 }
|
|
2191 }
|
|
2192
|
|
2193 #if 0
|
|
2194
|
|
2195 /* possible code if you want to have symbols such as `default-background'
|
|
2196 map to setting the background of `default', etc. */
|
|
2197
|
|
2198 static int
|
|
2199 dissect_as_face_setting (Lisp_Object sym, Lisp_Object *face_out,
|
|
2200 Lisp_Object *face_prop_out)
|
|
2201 {
|
|
2202 Lisp_Object list = Vbuilt_in_face_specifiers;
|
793
|
2203 Lisp_Object s;
|
428
|
2204
|
|
2205 if (!SYMBOLP (sym))
|
|
2206 return 0;
|
|
2207
|
|
2208 s = symbol_name (XSYMBOL (sym));
|
|
2209
|
|
2210 while (!NILP (list))
|
|
2211 {
|
|
2212 Lisp_Object prop = Fcar (list);
|
793
|
2213 Lisp_Object prop_name;
|
428
|
2214
|
|
2215 if (!SYMBOLP (prop))
|
|
2216 continue;
|
|
2217 prop_name = symbol_name (XSYMBOL (prop));
|
793
|
2218 if (XSTRING_LENGTH (s) > XSTRING_LENGTH (prop_name) + 1
|
|
2219 && !memcmp (XSTRING_DATA (prop_name),
|
|
2220 XSTRING_DATA (s) + XSTRING_LENGTH (s)
|
|
2221 - XSTRING_LENGTH (prop_name),
|
|
2222 XSTRING_LENGTH (prop_name))
|
|
2223 && XSTRING_DATA (s)[XSTRING_LENGTH (s) - XSTRING_LENGTH (prop_name)
|
428
|
2224 - 1] == '-')
|
|
2225 {
|
|
2226 Lisp_Object face =
|
793
|
2227 Ffind_face (make_string (XSTRING_DATA (s),
|
|
2228 XSTRING_LENGTH (s)
|
|
2229 - XSTRING_LENGTH (prop_name)
|
428
|
2230 - 1));
|
|
2231 if (!NILP (face))
|
|
2232 {
|
|
2233 *face_out = face;
|
|
2234 *face_prop_out = prop;
|
|
2235 return 1;
|
|
2236 }
|
|
2237 }
|
|
2238
|
|
2239 list = Fcdr (list);
|
|
2240 }
|
|
2241
|
|
2242 return 0;
|
|
2243 }
|
|
2244
|
|
2245 #endif /* 0 */
|
|
2246
|
|
2247 static Lisp_Object
|
|
2248 get_property_alias (Lisp_Object prop)
|
|
2249 {
|
|
2250 while (1)
|
|
2251 {
|
|
2252 Lisp_Object alias = Qnil;
|
|
2253
|
|
2254 if (SYMBOLP (prop))
|
|
2255 alias = Fget (prop, Qframe_property_alias, Qnil);
|
|
2256 if (NILP (alias))
|
|
2257 break;
|
|
2258 prop = alias;
|
|
2259 QUIT;
|
|
2260 }
|
|
2261
|
|
2262 return prop;
|
|
2263 }
|
|
2264
|
|
2265 /* #### Using this to modify the internal border width has no effect
|
|
2266 because the change isn't propagated to the windows. Are there
|
|
2267 other properties which this claims to handle, but doesn't?
|
|
2268
|
|
2269 But of course. This stuff needs more work, but it's a lot closer
|
|
2270 to sanity now than before with the horrible frame-params stuff. */
|
|
2271
|
|
2272 DEFUN ("set-frame-properties", Fset_frame_properties, 2, 2, 0, /*
|
|
2273 Change some properties of a frame.
|
|
2274 PLIST is a property list.
|
|
2275 You can also change frame properties individually using `set-frame-property',
|
|
2276 but it may be more efficient to change many properties at once.
|
|
2277
|
|
2278 Frame properties can be retrieved using `frame-property' or `frame-properties'.
|
|
2279
|
|
2280 The following symbols etc. have predefined meanings:
|
|
2281
|
|
2282 name Name of the frame. Used with X resources.
|
|
2283 Unchangeable after creation.
|
|
2284
|
|
2285 height Height of the frame, in lines.
|
|
2286
|
|
2287 width Width of the frame, in characters.
|
|
2288
|
|
2289 minibuffer Gives the minibuffer behavior for this frame. Either
|
|
2290 t (frame has its own minibuffer), `only' (frame is
|
442
|
2291 a minibuffer-only frame), `none' (frame has no minibuffer)
|
|
2292 or a window (frame uses that window, which is on another
|
|
2293 frame, as the minibuffer).
|
428
|
2294
|
|
2295 unsplittable If non-nil, frame cannot be split by `display-buffer'.
|
|
2296
|
|
2297 current-display-table, menubar-visible-p, left-margin-width,
|
|
2298 right-margin-width, minimum-line-ascent, minimum-line-descent,
|
|
2299 use-left-overflow, use-right-overflow, scrollbar-width, scrollbar-height,
|
|
2300 default-toolbar, top-toolbar, bottom-toolbar, left-toolbar, right-toolbar,
|
|
2301 default-toolbar-height, default-toolbar-width, top-toolbar-height,
|
|
2302 bottom-toolbar-height, left-toolbar-width, right-toolbar-width,
|
|
2303 default-toolbar-visible-p, top-toolbar-visible-p, bottom-toolbar-visible-p,
|
|
2304 left-toolbar-visible-p, right-toolbar-visible-p, toolbar-buttons-captioned-p,
|
|
2305 top-toolbar-border-width, bottom-toolbar-border-width,
|
|
2306 left-toolbar-border-width, right-toolbar-border-width,
|
442
|
2307 modeline-shadow-thickness, has-modeline-p,
|
|
2308 default-gutter, top-gutter, bottom-gutter, left-gutter, right-gutter,
|
|
2309 default-gutter-height, default-gutter-width, top-gutter-height,
|
|
2310 bottom-gutter-height, left-gutter-width, right-gutter-width,
|
|
2311 default-gutter-visible-p, top-gutter-visible-p, bottom-gutter-visible-p,
|
|
2312 left-gutter-visible-p, right-gutter-visible-p, top-gutter-border-width,
|
|
2313 bottom-gutter-border-width, left-gutter-border-width, right-gutter-border-width,
|
428
|
2314 [Giving the name of any built-in specifier variable is
|
|
2315 equivalent to calling `set-specifier' on the specifier,
|
|
2316 with a locale of FRAME. Giving the name to `frame-property'
|
|
2317 calls `specifier-instance' on the specifier.]
|
|
2318
|
|
2319 text-pointer-glyph, nontext-pointer-glyph, modeline-pointer-glyph,
|
|
2320 selection-pointer-glyph, busy-pointer-glyph, toolbar-pointer-glyph,
|
|
2321 menubar-pointer-glyph, scrollbar-pointer-glyph, gc-pointer-glyph,
|
|
2322 octal-escape-glyph, control-arrow-glyph, invisible-text-glyph,
|
|
2323 hscroll-glyph, truncation-glyph, continuation-glyph
|
|
2324 [Giving the name of any glyph variable is equivalent to
|
|
2325 calling `set-glyph-image' on the glyph, with a locale
|
|
2326 of FRAME. Giving the name to `frame-property' calls
|
|
2327 `glyph-image-instance' on the glyph.]
|
|
2328
|
|
2329 [default foreground], [default background], [default font],
|
|
2330 [modeline foreground], [modeline background], [modeline font],
|
|
2331 etc.
|
|
2332 [Giving a vector of a face and a property is equivalent
|
|
2333 to calling `set-face-property' on the face and property,
|
|
2334 with a locale of FRAME. Giving the vector to
|
|
2335 `frame-property' calls `face-property-instance' on the
|
|
2336 face and property.]
|
|
2337
|
|
2338 Finally, if a frame property symbol has the property `frame-property-alias'
|
|
2339 on it, then the value will be used in place of that symbol when looking
|
|
2340 up and setting frame property values. This allows you to alias one
|
|
2341 frame property name to another.
|
|
2342
|
|
2343 See the variables `default-x-frame-plist', `default-tty-frame-plist'
|
|
2344 and `default-mswindows-frame-plist' for a description of the properties
|
|
2345 recognized for particular types of frames.
|
|
2346 */
|
|
2347 (frame, plist))
|
|
2348 {
|
|
2349 struct frame *f = decode_frame (frame);
|
|
2350 Lisp_Object tail;
|
|
2351 Lisp_Object *tailp;
|
|
2352 struct gcpro gcpro1, gcpro2;
|
|
2353
|
793
|
2354 frame = wrap_frame (f);
|
428
|
2355 GCPRO2 (frame, plist);
|
|
2356 Fcheck_valid_plist (plist);
|
|
2357 plist = Fcopy_sequence (plist);
|
|
2358 Fcanonicalize_lax_plist (plist, Qnil);
|
|
2359 for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
|
|
2360 {
|
|
2361 Lisp_Object prop = Fcar (tail);
|
|
2362 Lisp_Object val = Fcar (Fcdr (tail));
|
|
2363
|
|
2364 prop = get_property_alias (prop);
|
|
2365
|
|
2366 #if 0
|
|
2367 /* mly wants this, but it's not reasonable to change the name of a
|
|
2368 frame after it has been created, because the old name was used
|
|
2369 for resource lookup. */
|
|
2370 if (EQ (prop, Qname))
|
|
2371 {
|
|
2372 CHECK_STRING (val);
|
|
2373 f->name = val;
|
|
2374 }
|
|
2375 #endif /* 0 */
|
|
2376 if (EQ (prop, Qminibuffer))
|
|
2377 store_minibuf_frame_prop (f, val);
|
|
2378 if (EQ (prop, Qunsplittable))
|
|
2379 f->no_split = !NILP (val);
|
|
2380 if (EQ (prop, Qbuffer_predicate))
|
|
2381 f->buffer_predicate = val;
|
|
2382 if (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop),
|
|
2383 Qconst_specifier))
|
|
2384 call3 (Qset_specifier, Fsymbol_value (prop), val, frame);
|
|
2385 if (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable, Qnil)))
|
|
2386 call3 (Qset_glyph_image, Fsymbol_value (prop), val, frame);
|
|
2387 if (VECTORP (prop) && XVECTOR_LENGTH (prop) == 2)
|
|
2388 {
|
|
2389 Lisp_Object face_prop = XVECTOR_DATA (prop)[1];
|
|
2390 CHECK_SYMBOL (face_prop);
|
|
2391 call4 (Qset_face_property,
|
|
2392 Fget_face (XVECTOR_DATA (prop)[0]),
|
|
2393 face_prop, val, frame);
|
|
2394 }
|
|
2395 }
|
|
2396
|
|
2397 MAYBE_FRAMEMETH (f, set_frame_properties, (f, plist));
|
|
2398 for (tailp = &plist; !NILP (*tailp);)
|
|
2399 {
|
|
2400 Lisp_Object *next_tailp;
|
|
2401 Lisp_Object next;
|
|
2402 Lisp_Object prop;
|
|
2403
|
|
2404 next = Fcdr (*tailp);
|
|
2405 CHECK_CONS (next);
|
|
2406 next_tailp = &XCDR (next);
|
|
2407 prop = Fcar (*tailp);
|
|
2408
|
|
2409 prop = get_property_alias (prop);
|
|
2410
|
|
2411 if (EQ (prop, Qminibuffer)
|
|
2412 || EQ (prop, Qunsplittable)
|
|
2413 || EQ (prop, Qbuffer_predicate)
|
|
2414 || EQ (prop, Qheight)
|
|
2415 || EQ (prop, Qwidth)
|
|
2416 || (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop),
|
|
2417 Qconst_specifier))
|
|
2418 || (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable,
|
|
2419 Qnil)))
|
|
2420 || (VECTORP (prop) && XVECTOR_LENGTH (prop) == 2)
|
|
2421 || FRAMEMETH_OR_GIVEN (f, internal_frame_property_p, (f, prop), 0))
|
|
2422 *tailp = *next_tailp;
|
|
2423 tailp = next_tailp;
|
|
2424 }
|
|
2425
|
|
2426 f->plist = nconc2 (plist, f->plist);
|
|
2427 Fcanonicalize_lax_plist (f->plist, Qnil);
|
|
2428 UNGCPRO;
|
|
2429 return Qnil;
|
|
2430 }
|
|
2431
|
|
2432 DEFUN ("frame-property", Fframe_property, 2, 3, 0, /*
|
|
2433 Return FRAME's value for property PROPERTY.
|
444
|
2434 Return DEFAULT if there is no such property.
|
428
|
2435 See `set-frame-properties' for the built-in property names.
|
|
2436 */
|
|
2437 (frame, property, default_))
|
|
2438 {
|
|
2439 struct frame *f = decode_frame (frame);
|
|
2440 Lisp_Object value;
|
|
2441
|
793
|
2442 frame = wrap_frame (f);
|
428
|
2443
|
|
2444 property = get_property_alias (property);
|
|
2445
|
|
2446 if (EQ (Qname, property)) return f->name;
|
|
2447
|
|
2448 if (EQ (Qheight, property) || EQ (Qwidth, property))
|
|
2449 {
|
|
2450 if (window_system_pixelated_geometry (frame))
|
|
2451 {
|
|
2452 int width, height;
|
|
2453 pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
|
|
2454 &width, &height);
|
|
2455 return make_int (EQ (Qheight, property) ? height: width);
|
|
2456 }
|
|
2457 else
|
|
2458 return make_int (EQ (Qheight, property) ?
|
|
2459 FRAME_HEIGHT (f) :
|
|
2460 FRAME_WIDTH (f));
|
|
2461 }
|
|
2462
|
|
2463 /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P.
|
|
2464 This is over-the-top bogosity, because it's inconsistent with
|
|
2465 the semantics of `minibuffer' when passed to `make-frame'.
|
|
2466 Returning Qt makes things consistent. */
|
|
2467 if (EQ (Qminibuffer, property))
|
|
2468 return (FRAME_MINIBUF_ONLY_P (f) ? Qonly :
|
|
2469 FRAME_HAS_MINIBUF_P (f) ? Qt :
|
|
2470 FRAME_MINIBUF_WINDOW (f));
|
|
2471 if (EQ (Qunsplittable, property))
|
|
2472 return FRAME_NO_SPLIT_P (f) ? Qt : Qnil;
|
|
2473 if (EQ (Qbuffer_predicate, property))
|
|
2474 return f->buffer_predicate;
|
|
2475
|
|
2476 if (SYMBOLP (property))
|
|
2477 {
|
|
2478 if (EQ (Fbuilt_in_variable_type (property), Qconst_specifier))
|
|
2479 return Fspecifier_instance (Fsymbol_value (property),
|
|
2480 frame, default_, Qnil);
|
|
2481 if (!NILP (Fget (property, Qconst_glyph_variable, Qnil)))
|
|
2482 {
|
|
2483 Lisp_Object glyph = Fsymbol_value (property);
|
|
2484 CHECK_GLYPH (glyph);
|
|
2485 return Fspecifier_instance (XGLYPH_IMAGE (glyph),
|
|
2486 frame, default_, Qnil);
|
|
2487 }
|
|
2488 }
|
|
2489
|
|
2490 if (VECTORP (property) && XVECTOR_LENGTH (property) == 2)
|
|
2491 {
|
|
2492 Lisp_Object face_prop = XVECTOR_DATA (property)[1];
|
|
2493 CHECK_SYMBOL (face_prop);
|
|
2494 return call3 (Qface_property_instance,
|
|
2495 Fget_face (XVECTOR_DATA (property)[0]),
|
|
2496 face_prop, frame);
|
|
2497 }
|
|
2498
|
|
2499 if (HAS_FRAMEMETH_P (f, frame_property))
|
|
2500 if (!UNBOUNDP (value = FRAMEMETH (f, frame_property, (f, property))))
|
|
2501 return value;
|
|
2502
|
|
2503 if (!UNBOUNDP (value = external_plist_get (&f->plist, property, 1, ERROR_ME)))
|
|
2504 return value;
|
|
2505
|
|
2506 return default_;
|
|
2507 }
|
|
2508
|
|
2509 DEFUN ("frame-properties", Fframe_properties, 0, 1, 0, /*
|
|
2510 Return a property list of the properties of FRAME.
|
|
2511 Do not modify this list; use `set-frame-property' instead.
|
|
2512 */
|
|
2513 (frame))
|
|
2514 {
|
|
2515 struct frame *f = decode_frame (frame);
|
|
2516 Lisp_Object result = Qnil;
|
|
2517 struct gcpro gcpro1;
|
|
2518
|
|
2519 GCPRO1 (result);
|
|
2520
|
793
|
2521 frame = wrap_frame (f);
|
428
|
2522
|
|
2523 /* #### for the moment (since old code uses `frame-parameters'),
|
|
2524 we call `copy-sequence' on f->plist. That allows frame-parameters
|
|
2525 to destructively convert the plist into an alist, which is more
|
|
2526 efficient than doing it non-destructively. At some point we
|
|
2527 should remove the call to copy-sequence. */
|
|
2528 result = Fcopy_sequence (f->plist);
|
|
2529
|
|
2530 /* #### should we be adding all the specifiers and glyphs?
|
|
2531 That would entail having a list of them all. */
|
|
2532 if (HAS_FRAMEMETH_P (f, frame_properties))
|
|
2533 result = nconc2 (FRAMEMETH (f, frame_properties, (f)), result);
|
|
2534
|
|
2535 if (!NILP (f->buffer_predicate))
|
|
2536 result = cons3 (Qbuffer_predicate, f->buffer_predicate, result);
|
|
2537
|
|
2538 if (FRAME_NO_SPLIT_P (f))
|
|
2539 result = cons3 (Qunsplittable, Qt, result);
|
|
2540
|
|
2541 /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P.
|
|
2542 This is over-the-top bogosity, because it's inconsistent with
|
|
2543 the semantics of `minibuffer' when passed to `make-frame'.
|
|
2544 Returning Qt makes things consistent. */
|
|
2545 result = cons3 (Qminibuffer,
|
|
2546 (FRAME_MINIBUF_ONLY_P (f) ? Qonly :
|
|
2547 FRAME_HAS_MINIBUF_P (f) ? Qt :
|
|
2548 FRAME_MINIBUF_WINDOW (f)),
|
|
2549 result);
|
|
2550 {
|
|
2551 int width, height;
|
|
2552
|
|
2553 if (window_system_pixelated_geometry (frame))
|
|
2554 {
|
|
2555 pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
|
|
2556 &width, &height);
|
|
2557 }
|
|
2558 else
|
|
2559 {
|
|
2560 height = FRAME_HEIGHT (f);
|
|
2561 width = FRAME_WIDTH (f);
|
|
2562 }
|
|
2563 result = cons3 (Qwidth , make_int (width), result);
|
|
2564 result = cons3 (Qheight, make_int (height), result);
|
|
2565 }
|
|
2566
|
|
2567 result = cons3 (Qname, f->name, result);
|
|
2568
|
|
2569 UNGCPRO;
|
|
2570 return result;
|
|
2571 }
|
|
2572
|
|
2573
|
|
2574 DEFUN ("frame-pixel-height", Fframe_pixel_height, 0, 1, 0, /*
|
|
2575 Return the height in pixels of FRAME.
|
|
2576 */
|
|
2577 (frame))
|
|
2578 {
|
|
2579 return make_int (decode_frame (frame)->pixheight);
|
|
2580 }
|
|
2581
|
|
2582 DEFUN ("frame-pixel-width", Fframe_pixel_width, 0, 1, 0, /*
|
|
2583 Return the width in pixels of FRAME.
|
|
2584 */
|
|
2585 (frame))
|
|
2586 {
|
|
2587 return make_int (decode_frame (frame)->pixwidth);
|
|
2588 }
|
|
2589
|
|
2590 DEFUN ("frame-name", Fframe_name, 0, 1, 0, /*
|
|
2591 Return the name of FRAME (defaulting to the selected frame).
|
|
2592 This is not the same as the `title' of the frame.
|
|
2593 */
|
|
2594 (frame))
|
|
2595 {
|
|
2596 return decode_frame (frame)->name;
|
|
2597 }
|
|
2598
|
|
2599 DEFUN ("frame-modified-tick", Fframe_modified_tick, 0, 1, 0, /*
|
|
2600 Return FRAME's tick counter, incremented for each change to the frame.
|
|
2601 Each frame has a tick counter which is incremented each time the frame
|
|
2602 is resized, a window is resized, added, or deleted, a face is changed,
|
|
2603 `set-window-buffer' or `select-window' is called on a window in the
|
|
2604 frame, the window-start of a window in the frame has changed, or
|
|
2605 anything else interesting has happened. It wraps around occasionally.
|
|
2606 No argument or nil as argument means use selected frame as FRAME.
|
|
2607 */
|
|
2608 (frame))
|
|
2609 {
|
|
2610 return make_int (decode_frame (frame)->modiff);
|
|
2611 }
|
|
2612
|
|
2613 static void
|
|
2614 internal_set_frame_size (struct frame *f, int cols, int rows, int pretend)
|
|
2615 {
|
|
2616 /* An explicit size change cancels any pending frame size adjustment */
|
|
2617 CLEAR_FRAME_SIZE_SLIPPED(f);
|
|
2618
|
|
2619 if (pretend || !HAS_FRAMEMETH_P (f, set_frame_size))
|
|
2620 change_frame_size (f, rows, cols, 0);
|
|
2621 else
|
|
2622 FRAMEMETH (f, set_frame_size, (f, cols, rows));
|
|
2623 }
|
|
2624
|
|
2625 DEFUN ("set-frame-height", Fset_frame_height, 2, 3, 0, /*
|
|
2626 Specify that the frame FRAME has LINES lines.
|
|
2627 Optional third arg non-nil means that redisplay should use LINES lines
|
|
2628 but that the idea of the actual height of the frame should not be changed.
|
|
2629 */
|
444
|
2630 (frame, lines, pretend))
|
428
|
2631 {
|
|
2632 struct frame *f = decode_frame (frame);
|
|
2633 int height, width;
|
793
|
2634 frame = wrap_frame (f);
|
444
|
2635 CHECK_INT (lines);
|
428
|
2636
|
|
2637 if (window_system_pixelated_geometry (frame))
|
|
2638 {
|
444
|
2639 char_to_real_pixel_size (f, 0, XINT (lines), 0, &height);
|
428
|
2640 width = FRAME_PIXWIDTH (f);
|
|
2641 }
|
|
2642 else
|
|
2643 {
|
444
|
2644 height = XINT (lines);
|
428
|
2645 width = FRAME_WIDTH (f);
|
|
2646 }
|
|
2647
|
|
2648 internal_set_frame_size (f, width, height, !NILP (pretend));
|
|
2649 return frame;
|
|
2650 }
|
|
2651
|
|
2652 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /*
|
|
2653 Specify that the frame FRAME has COLS columns.
|
|
2654 Optional third arg non-nil means that redisplay should use COLS columns
|
|
2655 but that the idea of the actual width of the frame should not be changed.
|
|
2656 */
|
|
2657 (frame, cols, pretend))
|
|
2658 {
|
|
2659 struct frame *f = decode_frame (frame);
|
|
2660 int width, height;
|
793
|
2661 frame = wrap_frame (f);
|
428
|
2662 CHECK_INT (cols);
|
|
2663
|
|
2664 if (window_system_pixelated_geometry (frame))
|
|
2665 {
|
|
2666 char_to_real_pixel_size (f, XINT (cols), 0, &width, 0);
|
|
2667 height = FRAME_PIXHEIGHT (f);
|
|
2668 }
|
|
2669 else
|
|
2670 {
|
|
2671 width = XINT (cols);
|
|
2672 height = FRAME_HEIGHT (f);
|
|
2673 }
|
|
2674
|
|
2675 internal_set_frame_size (f, width, height, !NILP (pretend));
|
|
2676 return frame;
|
|
2677 }
|
|
2678
|
|
2679 DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /*
|
444
|
2680 Set the size of FRAME to COLS by ROWS, measured in characters.
|
428
|
2681 Optional fourth arg non-nil means that redisplay should use COLS by ROWS
|
|
2682 but that the idea of the actual size of the frame should not be changed.
|
|
2683 */
|
|
2684 (frame, cols, rows, pretend))
|
|
2685 {
|
|
2686 struct frame *f = decode_frame (frame);
|
|
2687 int height, width;
|
793
|
2688 frame = wrap_frame (f);
|
428
|
2689 CHECK_INT (cols);
|
|
2690 CHECK_INT (rows);
|
|
2691
|
|
2692 if (window_system_pixelated_geometry (frame))
|
|
2693 char_to_real_pixel_size (f, XINT (cols), XINT (rows), &width, &height);
|
|
2694 else
|
|
2695 {
|
|
2696 height = XINT (rows);
|
|
2697 width = XINT (cols);
|
|
2698 }
|
|
2699
|
|
2700 internal_set_frame_size (f, width, height, !NILP (pretend));
|
|
2701 return frame;
|
|
2702 }
|
|
2703
|
|
2704 DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /*
|
|
2705 Set position of FRAME in pixels to XOFFSET by YOFFSET.
|
|
2706 This is actually the position of the upper left corner of the frame.
|
|
2707 Negative values for XOFFSET or YOFFSET are interpreted relative to
|
|
2708 the rightmost or bottommost possible position (that stays within the screen).
|
|
2709 */
|
|
2710 (frame, xoffset, yoffset))
|
|
2711 {
|
|
2712 struct frame *f = decode_frame (frame);
|
|
2713 CHECK_INT (xoffset);
|
|
2714 CHECK_INT (yoffset);
|
|
2715
|
|
2716 MAYBE_FRAMEMETH (f, set_frame_position, (f, XINT (xoffset), XINT (yoffset)));
|
|
2717
|
|
2718 return Qt;
|
|
2719 }
|
|
2720
|
|
2721
|
|
2722
|
|
2723 /* Frame size conversion functions moved here from EmacsFrame.c
|
|
2724 because they're generic and really don't belong in that file.
|
|
2725 Function get_default_char_pixel_size() removed because it's
|
|
2726 exactly the same as default_face_height_and_width(). */
|
|
2727 static void
|
|
2728 frame_conversion_internal (struct frame *f, int pixel_to_char,
|
|
2729 int *pixel_width, int *pixel_height,
|
|
2730 int *char_width, int *char_height,
|
|
2731 int real_face)
|
|
2732 {
|
|
2733 int cpw;
|
|
2734 int cph;
|
|
2735 int egw;
|
|
2736 int obw, obh, bdr;
|
|
2737 Lisp_Object frame, window;
|
|
2738
|
793
|
2739 frame = wrap_frame (f);
|
428
|
2740 if (real_face)
|
|
2741 default_face_height_and_width (frame, &cph, &cpw);
|
|
2742 else
|
|
2743 default_face_height_and_width_1 (frame, &cph, &cpw);
|
|
2744
|
|
2745 window = FRAME_SELECTED_WINDOW (f);
|
|
2746
|
438
|
2747 egw = max (glyph_width (Vcontinuation_glyph, window),
|
|
2748 glyph_width (Vtruncation_glyph, window));
|
428
|
2749 egw = max (egw, cpw);
|
|
2750 bdr = 2 * f->internal_border_width;
|
|
2751 obw = FRAME_SCROLLBAR_WIDTH (f) + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) +
|
|
2752 FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) +
|
|
2753 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) +
|
|
2754 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
|
|
2755 obh = FRAME_SCROLLBAR_HEIGHT (f) + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f) +
|
|
2756 FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) +
|
|
2757 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) +
|
|
2758 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
|
|
2759
|
|
2760 if (pixel_to_char)
|
|
2761 {
|
|
2762 if (char_width)
|
|
2763 *char_width = 1 + ((*pixel_width - egw) - bdr - obw) / cpw;
|
|
2764 if (char_height)
|
|
2765 *char_height = (*pixel_height - bdr - obh) / cph;
|
|
2766 }
|
|
2767 else
|
|
2768 {
|
|
2769 if (pixel_width)
|
|
2770 *pixel_width = (*char_width - 1) * cpw + egw + bdr + obw;
|
|
2771 if (pixel_height)
|
|
2772 *pixel_height = *char_height * cph + bdr + obh;
|
|
2773 }
|
|
2774 }
|
|
2775
|
|
2776 /* This takes the size in pixels of the text area, and returns the number
|
|
2777 of characters that will fit there, taking into account the internal
|
|
2778 border width, and the pixel width of the line terminator glyphs (which
|
|
2779 always count as one "character" wide, even if they are not the same size
|
|
2780 as the default character size of the default font). The frame scrollbar
|
|
2781 width and left and right toolbar widths are also subtracted out of the
|
|
2782 available width. The frame scrollbar height and top and bottom toolbar
|
|
2783 heights are subtracted out of the available height.
|
|
2784
|
|
2785 Therefore the result is not necessarily a multiple of anything in
|
|
2786 particular. */
|
|
2787 void
|
|
2788 pixel_to_char_size (struct frame *f, int pixel_width, int pixel_height,
|
|
2789 int *char_width, int *char_height)
|
|
2790 {
|
|
2791 frame_conversion_internal (f, 1, &pixel_width, &pixel_height, char_width,
|
|
2792 char_height, 0);
|
|
2793 }
|
|
2794
|
|
2795 /* Given a character size, this returns the minimum number of pixels
|
|
2796 necessary to display that many characters, taking into account the
|
|
2797 internal border width, scrollbar height and width, toolbar heights and
|
|
2798 widths and the size of the line terminator glyphs (assuming the line
|
|
2799 terminators take up exactly one character position).
|
|
2800
|
|
2801 Therefore the result is not necessarily a multiple of anything in
|
|
2802 particular. */
|
|
2803 void
|
|
2804 char_to_pixel_size (struct frame *f, int char_width, int char_height,
|
|
2805 int *pixel_width, int *pixel_height)
|
|
2806 {
|
|
2807 frame_conversion_internal (f, 0, pixel_width, pixel_height, &char_width,
|
|
2808 &char_height, 0);
|
|
2809 }
|
|
2810
|
|
2811 /* Given a pixel size, rounds DOWN to the smallest size in pixels necessary
|
|
2812 to display the same number of characters as are displayable now.
|
|
2813 */
|
|
2814 void
|
|
2815 round_size_to_char (struct frame *f, int in_width, int in_height,
|
|
2816 int *out_width, int *out_height)
|
|
2817 {
|
|
2818 int char_width;
|
|
2819 int char_height;
|
|
2820 pixel_to_char_size (f, in_width, in_height, &char_width, &char_height);
|
|
2821 char_to_pixel_size (f, char_width, char_height, out_width, out_height);
|
|
2822 }
|
|
2823
|
|
2824 /* Versions of the above which always account for real font metrics.
|
|
2825 */
|
|
2826 void
|
|
2827 pixel_to_real_char_size (struct frame *f, int pixel_width, int pixel_height,
|
|
2828 int *char_width, int *char_height)
|
|
2829 {
|
|
2830 frame_conversion_internal (f, 1, &pixel_width, &pixel_height, char_width,
|
|
2831 char_height, 1);
|
|
2832 }
|
|
2833
|
|
2834 void
|
|
2835 char_to_real_pixel_size (struct frame *f, int char_width, int char_height,
|
|
2836 int *pixel_width, int *pixel_height)
|
|
2837 {
|
|
2838 frame_conversion_internal (f, 0, pixel_width, pixel_height, &char_width,
|
|
2839 &char_height, 1);
|
|
2840 }
|
|
2841
|
|
2842 void
|
|
2843 round_size_to_real_char (struct frame *f, int in_width, int in_height,
|
|
2844 int *out_width, int *out_height)
|
|
2845 {
|
|
2846 int char_width;
|
|
2847 int char_height;
|
|
2848 pixel_to_real_char_size (f, in_width, in_height, &char_width, &char_height);
|
|
2849 char_to_real_pixel_size (f, char_width, char_height, out_width, out_height);
|
|
2850 }
|
|
2851
|
|
2852 /* Change the frame height and/or width. Values may be given as zero to
|
|
2853 indicate no change is to take place. */
|
|
2854 static void
|
|
2855 change_frame_size_1 (struct frame *f, int newheight, int newwidth)
|
|
2856 {
|
|
2857 Lisp_Object frame;
|
|
2858 int new_pixheight, new_pixwidth;
|
|
2859 int font_height, real_font_height, font_width;
|
|
2860
|
|
2861 /* #### Chuck -- shouldn't we be checking to see if the frame
|
|
2862 is being "changed" to its existing size, and do nothing if so? */
|
|
2863 /* No, because it would hose toolbar updates. The toolbar
|
|
2864 update code relies on this function to cause window `top' and
|
|
2865 `left' coordinates to be recomputed even though no frame size
|
|
2866 change occurs. --kyle */
|
|
2867 if (in_display)
|
|
2868 abort ();
|
|
2869
|
793
|
2870 frame = wrap_frame (f);
|
428
|
2871
|
|
2872 default_face_height_and_width (frame, &real_font_height, 0);
|
|
2873 default_face_height_and_width_1 (frame, &font_height, &font_width);
|
|
2874
|
|
2875 /* This size-change overrides any pending one for this frame. */
|
|
2876 FRAME_NEW_HEIGHT (f) = 0;
|
|
2877 FRAME_NEW_WIDTH (f) = 0;
|
|
2878
|
|
2879 new_pixheight = newheight * font_height;
|
|
2880 new_pixwidth = (newwidth - 1) * font_width;
|
|
2881
|
|
2882 /* #### dependency on FRAME_WIN_P should be removed. */
|
|
2883 if (FRAME_WIN_P (f))
|
|
2884 {
|
|
2885 new_pixheight += FRAME_SCROLLBAR_HEIGHT (f);
|
|
2886 new_pixwidth += FRAME_SCROLLBAR_WIDTH (f);
|
|
2887 }
|
|
2888
|
|
2889 /* when frame_conversion_internal() calculated the number of rows/cols
|
|
2890 in the frame, the theoretical toolbar sizes were subtracted out.
|
|
2891 The calculations below adjust for real toolbar height/width in
|
|
2892 frame, which may be different from frame spec, taking the above
|
|
2893 fact into account */
|
|
2894 new_pixheight +=
|
|
2895 + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f)
|
|
2896 + 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f)
|
|
2897 - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f)
|
|
2898 - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f);
|
|
2899
|
|
2900 new_pixheight +=
|
|
2901 + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f)
|
|
2902 + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)
|
|
2903 - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f)
|
|
2904 - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
|
|
2905
|
|
2906 new_pixwidth +=
|
|
2907 + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f)
|
|
2908 + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f)
|
|
2909 - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f)
|
|
2910 - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f);
|
|
2911
|
|
2912 new_pixwidth +=
|
|
2913 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f)
|
|
2914 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)
|
|
2915 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f)
|
|
2916 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
|
|
2917
|
|
2918 /* Adjust the width for the end glyph which may be a different width
|
|
2919 than the default character width. */
|
|
2920 {
|
|
2921 int adjustment, trunc_width, cont_width;
|
|
2922
|
440
|
2923 trunc_width = glyph_width (Vtruncation_glyph,
|
428
|
2924 FRAME_SELECTED_WINDOW (f));
|
440
|
2925 cont_width = glyph_width (Vcontinuation_glyph,
|
428
|
2926 FRAME_SELECTED_WINDOW (f));
|
|
2927 adjustment = max (trunc_width, cont_width);
|
|
2928 adjustment = max (adjustment, font_width);
|
|
2929
|
|
2930 new_pixwidth += adjustment;
|
|
2931 }
|
|
2932
|
|
2933 /* If we don't have valid values, exit. */
|
|
2934 if (!new_pixheight && !new_pixwidth)
|
|
2935 return;
|
|
2936
|
|
2937 if (new_pixheight)
|
|
2938 {
|
442
|
2939 /* Adjust for gutters here so that we always get set
|
|
2940 properly. */
|
|
2941 new_pixheight -=
|
|
2942 (FRAME_TOP_GUTTER_BOUNDS (f)
|
|
2943 + FRAME_BOTTOM_GUTTER_BOUNDS (f));
|
|
2944
|
|
2945 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top
|
|
2946 = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f);
|
428
|
2947
|
|
2948 if (FRAME_HAS_MINIBUF_P (f)
|
|
2949 && ! FRAME_MINIBUF_ONLY_P (f))
|
|
2950 /* Frame has both root and minibuffer. */
|
|
2951 {
|
|
2952 /*
|
|
2953 * Leave the minibuffer height the same if the frame has
|
|
2954 * been initialized, and the minibuffer height is tall
|
|
2955 * enough to display at least one line of text in the default
|
|
2956 * font, and the old minibuffer height is a multiple of the
|
|
2957 * default font height. This should cause the minibuffer
|
|
2958 * height to be recomputed on font changes but not for
|
|
2959 * other frame size changes, which seems reasonable.
|
|
2960 */
|
|
2961 int old_minibuf_height =
|
|
2962 XWINDOW(FRAME_MINIBUF_WINDOW(f))->pixel_height;
|
|
2963 int minibuf_height =
|
|
2964 f->init_finished && (old_minibuf_height % real_font_height) == 0 ?
|
|
2965 max(old_minibuf_height, real_font_height) :
|
|
2966 real_font_height;
|
|
2967 set_window_pixheight (FRAME_ROOT_WINDOW (f),
|
|
2968 /* - font_height for minibuffer */
|
|
2969 new_pixheight - minibuf_height, 0);
|
|
2970
|
|
2971 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top =
|
442
|
2972 FRAME_TOP_BORDER_END (f) +
|
|
2973 FRAME_TOP_GUTTER_BOUNDS (f) +
|
|
2974 FRAME_BOTTOM_GUTTER_BOUNDS (f) +
|
|
2975 new_pixheight - minibuf_height;
|
428
|
2976
|
|
2977 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0);
|
|
2978 }
|
|
2979 else
|
|
2980 /* Frame has just one top-level window. */
|
|
2981 set_window_pixheight (FRAME_ROOT_WINDOW (f), new_pixheight, 0);
|
|
2982
|
|
2983 FRAME_HEIGHT (f) = newheight;
|
|
2984 if (FRAME_TTY_P (f))
|
|
2985 f->pixheight = newheight;
|
|
2986 }
|
|
2987
|
|
2988 if (new_pixwidth)
|
|
2989 {
|
442
|
2990 /* Adjust for gutters here so that we always get set
|
|
2991 properly. */
|
|
2992 new_pixwidth -=
|
|
2993 (FRAME_LEFT_GUTTER_BOUNDS (f)
|
|
2994 + FRAME_RIGHT_GUTTER_BOUNDS (f));
|
|
2995
|
|
2996 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left =
|
|
2997 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f);
|
428
|
2998 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0);
|
|
2999
|
|
3000 if (FRAME_HAS_MINIBUF_P (f))
|
|
3001 {
|
|
3002 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left =
|
442
|
3003 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f);
|
428
|
3004 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0);
|
|
3005 }
|
|
3006
|
|
3007 FRAME_WIDTH (f) = newwidth;
|
|
3008 if (FRAME_TTY_P (f))
|
|
3009 f->pixwidth = newwidth;
|
|
3010 }
|
|
3011
|
|
3012 if (window_system_pixelated_geometry (frame))
|
|
3013 pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
|
|
3014 &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f));
|
|
3015 else
|
|
3016 {
|
|
3017 FRAME_CHARWIDTH (f) = FRAME_WIDTH (f);
|
|
3018 FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f);
|
|
3019 }
|
|
3020
|
|
3021 MARK_FRAME_TOOLBARS_CHANGED (f);
|
442
|
3022 MARK_FRAME_GUTTERS_CHANGED (f);
|
428
|
3023 MARK_FRAME_CHANGED (f);
|
|
3024 f->echo_area_garbaged = 1;
|
|
3025 }
|
|
3026
|
|
3027 void
|
|
3028 change_frame_size (struct frame *f, int newheight, int newwidth, int delay)
|
|
3029 {
|
|
3030 /* sometimes we get passed a size that's too small (esp. when a
|
|
3031 client widget gets resized, since we have no control over this).
|
|
3032 So deal. */
|
|
3033 check_frame_size (f, &newheight, &newwidth);
|
|
3034
|
450
|
3035 /* Unconditionally mark that the frame has changed size. This is
|
|
3036 because many things need to know after the
|
|
3037 fact. f->size_change_pending will get reset below. The most that
|
|
3038 can happen is that we will cycle through redisplay once more
|
|
3039 --andy. */
|
|
3040 MARK_FRAME_SIZE_CHANGED (f);
|
|
3041
|
428
|
3042 if (delay || in_display || gc_in_progress)
|
|
3043 {
|
|
3044 f->new_width = newwidth;
|
|
3045 f->new_height = newheight;
|
|
3046 return;
|
|
3047 }
|
|
3048
|
|
3049 f->size_change_pending = 0;
|
|
3050 /* For TTY frames, it's like one, like all ...
|
|
3051 Can't have two TTY frames of different sizes on the same device. */
|
|
3052 if (FRAME_TTY_P (f))
|
|
3053 {
|
|
3054 Lisp_Object frmcons;
|
|
3055
|
|
3056 DEVICE_FRAME_LOOP (frmcons, XDEVICE (FRAME_DEVICE (f)))
|
|
3057 change_frame_size_1 (XFRAME (XCAR (frmcons)), newheight, newwidth);
|
|
3058 }
|
|
3059 else
|
|
3060 change_frame_size_1 (f, newheight, newwidth);
|
|
3061 }
|
|
3062
|
|
3063
|
438
|
3064 /* The caller is responsible for freeing the returned string. */
|
665
|
3065 static Intbyte *
|
438
|
3066 generate_title_string (struct window *w, Lisp_Object format_str,
|
|
3067 face_index findex, int type)
|
|
3068 {
|
|
3069 struct display_line *dl;
|
|
3070 struct display_block *db;
|
|
3071 int elt = 0;
|
|
3072
|
|
3073 dl = &title_string_display_line;
|
|
3074 db = get_display_block_from_line (dl, TEXT);
|
|
3075 Dynarr_reset (db->runes);
|
|
3076
|
|
3077 generate_formatted_string_db (format_str, Qnil, w, dl, db, findex, 0,
|
|
3078 -1, type);
|
|
3079
|
|
3080 Dynarr_reset (title_string_emchar_dynarr);
|
|
3081 while (elt < Dynarr_length (db->runes))
|
|
3082 {
|
|
3083 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR)
|
|
3084 Dynarr_add (title_string_emchar_dynarr,
|
|
3085 Dynarr_atp (db->runes, elt)->object.chr.ch);
|
|
3086 elt++;
|
|
3087 }
|
|
3088
|
|
3089 return
|
|
3090 convert_emchar_string_into_malloced_string
|
|
3091 (Dynarr_atp (title_string_emchar_dynarr, 0),
|
|
3092 Dynarr_length (title_string_emchar_dynarr), 0);
|
|
3093 }
|
|
3094
|
428
|
3095 void
|
|
3096 update_frame_title (struct frame *f)
|
|
3097 {
|
|
3098 struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
|
|
3099 Lisp_Object title_format;
|
|
3100 Lisp_Object icon_format;
|
665
|
3101 Intbyte *title;
|
428
|
3102
|
|
3103 /* We don't change the title for the minibuffer unless the frame
|
|
3104 only has a minibuffer. */
|
|
3105 if (MINI_WINDOW_P (w) && !FRAME_MINIBUF_ONLY_P (f))
|
|
3106 return;
|
|
3107
|
|
3108 /* And we don't want dead buffers to blow up on us. */
|
|
3109 if (!BUFFER_LIVE_P (XBUFFER (w->buffer)))
|
|
3110 return;
|
|
3111
|
|
3112 title = NULL;
|
|
3113 title_format = symbol_value_in_buffer (Qframe_title_format, w->buffer);
|
|
3114 icon_format = symbol_value_in_buffer (Qframe_icon_title_format, w->buffer);
|
|
3115
|
665
|
3116 if (HAS_FRAMEMETH_P (f, set_title_from_intbyte))
|
428
|
3117 {
|
438
|
3118 title = generate_title_string (w, title_format,
|
|
3119 DEFAULT_INDEX, CURRENT_DISP);
|
665
|
3120 FRAMEMETH (f, set_title_from_intbyte, (f, title));
|
428
|
3121 }
|
|
3122
|
665
|
3123 if (HAS_FRAMEMETH_P (f, set_icon_name_from_intbyte))
|
428
|
3124 {
|
|
3125 if (!EQ (icon_format, title_format) || !title)
|
|
3126 {
|
|
3127 if (title)
|
|
3128 xfree (title);
|
|
3129
|
438
|
3130 title = generate_title_string (w, icon_format,
|
|
3131 DEFAULT_INDEX, CURRENT_DISP);
|
428
|
3132 }
|
665
|
3133 FRAMEMETH (f, set_icon_name_from_intbyte, (f, title));
|
428
|
3134 }
|
|
3135
|
|
3136 if (title)
|
|
3137 xfree (title);
|
|
3138 }
|
|
3139
|
|
3140
|
|
3141 DEFUN ("set-frame-pointer", Fset_frame_pointer, 2, 2, 0, /*
|
|
3142 Set the mouse pointer of FRAME to the given pointer image instance.
|
|
3143 You should not call this function directly. Instead, set one of
|
|
3144 the variables `text-pointer-glyph', `nontext-pointer-glyph',
|
|
3145 `modeline-pointer-glyph', `selection-pointer-glyph',
|
|
3146 `busy-pointer-glyph', or `toolbar-pointer-glyph'.
|
|
3147 */
|
|
3148 (frame, image_instance))
|
|
3149 {
|
|
3150 struct frame *f = decode_frame (frame);
|
|
3151 CHECK_POINTER_IMAGE_INSTANCE (image_instance);
|
|
3152 if (!EQ (f->pointer, image_instance))
|
|
3153 {
|
|
3154 f->pointer = image_instance;
|
|
3155 MAYBE_FRAMEMETH (f, set_frame_pointer, (f));
|
|
3156 }
|
|
3157 return Qnil;
|
|
3158 }
|
|
3159
|
|
3160
|
|
3161 void
|
|
3162 update_frame_icon (struct frame *f)
|
|
3163 {
|
|
3164 if (f->icon_changed || f->windows_changed)
|
|
3165 {
|
|
3166 Lisp_Object frame;
|
|
3167 Lisp_Object new_icon;
|
|
3168
|
793
|
3169 frame = wrap_frame (f);
|
428
|
3170 new_icon = glyph_image_instance (Vframe_icon_glyph, frame,
|
|
3171 ERROR_ME_WARN, 0);
|
|
3172 if (!EQ (new_icon, f->icon))
|
|
3173 {
|
|
3174 f->icon = new_icon;
|
|
3175 MAYBE_FRAMEMETH (f, set_frame_icon, (f));
|
|
3176 }
|
|
3177 }
|
|
3178
|
|
3179 f->icon_changed = 0;
|
|
3180 }
|
|
3181
|
|
3182 static void
|
|
3183 icon_glyph_changed (Lisp_Object glyph, Lisp_Object property,
|
|
3184 Lisp_Object locale)
|
|
3185 {
|
|
3186 MARK_ICON_CHANGED;
|
|
3187 }
|
|
3188
|
|
3189
|
438
|
3190 /***************************************************************************/
|
|
3191 /* */
|
|
3192 /* initialization */
|
|
3193 /* */
|
|
3194 /***************************************************************************/
|
|
3195
|
|
3196 void
|
|
3197 init_frame (void)
|
|
3198 {
|
|
3199 #ifndef PDUMP
|
|
3200 if (!initialized)
|
|
3201 #endif
|
|
3202 {
|
|
3203 title_string_emchar_dynarr = Dynarr_new (Emchar);
|
|
3204 xzero (title_string_display_line);
|
|
3205 }
|
|
3206 }
|
|
3207
|
428
|
3208 void
|
|
3209 syms_of_frame (void)
|
|
3210 {
|
442
|
3211 INIT_LRECORD_IMPLEMENTATION (frame);
|
|
3212
|
563
|
3213 DEFSYMBOL (Qdelete_frame_hook);
|
|
3214 DEFSYMBOL (Qselect_frame_hook);
|
|
3215 DEFSYMBOL (Qdeselect_frame_hook);
|
|
3216 DEFSYMBOL (Qcreate_frame_hook);
|
|
3217 DEFSYMBOL (Qcustom_initialize_frame);
|
|
3218 DEFSYMBOL (Qmouse_enter_frame_hook);
|
|
3219 DEFSYMBOL (Qmouse_leave_frame_hook);
|
|
3220 DEFSYMBOL (Qmap_frame_hook);
|
|
3221 DEFSYMBOL (Qunmap_frame_hook);
|
|
3222
|
|
3223 DEFSYMBOL (Qframep);
|
|
3224 DEFSYMBOL (Qframe_live_p);
|
|
3225 DEFSYMBOL (Qdelete_frame);
|
|
3226 DEFSYMBOL (Qsynchronize_minibuffers);
|
|
3227 DEFSYMBOL (Qbuffer_predicate);
|
|
3228 DEFSYMBOL (Qframe_being_created);
|
|
3229 DEFSYMBOL (Qmake_initial_minibuffer_frame);
|
|
3230
|
|
3231 DEFSYMBOL (Qframe_title_format);
|
|
3232 DEFSYMBOL (Qframe_icon_title_format);
|
|
3233
|
|
3234 DEFSYMBOL (Qhidden);
|
|
3235 DEFSYMBOL (Qvisible);
|
|
3236 DEFSYMBOL (Qiconic);
|
|
3237 DEFSYMBOL (Qinvisible);
|
|
3238 DEFSYMBOL (Qvisible_iconic);
|
|
3239 DEFSYMBOL (Qinvisible_iconic);
|
|
3240 DEFSYMBOL (Qnomini);
|
|
3241 DEFSYMBOL (Qvisible_nomini);
|
|
3242 DEFSYMBOL (Qiconic_nomini);
|
|
3243 DEFSYMBOL (Qinvisible_nomini);
|
|
3244 DEFSYMBOL (Qvisible_iconic_nomini);
|
|
3245 DEFSYMBOL (Qinvisible_iconic_nomini);
|
|
3246
|
|
3247 DEFSYMBOL (Qminibuffer);
|
|
3248 DEFSYMBOL (Qunsplittable);
|
|
3249 DEFSYMBOL (Qinternal_border_width);
|
|
3250 DEFSYMBOL (Qtop_toolbar_shadow_color);
|
|
3251 DEFSYMBOL (Qbottom_toolbar_shadow_color);
|
|
3252 DEFSYMBOL (Qbackground_toolbar_color);
|
|
3253 DEFSYMBOL (Qtop_toolbar_shadow_pixmap);
|
|
3254 DEFSYMBOL (Qbottom_toolbar_shadow_pixmap);
|
|
3255 DEFSYMBOL (Qtoolbar_shadow_thickness);
|
|
3256 DEFSYMBOL (Qscrollbar_placement);
|
|
3257 DEFSYMBOL (Qinter_line_space);
|
428
|
3258 /* Qiconic already in this function. */
|
563
|
3259 DEFSYMBOL (Qvisual_bell);
|
|
3260 DEFSYMBOL (Qbell_volume);
|
|
3261 DEFSYMBOL (Qpointer_background);
|
|
3262 DEFSYMBOL (Qpointer_color);
|
|
3263 DEFSYMBOL (Qtext_pointer);
|
|
3264 DEFSYMBOL (Qspace_pointer);
|
|
3265 DEFSYMBOL (Qmodeline_pointer);
|
|
3266 DEFSYMBOL (Qgc_pointer);
|
|
3267 DEFSYMBOL (Qinitially_unmapped);
|
|
3268 DEFSYMBOL (Quse_backing_store);
|
|
3269 DEFSYMBOL (Qborder_color);
|
|
3270 DEFSYMBOL (Qborder_width);
|
428
|
3271 /* Qwidth, Qheight, Qleft, Qtop in general.c */
|
563
|
3272 DEFSYMBOL (Qset_specifier);
|
|
3273 DEFSYMBOL (Qset_face_property);
|
|
3274 DEFSYMBOL (Qface_property_instance);
|
|
3275 DEFSYMBOL (Qframe_property_alias);
|
428
|
3276
|
|
3277 DEFSUBR (Fmake_frame);
|
|
3278 DEFSUBR (Fframep);
|
|
3279 DEFSUBR (Fframe_live_p);
|
|
3280 #if 0 /* FSFmacs */
|
|
3281 DEFSUBR (Fignore_event);
|
|
3282 #endif
|
|
3283 DEFSUBR (Ffocus_frame);
|
|
3284 DEFSUBR (Fselect_frame);
|
|
3285 DEFSUBR (Fselected_frame);
|
|
3286 DEFSUBR (Factive_minibuffer_window);
|
|
3287 DEFSUBR (Flast_nonminibuf_frame);
|
|
3288 DEFSUBR (Fframe_root_window);
|
|
3289 DEFSUBR (Fframe_selected_window);
|
|
3290 DEFSUBR (Fset_frame_selected_window);
|
|
3291 DEFSUBR (Fframe_device);
|
|
3292 DEFSUBR (Fnext_frame);
|
|
3293 DEFSUBR (Fprevious_frame);
|
|
3294 DEFSUBR (Fdelete_frame);
|
|
3295 DEFSUBR (Fmouse_position);
|
|
3296 DEFSUBR (Fmouse_pixel_position);
|
|
3297 DEFSUBR (Fmouse_position_as_motion_event);
|
|
3298 DEFSUBR (Fset_mouse_position);
|
|
3299 DEFSUBR (Fset_mouse_pixel_position);
|
|
3300 DEFSUBR (Fmake_frame_visible);
|
|
3301 DEFSUBR (Fmake_frame_invisible);
|
|
3302 DEFSUBR (Ficonify_frame);
|
|
3303 DEFSUBR (Fdeiconify_frame);
|
|
3304 DEFSUBR (Fframe_visible_p);
|
|
3305 DEFSUBR (Fframe_totally_visible_p);
|
|
3306 DEFSUBR (Fframe_iconified_p);
|
|
3307 DEFSUBR (Fvisible_frame_list);
|
|
3308 DEFSUBR (Fraise_frame);
|
|
3309 DEFSUBR (Flower_frame);
|
442
|
3310 DEFSUBR (Fdisable_frame);
|
|
3311 DEFSUBR (Fenable_frame);
|
428
|
3312 DEFSUBR (Fframe_property);
|
|
3313 DEFSUBR (Fframe_properties);
|
|
3314 DEFSUBR (Fset_frame_properties);
|
|
3315 DEFSUBR (Fframe_pixel_height);
|
|
3316 DEFSUBR (Fframe_pixel_width);
|
|
3317 DEFSUBR (Fframe_name);
|
|
3318 DEFSUBR (Fframe_modified_tick);
|
|
3319 DEFSUBR (Fset_frame_height);
|
|
3320 DEFSUBR (Fset_frame_width);
|
|
3321 DEFSUBR (Fset_frame_size);
|
|
3322 DEFSUBR (Fset_frame_position);
|
|
3323 DEFSUBR (Fset_frame_pointer);
|
442
|
3324 DEFSUBR (Fprint_job_page_number);
|
|
3325 DEFSUBR (Fprint_job_eject_page);
|
428
|
3326 }
|
|
3327
|
|
3328 void
|
|
3329 vars_of_frame (void)
|
|
3330 {
|
|
3331 /* */
|
|
3332 Vframe_being_created = Qnil;
|
|
3333 staticpro (&Vframe_being_created);
|
|
3334
|
|
3335 #ifdef HAVE_CDE
|
|
3336 Fprovide (intern ("cde"));
|
|
3337 #endif
|
|
3338
|
|
3339 #ifdef HAVE_OFFIX_DND
|
|
3340 Fprovide (intern ("offix"));
|
|
3341 #endif
|
|
3342
|
|
3343 #if 0 /* FSFmacs stupidity */
|
|
3344 xxDEFVAR_LISP ("emacs-iconified", &Vemacs_iconified /*
|
|
3345 Non-nil if all of emacs is iconified and frame updates are not needed.
|
|
3346 */ );
|
|
3347 Vemacs_iconified = Qnil;
|
|
3348 #endif
|
|
3349
|
|
3350 DEFVAR_LISP ("select-frame-hook", &Vselect_frame_hook /*
|
|
3351 Function or functions to run just after a new frame is given the focus.
|
|
3352 Note that calling `select-frame' does not necessarily set the focus:
|
|
3353 The actual window-system focus will not be changed until the next time
|
|
3354 that XEmacs is waiting for an event, and even then, the window manager
|
|
3355 may refuse the focus-change request.
|
|
3356 */ );
|
|
3357 Vselect_frame_hook = Qnil;
|
|
3358
|
|
3359 DEFVAR_LISP ("deselect-frame-hook", &Vdeselect_frame_hook /*
|
|
3360 Function or functions to run just before a frame loses the focus.
|
|
3361 See `select-frame-hook'.
|
|
3362 */ );
|
|
3363 Vdeselect_frame_hook = Qnil;
|
|
3364
|
|
3365 DEFVAR_LISP ("delete-frame-hook", &Vdelete_frame_hook /*
|
|
3366 Function or functions to call when a frame is deleted.
|
|
3367 One argument, the about-to-be-deleted frame.
|
|
3368 */ );
|
|
3369 Vdelete_frame_hook = Qnil;
|
|
3370
|
|
3371 DEFVAR_LISP ("create-frame-hook", &Vcreate_frame_hook /*
|
|
3372 Function or functions to call when a frame is created.
|
|
3373 One argument, the newly-created frame.
|
|
3374 */ );
|
|
3375 Vcreate_frame_hook = Qnil;
|
|
3376
|
|
3377 DEFVAR_LISP ("mouse-enter-frame-hook", &Vmouse_enter_frame_hook /*
|
|
3378 Function or functions to call when the mouse enters a frame.
|
|
3379 One argument, the frame.
|
|
3380 Be careful not to make assumptions about the window manager's focus model.
|
|
3381 In most cases, the `deselect-frame-hook' is more appropriate.
|
|
3382 */ );
|
|
3383 Vmouse_enter_frame_hook = Qnil;
|
|
3384
|
|
3385 DEFVAR_LISP ("mouse-leave-frame-hook", &Vmouse_leave_frame_hook /*
|
|
3386 Function or functions to call when the mouse leaves a frame.
|
|
3387 One argument, the frame.
|
|
3388 Be careful not to make assumptions about the window manager's focus model.
|
|
3389 In most cases, the `select-frame-hook' is more appropriate.
|
|
3390 */ );
|
|
3391 Vmouse_leave_frame_hook = Qnil;
|
|
3392
|
|
3393 DEFVAR_LISP ("map-frame-hook", &Vmap_frame_hook /*
|
|
3394 Function or functions to call when a frame is mapped.
|
|
3395 One argument, the frame.
|
|
3396 */ );
|
|
3397 Vmap_frame_hook = Qnil;
|
|
3398
|
|
3399 DEFVAR_LISP ("unmap-frame-hook", &Vunmap_frame_hook /*
|
|
3400 Function or functions to call when a frame is unmapped.
|
|
3401 One argument, the frame.
|
|
3402 */ );
|
|
3403 Vunmap_frame_hook = Qnil;
|
|
3404
|
|
3405 DEFVAR_BOOL ("allow-deletion-of-last-visible-frame",
|
|
3406 &allow_deletion_of_last_visible_frame /*
|
|
3407 *Non-nil means to assume the force option to delete-frame.
|
|
3408 */ );
|
|
3409 allow_deletion_of_last_visible_frame = 0;
|
|
3410
|
|
3411 DEFVAR_LISP ("adjust-frame-function", &Vadjust_frame_function /*
|
|
3412 Function or constant controlling adjustment of frame.
|
|
3413 When scrollbars, toolbars, default font etc. change in frame, the frame
|
|
3414 needs to be adjusted. The adjustment is controlled by this variable.
|
|
3415 Legal values are:
|
|
3416 nil to keep character frame size unchanged when possible (resize)
|
|
3417 t to keep pixel size unchanged (never resize)
|
|
3418 function symbol or lambda form. This function must return boolean
|
|
3419 value which is treated as above. Function is passed one parameter,
|
|
3420 the frame being adjusted. It function should not modify or delete
|
|
3421 the frame.
|
|
3422 */ );
|
|
3423 Vadjust_frame_function = Qnil;
|
|
3424
|
|
3425 DEFVAR_LISP ("mouse-motion-handler", &Vmouse_motion_handler /*
|
|
3426 Handler for motion events. One arg, the event.
|
|
3427 For most applications, you should use `mode-motion-hook' instead of this.
|
|
3428 */ );
|
|
3429 Vmouse_motion_handler = Qnil;
|
|
3430
|
|
3431 DEFVAR_LISP ("synchronize-minibuffers",&Vsynchronize_minibuffers /*
|
|
3432 Set to t if all minibuffer windows are to be synchronized.
|
|
3433 This will cause echo area messages to appear in the minibuffers of all
|
|
3434 visible frames.
|
|
3435 */ );
|
|
3436 Vsynchronize_minibuffers = Qnil;
|
|
3437
|
|
3438 DEFVAR_LISP ("frame-title-format", &Vframe_title_format /*
|
442
|
3439 Controls the title of the window-system window of the selected frame.
|
428
|
3440 This is the same format as `modeline-format' with the exception that
|
|
3441 %- is ignored.
|
|
3442 */ );
|
442
|
3443 /* #### I would change this unilaterally but for the wrath of the Kyles
|
|
3444 of the world. */
|
|
3445 #ifdef WIN32_NATIVE
|
|
3446 Vframe_title_format = build_string ("%b - XEmacs");
|
|
3447 #else
|
428
|
3448 Vframe_title_format = build_string ("%S: %b");
|
442
|
3449 #endif
|
428
|
3450
|
|
3451 DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /*
|
|
3452 Controls the title of the icon corresponding to the selected frame.
|
|
3453 See also the variable `frame-title-format'.
|
|
3454 */ );
|
|
3455 Vframe_icon_title_format = build_string ("%b");
|
|
3456
|
|
3457 DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /*
|
|
3458 The default name to assign to newly-created frames.
|
442
|
3459 This can be overridden by arguments to `make-frame'. This must be a string.
|
|
3460 This is used primarily for picking up X resources, and is *not* the title
|
|
3461 of the frame. (See `frame-title-format'.)
|
428
|
3462 */ );
|
|
3463 #ifndef INFODOCK
|
|
3464 Vdefault_frame_name = build_string ("emacs");
|
|
3465 #else
|
|
3466 Vdefault_frame_name = build_string ("InfoDock");
|
|
3467 #endif
|
|
3468
|
|
3469 DEFVAR_LISP ("default-frame-plist", &Vdefault_frame_plist /*
|
|
3470 Plist of default values for frame creation, other than the first one.
|
|
3471 These may be set in your init file, like this:
|
|
3472
|
|
3473 \(setq default-frame-plist '(width 80 height 55))
|
|
3474
|
|
3475 The properties may be in alist format for backward compatibility
|
|
3476 but you should not rely on this behavior.
|
|
3477
|
|
3478 These override values given in window system configuration data,
|
|
3479 including X Windows' defaults database.
|
|
3480
|
|
3481 Since the first X frame is created before loading your .emacs file,
|
|
3482 you must use the X resource database for that.
|
|
3483
|
|
3484 For values specific to the first Emacs frame, see `initial-frame-plist'.
|
|
3485 For values specific to the separate minibuffer frame, see
|
|
3486 `minibuffer-frame-plist'.
|
|
3487
|
|
3488 See also the variables `default-x-frame-plist' and
|
|
3489 `default-tty-frame-plist', which are like `default-frame-plist'
|
|
3490 except that they apply only to X or tty frames, respectively
|
|
3491 \(whereas `default-frame-plist' applies to all types of frames).
|
|
3492 */ );
|
|
3493 Vdefault_frame_plist = Qnil;
|
|
3494
|
|
3495 DEFVAR_LISP ("frame-icon-glyph", &Vframe_icon_glyph /*
|
|
3496 Icon glyph used to iconify a frame.
|
|
3497 */ );
|
|
3498 }
|
|
3499
|
|
3500 void
|
|
3501 complex_vars_of_frame (void)
|
|
3502 {
|
|
3503 Vframe_icon_glyph = allocate_glyph (GLYPH_ICON, icon_glyph_changed);
|
|
3504 }
|