Mercurial > emacs
annotate src/frame.c @ 1057:d9775f33488d
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 31 Aug 1992 05:54:58 +0000 |
parents | a13ee72d74a2 |
children | a43d53261506 |
rev | line source |
---|---|
765 | 1 /* Generic frame functions. |
708 | 2 Copyright (C) 1989, 1992 Free Software Foundation. |
286 | 3 |
4 This file is part of GNU Emacs. | |
5 | |
6 GNU Emacs is free software; you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
708 | 8 the Free Software Foundation; either version 2, or (at your option) |
286 | 9 any later version. |
10 | |
11 GNU Emacs is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GNU Emacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | |
363 | 20 #include <stdio.h> |
21 | |
286 | 22 #include "config.h" |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
23 #include "lisp.h" |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
24 #include "frame.h" |
732 | 25 |
765 | 26 #ifdef MULTI_FRAME |
732 | 27 |
286 | 28 #include "window.h" |
363 | 29 #include "termhooks.h" |
286 | 30 |
31 Lisp_Object Vemacs_iconified; | |
765 | 32 Lisp_Object Vframe_list; |
33 Lisp_Object Vterminal_frame; | |
34 Lisp_Object Vdefault_minibuffer_frame; | |
35 Lisp_Object Vdefault_frame_alist; | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
36 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
37 /* Evaluate this expression to rebuild the section of syms_of_frame |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
38 that initializes and staticpros the symbols declared below. Note |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
39 that Emacs 18 has a bug that keeps C-x C-e from being able to |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
40 evaluate this expression. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
41 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
42 (progn |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
43 ;; Accumulate a list of the symbols we want to initialize from the |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
44 ;; declarations at the top of the file. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
45 (goto-char (point-min)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
46 (search-forward "/\*&&& symbols declared here &&&*\/\n") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
47 (let (symbol-list) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
48 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
49 (setq symbol-list |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
50 (cons (buffer-substring (match-beginning 1) (match-end 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
51 symbol-list)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
52 (forward-line 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
53 (setq symbol-list (nreverse symbol-list)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
54 ;; Delete the section of syms_of_... where we initialize the symbols. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
55 (search-forward "\n /\*&&& init symbols here &&&*\/\n") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
56 (let ((start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
57 (while (looking-at "^ Q") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
58 (forward-line 2)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
59 (kill-region start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
60 ;; Write a new symbol initialization section. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
61 (while symbol-list |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
62 (insert (format " %s = intern (\"" (car symbol-list))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
63 (let ((start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
64 (insert (substring (car symbol-list) 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
65 (subst-char-in-region start (point) ?_ ?-)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
66 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
67 (setq symbol-list (cdr symbol-list))))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
68 */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
69 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
70 /*&&& symbols declared here &&&*/ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
71 Lisp_Object Qframep; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
72 Lisp_Object Qlive_frame_p; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
73 Lisp_Object Qheight; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
74 Lisp_Object Qicon; |
539 | 75 Lisp_Object Qminibuffer; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
76 Lisp_Object Qmodeline; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
77 Lisp_Object Qname; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
78 Lisp_Object Qnone; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
79 Lisp_Object Qonly; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
80 Lisp_Object Qunsplittable; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
81 Lisp_Object Qwidth; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
82 Lisp_Object Qx; |
286 | 83 |
84 extern Lisp_Object Vminibuffer_list; | |
85 extern Lisp_Object get_minibuffer (); | |
86 | |
765 | 87 DEFUN ("framep", Fframep, Sframep, 1, 1, 0, |
88 "Return non-nil if OBJECT is a frame.\n\ | |
89 Value is t for a termcap frame (a character-only terminal),\n\ | |
90 `x' for an Emacs frame that is really an X window.\n\ | |
91 Also see `live-frame-p'.") | |
454 | 92 (object) |
93 Lisp_Object object; | |
286 | 94 { |
765 | 95 if (XTYPE (object) != Lisp_Frame) |
286 | 96 return Qnil; |
765 | 97 switch (XFRAME (object)->output_method) |
286 | 98 { |
99 case output_termcap: | |
100 return Qt; | |
101 case output_x_window: | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
102 return Qx; |
286 | 103 default: |
104 abort (); | |
105 } | |
106 } | |
107 | |
765 | 108 DEFUN ("live-frame-p", Flive_frame_p, Slive_frame_p, 1, 1, 0, |
109 "Return non-nil if OBJECT is a frame which has not been deleted.\n\ | |
110 Value is nil if OBJECT is not a live frame. If object is a live\n\ | |
111 frame, the return value indicates what sort of output device it is\n\ | |
112 displayed on. Value is t for a termcap frame (a character-only\n\ | |
113 terminal), `x' for an Emacs frame being displayed in an X window.") | |
454 | 114 (object) |
115 Lisp_Object object; | |
116 { | |
765 | 117 return ((FRAMEP (object) |
118 && FRAME_LIVE_P (XFRAME (object))) | |
119 ? Fframep (object) | |
454 | 120 : Qnil); |
121 } | |
122 | |
765 | 123 struct frame * |
124 make_frame (mini_p) | |
286 | 125 int mini_p; |
126 { | |
765 | 127 Lisp_Object frame; |
128 register struct frame *f; | |
286 | 129 register Lisp_Object root_window; |
130 register Lisp_Object mini_window; | |
131 | |
765 | 132 frame = Fmake_vector (((sizeof (struct frame) - (sizeof (Lisp_Vector) |
363 | 133 - sizeof (Lisp_Object))) |
134 / sizeof (Lisp_Object)), | |
286 | 135 make_number (0)); |
765 | 136 XSETTYPE (frame, Lisp_Frame); |
137 f = XFRAME (frame); | |
286 | 138 |
765 | 139 f->cursor_x = 0; |
140 f->cursor_y = 0; | |
141 f->current_glyphs = 0; | |
142 f->desired_glyphs = 0; | |
143 f->visible = 0; | |
144 f->display.nothing = 0; | |
145 f->iconified = 0; | |
146 f->wants_modeline = 1; | |
147 f->auto_raise = 0; | |
148 f->auto_lower = 0; | |
149 f->no_split = 0; | |
150 f->garbaged = 0; | |
151 f->has_minibuffer = mini_p; | |
152 f->focus_frame = frame; | |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
153 f->explicit_name = 0; |
286 | 154 |
765 | 155 f->param_alist = Qnil; |
286 | 156 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
157 root_window = make_window (); |
286 | 158 if (mini_p) |
159 { | |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
160 mini_window = make_window (); |
286 | 161 XWINDOW (root_window)->next = mini_window; |
162 XWINDOW (mini_window)->prev = root_window; | |
163 XWINDOW (mini_window)->mini_p = Qt; | |
765 | 164 XWINDOW (mini_window)->frame = frame; |
165 f->minibuffer_window = mini_window; | |
286 | 166 } |
167 else | |
168 { | |
169 mini_window = Qnil; | |
170 XWINDOW (root_window)->next = Qnil; | |
765 | 171 f->minibuffer_window = Qnil; |
286 | 172 } |
173 | |
765 | 174 XWINDOW (root_window)->frame = frame; |
286 | 175 |
176 /* 10 is arbitrary, | |
177 just so that there is "something there." | |
765 | 178 Correct size will be set up later with change_frame_size. */ |
286 | 179 |
765 | 180 f->width = 10; |
181 f->height = 10; | |
286 | 182 |
183 XFASTINT (XWINDOW (root_window)->width) = 10; | |
184 XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10); | |
185 | |
186 if (mini_p) | |
187 { | |
188 XFASTINT (XWINDOW (mini_window)->width) = 10; | |
189 XFASTINT (XWINDOW (mini_window)->top) = 9; | |
190 XFASTINT (XWINDOW (mini_window)->height) = 1; | |
191 } | |
192 | |
765 | 193 /* Choose a buffer for the frame's root window. */ |
386 | 194 { |
195 Lisp_Object buf; | |
196 | |
197 XWINDOW (root_window)->buffer = Qt; | |
198 buf = Fcurrent_buffer (); | |
199 /* If buf is a 'hidden' buffer (i.e. one whose name starts with | |
200 a space), try to find another one. */ | |
201 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') | |
202 buf = Fother_buffer (buf); | |
203 Fset_window_buffer (root_window, buf); | |
204 } | |
205 | |
286 | 206 if (mini_p) |
207 { | |
208 XWINDOW (mini_window)->buffer = Qt; | |
209 Fset_window_buffer (mini_window, | |
485 | 210 (NILP (Vminibuffer_list) |
286 | 211 ? get_minibuffer (0) |
212 : Fcar (Vminibuffer_list))); | |
213 } | |
214 | |
765 | 215 f->root_window = root_window; |
216 f->selected_window = root_window; | |
363 | 217 /* Make sure this window seems more recently used than |
218 a newly-created, never-selected window. */ | |
765 | 219 XFASTINT (XWINDOW (f->selected_window)->use_time) = ++window_select_count; |
286 | 220 |
765 | 221 Vframe_list = Fcons (frame, Vframe_list); |
286 | 222 |
765 | 223 return f; |
286 | 224 } |
225 | |
765 | 226 /* Make a frame using a separate minibuffer window on another frame. |
286 | 227 MINI_WINDOW is the minibuffer window to use. nil means use the |
228 default (the global minibuffer). */ | |
229 | |
765 | 230 struct frame * |
231 make_frame_without_minibuffer (mini_window) | |
286 | 232 register Lisp_Object mini_window; |
233 { | |
765 | 234 register struct frame *f; |
286 | 235 |
236 /* Choose the minibuffer window to use. */ | |
485 | 237 if (NILP (mini_window)) |
286 | 238 { |
765 | 239 if (XTYPE (Vdefault_minibuffer_frame) != Lisp_Frame) |
240 error ("default-minibuffer-frame must be set when creating minibufferless frames"); | |
241 if (! FRAME_LIVE_P (XFRAME (Vdefault_minibuffer_frame))) | |
242 error ("default-minibuffer-frame must be a live frame"); | |
243 mini_window = XFRAME (Vdefault_minibuffer_frame)->minibuffer_window; | |
286 | 244 } |
245 else | |
246 { | |
247 CHECK_WINDOW (mini_window, 0); | |
248 } | |
249 | |
765 | 250 /* Make a frame containing just a root window. */ |
251 f = make_frame (0); | |
286 | 252 |
253 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 254 f->minibuffer_window = mini_window; |
286 | 255 Fset_window_buffer (mini_window, |
485 | 256 (NILP (Vminibuffer_list) |
286 | 257 ? get_minibuffer (0) |
258 : Fcar (Vminibuffer_list))); | |
765 | 259 return f; |
286 | 260 } |
261 | |
765 | 262 /* Make a frame containing only a minibuffer window. */ |
286 | 263 |
765 | 264 struct frame * |
265 make_minibuffer_frame () | |
286 | 266 { |
765 | 267 /* First make a frame containing just a root window, no minibuffer. */ |
286 | 268 |
765 | 269 register struct frame *f = make_frame (0); |
286 | 270 register Lisp_Object mini_window; |
765 | 271 register Lisp_Object frame; |
286 | 272 |
765 | 273 XSET (frame, Lisp_Frame, f); |
286 | 274 |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
275 f->auto_raise = 0; |
765 | 276 f->auto_lower = 0; |
277 f->no_split = 1; | |
278 f->wants_modeline = 0; | |
279 f->has_minibuffer = 1; | |
286 | 280 |
281 /* Now label the root window as also being the minibuffer. | |
282 Avoid infinite looping on the window chain by marking next pointer | |
283 as nil. */ | |
284 | |
765 | 285 mini_window = f->minibuffer_window = f->root_window; |
286 | 286 XWINDOW (mini_window)->mini_p = Qt; |
287 XWINDOW (mini_window)->next = Qnil; | |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
288 XWINDOW (mini_window)->prev = Qnil; |
765 | 289 XWINDOW (mini_window)->frame = frame; |
286 | 290 |
291 /* Put the proper buffer in that window. */ | |
292 | |
293 Fset_window_buffer (mini_window, | |
485 | 294 (NILP (Vminibuffer_list) |
286 | 295 ? get_minibuffer (0) |
296 : Fcar (Vminibuffer_list))); | |
765 | 297 return f; |
286 | 298 } |
299 | |
765 | 300 /* Construct a frame that refers to the terminal (stdin and stdout). */ |
286 | 301 |
765 | 302 struct frame * |
303 make_terminal_frame () | |
286 | 304 { |
765 | 305 register struct frame *f; |
286 | 306 |
765 | 307 Vframe_list = Qnil; |
308 f = make_frame (1); | |
309 f->name = build_string ("terminal"); | |
310 f->visible = 1; | |
311 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ | |
312 XSET (Vterminal_frame, Lisp_Frame, f); | |
313 return f; | |
286 | 314 } |
315 | |
765 | 316 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, 0, |
317 "Select the frame FRAME. FRAMES's selected window becomes \"the\"\n\ | |
363 | 318 selected window. If the optional parameter NO-ENTER is non-nil, don't\n\ |
765 | 319 focus on that frame.") |
320 (frame, no_enter) | |
321 Lisp_Object frame, no_enter; | |
286 | 322 { |
765 | 323 CHECK_LIVE_FRAME (frame, 0); |
286 | 324 |
765 | 325 if (selected_frame == XFRAME (frame)) |
326 return frame; | |
286 | 327 |
765 | 328 selected_frame = XFRAME (frame); |
329 if (! FRAME_MINIBUF_ONLY_P (selected_frame)) | |
330 last_nonminibuf_frame = selected_frame; | |
363 | 331 |
765 | 332 Fselect_window (XFRAME (frame)->selected_window); |
286 | 333 |
334 #ifdef HAVE_X_WINDOWS | |
765 | 335 #ifdef MULTI_FRAME |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
336 if (FRAME_X_P (XFRAME (frame)) |
485 | 337 && NILP (no_enter)) |
286 | 338 { |
765 | 339 Ffocus_frame (frame); |
286 | 340 } |
341 #endif | |
342 #endif | |
765 | 343 choose_minibuf_frame (); |
286 | 344 |
765 | 345 return frame; |
286 | 346 } |
347 | |
765 | 348 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
349 "Return the frame that is now selected.") | |
286 | 350 () |
351 { | |
352 Lisp_Object tem; | |
765 | 353 XSET (tem, Lisp_Frame, selected_frame); |
286 | 354 return tem; |
355 } | |
356 | |
765 | 357 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
358 "Return the frame object that window WINDOW is on.") | |
286 | 359 (window) |
360 Lisp_Object window; | |
361 { | |
362 CHECK_WINDOW (window, 0); | |
765 | 363 return XWINDOW (window)->frame; |
286 | 364 } |
365 | |
765 | 366 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, |
367 "Returns the root-window of FRAME.") | |
368 (frame) | |
369 Lisp_Object frame; | |
286 | 370 { |
765 | 371 if (NILP (frame)) |
372 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 373 else |
765 | 374 CHECK_LIVE_FRAME (frame, 0); |
286 | 375 |
765 | 376 return XFRAME (frame)->root_window; |
286 | 377 } |
378 | |
765 | 379 DEFUN ("frame-selected-window", Fframe_selected_window, |
380 Sframe_selected_window, 0, 1, 0, | |
381 "Return the selected window of frame object FRAME.") | |
382 (frame) | |
383 Lisp_Object frame; | |
286 | 384 { |
765 | 385 if (NILP (frame)) |
386 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 387 else |
765 | 388 CHECK_LIVE_FRAME (frame, 0); |
286 | 389 |
765 | 390 return XFRAME (frame)->selected_window; |
286 | 391 } |
392 | |
765 | 393 DEFUN ("frame-list", Fframe_list, Sframe_list, |
286 | 394 0, 0, 0, |
765 | 395 "Return a list of all frames.") |
286 | 396 () |
397 { | |
765 | 398 return Fcopy_sequence (Vframe_list); |
286 | 399 } |
400 | |
765 | 401 #ifdef MULTI_FRAME |
454 | 402 |
765 | 403 /* Return the next frame in the frame list after FRAME. |
404 If MINIBUF is non-nil, include all frames. | |
405 If MINIBUF is nil, exclude minibuffer-only frames. | |
406 If MINIBUF is a window, include only frames using that window for | |
454 | 407 their minibuffer. */ |
286 | 408 Lisp_Object |
765 | 409 next_frame (frame, minibuf) |
410 Lisp_Object frame; | |
454 | 411 Lisp_Object minibuf; |
286 | 412 { |
413 Lisp_Object tail; | |
414 int passed = 0; | |
415 | |
765 | 416 /* There must always be at least one frame in Vframe_list. */ |
417 if (! CONSP (Vframe_list)) | |
454 | 418 abort (); |
419 | |
286 | 420 while (1) |
765 | 421 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 422 { |
423 if (passed) | |
363 | 424 { |
765 | 425 Lisp_Object f = XCONS (tail)->car; |
335 | 426 |
765 | 427 /* Decide whether this frame is eligible to be returned, |
454 | 428 according to minibuf. */ |
765 | 429 if ((NILP (minibuf) && ! FRAME_MINIBUF_ONLY_P (XFRAME (f))) |
454 | 430 || XTYPE (minibuf) != Lisp_Window |
765 | 431 || EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf) |
432 || EQ (f, frame)) | |
433 return f; | |
363 | 434 } |
286 | 435 |
765 | 436 if (EQ (frame, XCONS (tail)->car)) |
286 | 437 passed++; |
438 } | |
439 } | |
440 | |
765 | 441 /* Return the previous frame in the frame list before FRAME. |
442 If MINIBUF is non-nil, include all frames. | |
443 If MINIBUF is nil, exclude minibuffer-only frames. | |
444 If MINIBUF is a window, include only frames using that window for | |
454 | 445 their minibuffer. */ |
286 | 446 Lisp_Object |
765 | 447 prev_frame (frame, minibuf) |
448 Lisp_Object frame; | |
454 | 449 Lisp_Object minibuf; |
286 | 450 { |
451 Lisp_Object tail; | |
452 Lisp_Object prev; | |
453 | |
765 | 454 /* There must always be at least one frame in Vframe_list. */ |
455 if (! CONSP (Vframe_list)) | |
454 | 456 abort (); |
457 | |
286 | 458 prev = Qnil; |
459 while (1) | |
454 | 460 { |
765 | 461 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
454 | 462 { |
463 Lisp_Object scr = XCONS (tail)->car; | |
464 | |
765 | 465 if (XTYPE (scr) != Lisp_Frame) |
454 | 466 abort (); |
467 | |
765 | 468 if (EQ (frame, scr) && !NILP (prev)) |
454 | 469 return prev; |
470 | |
765 | 471 /* Decide whether this frame is eligible to be returned, |
454 | 472 according to minibuf. */ |
765 | 473 if ((NILP (minibuf) && ! FRAME_MINIBUF_ONLY_P (XFRAME (scr))) |
454 | 474 || XTYPE (minibuf) != Lisp_Window |
765 | 475 || EQ (FRAME_MINIBUF_WINDOW (XFRAME (scr)), minibuf)) |
454 | 476 prev = scr; |
477 } | |
478 | |
485 | 479 if (NILP (prev)) |
765 | 480 /* We went through the whole frame list without finding a single |
481 acceptable frame. Return the original frame. */ | |
482 prev = frame; | |
454 | 483 } |
484 | |
286 | 485 } |
486 | |
765 | 487 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0, |
488 "Return the next frame in the frame list after FRAME.\n\ | |
489 If optional argument MINIBUF is non-nil, include all frames. If\n\ | |
490 MINIBUF is nil or omitted, exclude minibuffer-only frames. If\n\ | |
491 MINIBUF is a window, include only frames using that window for their\n\ | |
454 | 492 minibuffer.") |
765 | 493 (frame, miniframe) |
494 Lisp_Object frame, miniframe; | |
286 | 495 { |
496 Lisp_Object tail; | |
497 | |
765 | 498 if (NILP (frame)) |
499 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 500 else |
765 | 501 CHECK_LIVE_FRAME (frame, 0); |
286 | 502 |
765 | 503 return next_frame (frame, miniframe); |
286 | 504 } |
765 | 505 #endif /* MULTI_FRAME */ |
286 | 506 |
765 | 507 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 1, "", |
508 "Delete FRAME, permanently eliminating it from use.\n\ | |
509 If omitted, FRAME defaults to the selected frame.\n\ | |
510 A frame may not be deleted if its minibuffer is used by other frames.") | |
511 (frame) | |
512 Lisp_Object frame; | |
286 | 513 { |
765 | 514 struct frame *f; |
286 | 515 union display displ; |
516 | |
765 | 517 if (EQ (frame, Qnil)) |
286 | 518 { |
765 | 519 f = selected_frame; |
520 XSET (frame, Lisp_Frame, f); | |
286 | 521 } |
522 else | |
523 { | |
765 | 524 CHECK_FRAME (frame, 0); |
525 f = XFRAME (frame); | |
286 | 526 } |
527 | |
765 | 528 if (! FRAME_LIVE_P (f)) |
454 | 529 return; |
530 | |
765 | 531 /* Are there any other frames besides this one? */ |
532 if (f == selected_frame && EQ (next_frame (frame, Qt), frame)) | |
533 error ("Attempt to delete the only frame"); | |
286 | 534 |
765 | 535 /* Does this frame have a minibuffer, and is it the surrogate |
536 minibuffer for any other frame? */ | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
537 if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) |
363 | 538 { |
765 | 539 Lisp_Object frames; |
708 | 540 |
765 | 541 for (frames = Vframe_list; |
542 CONSP (frames); | |
543 frames = XCONS (frames)->cdr) | |
708 | 544 { |
765 | 545 Lisp_Object this = XCONS (frames)->car; |
363 | 546 |
765 | 547 if (! EQ (this, frame) |
548 && EQ (frame, | |
549 (WINDOW_FRAME | |
708 | 550 (XWINDOW |
765 | 551 (FRAME_MINIBUF_WINDOW |
552 (XFRAME (this))))))) | |
553 error ("Attempt to delete a surrogate minibuffer frame"); | |
708 | 554 } |
286 | 555 } |
556 | |
765 | 557 /* Don't let the frame remain selected. */ |
558 if (f == selected_frame) | |
559 Fselect_frame (next_frame (frame, Qt)); | |
286 | 560 |
765 | 561 /* Don't allow minibuf_window to remain on a deleted frame. */ |
562 if (EQ (f->minibuffer_window, minibuf_window)) | |
286 | 563 { |
765 | 564 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 565 XWINDOW (minibuf_window)->buffer); |
765 | 566 minibuf_window = selected_frame->minibuffer_window; |
286 | 567 } |
568 | |
765 | 569 Vframe_list = Fdelq (frame, Vframe_list); |
570 f->visible = 0; | |
571 displ = f->display; | |
572 f->display.nothing = 0; | |
286 | 573 |
363 | 574 #ifdef HAVE_X_WINDOWS |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
575 if (FRAME_X_P (f)) |
765 | 576 x_destroy_window (f, displ); |
363 | 577 #endif |
578 | |
765 | 579 /* If we've deleted the last_nonminibuf_frame, then try to find |
363 | 580 another one. */ |
765 | 581 if (f == last_nonminibuf_frame) |
363 | 582 { |
765 | 583 Lisp_Object frames; |
708 | 584 |
765 | 585 last_nonminibuf_frame = 0; |
363 | 586 |
765 | 587 for (frames = Vframe_list; |
588 CONSP (frames); | |
589 frames = XCONS (frames)->cdr) | |
363 | 590 { |
765 | 591 f = XFRAME (XCONS (frames)->car); |
592 if (!FRAME_MINIBUF_ONLY_P (f)) | |
363 | 593 { |
765 | 594 last_nonminibuf_frame = f; |
363 | 595 break; |
596 } | |
597 } | |
598 } | |
286 | 599 |
765 | 600 /* If we've deleted Vdefault_minibuffer_frame, try to find another |
601 one. Prefer minibuffer-only frames, but also notice frames | |
708 | 602 with other windows. */ |
765 | 603 if (EQ (frame, Vdefault_minibuffer_frame)) |
708 | 604 { |
765 | 605 Lisp_Object frames; |
708 | 606 |
765 | 607 /* The last frame we saw with a minibuffer, minibuffer-only or not. */ |
608 Lisp_Object frame_with_minibuf = Qnil; | |
708 | 609 |
765 | 610 for (frames = Vframe_list; |
611 CONSP (frames); | |
612 frames = XCONS (frames)->cdr) | |
708 | 613 { |
765 | 614 Lisp_Object this = XCONS (frames)->car; |
708 | 615 |
765 | 616 if (XTYPE (this) != Lisp_Frame) |
708 | 617 abort (); |
765 | 618 f = XFRAME (this); |
708 | 619 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
620 if (FRAME_HAS_MINIBUF_P (f)) |
708 | 621 { |
765 | 622 frame_with_minibuf = this; |
623 if (FRAME_MINIBUF_ONLY_P (f)) | |
708 | 624 break; |
625 } | |
626 } | |
627 | |
765 | 628 /* We know that there must be some frame with a minibuffer out |
629 there. If this were not true, all of the frames present | |
708 | 630 would have to be minibufferless, which implies that at some |
765 | 631 point their minibuffer frames must have been deleted, but |
708 | 632 that is prohibited at the top; you can't delete surrogate |
765 | 633 minibuffer frames. */ |
634 if (NILP (frame_with_minibuf)) | |
708 | 635 abort (); |
636 | |
765 | 637 Vdefault_minibuffer_frame = frame_with_minibuf; |
708 | 638 } |
639 | |
286 | 640 return Qnil; |
641 } | |
642 | |
643 /* Return mouse position in character cell units. */ | |
644 | |
454 | 645 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
765 | 646 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ |
454 | 647 If Emacs is running on a mouseless terminal or hasn't been programmed\n\ |
765 | 648 to read the mouse position, it returns the selected frame for FRAME\n\ |
454 | 649 and nil for X and Y.") |
650 () | |
286 | 651 { |
454 | 652 Lisp_Object x, y, dummy; |
765 | 653 FRAME_PTR f; |
286 | 654 |
454 | 655 if (mouse_position_hook) |
765 | 656 (*mouse_position_hook) (&f, &x, &y, &dummy); |
454 | 657 else |
658 { | |
765 | 659 f = selected_frame; |
454 | 660 x = y = Qnil; |
661 } | |
286 | 662 |
765 | 663 XSET (dummy, Lisp_Frame, f); |
454 | 664 return Fcons (dummy, Fcons (make_number (x), make_number (y))); |
286 | 665 } |
666 | |
667 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, | |
765 | 668 "Move the mouse pointer to the center of cell (X,Y) in FRAME.\n\ |
669 WARNING: If you use this under X, you should do `unfocus-frame' afterwards.") | |
670 (frame, x, y) | |
671 Lisp_Object frame, x, y; | |
286 | 672 { |
765 | 673 CHECK_LIVE_FRAME (frame, 0); |
286 | 674 CHECK_NUMBER (x, 2); |
675 CHECK_NUMBER (y, 1); | |
676 | |
677 #ifdef HAVE_X_WINDOWS | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
678 if (FRAME_X_P (XFRAME (frame))) |
286 | 679 /* Warping the mouse will cause enternotify and focus events. */ |
765 | 680 x_set_mouse_position (XFRAME (frame), x, y); |
286 | 681 #endif |
682 | |
683 return Qnil; | |
684 } | |
685 | |
686 #if 0 | |
687 /* ??? Can this be replaced with a Lisp function? | |
756 | 688 It is used in minibuf.c. Can we get rid of that? |
689 Yes. All uses in minibuf.c are gone, and parallels to these | |
765 | 690 functions have been defined in frame.el. */ |
286 | 691 |
765 | 692 DEFUN ("frame-configuration", Fframe_configuration, Sframe_configuration, |
286 | 693 0, 0, 0, |
765 | 694 "Return object describing current frame configuration.\n\ |
695 The frame configuration is the current mouse position and selected frame.\n\ | |
696 This object can be given to `restore-frame-configuration'\n\ | |
697 to restore this frame configuration.") | |
286 | 698 () |
699 { | |
454 | 700 Lisp_Object c, time; |
286 | 701 |
454 | 702 c = Fmake_vector (make_number(4), Qnil); |
765 | 703 XVECTOR (c)->contents[0] = Fselected_frame(); |
454 | 704 if (mouse_position_hook) |
705 (*mouse_position_hook) (&XVECTOR (c)->contents[1] | |
706 &XVECTOR (c)->contents[2], | |
707 &XVECTOR (c)->contents[3], | |
708 &time); | |
286 | 709 return c; |
710 } | |
711 | |
765 | 712 DEFUN ("restore-frame-configuration", Frestore_frame_configuration, |
713 Srestore_frame_configuration, | |
286 | 714 1, 1, 0, |
765 | 715 "Restores frame configuration CONFIGURATION.") |
286 | 716 (config) |
717 Lisp_Object config; | |
718 { | |
765 | 719 Lisp_Object x_pos, y_pos, frame; |
286 | 720 |
721 CHECK_VECTOR (config, 0); | |
722 if (XVECTOR (config)->size != 3) | |
723 { | |
765 | 724 error ("Wrong size vector passed to restore-frame-configuration"); |
286 | 725 } |
765 | 726 frame = XVECTOR (config)->contents[0]; |
727 CHECK_LIVE_FRAME (frame, 0); | |
286 | 728 |
765 | 729 Fselect_frame (frame, Qnil); |
286 | 730 |
731 #if 0 | |
765 | 732 /* This seems to interfere with the frame selection mechanism. jla */ |
454 | 733 x_pos = XVECTOR (config)->contents[2]; |
734 y_pos = XVECTOR (config)->contents[3]; | |
765 | 735 set_mouse_position (frame, XINT (x_pos), XINT (y_pos)); |
286 | 736 #endif |
737 | |
765 | 738 return frame; |
286 | 739 } |
740 #endif | |
741 | |
765 | 742 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible, |
872 | 743 0, 1, 0, |
765 | 744 "Make the frame FRAME visible (assuming it is an X-window).\n\ |
745 Also raises the frame so that nothing obscures it.") | |
746 (frame) | |
747 Lisp_Object frame; | |
286 | 748 { |
872 | 749 if (NILP (frame)) |
886 | 750 XSET (frame, Lisp_Frame, selected_frame); |
872 | 751 |
765 | 752 CHECK_LIVE_FRAME (frame, 0); |
286 | 753 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
754 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
755 if (FRAME_X_P (XFRAME (frame))) |
765 | 756 x_make_frame_visible (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
757 #endif |
286 | 758 |
765 | 759 return frame; |
286 | 760 } |
761 | |
765 | 762 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible, |
872 | 763 0, 1, "", |
765 | 764 "Make the frame FRAME invisible (assuming it is an X-window).") |
765 (frame) | |
766 Lisp_Object frame; | |
286 | 767 { |
872 | 768 if (NILP (frame)) |
886 | 769 XSET (frame, Lisp_Frame, selected_frame); |
872 | 770 |
765 | 771 CHECK_LIVE_FRAME (frame, 0); |
286 | 772 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
773 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
774 if (FRAME_X_P (XFRAME (frame))) |
765 | 775 x_make_frame_invisible (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
776 #endif |
286 | 777 |
778 return Qnil; | |
779 } | |
780 | |
765 | 781 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, |
872 | 782 0, 1, "", |
765 | 783 "Make the frame FRAME into an icon.") |
784 (frame) | |
785 Lisp_Object frame; | |
286 | 786 { |
872 | 787 if (NILP (frame)) |
886 | 788 XSET (frame, Lisp_Frame, selected_frame); |
872 | 789 |
765 | 790 CHECK_LIVE_FRAME (frame, 0); |
286 | 791 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
792 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
793 if (FRAME_X_P (XFRAME (frame))) |
765 | 794 x_iconify_frame (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
795 #endif |
286 | 796 |
797 return Qnil; | |
798 } | |
799 | |
765 | 800 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, |
286 | 801 1, 1, 0, |
765 | 802 "Return t if FRAME is now \"visible\" (actually in use for display).\n\ |
803 A frame that is not \"visible\" is not updated and, if it works through\n\ | |
286 | 804 a window system, it may not show at all.\n\ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
805 Return the symbol `icon' if frame is visible only as an icon.") |
765 | 806 (frame) |
807 Lisp_Object frame; | |
286 | 808 { |
765 | 809 CHECK_LIVE_FRAME (frame, 0); |
286 | 810 |
765 | 811 if (XFRAME (frame)->visible) |
286 | 812 return Qt; |
765 | 813 if (XFRAME (frame)->iconified) |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
814 return Qicon; |
286 | 815 return Qnil; |
816 } | |
817 | |
765 | 818 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, |
286 | 819 0, 0, 0, |
765 | 820 "Return a list of all frames now \"visible\" (being updated).") |
286 | 821 () |
822 { | |
765 | 823 Lisp_Object tail, frame; |
824 struct frame *f; | |
286 | 825 Lisp_Object value; |
826 | |
827 value = Qnil; | |
765 | 828 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 829 { |
765 | 830 frame = XCONS (tail)->car; |
831 if (XTYPE (frame) != Lisp_Frame) | |
286 | 832 continue; |
765 | 833 f = XFRAME (frame); |
834 if (f->visible) | |
835 value = Fcons (frame, value); | |
286 | 836 } |
837 return value; | |
838 } | |
363 | 839 |
840 | |
841 | |
765 | 842 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus, |
363 | 843 1, 2, 0, |
765 | 844 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\ |
845 This means that, after reading a keystroke typed at FRAME,\n\ | |
846 `last-event-frame' will be FOCUS-FRAME.\n\ | |
363 | 847 \n\ |
765 | 848 If FOCUS-FRAME is omitted or eq to FRAME, any existing redirection is\n\ |
849 cancelled, and the frame again receives its own keystrokes.\n\ | |
363 | 850 \n\ |
765 | 851 The redirection lasts until the next call to `redirect-frame-focus'\n\ |
852 or `select-frame'.\n\ | |
363 | 853 \n\ |
854 This is useful for temporarily redirecting keystrokes to the minibuffer\n\ | |
765 | 855 window when a frame doesn't have its own minibuffer.") |
856 (frame, focus_frame) | |
857 Lisp_Object frame, focus_frame; | |
363 | 858 { |
765 | 859 CHECK_LIVE_FRAME (frame, 0); |
454 | 860 |
765 | 861 if (NILP (focus_frame)) |
862 focus_frame = frame; | |
363 | 863 else |
765 | 864 CHECK_LIVE_FRAME (focus_frame, 1); |
363 | 865 |
765 | 866 XFRAME (frame)->focus_frame = focus_frame; |
363 | 867 |
765 | 868 if (frame_rehighlight_hook) |
869 (*frame_rehighlight_hook) (); | |
363 | 870 |
871 return Qnil; | |
872 } | |
873 | |
874 | |
765 | 875 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0, |
876 "Return the frame to which FRAME's keystrokes are currently being sent.\n\ | |
877 See `redirect-frame-focus'.") | |
878 (frame) | |
879 Lisp_Object frame; | |
363 | 880 { |
765 | 881 CHECK_LIVE_FRAME (frame, 0); |
882 return FRAME_FOCUS_FRAME (XFRAME (frame)); | |
363 | 883 } |
884 | |
885 | |
286 | 886 |
887 Lisp_Object | |
765 | 888 get_frame_param (frame, prop) |
889 register struct frame *frame; | |
286 | 890 Lisp_Object prop; |
891 { | |
892 register Lisp_Object tem; | |
893 | |
765 | 894 tem = Fassq (prop, frame->param_alist); |
286 | 895 if (EQ (tem, Qnil)) |
896 return tem; | |
897 return Fcdr (tem); | |
898 } | |
899 | |
900 void | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
901 store_in_alist (alistptr, prop, val) |
286 | 902 Lisp_Object *alistptr, val; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
903 Lisp_Object prop; |
286 | 904 { |
905 register Lisp_Object tem; | |
906 | |
907 tem = Fassq (prop, *alistptr); | |
908 if (EQ (tem, Qnil)) | |
909 *alistptr = Fcons (Fcons (prop, val), *alistptr); | |
910 else | |
911 Fsetcdr (tem, val); | |
912 } | |
913 | |
914 void | |
765 | 915 store_frame_param (f, prop, val) |
916 struct frame *f; | |
286 | 917 Lisp_Object prop, val; |
918 { | |
919 register Lisp_Object tem; | |
920 | |
765 | 921 tem = Fassq (prop, f->param_alist); |
286 | 922 if (EQ (tem, Qnil)) |
765 | 923 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
286 | 924 else |
925 Fsetcdr (tem, val); | |
539 | 926 |
927 if (EQ (prop, Qminibuffer) | |
928 && XTYPE (val) == Lisp_Window) | |
929 { | |
930 if (! MINI_WINDOW_P (XWINDOW (val))) | |
931 error ("Surrogate minibuffer windows must be minibuffer windows."); | |
932 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
933 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) |
765 | 934 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer."); |
539 | 935 |
936 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 937 f->minibuffer_window = val; |
539 | 938 } |
286 | 939 } |
940 | |
765 | 941 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, |
942 "Return the parameters-alist of frame FRAME.\n\ | |
286 | 943 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ |
777 | 944 The meaningful PARMs depend on the kind of frame.\n\ |
945 If FRAME is omitted, return information on the currently selected frame.") | |
765 | 946 (frame) |
947 Lisp_Object frame; | |
286 | 948 { |
949 Lisp_Object alist; | |
765 | 950 struct frame *f; |
286 | 951 |
765 | 952 if (EQ (frame, Qnil)) |
953 f = selected_frame; | |
286 | 954 else |
955 { | |
765 | 956 CHECK_FRAME (frame, 0); |
957 f = XFRAME (frame); | |
286 | 958 } |
959 | |
765 | 960 if (f->display.nothing == 0) |
286 | 961 return Qnil; |
962 | |
765 | 963 alist = Fcopy_alist (f->param_alist); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
964 store_in_alist (&alist, Qname, f->name); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
965 store_in_alist (&alist, Qheight, make_number (f->height)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
966 store_in_alist (&alist, Qwidth, make_number (f->width)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
967 store_in_alist (&alist, Qmodeline, (f->wants_modeline ? Qt : Qnil)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
968 store_in_alist (&alist, Qminibuffer, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
969 (! FRAME_HAS_MINIBUF_P (f) ? Qnone |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
970 : (FRAME_MINIBUF_ONLY_P (f) ? Qonly |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
971 : FRAME_MINIBUF_WINDOW (f)))); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
972 store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil)); |
286 | 973 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
974 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
975 if (FRAME_X_P (f)) |
765 | 976 x_report_frame_params (f, &alist); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
977 #endif |
286 | 978 return alist; |
979 } | |
980 | |
765 | 981 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, |
982 Smodify_frame_parameters, 2, 2, 0, | |
983 "Modify the parameters of frame FRAME according to ALIST.\n\ | |
286 | 984 ALIST is an alist of parameters to change and their new values.\n\ |
985 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ | |
765 | 986 The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.") |
987 (frame, alist) | |
988 Lisp_Object frame, alist; | |
286 | 989 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
990 FRAME_PTR f; |
286 | 991 register Lisp_Object tail, elt, prop, val; |
992 | |
765 | 993 if (EQ (frame, Qnil)) |
994 f = selected_frame; | |
286 | 995 else |
996 { | |
765 | 997 CHECK_LIVE_FRAME (frame, 0); |
998 f = XFRAME (frame); | |
286 | 999 } |
1000 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1001 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1002 if (FRAME_X_P (f)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1003 #if 1 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1004 x_set_frame_parameters (f, alist); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1005 #else |
286 | 1006 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) |
1007 { | |
1008 elt = Fcar (tail); | |
1009 prop = Fcar (elt); | |
1010 val = Fcdr (elt); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1011 x_set_frame_param (f, prop, val, get_frame_param (f, prop)); |
765 | 1012 store_frame_param (f, prop, val); |
286 | 1013 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1014 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1015 #endif |
286 | 1016 |
1017 return Qnil; | |
1018 } | |
1019 | |
1020 | |
777 | 1021 #if 0 |
1022 /* This function isn't useful enough by itself to include; we need to | |
1023 add functions to allow the user to find the size of a font before | |
1024 this is actually useful. */ | |
1025 | |
765 | 1026 DEFUN ("frame-pixel-size", Fframe_pixel_size, |
1027 Sframe_pixel_size, 1, 1, 0, | |
1028 "Return a cons (width . height) of FRAME's size in pixels.") | |
1029 (frame) | |
1030 Lisp_Object frame; | |
286 | 1031 { |
765 | 1032 register struct frame *f; |
286 | 1033 int width, height; |
1034 | |
765 | 1035 CHECK_LIVE_FRAME (frame, 0); |
1036 f = XFRAME (frame); | |
286 | 1037 |
765 | 1038 return Fcons (make_number (x_pixel_width (f)), |
1039 make_number (x_pixel_height (f))); | |
286 | 1040 } |
777 | 1041 #endif |
1042 | |
1043 #if 0 | |
1044 /* These functions have no C callers, and can be written nicely in lisp. */ | |
286 | 1045 |
765 | 1046 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
1047 "Return number of lines available for display on selected frame.") | |
286 | 1048 () |
1049 { | |
765 | 1050 return make_number (FRAME_HEIGHT (selected_frame)); |
286 | 1051 } |
1052 | |
765 | 1053 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, |
1054 "Return number of columns available for display on selected frame.") | |
286 | 1055 () |
1056 { | |
765 | 1057 return make_number (FRAME_WIDTH (selected_frame)); |
286 | 1058 } |
777 | 1059 #endif |
286 | 1060 |
765 | 1061 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
1062 "Specify that the frame FRAME has LINES lines.\n\ | |
286 | 1063 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
765 | 1064 but that the idea of the actual height of the frame should not be changed.") |
1065 (frame, rows, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1066 Lisp_Object frame, rows, pretend; |
286 | 1067 { |
765 | 1068 register struct frame *f; |
286 | 1069 |
1070 CHECK_NUMBER (rows, 0); | |
765 | 1071 if (NILP (frame)) |
1072 f = selected_frame; | |
286 | 1073 else |
1074 { | |
765 | 1075 CHECK_LIVE_FRAME (frame, 0); |
1076 f = XFRAME (frame); | |
286 | 1077 } |
1078 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1079 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1080 if (FRAME_X_P (f)) |
286 | 1081 { |
765 | 1082 if (XINT (rows) != f->width) |
1083 x_set_window_size (f, f->width, XINT (rows)); | |
286 | 1084 } |
1085 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1086 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1087 change_frame_size (f, XINT (rows), 0, !NILP (pretend), 0); |
286 | 1088 return Qnil; |
1089 } | |
1090 | |
765 | 1091 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
1092 "Specify that the frame FRAME has COLS columns.\n\ | |
286 | 1093 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
765 | 1094 but that the idea of the actual width of the frame should not be changed.") |
1095 (frame, cols, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1096 Lisp_Object frame, cols, pretend; |
286 | 1097 { |
765 | 1098 register struct frame *f; |
286 | 1099 CHECK_NUMBER (cols, 0); |
765 | 1100 if (NILP (frame)) |
1101 f = selected_frame; | |
286 | 1102 else |
1103 { | |
765 | 1104 CHECK_LIVE_FRAME (frame, 0); |
1105 f = XFRAME (frame); | |
286 | 1106 } |
1107 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1108 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1109 if (FRAME_X_P (f)) |
286 | 1110 { |
765 | 1111 if (XINT (cols) != f->width) |
1112 x_set_window_size (f, XINT (cols), f->height); | |
286 | 1113 } |
1114 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1115 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1116 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0); |
286 | 1117 return Qnil; |
1118 } | |
1119 | |
765 | 1120 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
1121 "Sets size of FRAME to COLS by ROWS, measured in characters.") | |
1122 (frame, cols, rows) | |
1123 Lisp_Object frame, cols, rows; | |
286 | 1124 { |
765 | 1125 register struct frame *f; |
286 | 1126 int mask; |
1127 | |
765 | 1128 CHECK_LIVE_FRAME (frame, 0); |
286 | 1129 CHECK_NUMBER (cols, 2); |
1130 CHECK_NUMBER (rows, 1); | |
765 | 1131 f = XFRAME (frame); |
286 | 1132 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1133 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1134 if (FRAME_X_P (f)) |
286 | 1135 { |
765 | 1136 if (XINT (rows) != f->height || XINT (cols) != f->width) |
1137 x_set_window_size (f, XINT (cols), XINT (rows)); | |
286 | 1138 } |
1139 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1140 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1141 change_frame_size (f, XINT (rows), XINT (cols), 0, 0); |
286 | 1142 |
1143 return Qnil; | |
1144 } | |
1145 | |
765 | 1146 DEFUN ("set-frame-position", Fset_frame_position, |
1147 Sset_frame_position, 3, 3, 0, | |
1148 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\ | |
454 | 1149 If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\ |
765 | 1150 the leftmost or bottommost position FRAME could occupy without going\n\ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1151 off the screen.") |
765 | 1152 (frame, xoffset, yoffset) |
1153 Lisp_Object frame, xoffset, yoffset; | |
286 | 1154 { |
765 | 1155 register struct frame *f; |
286 | 1156 int mask; |
1157 | |
765 | 1158 CHECK_LIVE_FRAME (frame, 0); |
286 | 1159 CHECK_NUMBER (xoffset, 1); |
1160 CHECK_NUMBER (yoffset, 2); | |
765 | 1161 f = XFRAME (frame); |
286 | 1162 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1163 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1164 if (FRAME_X_P (f)) |
765 | 1165 x_set_offset (f, XINT (xoffset), XINT (yoffset)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1166 #endif |
286 | 1167 |
1168 return Qt; | |
1169 } | |
777 | 1170 |
286 | 1171 |
1172 #ifndef HAVE_X11 | |
1173 DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle, | |
1174 3, 3, "", | |
765 | 1175 "Ask user to specify a window position and size on FRAME with the mouse.\n\ |
1176 Arguments are FRAME, NAME and GEO. NAME is a name to be displayed as\n\ | |
286 | 1177 the purpose of this rectangle. GEO is an X-windows size spec that can\n\ |
1178 specify defaults for some sizes/positions. If GEO specifies everything,\n\ | |
1179 the mouse is not used.\n\ | |
765 | 1180 Returns a list of five values: (FRAME LEFT TOP WIDTH HEIGHT).") |
1181 (frame, name, geo) | |
1182 Lisp_Object frame; | |
286 | 1183 Lisp_Object name; |
1184 Lisp_Object geo; | |
1185 { | |
1186 int vals[4]; | |
1187 Lisp_Object nums[4]; | |
1188 int i; | |
1189 | |
765 | 1190 CHECK_FRAME (frame, 0); |
286 | 1191 CHECK_STRING (name, 1); |
1192 CHECK_STRING (geo, 2); | |
1193 | |
765 | 1194 switch (XFRAME (frame)->output_method) |
286 | 1195 { |
1196 case output_x_window: | |
765 | 1197 x_rubber_band (XFRAME (frame), &vals[0], &vals[1], &vals[2], &vals[3], |
286 | 1198 XSTRING (geo)->data, XSTRING (name)->data); |
1199 break; | |
1200 | |
1201 default: | |
1202 return Qnil; | |
1203 } | |
1204 | |
1205 for (i = 0; i < 4; i++) | |
1206 XFASTINT (nums[i]) = vals[i]; | |
765 | 1207 return Fcons (frame, Flist (4, nums)); |
286 | 1208 return Qnil; |
1209 } | |
1210 #endif /* not HAVE_X11 */ | |
1211 | |
765 | 1212 choose_minibuf_frame () |
286 | 1213 { |
765 | 1214 /* For lowest-level minibuf, put it on currently selected frame |
1215 if frame has a minibuffer. */ | |
286 | 1216 if (minibuf_level == 0 |
765 | 1217 && selected_frame != 0 |
1218 && !EQ (minibuf_window, selected_frame->minibuffer_window) | |
1219 && !EQ (Qnil, selected_frame->minibuffer_window)) | |
286 | 1220 { |
765 | 1221 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 1222 XWINDOW (minibuf_window)->buffer); |
765 | 1223 minibuf_window = selected_frame->minibuffer_window; |
286 | 1224 } |
1225 } | |
1226 | |
765 | 1227 syms_of_frame () |
286 | 1228 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1229 /*&&& init symbols here &&&*/ |
765 | 1230 Qframep = intern ("framep"); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1231 staticpro (&Qframep); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1232 Qlive_frame_p = intern ("live-frame-p"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1233 staticpro (&Qlive_frame_p); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1234 Qheight = intern ("height"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1235 staticpro (&Qheight); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1236 Qicon = intern ("icon"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1237 staticpro (&Qicon); |
539 | 1238 Qminibuffer = intern ("minibuffer"); |
1239 staticpro (&Qminibuffer); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1240 Qmodeline = intern ("modeline"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1241 staticpro (&Qmodeline); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1242 Qname = intern ("name"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1243 staticpro (&Qname); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1244 Qnone = intern ("none"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1245 staticpro (&Qnone); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1246 Qonly = intern ("only"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1247 staticpro (&Qonly); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1248 Qunsplittable = intern ("unsplittable"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1249 staticpro (&Qunsplittable); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1250 Qwidth = intern ("width"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1251 staticpro (&Qwidth); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1252 Qx = intern ("x"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1253 staticpro (&Qx); |
286 | 1254 |
765 | 1255 staticpro (&Vframe_list); |
286 | 1256 |
765 | 1257 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, |
1258 "The initial frame-object, which represents Emacs's stdout."); | |
286 | 1259 |
1260 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, | |
765 | 1261 "Non-nil if all of emacs is iconified and frame updates are not needed."); |
286 | 1262 Vemacs_iconified = Qnil; |
1263 | |
765 | 1264 DEFVAR_LISP ("default-minibuffer-frame", &Vdefault_minibuffer_frame, |
1265 "Minibufferless frames use this frame's minibuffer.\n\ | |
454 | 1266 \n\ |
765 | 1267 Emacs cannot create minibufferless frames unless this is set to an\n\ |
454 | 1268 appropriate surrogate.\n\ |
1269 \n\ | |
1270 Emacs consults this variable only when creating minibufferless\n\ | |
765 | 1271 frames; once the frame is created, it sticks with its assigned\n\ |
454 | 1272 minibuffer, no matter what this variable is set to. This means that\n\ |
1273 this variable doesn't necessarily say anything meaningful about the\n\ | |
765 | 1274 current set of frames, or where the minibuffer is currently being\n\ |
454 | 1275 displayed."); |
765 | 1276 Vdefault_minibuffer_frame = Qnil; |
286 | 1277 |
765 | 1278 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
1279 "Alist of default values for frame creation.\n\ | |
386 | 1280 These may be set in your init file, like this:\n\ |
765 | 1281 (setq default-frame-alist '((width . 80) (height . 55)))\n\ |
386 | 1282 These override values given in window system configuration data, like\n\ |
1283 X Windows' defaults database.\n\ | |
765 | 1284 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\ |
1285 For values specific to the separate minibuffer frame, see\n\ | |
1286 `minibuffer-frame-alist'."); | |
1287 Vdefault_frame_alist = Qnil; | |
386 | 1288 |
765 | 1289 defsubr (&Sframep); |
1290 defsubr (&Slive_frame_p); | |
1291 defsubr (&Sselect_frame); | |
1292 defsubr (&Sselected_frame); | |
1293 defsubr (&Swindow_frame); | |
1294 defsubr (&Sframe_root_window); | |
1295 defsubr (&Sframe_selected_window); | |
1296 defsubr (&Sframe_list); | |
1297 defsubr (&Snext_frame); | |
1298 defsubr (&Sdelete_frame); | |
454 | 1299 defsubr (&Smouse_position); |
286 | 1300 defsubr (&Sset_mouse_position); |
1301 #if 0 | |
765 | 1302 defsubr (&Sframe_configuration); |
1303 defsubr (&Srestore_frame_configuration); | |
286 | 1304 #endif |
765 | 1305 defsubr (&Smake_frame_visible); |
1306 defsubr (&Smake_frame_invisible); | |
1307 defsubr (&Siconify_frame); | |
1308 defsubr (&Sframe_visible_p); | |
1309 defsubr (&Svisible_frame_list); | |
1310 defsubr (&Sredirect_frame_focus); | |
1311 defsubr (&Sframe_focus); | |
1312 defsubr (&Sframe_parameters); | |
1313 defsubr (&Smodify_frame_parameters); | |
785 | 1314 #if 0 |
765 | 1315 defsubr (&Sframe_pixel_size); |
1316 defsubr (&Sframe_height); | |
1317 defsubr (&Sframe_width); | |
785 | 1318 #endif |
765 | 1319 defsubr (&Sset_frame_height); |
1320 defsubr (&Sset_frame_width); | |
1321 defsubr (&Sset_frame_size); | |
1322 defsubr (&Sset_frame_position); | |
286 | 1323 #ifndef HAVE_X11 |
1324 defsubr (&Srubber_band_rectangle); | |
1325 #endif /* HAVE_X11 */ | |
1326 } | |
732 | 1327 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1328 #else /* not MULTI_SCREEN */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1329 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1330 /* If we're not using multi-frame stuff, we still need to provide some |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1331 support functions. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1332 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1333 /* Unless this function is defined, providing set-frame-height and |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1334 set-frame-width doesn't help compatibility any, since they both |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1335 want this as their first argument. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1336 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1337 "Return the frame that is now selected.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1338 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1339 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1340 Lisp_Object tem; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1341 XFASTINT (tem) = 0; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1342 return tem; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1343 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1344 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1345 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1346 "Specify that the frame FRAME has LINES lines.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1347 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1348 but that the idea of the actual height of the frame should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1349 (frame, rows, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1350 Lisp_Object frame, rows, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1351 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1352 CHECK_NUMBER (rows, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1353 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1354 change_frame_size (0, XINT (rows), 0, !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1355 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1356 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1357 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1358 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1359 "Specify that the frame FRAME has COLS columns.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1360 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1361 but that the idea of the actual width of the frame should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1362 (frame, cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1363 Lisp_Object frame, cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1364 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1365 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1366 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1367 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1368 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1369 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1370 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1371 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1372 "Sets size of FRAME to COLS by ROWS, measured in characters.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1373 (frame, cols, rows) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1374 Lisp_Object frame, cols, rows; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1375 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1376 CHECK_NUMBER (cols, 2); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1377 CHECK_NUMBER (rows, 1); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1378 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1379 change_frame_size (0, XINT (rows), XINT (cols), 0, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1380 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1381 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1382 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1383 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1384 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1385 "Return number of lines available for display on selected frame.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1386 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1387 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1388 return make_number (FRAME_HEIGHT (selected_frame)); |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1389 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1390 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1391 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1392 "Return number of columns available for display on selected frame.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1393 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1394 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1395 return make_number (FRAME_WIDTH (selected_frame)); |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1396 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1397 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1398 /* These are for backward compatibility with Emacs 18. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1399 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1400 DEFUN ("set-screen-height", Fset_screen_height, Sset_screen_height, 1, 2, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1401 "Tell redisplay that the screen has LINES lines.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1402 Optional second arg non-nil means that redisplay should use LINES lines\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1403 but that the idea of the actual height of the screen should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1404 (lines, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1405 Lisp_Object lines, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1406 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1407 CHECK_NUMBER (lines, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1408 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1409 change_frame_size (0, XINT (lines), 0, !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1410 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1411 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1412 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1413 DEFUN ("set-screen-width", Fset_screen_width, Sset_screen_width, 1, 2, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1414 "Tell redisplay that the screen has COLS columns.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1415 Optional second arg non-nil means that redisplay should use COLS columns\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1416 but that the idea of the actual width of the screen should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1417 (cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1418 Lisp_Object cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1419 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1420 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1421 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1422 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1423 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1424 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1425 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1426 syms_of_frame () |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1427 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1428 defsubr (&Sset_frame_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1429 defsubr (&Sset_frame_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1430 defsubr (&Sset_frame_size); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1431 defsubr (&Sset_screen_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1432 defsubr (&Sset_screen_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1433 defsubr (&Sframe_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1434 Ffset (intern ("screen-height"), intern ("frame-height")); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1435 defsubr (&Sframe_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1436 Ffset (intern ("screen-width"), intern ("frame-width")); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1437 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1438 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1439 #endif /* not MULTI_FRAME */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1440 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1441 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1442 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1443 |