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