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