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