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.
5 This file is part of XEmacs.
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
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
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. */
22 /* Synched up with: Not synched with FSF. */
26 Ultimately based on FSF.
27 Substantially rewritten for XEmacs by Ben Wing.
28 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
29 Graphics features added and frame resizing fiddled with by Andy Piper.
36 #include "console-msw.h"
37 #include "glyphs-msw.h"
42 #include "redisplay.h"
45 #define MSWINDOWS_FRAME_STYLE (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW)
46 #define MSWINDOWS_POPUP_STYLE (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP \
47 | WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX)
49 #define MSWINDOWS_FRAME_EXSTYLE WS_EX_OVERLAPPEDWINDOW
50 #define MSWINDOWS_POPUP_EXSTYLE WS_EX_PALETTEWINDOW
52 /* Default popup left top corner offset from the same
53 corner of the parent frame, in pixel */
54 #define POPUP_OFFSET 30
56 /* Default popup size, in characters */
57 #define POPUP_WIDTH 30
58 #define POPUP_HEIGHT 10
60 /* Default popup size, in characters */
61 #define DEFAULT_FRAME_WIDTH 80
62 #define DEFAULT_FRAME_HEIGHT 35
65 #define ADJR_MENUFLAG TRUE
67 #define ADJR_MENUFLAG FALSE
70 /* Default properties to use when creating frames. */
71 Lisp_Object Vdefault_mswindows_frame_plist;
72 Lisp_Object Vmswindows_use_system_frame_size_defaults;
74 /* This does not need to be GC protected, as it holds a
75 frame Lisp_Object already protected by Fmake_frame */
76 Lisp_Object Vmswindows_frame_being_created;
79 mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
81 Lisp_Object initially_unmapped;
82 Lisp_Object name, height, width, popup, top, left;
83 Lisp_Object frame_obj = Qnil;
85 XEMACS_RECT_WH rect_default;
87 HWND hwnd, hwnd_parent;
89 /* Pick up relevant properties */
90 initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil);
91 name = Fplist_get (props, Qname, Qnil);
93 popup = Fplist_get (props, Qpopup, Qnil);
95 popup = Fselected_frame (Qnil);
97 left = Fplist_get (props, Qleft, Qnil);
101 top = Fplist_get (props, Qtop, Qnil);
105 width = Fplist_get (props, Qwidth, Qnil);
109 height = Fplist_get (props, Qheight, Qnil);
113 f->frame_data = xnew_and_zero (struct mswindows_frame);
114 FRAME_MSWINDOWS_TARGET_RECT (f) = xnew_and_zero (XEMACS_RECT_WH);
116 FRAME_MSWINDOWS_TARGET_RECT (f)->left = NILP (left) ? -1 : abs (XINT (left));
117 FRAME_MSWINDOWS_TARGET_RECT (f)->top = NILP (top) ? -1 : abs (XINT (top));
118 FRAME_MSWINDOWS_TARGET_RECT (f)->width = NILP (width) ? -1 :
120 FRAME_MSWINDOWS_TARGET_RECT (f)->height = NILP (height) ? -1 :
123 /* Misc frame stuff */
124 FRAME_MSWINDOWS_DATA(f)->button2_need_lbutton = 0;
125 FRAME_MSWINDOWS_DATA(f)->button2_need_rbutton = 0;
126 FRAME_MSWINDOWS_DATA(f)->button2_is_down = 0;
127 FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0;
128 FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0;
129 FRAME_MSWINDOWS_DATA(f)->sizing = 0;
130 FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil;
132 FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) =
133 make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
136 /* Will initialize these in WM_SIZE handler. We cannot do it now,
137 because we do not know what is CW_USEDEFAULT height and width */
139 FRAME_HEIGHT (f) = 0;
140 FRAME_PIXWIDTH (f) = 0;
141 FRAME_PIXHEIGHT (f) = 0;
145 style = MSWINDOWS_FRAME_STYLE;
146 exstyle = MSWINDOWS_FRAME_EXSTYLE;
149 rect_default.left = rect_default.top = CW_USEDEFAULT;
150 rect_default.width = rect_default.height = CW_USEDEFAULT;
154 style = MSWINDOWS_POPUP_STYLE;
155 exstyle = MSWINDOWS_POPUP_EXSTYLE;
157 CHECK_MSWINDOWS_FRAME (popup);
158 hwnd_parent = FRAME_MSWINDOWS_HANDLE (XFRAME (popup));
159 assert (IsWindow (hwnd_parent));
161 /* We cannot use CW_USEDEFAULT when creating a popup window.
162 So by default, we offset the new popup 30 pixels right
163 and down from its parent, and give it size of 30x10 characters.
164 These dimensions look adequate on both high and low res monitors */
165 GetWindowRect (hwnd_parent, &rect);
166 rect_default.left = rect.left + POPUP_OFFSET;
167 rect_default.top = rect.top + POPUP_OFFSET;
168 char_to_real_pixel_size (f, POPUP_WIDTH, POPUP_HEIGHT,
169 &rect_default.width, &rect_default.height);
172 AdjustWindowRectEx(&rect, style, ADJR_MENUFLAG, exstyle);
174 XSETFRAME (frame_obj, f);
176 Vmswindows_frame_being_created = frame_obj;
178 hwnd = CreateWindowEx (exstyle,
180 STRINGP(f->name) ? XSTRING_DATA(f->name) :
181 (STRINGP(name) ? XSTRING_DATA(name) : XEMACS_CLASS),
183 rect_default.left, rect_default.top,
184 rect_default.width, rect_default.height,
185 hwnd_parent, NULL, NULL, NULL);
187 Vmswindows_frame_being_created = Qnil;
190 error ("System call to create frame failed");
192 FRAME_MSWINDOWS_HANDLE(f) = hwnd;
194 SetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)LISP_TO_VOID(frame_obj));
195 FRAME_MSWINDOWS_DC(f) = GetDC (hwnd);
196 FRAME_MSWINDOWS_CDC(f) = CreateCompatibleDC (FRAME_MSWINDOWS_CDC(f));
197 SetTextAlign (FRAME_MSWINDOWS_DC(f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP);
201 mswindows_init_frame_2 (struct frame *f, Lisp_Object props)
203 if (NILP (Vmswindows_use_system_frame_size_defaults))
205 /* I don't think anything can set the frame size before this
206 since we don't have X resources. This may change if we look
207 at the registry. Even so these values can get overridden
209 XEMACS_RECT_WH dest = { -1, -1, DEFAULT_FRAME_WIDTH,
210 DEFAULT_FRAME_HEIGHT };
211 mswindows_size_frame_internal (f, &dest);
215 /* Called after frame's properties are set */
217 mswindows_init_frame_3 (struct frame *f)
219 /* Don't do this earlier or we get a WM_PAINT before the frame is ready.
220 * The SW_x parameter in the first call that an app makes to ShowWindow is
221 * ignored, and the parameter specified in the caller's STARTUPINFO is
222 * substituted instead. That parameter is SW_HIDE if we were started by
223 * runemacs, so call this twice. #### runemacs is evil */
224 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
225 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
226 SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
227 DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
231 mswindows_after_init_frame (struct frame *f, int first_on_device,
232 int first_on_console)
234 /* Windows, unlike X, is very synchronous. After the initial
235 frame is created, it will never be displayed, except for
236 hollow border, unless we start pumping messages. Load progress
237 messages show in the bottom of the hollow frame, which is ugly.
238 We redisplay the initial frame here, so modeline and root window
241 if (first_on_console)
246 mswindows_mark_frame (struct frame *f, void (*markobj) (Lisp_Object))
248 markobj (FRAME_MSWINDOWS_MENU_HASH_TABLE (f));
250 markobj (FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f));
255 mswindows_focus_on_frame (struct frame *f)
257 SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
261 mswindows_delete_frame (struct frame *f)
265 DeleteDC(FRAME_MSWINDOWS_CDC(f));
266 ReleaseDC(FRAME_MSWINDOWS_HANDLE(f), FRAME_MSWINDOWS_DC(f));
267 DestroyWindow(FRAME_MSWINDOWS_HANDLE(f));
268 xfree (f->frame_data);
274 mswindows_set_frame_size (struct frame *f, int width, int height)
277 rect.left = rect.top = 0;
279 rect.bottom = height;
281 AdjustWindowRectEx (&rect,
282 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_STYLE),
283 GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL,
284 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE));
286 if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
287 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
289 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
290 0, 0, rect.right-rect.left, rect.bottom-rect.top,
291 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOMOVE);
295 mswindows_set_frame_position (struct frame *f, int xoff, int yoff)
297 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
299 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOSIZE);
303 mswindows_make_frame_visible (struct frame *f)
306 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
308 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
314 mswindows_make_frame_invisible (struct frame *f)
316 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_HIDE);
321 mswindows_frame_totally_visible_p (struct frame *f)
323 RECT rc_me, rc_other, rc_temp;
324 HWND hwnd = FRAME_MSWINDOWS_HANDLE(f);
326 /* We test against not a whole window rectangle, only against its
327 client part. So, if non-client are is covered and client area is
328 not, we return true. */
329 GetClientRect (hwnd, &rc_me);
330 MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT)&rc_me, 2);
332 /* First see if we're off the desktop */
333 GetWindowRect (GetDesktopWindow(), &rc_other);
334 UnionRect(&rc_temp, &rc_me, &rc_other);
335 if (!EqualRect (&rc_temp, &rc_other))
338 /* Then see if any window above us obscures us */
339 while ((hwnd = GetWindow (hwnd, GW_HWNDPREV)) != NULL)
340 if (IsWindowVisible (hwnd))
342 GetWindowRect (hwnd, &rc_other);
343 if (IntersectRect(&rc_temp, &rc_me, &rc_other))
351 mswindows_frame_visible_p (struct frame *f)
353 return IsWindowVisible (FRAME_MSWINDOWS_HANDLE(f))
354 && !IsIconic (FRAME_MSWINDOWS_HANDLE(f));
359 mswindows_iconify_frame (struct frame *f)
361 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_MINIMIZE);
367 mswindows_frame_iconified_p (struct frame *f)
369 return IsIconic (FRAME_MSWINDOWS_HANDLE(f));
373 mswindows_set_frame_icon (struct frame *f)
375 if (IMAGE_INSTANCEP (f->icon)
376 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (f->icon)))
378 if (!XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon))
380 mswindows_initialize_image_instance_icon (XIMAGE_INSTANCE (f->icon),
384 SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON,
385 (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon));
390 mswindows_set_frame_pointer (struct frame *f)
392 if (IMAGE_INSTANCEP (f->pointer)
393 && IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (f->pointer)) == IMAGE_POINTER)
395 SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HCURSOR,
396 (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->pointer));
401 mswindows_set_mouse_position (struct window *w, int x, int y)
403 struct frame *f = XFRAME (w->frame);
406 pt.x = w->pixel_left + x;
407 pt.y = w->pixel_top + y;
408 ClientToScreen (FRAME_MSWINDOWS_HANDLE(f), &pt);
409 SetCursorPos (pt.x, pt.y);
413 mswindows_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y)
420 /* What's under cursor? */
421 hwnd = WindowFromPoint (pt);
425 /* Get grandest parent of the window */
428 while ((hwnd_parent = GetParent (hwnd)) != NULL)
432 /* Make sure it belongs to us */
433 if (GetWindowThreadProcessId (hwnd, NULL) != GetCurrentThreadId ())
436 /* And that the window is an XEmacs frame */
438 char class_name [sizeof(XEMACS_CLASS) + 1];
439 if (!GetClassName (hwnd, class_name, sizeof(XEMACS_CLASS))
440 || strcmp (class_name, XEMACS_CLASS) != 0)
445 ScreenToClient (hwnd, &pt);
446 VOID_TO_LISP (*frame, GetWindowLong (hwnd, XWL_FRAMEOBJ));
453 mswindows_raise_frame (struct frame *f)
455 BringWindowToTop (FRAME_MSWINDOWS_HANDLE(f));
456 /* XXX Should we do SetWindowForeground too ? */
460 mswindows_lower_frame (struct frame *f)
462 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), HWND_BOTTOM, 0, 0, 0, 0,
463 SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING);
467 mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title)
469 unsigned int new_checksum = hash_string (title, strlen (title));
470 if (new_checksum != FRAME_MSWINDOWS_TITLE_CHECKSUM(f))
472 FRAME_MSWINDOWS_TITLE_CHECKSUM(f) = new_checksum;
473 SetWindowText (FRAME_MSWINDOWS_HANDLE(f), title);
478 mswindows_frame_property (struct frame *f, Lisp_Object property)
480 if (EQ (Qleft, property) || EQ (Qtop, property))
483 GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rc);
484 return make_int (EQ (Qtop, property) ? rc.top : rc.left);
490 mswindows_internal_frame_property_p (struct frame *f, Lisp_Object property)
492 return EQ (property, Qleft)
493 || EQ (property, Qtop);
494 /* #### frame-x.c has also this. Why?
495 || STRINGP (property);
500 mswindows_frame_properties (struct frame *f)
502 Lisp_Object props = Qnil;
504 GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rc);
506 props = cons3 (Qtop, make_int (rc.top), props);
507 props = cons3 (Qleft, make_int (rc.left), props);
513 mswindows_set_frame_properties (struct frame *f, Lisp_Object plist)
516 int width = -1, height = -1;
517 BOOL width_specified_p = FALSE;
518 BOOL height_specified_p = FALSE;
519 BOOL x_specified_p = FALSE;
520 BOOL y_specified_p = FALSE;
523 /* Extract the properties from plist */
524 for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
526 Lisp_Object prop = Fcar (tail);
527 Lisp_Object val = Fcar (Fcdr (tail));
531 /* Kludge to handle the font property. */
532 if (EQ (prop, Qfont))
534 /* If the value is not a string we silently ignore it. */
537 Lisp_Object frm, font_spec;
540 font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil);
542 Fadd_spec_to_specifier (font_spec, val, frm, Qnil, Qnil);
543 update_frame_face_values (f);
546 else if (EQ (prop, Qwidth))
550 width_specified_p = TRUE;
552 else if (EQ (prop, Qheight))
556 height_specified_p = TRUE;
558 else if (EQ (prop, Qleft))
562 x_specified_p = TRUE;
564 else if (EQ (prop, Qtop))
568 y_specified_p = TRUE;
573 /* Now we've extracted the properties, apply them.
574 Do not apply geometric properties during frame creation. This
575 is excessive anyways, and this loses becuase WM_SIZE has not
576 been sent yet, so frame width and height fields are not initialized.
578 unfortunately WM_SIZE loses as well since the resize is only
579 applied once and the first time WM_SIZE is applied not everything
580 is initialised in the frame (toolbars for instance). enabling
581 this always makes no visible difference and fixes a whole host of
582 bugs (and is more consistent with X) so I am going to reenable it.
584 if ( FRAME_PIXWIDTH (f) && FRAME_PIXHEIGHT (f)
585 && (width_specified_p || height_specified_p || x_specified_p || y_specified_p))
587 XEMACS_RECT_WH dest = { x, y, width, height };
589 mswindows_size_frame_internal (f, &dest);
593 void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest)
596 int pixel_width, pixel_height;
597 int size_p = (dest->width >=0 || dest->height >=0);
598 int move_p = (dest->top >=0 || dest->left >=0);
599 struct device* d = XDEVICE (FRAME_DEVICE (f));
600 char_to_real_pixel_size (f, dest->width, dest->height, &pixel_width, &pixel_height);
603 pixel_width = FRAME_PIXWIDTH (f);
604 if (dest->height < 0)
605 pixel_height = FRAME_PIXHEIGHT (f);
607 GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rect);
609 dest->left = rect.left;
611 dest->top = rect.top;
613 rect.left = rect.top = 0;
614 rect.right = pixel_width;
615 rect.bottom = pixel_height;
617 AdjustWindowRectEx (&rect,
618 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_STYLE),
619 GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL,
620 GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE));
622 /* resize and move the window so that it fits on the screen. This is
623 not restrictive since this will happen later anyway in WM_SIZE. We
624 have to do this after adjusting the rect to account for menubar
626 pixel_width = rect.right - rect.left;
627 pixel_height = rect.bottom - rect.top;
628 if (pixel_width > DEVICE_MSWINDOWS_HORZRES(d))
630 pixel_width = DEVICE_MSWINDOWS_HORZRES(d);
633 if (pixel_height > DEVICE_MSWINDOWS_VERTRES(d))
635 pixel_height = DEVICE_MSWINDOWS_VERTRES(d);
639 /* adjust position so window is on screen */
640 if (dest->left + pixel_width > DEVICE_MSWINDOWS_HORZRES(d))
642 dest->left = DEVICE_MSWINDOWS_HORZRES(d) - pixel_width;
645 if (dest->top + pixel_height > DEVICE_MSWINDOWS_VERTRES(d))
647 dest->top = DEVICE_MSWINDOWS_VERTRES(d) - pixel_height;
651 if (IsIconic (FRAME_MSWINDOWS_HANDLE(f))
652 || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
653 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
655 SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
656 dest->left, dest->top, pixel_width, pixel_height,
657 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING
658 | (size_p ? 0 : SWP_NOSIZE)
659 | (move_p ? 0 : SWP_NOMOVE));
663 mswindows_get_frame_parent (struct frame *f)
665 HWND hwnd = FRAME_MSWINDOWS_HANDLE(f);
666 hwnd = GetParent (hwnd);
670 VOID_TO_LISP (parent, GetWindowLong (hwnd, XWL_FRAMEOBJ));
671 assert (FRAME_MSWINDOWS_P (XFRAME (parent)));
679 mswindows_update_frame_external_traits (struct frame* frm, Lisp_Object name)
684 mswindows_frame_size_fixed_p (struct frame *f)
686 /* Frame size cannot change if the frame is maximized */
687 return IsZoomed (FRAME_MSWINDOWS_HANDLE (f));
691 console_type_create_frame_mswindows (void)
694 CONSOLE_HAS_METHOD (mswindows, init_frame_1);
695 CONSOLE_HAS_METHOD (mswindows, init_frame_2);
696 CONSOLE_HAS_METHOD (mswindows, init_frame_3);
697 CONSOLE_HAS_METHOD (mswindows, after_init_frame);
698 CONSOLE_HAS_METHOD (mswindows, mark_frame);
699 CONSOLE_HAS_METHOD (mswindows, focus_on_frame);
700 CONSOLE_HAS_METHOD (mswindows, delete_frame);
701 CONSOLE_HAS_METHOD (mswindows, get_mouse_position);
702 CONSOLE_HAS_METHOD (mswindows, set_mouse_position);
703 CONSOLE_HAS_METHOD (mswindows, raise_frame);
704 CONSOLE_HAS_METHOD (mswindows, lower_frame);
705 CONSOLE_HAS_METHOD (mswindows, make_frame_visible);
706 CONSOLE_HAS_METHOD (mswindows, make_frame_invisible);
707 CONSOLE_HAS_METHOD (mswindows, iconify_frame);
708 CONSOLE_HAS_METHOD (mswindows, set_frame_size);
709 CONSOLE_HAS_METHOD (mswindows, set_frame_position);
710 CONSOLE_HAS_METHOD (mswindows, frame_property);
711 CONSOLE_HAS_METHOD (mswindows, internal_frame_property_p);
712 CONSOLE_HAS_METHOD (mswindows, frame_properties);
713 CONSOLE_HAS_METHOD (mswindows, set_frame_properties);
714 CONSOLE_HAS_METHOD (mswindows, set_title_from_bufbyte);
715 /* CONSOLE_HAS_METHOD (mswindows, set_icon_name_from_bufbyte); */
716 CONSOLE_HAS_METHOD (mswindows, frame_visible_p);
717 CONSOLE_HAS_METHOD (mswindows, frame_totally_visible_p);
718 CONSOLE_HAS_METHOD (mswindows, frame_iconified_p);
719 CONSOLE_HAS_METHOD (mswindows, set_frame_pointer);
720 CONSOLE_HAS_METHOD (mswindows, set_frame_icon);
721 CONSOLE_HAS_METHOD (mswindows, get_frame_parent);
722 CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits);
723 CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p);
727 syms_of_frame_mswindows (void)
732 vars_of_frame_mswindows (void)
734 /* Needn't staticpro -- see comment above. */
735 Vmswindows_frame_being_created = Qnil;
737 DEFVAR_LISP ("mswindows-use-system-frame-size-defaults", &Vmswindows_use_system_frame_size_defaults /*
738 Controls whether to use system or XEmacs defaults for frame size.
739 If nil then reasonable defaults are used for intial frame sizes. If t
740 then the system will choose default sizes for the frame.
742 Vmswindows_use_system_frame_size_defaults = Qnil;
744 DEFVAR_LISP ("default-mswindows-frame-plist", &Vdefault_mswindows_frame_plist /*
745 Plist of default frame-creation properties for mswindows frames.
746 These override what is specified in `default-frame-plist', but are
747 overridden by the arguments to the particular call to `make-frame'.
749 Note: In many cases, properties of a frame are available as specifiers
750 instead of through the frame-properties mechanism.
752 Here is a list of recognized frame properties, other than those
753 documented in `set-frame-properties' (they can be queried and
754 set at any time, except as otherwise noted):
756 initially-unmapped If non-nil, the frame will not be visible
757 when it is created. In this case, you
758 need to call `make-frame-visible' to make
760 popup If non-nil, it should be a frame, and this
761 frame will be created as a "popup" frame
762 whose parent is the given frame. This
763 will make the window manager treat the
764 frame as a dialog box, which may entail
765 doing different things (e.g. not asking
766 for positioning, and not iconifying
767 separate from its parent).
768 top Y position (in pixels) of the upper-left
769 outermost corner of the frame (i.e. the
770 upper-left of the window-manager
772 left X position (in pixels) of the upper-left
773 outermost corner of the frame (i.e. the
774 upper-left of the window-manager
777 See also `default-frame-plist', which specifies properties which apply
778 to all frames, not just mswindows frames.
780 Vdefault_mswindows_frame_plist = Qnil;
782 mswindows_console_methods->device_specific_frame_props =
783 &Vdefault_mswindows_frame_plist;