213
|
1 /* Functions for the mswindows window system.
|
|
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995, 1996 Ben Wing.
|
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with XEmacs; see the file COPYING. If not, write to
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: Not synched with FSF. */
|
|
23
|
|
24 /* Authorship:
|
|
25
|
|
26 Ultimately based on FSF.
|
|
27 Substantially rewritten for XEmacs by Ben Wing.
|
|
28 Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4.
|
|
29 */
|
|
30
|
|
31 #include <config.h>
|
|
32 #include "lisp.h"
|
|
33
|
269
|
34 #include "buffer.h"
|
213
|
35 #include "console-msw.h"
|
269
|
36 #include "events.h"
|
231
|
37 #include "faces.h"
|
213
|
38 #include "frame.h"
|
269
|
39 #include "redisplay.h"
|
213
|
40
|
269
|
41 #define MSWINDOWS_FRAME_STYLE (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW)
|
|
42 #define MSWINDOWS_POPUP_STYLE (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP \
|
|
43 | WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX)
|
223
|
44
|
|
45 #define MSWINDOWS_FRAME_EXSTYLE WS_EX_OVERLAPPEDWINDOW
|
269
|
46 #define MSWINDOWS_POPUP_EXSTYLE WS_EX_PALETTEWINDOW
|
|
47
|
|
48 /* Default popup left top corner offset from the same
|
|
49 corner of the parent frame, in pixel */
|
|
50 #define POPUP_OFFSET 30
|
|
51
|
|
52 /* Default popup size, in characters */
|
|
53 #define POPUP_WIDTH 30
|
|
54 #define POPUP_HEIGHT 10
|
223
|
55
|
|
56 #ifdef HAVE_MENUBARS
|
|
57 #define ADJR_MENUFLAG TRUE
|
|
58 #else
|
|
59 #define ADJR_MENUFLAG FALSE
|
|
60 #endif
|
|
61
|
213
|
62 /* Default properties to use when creating frames. */
|
|
63 Lisp_Object Vdefault_mswindows_frame_plist;
|
269
|
64
|
213
|
65 /* Lisp_Object Qname, Qheight, Qwidth, Qinitially_unmapped, Qpopup, Qtop, Qleft; */
|
|
66 Lisp_Object Qinitially_unmapped, Qpopup;
|
|
67
|
269
|
68 /* This does not need to be GC protected, as it holds a
|
|
69 frame Lisp_Object already protected by Fmake_frame */
|
|
70 Lisp_Object mswindows_frame_being_created;
|
|
71
|
|
72 /* Geometry, in characters, as specified by proplist during frame
|
|
73 creation. Memebers are set to -1 for unspecified */
|
|
74 XEMACS_RECT_WH mswindows_frame_target_rect;
|
|
75
|
213
|
76 static void
|
|
77 mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
|
|
78 {
|
|
79 Lisp_Object device = FRAME_DEVICE (f);
|
231
|
80 Lisp_Object initially_unmapped;
|
223
|
81 Lisp_Object name, height, width, popup, top, left;
|
269
|
82 Lisp_Object frame_obj = Qnil;
|
223
|
83 RECT rect;
|
269
|
84 XEMACS_RECT_WH rect_default;
|
223
|
85 DWORD style, exstyle;
|
269
|
86 HWND hwnd, hwnd_parent;
|
213
|
87
|
269
|
88 /* Pick up relevant properties */
|
223
|
89 initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil);
|
|
90 name = Fplist_get (props, Qname, Qnil);
|
269
|
91
|
223
|
92 popup = Fplist_get (props, Qpopup, Qnil);
|
269
|
93 if (EQ (popup, Qt))
|
|
94 popup = Fselected_frame (Qnil);
|
|
95
|
|
96 left = Fplist_get (props, Qleft, Qnil);
|
|
97 if (!NILP (left))
|
|
98 CHECK_INT (left);
|
|
99
|
223
|
100 top = Fplist_get (props, Qtop, Qnil);
|
269
|
101 if (!NILP (top))
|
|
102 CHECK_INT (top);
|
|
103
|
|
104 width = Fplist_get (props, Qwidth, Qnil);
|
|
105 if (!NILP (width))
|
|
106 CHECK_INT (width);
|
|
107
|
|
108 height = Fplist_get (props, Qheight, Qnil);
|
|
109 if (!NILP (height))
|
|
110 CHECK_INT (height);
|
|
111
|
|
112 mswindows_frame_target_rect.left = NILP (left) ? -1 : abs (XINT (left));
|
|
113 mswindows_frame_target_rect.top = NILP (top) ? -1 : abs (XINT (top));
|
|
114 mswindows_frame_target_rect.width = NILP (width) ? -1 : abs (XINT (width));
|
|
115 mswindows_frame_target_rect.height = NILP (height) ? -1 : abs (XINT (height));
|
213
|
116
|
225
|
117 /* These shouldn't be here, but the window is created too early.
|
|
118 The initialization of scrollbar resources is done between
|
|
119 init_frame_1 and init_frame_2 in make_frame. jsparkes */
|
|
120 f->scrollbar_width = make_int (15);
|
|
121 f->scrollbar_height = make_int (15);
|
|
122
|
213
|
123 f->frame_data = xnew_and_zero (struct mswindows_frame);
|
223
|
124
|
269
|
125 /* Misc frame stuff */
|
223
|
126 FRAME_MSWINDOWS_DATA(f)->button2_need_lbutton = 0;
|
|
127 FRAME_MSWINDOWS_DATA(f)->button2_need_rbutton = 0;
|
|
128 FRAME_MSWINDOWS_DATA(f)->button2_is_down = 0;
|
|
129 FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0;
|
|
130 FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0;
|
|
131 FRAME_MSWINDOWS_DATA(f)->sizing = 0;
|
|
132
|
231
|
133 FRAME_MSWINDOWS_MENU_HASHTABLE(f) = Qnil;
|
|
134
|
269
|
135 /* Will initialize these in WM_SIZE handler. We cannot do it now,
|
|
136 because we do not know what is CW_USEDEFAULT height and width */
|
|
137 FRAME_WIDTH (f) = 0;
|
|
138 FRAME_HEIGHT (f) = 0;
|
|
139 FRAME_PIXWIDTH (f) = 0;
|
|
140 FRAME_PIXHEIGHT (f) = 0;
|
|
141
|
|
142 if (NILP (popup))
|
|
143 {
|
|
144 style = MSWINDOWS_FRAME_STYLE;
|
|
145 exstyle = MSWINDOWS_FRAME_EXSTYLE;
|
|
146 hwnd_parent = NULL;
|
|
147
|
|
148 /* We always create am overlapped frame with default size,
|
|
149 and later adjust only requested geometry parameters. */
|
|
150 rect_default.left = rect_default.top = CW_USEDEFAULT;
|
|
151 rect_default.width = rect_default.height = CW_USEDEFAULT;
|
|
152 }
|
|
153 else
|
|
154 {
|
|
155 style = MSWINDOWS_POPUP_STYLE;
|
|
156 exstyle = MSWINDOWS_POPUP_EXSTYLE;
|
|
157
|
|
158 CHECK_MSWINDOWS_FRAME (popup);
|
|
159 hwnd_parent = FRAME_MSWINDOWS_HANDLE (XFRAME (popup));
|
|
160 assert (IsWindow (hwnd_parent));
|
|
161
|
|
162 /* We cannot use CW_USEDEFAULT when creating a popup window.
|
|
163 So by default, we offset the new popup 30 pixels right
|
|
164 and down from its parent, and give it size of 30x10 characters.
|
|
165 These dimensions look adequate on both high and low res monitors */
|
|
166 GetWindowRect (hwnd_parent, &rect);
|
|
167 rect_default.left = rect.left + POPUP_OFFSET;
|
|
168 rect_default.top = rect.top + POPUP_OFFSET;
|
|
169 char_to_real_pixel_size (f, POPUP_WIDTH, POPUP_HEIGHT,
|
|
170 &rect_default.width, &rect_default.height);
|
|
171 }
|
|
172
|
223
|
173 AdjustWindowRectEx(&rect, style, ADJR_MENUFLAG, exstyle);
|
|
174
|
|
175 XSETFRAME (frame_obj, f);
|
269
|
176
|
|
177 mswindows_frame_being_created = frame_obj;
|
|
178
|
|
179 hwnd = CreateWindowEx (exstyle,
|
|
180 XEMACS_CLASS,
|
|
181 STRINGP(f->name) ? XSTRING_DATA(f->name) :
|
|
182 (STRINGP(name) ? XSTRING_DATA(name) : XEMACS_CLASS),
|
|
183 style,
|
|
184 rect_default.left, rect_default.top,
|
|
185 rect_default.width, rect_default.height,
|
|
186 hwnd_parent, NULL, NULL, NULL);
|
|
187
|
|
188 mswindows_frame_being_created = Qnil;
|
|
189
|
|
190 if (hwnd == NULL)
|
|
191 error ("System call to create frame failed");
|
|
192
|
|
193 FRAME_MSWINDOWS_HANDLE(f) = hwnd;
|
|
194
|
|
195 SetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)LISP_TO_VOID(frame_obj));
|
|
196 FRAME_MSWINDOWS_DC(f) = GetDC (hwnd);
|
|
197 FRAME_MSWINDOWS_CDC(f) = CreateCompatibleDC (FRAME_MSWINDOWS_CDC(f));
|
|
198 SetTextAlign (FRAME_MSWINDOWS_DC(f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP);
|
213
|
199 }
|
|
200
|
269
|
201 #if 0 /* #### unused */
|
213
|
202 static void
|
|
203 mswindows_init_frame_2 (struct frame *f, Lisp_Object props)
|
|
204 {
|
|
205 }
|
269
|
206 #endif
|
213
|
207
|
|
208 /* Called after frame's properties are set */
|
|
209 static void
|
|
210 mswindows_init_frame_3 (struct frame *f)
|
|
211 {
|
269
|
212 /* Don't do this earlier or we get a WM_PAINT before the frame is ready */
|
219
|
213 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
|
|
214 SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
|
249
|
215 DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
|
219
|
216 }
|
|
217
|
|
218 static void
|
269
|
219 mswindows_after_init_frame (struct frame *f, int first_on_device,
|
|
220 int first_on_console)
|
|
221 {
|
|
222 /* Windows, unlike X, is very synchronous. After the initial
|
|
223 frame is created, it will never be displayed, except for
|
|
224 hollow border, unless we start pumping messages. Load progress
|
|
225 messages show in the bottom of the hollow frame, which is ugly.
|
|
226 We redipsplay the initial frame here, so modeline and root window
|
|
227 backgorund show.
|
|
228 */
|
|
229 if (first_on_console)
|
|
230 redisplay ();
|
|
231 }
|
|
232
|
|
233 static void
|
231
|
234 mswindows_mark_frame (struct frame *f, void (*markobj) (Lisp_Object))
|
|
235 {
|
|
236 ((markobj) (FRAME_MSWINDOWS_MENU_HASHTABLE (f)));
|
|
237 }
|
|
238
|
|
239 static void
|
219
|
240 mswindows_focus_on_frame (struct frame *f)
|
|
241 {
|
269
|
242 SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
|
213
|
243 }
|
|
244
|
|
245 static void
|
|
246 mswindows_delete_frame (struct frame *f)
|
|
247 {
|
|
248 if (f->frame_data)
|
|
249 {
|
269
|
250 DeleteDC(FRAME_MSWINDOWS_CDC(f));
|
223
|
251 ReleaseDC(FRAME_MSWINDOWS_HANDLE(f), FRAME_MSWINDOWS_DC(f));
|
|
252 DestroyWindow(FRAME_MSWINDOWS_HANDLE(f));
|
269
|
253 xfree (f->frame_data);
|
213
|
254 }
|
269
|
255 f->frame_data = 0;
|
213
|
256 }
|
|
257
|
|
258 static void
|
|
259 mswindows_set_frame_size (struct frame *f, int cols, int rows)
|
|
260 {
|
269
|
261 RECT rect;
|
|
262 rect.left = rect.top = 0;
|
|
263 rect.right = cols;
|
|
264 rect.bottom = rows;
|
223
|
265
|
269
|
266 AdjustWindowRectEx (&rect,
|
223
|
267 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_STYLE),
|
|
268 GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL,
|
|
269 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE));
|
269
|
270
|
|
271 if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
|
|
272 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
|
|
273
|
|
274 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
|
|
275 0, 0, rect.right-rect.left, rect.bottom-rect.top,
|
|
276 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOMOVE);
|
213
|
277 }
|
|
278
|
|
279 static void
|
|
280 mswindows_set_frame_position (struct frame *f, int xoff, int yoff)
|
|
281 {
|
269
|
282 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
|
|
283 xoff, yoff, 0, 0,
|
|
284 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOSIZE);
|
219
|
285 }
|
|
286
|
|
287 static void
|
|
288 mswindows_make_frame_visible (struct frame *f)
|
|
289 {
|
|
290 if (f->iconified)
|
|
291 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
|
|
292 else
|
|
293 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
|
|
294 f->visible = 1;
|
|
295 f->iconified = 0;
|
|
296 }
|
|
297
|
|
298 static void
|
|
299 mswindows_make_frame_invisible (struct frame *f)
|
|
300 {
|
|
301 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_HIDE);
|
|
302 f->visible = -1;
|
|
303 }
|
|
304
|
|
305 static int
|
|
306 mswindows_frame_visible_p (struct frame *f)
|
|
307 {
|
|
308 return IsWindowVisible (FRAME_MSWINDOWS_HANDLE(f))
|
|
309 && !IsIconic (FRAME_MSWINDOWS_HANDLE(f));
|
|
310 }
|
|
311
|
|
312
|
|
313 static void
|
|
314 mswindows_iconify_frame (struct frame *f)
|
|
315 {
|
|
316 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_MINIMIZE);
|
|
317 f->visible = 0;
|
|
318 f->iconified = 1;
|
|
319 }
|
|
320
|
|
321 static int
|
|
322 mswindows_frame_iconified_p (struct frame *f)
|
|
323 {
|
|
324 return IsIconic (FRAME_MSWINDOWS_HANDLE(f));
|
|
325 }
|
|
326
|
|
327 static void
|
|
328 mswindows_raise_frame (struct frame *f)
|
|
329 {
|
|
330 BringWindowToTop (FRAME_MSWINDOWS_HANDLE(f));
|
|
331 /* XXX Should we do SetWindowForeground too ? */
|
|
332 }
|
|
333
|
|
334 static void
|
|
335 mswindows_lower_frame (struct frame *f)
|
|
336 {
|
269
|
337 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), HWND_BOTTOM, 0, 0, 0, 0,
|
|
338 SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING);
|
219
|
339 }
|
|
340
|
|
341 static void
|
|
342 mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title)
|
|
343 {
|
|
344 SetWindowText (FRAME_MSWINDOWS_HANDLE(f), title);
|
213
|
345 }
|
|
346
|
|
347 static void
|
|
348 mswindows_set_frame_properties (struct frame *f, Lisp_Object plist)
|
|
349 {
|
245
|
350 int x=0, y=0;
|
213
|
351 int width = 0, height = 0;
|
|
352 BOOL width_specified_p = FALSE;
|
|
353 BOOL height_specified_p = FALSE;
|
|
354 BOOL x_specified_p = FALSE;
|
|
355 BOOL y_specified_p = FALSE;
|
|
356 Lisp_Object tail;
|
|
357
|
|
358 /* Extract the properties from plist */
|
|
359 for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
|
|
360 {
|
|
361 Lisp_Object prop = Fcar (tail);
|
|
362 Lisp_Object val = Fcar (Fcdr (tail));
|
|
363
|
|
364 if (SYMBOLP (prop))
|
|
365 {
|
|
366 /* Kludge to handle the font property. */
|
|
367 if (EQ (prop, Qfont))
|
|
368 {
|
|
369 /* If the value is not a string we silently ignore it. */
|
|
370 if (STRINGP (val))
|
|
371 {
|
|
372 Lisp_Object frm, font_spec;
|
|
373
|
|
374 XSETFRAME (frm, f);
|
|
375 font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil);
|
|
376
|
|
377 Fadd_spec_to_specifier (font_spec, val, frm, Qnil, Qnil);
|
|
378 update_frame_face_values (f);
|
|
379 }
|
|
380 }
|
|
381 else if (EQ (prop, Qwidth))
|
|
382 {
|
|
383 CHECK_INT (val);
|
|
384 width = XINT (val);
|
|
385 width_specified_p = TRUE;
|
|
386 }
|
|
387 else if (EQ (prop, Qheight))
|
|
388 {
|
|
389 CHECK_INT (val);
|
|
390 height = XINT (val);
|
|
391 height_specified_p = TRUE;
|
|
392 }
|
|
393 else if (EQ (prop, Qleft))
|
|
394 {
|
|
395 CHECK_INT (val);
|
|
396 x = XINT (val);
|
|
397 x_specified_p = TRUE;
|
|
398 }
|
|
399 else if (EQ (prop, Qtop))
|
|
400 {
|
|
401 CHECK_INT (val);
|
|
402 y = XINT (val);
|
|
403 y_specified_p = TRUE;
|
|
404 }
|
|
405 }
|
|
406 }
|
|
407
|
269
|
408 /* Now we've extracted the properties, apply them.
|
|
409 Do not apply geometric properties during frame creation. This
|
|
410 is excessive anyways, and this loses becuase WM_SIZE has not
|
|
411 been sent yet, so frame width and height fields are not initialized
|
|
412 */
|
|
413 if (f->init_finished
|
|
414 && (width_specified_p || height_specified_p || x_specified_p || y_specified_p))
|
213
|
415 {
|
269
|
416 Lisp_Object frame = Qnil;
|
213
|
417 RECT rect;
|
|
418 int pixel_width, pixel_height;
|
|
419 XSETFRAME (frame, f);
|
|
420
|
269
|
421 char_to_real_pixel_size (f, width, height, &pixel_width, &pixel_height);
|
213
|
422 if (!width_specified_p)
|
269
|
423 pixel_width = FRAME_PIXWIDTH (f);
|
213
|
424 if (!height_specified_p)
|
269
|
425 pixel_height = FRAME_PIXHEIGHT (f);
|
213
|
426
|
|
427 GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rect);
|
|
428 if (!x_specified_p)
|
|
429 x = rect.left;
|
|
430 if (!y_specified_p)
|
|
431 y = rect.top;
|
219
|
432
|
269
|
433 rect.left = rect.top = 0;
|
|
434 rect.right = pixel_width;
|
|
435 rect.bottom = pixel_height;
|
223
|
436 AdjustWindowRectEx (&rect,
|
|
437 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_STYLE),
|
|
438 GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL,
|
|
439 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE));
|
269
|
440
|
223
|
441
|
269
|
442 if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
|
|
443 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
|
|
444
|
|
445 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
|
|
446 x, y, rect.right - rect.left, rect.bottom - rect.top,
|
|
447 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING
|
|
448 | ((width_specified_p || height_specified_p) ? 0 : SWP_NOSIZE)
|
|
449 | ((x_specified_p || y_specified_p) ? 0 : SWP_NOMOVE));
|
213
|
450 }
|
|
451 }
|
|
452
|
269
|
453 static Lisp_Object
|
|
454 mswindows_get_frame_parent (struct frame *f)
|
|
455 {
|
|
456 HWND hwnd = FRAME_MSWINDOWS_HANDLE(f);
|
|
457 hwnd = GetParent (hwnd);
|
|
458 if (hwnd)
|
|
459 {
|
|
460 Lisp_Object parent;
|
|
461 VOID_TO_LISP (parent, GetWindowLong (hwnd, XWL_FRAMEOBJ));
|
|
462 assert (FRAME_MSWINDOWS_P (XFRAME (parent)));
|
|
463 return parent;
|
|
464 }
|
|
465 else
|
|
466 return Qnil;
|
|
467 }
|
|
468
|
|
469 static void
|
|
470 mswindows_update_frame_external_traits (struct frame* frm, Lisp_Object name)
|
|
471 {
|
|
472 if (EQ (name, Qfont))
|
|
473 {
|
|
474 /* We resize the frame along with the font if user preference
|
|
475 of MS style compliance is turned off, and if font size has
|
|
476 really changed
|
|
477 */
|
|
478 /* #### Frame gets resized after font here */
|
|
479 if (1)
|
|
480 {
|
|
481 int new_char_height, new_char_width;
|
|
482 pixel_to_real_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm),
|
|
483 &new_char_width, &new_char_height);
|
|
484 if (new_char_width != MSWINDOWS_FRAME_CHARWIDTH (frm)
|
|
485 || new_char_height != MSWINDOWS_FRAME_CHARHEIGHT (frm))
|
|
486 {
|
|
487 Lisp_Object frame;
|
|
488 XSETFRAME (frame, frm);
|
|
489 Fset_frame_size (frame, MSWINDOWS_FRAME_CHARWIDTH (frm),
|
|
490 MSWINDOWS_FRAME_CHARHEIGHT (frm), Qnil);
|
|
491 }
|
|
492 }
|
|
493
|
|
494 /* This resizes minibuffer and redraws modeline. */
|
|
495 {
|
|
496 int width, height;
|
|
497 pixel_to_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm),
|
|
498 &width, &height);
|
|
499 change_frame_size (frm, height, width, 1);
|
|
500 }
|
|
501 }
|
|
502 }
|
213
|
503
|
|
504 void
|
|
505 console_type_create_frame_mswindows (void)
|
|
506 {
|
|
507 /* frame methods */
|
|
508 CONSOLE_HAS_METHOD (mswindows, init_frame_1);
|
269
|
509 /* CONSOLE_HAS_METHOD (mswindows, init_frame_2); */
|
213
|
510 CONSOLE_HAS_METHOD (mswindows, init_frame_3);
|
269
|
511 CONSOLE_HAS_METHOD (mswindows, after_init_frame);
|
231
|
512 CONSOLE_HAS_METHOD (mswindows, mark_frame);
|
219
|
513 CONSOLE_HAS_METHOD (mswindows, focus_on_frame);
|
213
|
514 CONSOLE_HAS_METHOD (mswindows, delete_frame);
|
|
515 /* CONSOLE_HAS_METHOD (mswindows, get_mouse_position); */
|
|
516 /* CONSOLE_HAS_METHOD (mswindows, set_mouse_position); */
|
219
|
517 CONSOLE_HAS_METHOD (mswindows, raise_frame);
|
|
518 CONSOLE_HAS_METHOD (mswindows, lower_frame);
|
|
519 CONSOLE_HAS_METHOD (mswindows, make_frame_visible);
|
|
520 CONSOLE_HAS_METHOD (mswindows, make_frame_invisible);
|
|
521 CONSOLE_HAS_METHOD (mswindows, iconify_frame);
|
213
|
522 CONSOLE_HAS_METHOD (mswindows, set_frame_size);
|
|
523 CONSOLE_HAS_METHOD (mswindows, set_frame_position);
|
|
524 /* CONSOLE_HAS_METHOD (mswindows, frame_property); */
|
|
525 /* CONSOLE_HAS_METHOD (mswindows, internal_frame_property_p); */
|
|
526 /* CONSOLE_HAS_METHOD (mswindows, frame_properties); */
|
|
527 CONSOLE_HAS_METHOD (mswindows, set_frame_properties);
|
219
|
528 CONSOLE_HAS_METHOD (mswindows, set_title_from_bufbyte);
|
213
|
529 /* CONSOLE_HAS_METHOD (mswindows, set_icon_name_from_bufbyte); */
|
219
|
530 CONSOLE_HAS_METHOD (mswindows, frame_visible_p);
|
213
|
531 /* CONSOLE_HAS_METHOD (mswindows, frame_totally_visible_p); */
|
219
|
532 CONSOLE_HAS_METHOD (mswindows, frame_iconified_p);
|
213
|
533 /* CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); */
|
|
534 /* CONSOLE_HAS_METHOD (mswindows, set_frame_icon); */
|
269
|
535 CONSOLE_HAS_METHOD (mswindows, get_frame_parent);
|
|
536 CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits);
|
213
|
537 }
|
|
538
|
|
539 void
|
|
540 syms_of_frame_mswindows (void)
|
|
541 {
|
|
542 #if 0 /* XXX these are in general.c */
|
|
543 defsymbol (&Qname, "name");
|
|
544 defsymbol (&Qheight, "height");
|
|
545 defsymbol (&Qwidth, "width");
|
|
546 defsymbol (&Qtop, "top");
|
|
547 defsymbol (&Qleft, "left");
|
|
548 #endif
|
|
549 defsymbol (&Qinitially_unmapped, "initially-unmapped");
|
|
550 defsymbol (&Qpopup, "popup");
|
|
551 }
|
|
552
|
|
553 void
|
|
554 vars_of_frame_mswindows (void)
|
|
555 {
|
269
|
556 mswindows_frame_being_created = Qnil;
|
|
557 staticpro (&mswindows_frame_being_created);
|
|
558
|
213
|
559 DEFVAR_LISP ("default-mswindows-frame-plist", &Vdefault_mswindows_frame_plist /*
|
|
560 Plist of default frame-creation properties for mswindows frames.
|
|
561 These override what is specified in `default-frame-plist', but are
|
|
562 overridden by the arguments to the particular call to `make-frame'.
|
|
563
|
|
564 Note: In many cases, properties of a frame are available as specifiers
|
|
565 instead of through the frame-properties mechanism.
|
|
566
|
|
567 Here is a list of recognized frame properties, other than those
|
|
568 documented in `set-frame-properties' (they can be queried and
|
|
569 set at any time, except as otherwise noted):
|
|
570
|
|
571 initially-unmapped If non-nil, the frame will not be visible
|
|
572 when it is created. In this case, you
|
|
573 need to call `make-frame-visible' to make
|
|
574 the frame appear.
|
|
575 popup If non-nil, it should be a frame, and this
|
|
576 frame will be created as a "popup" frame
|
|
577 whose parent is the given frame. This
|
|
578 will make the window manager treat the
|
|
579 frame as a dialog box, which may entail
|
|
580 doing different things (e.g. not asking
|
|
581 for positioning, and not iconifying
|
|
582 separate from its parent).
|
|
583 top Y position (in pixels) of the upper-left
|
|
584 outermost corner of the frame (i.e. the
|
|
585 upper-left of the window-manager
|
|
586 decorations).
|
|
587 left X position (in pixels) of the upper-left
|
|
588 outermost corner of the frame (i.e. the
|
|
589 upper-left of the window-manager
|
|
590 decorations).
|
|
591
|
|
592 See also `default-frame-plist', which specifies properties which apply
|
|
593 to all frames, not just mswindows frames.
|
|
594 */ );
|
|
595 Vdefault_mswindows_frame_plist = Qnil;
|
|
596
|
|
597 mswindows_console_methods->device_specific_frame_props =
|
|
598 &Vdefault_mswindows_frame_plist;
|
|
599 }
|