comparison src/frame.c @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents 0293115a14e9
children 8fc7fe29b841
comparison
equal deleted inserted replaced
19:ac1f612d5250 20:859a2309aef8
363 foolist = Fcopy_sequence (foolist); 363 foolist = Fcopy_sequence (foolist);
364 364
365 return foolist; 365 return foolist;
366 } 366 }
367 367
368 DEFUN ("make-frame", Fmake_frame, Smake_frame, 0, 2, "" /* 368 DEFUN ("make-frame", Fmake_frame, 0, 2, "", /*
369 Create a new frame, displaying the current buffer. 369 Create a new frame, displaying the current buffer.
370 370
371 Optional argument PROPS is a property list (a list of alternating 371 Optional argument PROPS is a property list (a list of alternating
372 keyword-value specifcations) of properties for the new frame. 372 keyword-value specifcations) of properties for the new frame.
373 \(An alist is accepted for backward compatibility but should not 373 \(An alist is accepted for backward compatibility but should not
374 be passed in.) 374 be passed in.)
375 375
376 See `set-frame-properties', `default-x-frame-plist', and 376 See `set-frame-properties', `default-x-frame-plist', and
377 `default-tty-frame-plist' for the specially-recognized properties. 377 `default-tty-frame-plist' for the specially-recognized properties.
378 */ ) 378 */
379 (props, device) 379 (props, device))
380 Lisp_Object props, device;
381 { 380 {
382 struct frame *f; 381 struct frame *f;
383 struct device *d; 382 struct device *d;
384 Lisp_Object frame = Qnil, name = Qnil, minibuf; 383 Lisp_Object frame = Qnil, name = Qnil, minibuf;
385 struct gcpro gcpro1, gcpro2, gcpro3; 384 struct gcpro gcpro1, gcpro2, gcpro3;
608 unhold_one_frame_size_changes (XFRAME (XCAR (frmcons))); 607 unhold_one_frame_size_changes (XFRAME (XCAR (frmcons)));
609 } 608 }
610 609
611 610
612 611
613 DEFUN ("framep", Fframep, Sframep, 1, 1, 0 /* 612 DEFUN ("framep", Fframep, 1, 1, 0, /*
614 Return non-nil if OBJECT is a frame. 613 Return non-nil if OBJECT is a frame.
615 Also see `frame-live-p'. 614 Also see `frame-live-p'.
616 Note that FSF Emacs kludgily returns a value indicating what type of 615 Note that FSF Emacs kludgily returns a value indicating what type of
617 frame this is. Use the cleaner function `frame-type' for that. 616 frame this is. Use the cleaner function `frame-type' for that.
618 */ ) 617 */
619 (object) 618 (object))
620 Lisp_Object object;
621 { 619 {
622 return FRAMEP (object) ? Qt : Qnil; 620 return FRAMEP (object) ? Qt : Qnil;
623 } 621 }
624 622
625 DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0 /* 623 DEFUN ("frame-live-p", Fframe_live_p, 1, 1, 0, /*
626 Return non-nil if OBJECT is a frame which has not been deleted. 624 Return non-nil if OBJECT is a frame which has not been deleted.
627 */ ) 625 */
628 (object) 626 (object))
629 Lisp_Object object;
630 { 627 {
631 return FRAMEP (object) && FRAME_LIVE_P (XFRAME (object)) ? Qt : Qnil; 628 return FRAMEP (object) && FRAME_LIVE_P (XFRAME (object)) ? Qt : Qnil;
632 } 629 }
633 630
634 631
647 select_device_1 (FRAME_DEVICE (f)); 644 select_device_1 (FRAME_DEVICE (f));
648 645
649 update_frame_window_mirror (f); 646 update_frame_window_mirror (f);
650 } 647 }
651 648
652 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 1, 0 /* 649 DEFUN ("select-frame", Fselect_frame, 1, 1, 0, /*
653 Select the frame FRAME. 650 Select the frame FRAME.
654 Subsequent editing commands apply to its selected window. 651 Subsequent editing commands apply to its selected window.
655 The selection of FRAME lasts until the next time the user does 652 The selection of FRAME lasts until the next time the user does
656 something to select a different frame, or until the next time this 653 something to select a different frame, or until the next time this
657 function is called. 654 function is called.
658 655
659 Note that this does not actually cause the window-system focus to 656 Note that this does not actually cause the window-system focus to
660 be set to this frame, or the select-frame-hook or deselect-frame-hook 657 be set to this frame, or the select-frame-hook or deselect-frame-hook
661 to be run, until the next time that XEmacs is waiting for an event. 658 to be run, until the next time that XEmacs is waiting for an event.
662 */ ) 659 */
663 (frame) 660 (frame))
664 Lisp_Object frame;
665 { 661 {
666 CHECK_LIVE_FRAME (frame); 662 CHECK_LIVE_FRAME (frame);
667 663
668 /* select the frame's selected window. This will call 664 /* select the frame's selected window. This will call
669 selected_frame_1(). */ 665 selected_frame_1(). */
718 This function selects the selected window of the frame of EVENT. 714 This function selects the selected window of the frame of EVENT.
719 715
720 If EVENT is frame object, handle it as if it were a switch-frame event 716 If EVENT is frame object, handle it as if it were a switch-frame event
721 to that frame. 717 to that frame.
722 */ ) 718 */ )
723 (frame, no_enter) 719 (Lisp_Object frame, Lisp_Object no_enter)
724 Lisp_Object frame, no_enter;
725 { 720 {
726 /* Preserve prefix arg that the command loop just cleared. */ 721 /* Preserve prefix arg that the command loop just cleared. */
727 XCONSOLE (Vselected_console)->prefix_arg = Vcurrent_prefix_arg; 722 XCONSOLE (Vselected_console)->prefix_arg = Vcurrent_prefix_arg;
728 #if 0 /* unclean! */ 723 #if 0 /* unclean! */
729 run_hook (Qmouse_leave_buffer_hook); 724 run_hook (Qmouse_leave_buffer_hook);
744 return Qnil; 739 return Qnil;
745 } 740 }
746 741
747 #endif 742 #endif
748 743
749 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 1, 0 /* 744 DEFUN ("selected-frame", Fselected_frame, 0, 1, 0, /*
750 Return the frame that is now selected on device DEVICE. 745 Return the frame that is now selected on device DEVICE.
751 If DEVICE is not specified, the selected device will be used. 746 If DEVICE is not specified, the selected device will be used.
752 If no frames exist on the device, nil is returned. 747 If no frames exist on the device, nil is returned.
753 */ ) 748 */
754 (device) 749 (device))
755 Lisp_Object device;
756 { 750 {
757 if (NILP (device) && NILP (Fselected_device (Qnil))) 751 if (NILP (device) && NILP (Fselected_device (Qnil)))
758 return Qnil; /* happens early in temacs */ 752 return Qnil; /* happens early in temacs */
759 return DEVICE_SELECTED_FRAME (decode_device (device)); 753 return DEVICE_SELECTED_FRAME (decode_device (device));
760 } 754 }
775 } 769 }
776 770
777 return w; 771 return w;
778 } 772 }
779 773
780 DEFUN ("active-minibuffer-window", Factive_minibuffer_window, 774 DEFUN ("active-minibuffer-window", Factive_minibuffer_window, 0, 0, 0, /*
781 Sactive_minibuffer_window, 0, 0, 0 /*
782 Return the currently active minibuffer window, or nil if none. 775 Return the currently active minibuffer window, or nil if none.
783 */ ) 776 */
784 () 777 ())
785 { 778 {
786 return minibuf_level ? minibuf_window : Qnil; 779 return minibuf_level ? minibuf_window : Qnil;
787 } 780 }
788 781
789 DEFUN ("last-nonminibuf-frame", Flast_nonminibuf_frame, 782 DEFUN ("last-nonminibuf-frame", Flast_nonminibuf_frame, 0, 1, 0, /*
790 Slast_nonminibuf_frame, 0, 1, 0 /*
791 Return the most-recently-selected non-minibuffer-only frame on CONSOLE. 783 Return the most-recently-selected non-minibuffer-only frame on CONSOLE.
792 This will always be the same as (selected-frame device) unless the 784 This will always be the same as (selected-frame device) unless the
793 selected frame is a minibuffer-only frame. 785 selected frame is a minibuffer-only frame.
794 CONSOLE defaults to the selected console if omitted. 786 CONSOLE defaults to the selected console if omitted.
795 */ ) 787 */
796 (console) 788 (console))
797 Lisp_Object console;
798 { 789 {
799 Lisp_Object result; 790 Lisp_Object result;
800 791
801 XSETCONSOLE (console, decode_console (console)); 792 XSETCONSOLE (console, decode_console (console));
802 /* Just in case the machinations in delete_frame_internal() resulted 793 /* Just in case the machinations in delete_frame_internal() resulted
806 if (!NILP (result) && !FRAME_MINIBUF_ONLY_P (XFRAME (result))) 797 if (!NILP (result) && !FRAME_MINIBUF_ONLY_P (XFRAME (result)))
807 return result; 798 return result;
808 return CONSOLE_LAST_NONMINIBUF_FRAME (XCONSOLE (console)); 799 return CONSOLE_LAST_NONMINIBUF_FRAME (XCONSOLE (console));
809 } 800 }
810 801
811 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0 /* 802 DEFUN ("frame-root-window", Fframe_root_window, 0, 1, 0, /*
812 Return the root-window of FRAME. 803 Return the root-window of FRAME.
813 If omitted, FRAME defaults to the currently selected frame. 804 If omitted, FRAME defaults to the currently selected frame.
814 */ ) 805 */
815 (frame) 806 (frame))
816 Lisp_Object frame;
817 { 807 {
818 return (FRAME_ROOT_WINDOW (decode_frame (frame))); 808 return (FRAME_ROOT_WINDOW (decode_frame (frame)));
819 } 809 }
820 810
821 DEFUN ("frame-selected-window", Fframe_selected_window, 811 DEFUN ("frame-selected-window", Fframe_selected_window, 0, 1, 0, /*
822 Sframe_selected_window, 0, 1, 0 /*
823 Return the selected window of frame object FRAME. 812 Return the selected window of frame object FRAME.
824 If omitted, FRAME defaults to the currently selected frame. 813 If omitted, FRAME defaults to the currently selected frame.
825 */ ) 814 */
826 (frame) 815 (frame))
827 Lisp_Object frame;
828 { 816 {
829 return (FRAME_SELECTED_WINDOW (decode_frame (frame))); 817 return (FRAME_SELECTED_WINDOW (decode_frame (frame)));
830 } 818 }
831 819
832 void 820 void
836 f->selected_window = window; 824 f->selected_window = window;
837 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f)) 825 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f))
838 f->last_nonminibuf_window = window; 826 f->last_nonminibuf_window = window;
839 } 827 }
840 828
841 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 829 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /*
842 Sset_frame_selected_window, 2, 2, 0 /*
843 Set the selected window of frame object FRAME to WINDOW. 830 Set the selected window of frame object FRAME to WINDOW.
844 If FRAME is nil, the selected frame is used. 831 If FRAME is nil, the selected frame is used.
845 If FRAME is the selected frame, this makes WINDOW the selected window. 832 If FRAME is the selected frame, this makes WINDOW the selected window.
846 */ ) 833 */
847 (frame, window) 834 (frame, window))
848 Lisp_Object frame, window;
849 { 835 {
850 XSETFRAME (frame, decode_frame (frame)); 836 XSETFRAME (frame, decode_frame (frame));
851 CHECK_LIVE_WINDOW (window); 837 CHECK_LIVE_WINDOW (window);
852 838
853 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window)))) 839 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
859 set_frame_selected_window (XFRAME (frame), window); 845 set_frame_selected_window (XFRAME (frame), window);
860 return window; 846 return window;
861 } 847 }
862 848
863 849
864 DEFUN ("frame-device", Fframe_device, Sframe_device, 850 DEFUN ("frame-device", Fframe_device, 0, 1, 0, /*
865 0, 1, 0 /*
866 Return the device that FRAME is on. 851 Return the device that FRAME is on.
867 If omitted, FRAME defaults to the currently selected frame. 852 If omitted, FRAME defaults to the currently selected frame.
868 */ ) 853 */
869 (frame) 854 (frame))
870 Lisp_Object frame;
871 { 855 {
872 return (FRAME_DEVICE (decode_frame (frame))); 856 return (FRAME_DEVICE (decode_frame (frame)));
873 } 857 }
874 858
875 int 859 int
1094 we would have returned directly from the loop. Since PREV is the last 1078 we would have returned directly from the loop. Since PREV is the last
1095 acceptable frame in the list, return it. */ 1079 acceptable frame in the list, return it. */
1096 return prev; 1080 return prev;
1097 } 1081 }
1098 1082
1099 DEFUN ("next-frame", Fnext_frame, Snext_frame, 1083 DEFUN ("next-frame", Fnext_frame, 0, 3, 0, /*
1100 0, 3, 0 /*
1101 Return the next frame of the right type in the frame list after FRAME. 1084 Return the next frame of the right type in the frame list after FRAME.
1102 FRAMETYPE controls which frames are eligible to be returned; all 1085 FRAMETYPE controls which frames are eligible to be returned; all
1103 others will be skipped. Note that if there is only one eligible 1086 others will be skipped. Note that if there is only one eligible
1104 frame, then `next-frame' called repeatedly will always return 1087 frame, then `next-frame' called repeatedly will always return
1105 the same frame, and if there is no eligible frame, then FRAME is 1088 the same frame, and if there is no eligible frame, then FRAME is
1134 on that console. If CONSOLE is a device, return frames only on that 1117 on that console. If CONSOLE is a device, return frames only on that
1135 device. If CONSOLE is a console type, return frames only on consoles 1118 device. If CONSOLE is a console type, return frames only on consoles
1136 of that type. If CONSOLE is 'window-system, return any frames on any 1119 of that type. If CONSOLE is 'window-system, return any frames on any
1137 window-system consoles. If CONSOLE is nil or omitted, return frames only 1120 window-system consoles. If CONSOLE is nil or omitted, return frames only
1138 on the FRAME's console. Otherwise, all frames are considered. 1121 on the FRAME's console. Otherwise, all frames are considered.
1139 */ ) 1122 */
1140 (frame, frametype, console) 1123 (frame, frametype, console))
1141 Lisp_Object frame, frametype, console;
1142 { 1124 {
1143 XSETFRAME (frame, decode_frame (frame)); 1125 XSETFRAME (frame, decode_frame (frame));
1144 1126
1145 return (next_frame (frame, frametype, console)); 1127 return (next_frame (frame, frametype, console));
1146 } 1128 }
1147 1129
1148 DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 1130 DEFUN ("previous-frame", Fprevious_frame, 0, 3, 0, /*
1149 0, 3, 0 /*
1150 Return the next frame of the right type in the frame list after FRAME. 1131 Return the next frame of the right type in the frame list after FRAME.
1151 FRAMETYPE controls which frames are eligible to be returned; all 1132 FRAMETYPE controls which frames are eligible to be returned; all
1152 others will be skipped. Note that if there is only one eligible 1133 others will be skipped. Note that if there is only one eligible
1153 frame, then `previous-frame' called repeatedly will always return 1134 frame, then `previous-frame' called repeatedly will always return
1154 the same frame, and if there is no eligible frame, then FRAME is 1135 the same frame, and if there is no eligible frame, then FRAME is
1155 returned. 1136 returned.
1156 1137
1157 See `next-frame' for an explanation of the FRAMETYPE and CONSOLE 1138 See `next-frame' for an explanation of the FRAMETYPE and CONSOLE
1158 arguments. 1139 arguments.
1159 */ ) 1140 */
1160 (frame, frametype, console) 1141 (frame, frametype, console))
1161 Lisp_Object frame, frametype, console;
1162 { 1142 {
1163 XSETFRAME (frame, decode_frame (frame)); 1143 XSETFRAME (frame, decode_frame (frame));
1164 1144
1165 return (prev_frame (frame, frametype, console)); 1145 return (prev_frame (frame, frametype, console));
1166 } 1146 }
1295 signal_simple_error 1275 signal_simple_error
1296 ("Attempt to delete a surrogate minibuffer frame", frame); 1276 ("Attempt to delete a surrogate minibuffer frame", frame);
1297 } 1277 }
1298 } 1278 }
1299 } 1279 }
1280 /* Test for popup frames hanging around. */
1281 /* Deletion of a parent frame with popups is deadly. */
1282 {
1283 Lisp_Object frmcons, devcons, concons;
1284
1285 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
1286 {
1287 Lisp_Object this = XCAR (frmcons);
1288
1289
1290 if (! EQ (this, frame)
1291 && EQ (frame, DEVMETH_OR_GIVEN(XDEVICE(XCAR(devcons)),
1292 get_frame_parent,
1293 (XFRAME(this)),
1294 Qnil)))
1295 {
1296 /* We've found another frame whose minibuffer is on
1297 this frame. */
1298 signal_simple_error
1299 ("Attempt to delete a frame with live popups", frame);
1300 }
1301 }
1302 }
1300 1303
1301 /* Before here, we haven't made any dangerous changes (just checked for 1304 /* Before here, we haven't made any dangerous changes (just checked for
1302 error conditions). Now run the delete-frame-hook. Remember that 1305 error conditions). Now run the delete-frame-hook. Remember that
1303 user code there could do any number of dangerous things, including 1306 user code there could do any number of dangerous things, including
1304 signalling an error. */ 1307 signalling an error. */
1316 signal an error. */ 1319 signal an error. */
1317 if (XINT (Flength (DEVICE_FRAME_LIST (d))) == 1) 1320 if (XINT (Flength (DEVICE_FRAME_LIST (d))) == 1)
1318 { 1321 {
1319 va_run_hook_with_args (Qdelete_device_hook, 1, device); 1322 va_run_hook_with_args (Qdelete_device_hook, 1, device);
1320 if (!FRAME_LIVE_P (f)) /* Make sure the delete-device-hook didn't */ 1323 if (!FRAME_LIVE_P (f)) /* Make sure the delete-device-hook didn't */
1321 { /* go ahead and delete anything. */ 1324 { /* go ahead and delete anything. */
1322 UNGCPRO; 1325 UNGCPRO;
1323 return; 1326 return;
1324 } 1327 }
1325 1328
1326 if (XINT (Flength (CONSOLE_DEVICE_LIST (con))) == 1) 1329 if (XINT (Flength (CONSOLE_DEVICE_LIST (con))) == 1)
1372 /* If this is a popup frame, select its parent if possible. 1375 /* If this is a popup frame, select its parent if possible.
1373 Otherwise, find another visible frame; if none, just take any frame. 1376 Otherwise, find another visible frame; if none, just take any frame.
1374 First try the same device, then the same console. */ 1377 First try the same device, then the same console. */
1375 1378
1376 next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil); 1379 next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil);
1380
1377 if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next))) 1381 if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next)))
1378 next = next_frame_internal (frame, Qvisible, device, 1382 next = next_frame_internal (frame, Qvisible, device,
1379 called_from_delete_device); 1383 called_from_delete_device);
1380 if (NILP (next) || EQ (next, frame)) 1384 if (NILP (next) || EQ (next, frame))
1381 next = next_frame_internal (frame, Qvisible, console, 1385 next = next_frame_internal (frame, Qvisible, console,
1543 io_error_delete_frame (Lisp_Object frame) 1547 io_error_delete_frame (Lisp_Object frame)
1544 { 1548 {
1545 delete_frame_internal (XFRAME (frame), 1, 0, 1); 1549 delete_frame_internal (XFRAME (frame), 1, 0, 1);
1546 } 1550 }
1547 1551
1548 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 1552 DEFUN ("delete-frame", Fdelete_frame, 0, 2, "", /*
1549 0, 2, "" /*
1550 Delete FRAME, permanently eliminating it from use. 1553 Delete FRAME, permanently eliminating it from use.
1551 If omitted, FRAME defaults to the selected frame. 1554 If omitted, FRAME defaults to the selected frame.
1552 A frame may not be deleted if its minibuffer is used by other frames. 1555 A frame may not be deleted if its minibuffer is used by other frames.
1553 Normally, you cannot delete the last non-minibuffer-only frame (you must 1556 Normally, you cannot delete the last non-minibuffer-only frame (you must
1554 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional 1557 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional
1555 second argument FORCE is non-nil, you can delete the last frame. (This 1558 second argument FORCE is non-nil, you can delete the last frame. (This
1556 will automatically call `save-buffers-kill-emacs'.) 1559 will automatically call `save-buffers-kill-emacs'.)
1557 */ ) 1560 */
1558 (frame, force) 1561 (frame, force))
1559 Lisp_Object frame, force;
1560 { 1562 {
1561 /* This function can GC */ 1563 /* This function can GC */
1562 struct frame *f; 1564 struct frame *f;
1563 1565
1564 if (NILP (frame)) 1566 if (NILP (frame))
1577 } 1579 }
1578 1580
1579 1581
1580 /* Return mouse position in character cell units. */ 1582 /* Return mouse position in character cell units. */
1581 1583
1582 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 1, 0 /* 1584 DEFUN ("mouse-position", Fmouse_position, 0, 1, 0, /*
1583 Return a list (WINDOW X . Y) giving the current mouse window and position. 1585 Return a list (WINDOW X . Y) giving the current mouse window and position.
1584 The position is given in character cells, where (0, 0) is the 1586 The position is given in character cells, where (0, 0) is the
1585 upper-left corner of the window. 1587 upper-left corner of the window.
1586 1588
1587 DEVICE specifies the device on which to read the mouse position, and 1589 DEVICE specifies the device on which to read the mouse position, and
1588 defaults to the selected device. If the device is a mouseless terminal 1590 defaults to the selected device. If the device is a mouseless terminal
1589 or Emacs hasn't been programmed to read its mouse position, it returns 1591 or Emacs hasn't been programmed to read its mouse position, it returns
1590 the device's selected window for WINDOW and nil for X and Y. 1592 the device's selected window for WINDOW and nil for X and Y.
1591 */ ) 1593 */
1592 (device) 1594 (device))
1593 Lisp_Object device;
1594 { 1595 {
1595 Lisp_Object val = Fmouse_pixel_position (device); 1596 Lisp_Object val = Fmouse_pixel_position (device);
1596 int x, y, obj_x, obj_y; 1597 int x, y, obj_x, obj_y;
1597 struct window *w; 1598 struct window *w;
1598 struct frame *f; 1599 struct frame *f;
1649 } 1650 }
1650 1651
1651 return 0; 1652 return 0;
1652 } 1653 }
1653 1654
1654 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 1655 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /*
1655 Smouse_pixel_position, 0, 1, 0 /*
1656 Return a list (WINDOW X . Y) giving the current mouse window and position. 1656 Return a list (WINDOW X . Y) giving the current mouse window and position.
1657 The position is given in pixel units, where (0, 0) is the 1657 The position is given in pixel units, where (0, 0) is the
1658 upper-left corner. 1658 upper-left corner.
1659 1659
1660 DEVICE specifies the device on which to read the mouse position, and 1660 DEVICE specifies the device on which to read the mouse position, and
1661 defaults to the selected device. If the device is a mouseless terminal 1661 defaults to the selected device. If the device is a mouseless terminal
1662 or Emacs hasn't been programmed to read its mouse position, it returns 1662 or Emacs hasn't been programmed to read its mouse position, it returns
1663 the device's selected window for WINDOW and nil for X and Y. 1663 the device's selected window for WINDOW and nil for X and Y.
1664 */ ) 1664 */
1665 (device) 1665 (device))
1666 Lisp_Object device;
1667 { 1666 {
1668 struct device *d = decode_device (device); 1667 struct device *d = decode_device (device);
1669 Lisp_Object frame; 1668 Lisp_Object frame;
1670 Lisp_Object window; 1669 Lisp_Object window;
1671 Lisp_Object x, y; 1670 Lisp_Object x, y;
1699 } 1698 }
1700 1699
1701 return Fcons (window, Fcons (x, y)); 1700 return Fcons (window, Fcons (x, y));
1702 } 1701 }
1703 1702
1704 DEFUN ("mouse-position-as-motion-event", Fmouse_position_as_motion_event, 1703 DEFUN ("mouse-position-as-motion-event", Fmouse_position_as_motion_event, 0, 1, 0, /*
1705 Smouse_position_as_motion_event, 0, 1, 0 /*
1706 Return the current mouse position as a motion event. 1704 Return the current mouse position as a motion event.
1707 This allows you to call the standard event functions such as 1705 This allows you to call the standard event functions such as
1708 `event-over-toolbar-p' to determine where the mouse is. 1706 `event-over-toolbar-p' to determine where the mouse is.
1709 1707
1710 DEVICE specifies the device on which to read the mouse position, and 1708 DEVICE specifies the device on which to read the mouse position, and
1711 defaults to the selected device. If the mouse position can't be determined 1709 defaults to the selected device. If the mouse position can't be determined
1712 (e.g. DEVICE is a TTY device), nil is returned instead of an event. 1710 (e.g. DEVICE is a TTY device), nil is returned instead of an event.
1713 */ ) 1711 */
1714 (device) 1712 (device))
1715 Lisp_Object device;
1716 { 1713 {
1717 struct device *d = decode_device (device); 1714 struct device *d = decode_device (device);
1718 Lisp_Object frame; 1715 Lisp_Object frame;
1719 int intx, inty; 1716 int intx, inty;
1720 1717
1729 } 1726 }
1730 else 1727 else
1731 return Qnil; 1728 return Qnil;
1732 } 1729 }
1733 1730
1734 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0 /* 1731 DEFUN ("set-mouse-position", Fset_mouse_position, 3, 3, 0, /*
1735 Move the mouse pointer to the center of character cell (X,Y) in WINDOW. 1732 Move the mouse pointer to the center of character cell (X,Y) in WINDOW.
1736 Note, this is a no-op for an X frame that is not visible. 1733 Note, this is a no-op for an X frame that is not visible.
1737 If you have just created a frame, you must wait for it to become visible 1734 If you have just created a frame, you must wait for it to become visible
1738 before calling this function on it, like this. 1735 before calling this function on it, like this.
1739 (while (not (frame-visible-p frame)) (sleep-for .5)) 1736 (while (not (frame-visible-p frame)) (sleep-for .5))
1740 Note also: Warping the mouse is contrary to the ICCCM, so be very sure 1737 Note also: Warping the mouse is contrary to the ICCCM, so be very sure
1741 that the behavior won't end up being obnoxious! 1738 that the behavior won't end up being obnoxious!
1742 */ ) 1739 */
1743 (window, x, y) 1740 (window, x, y))
1744 Lisp_Object window, x, y;
1745 { 1741 {
1746 struct window *w; 1742 struct window *w;
1747 int pix_x, pix_y; 1743 int pix_x, pix_y;
1748 1744
1749 CHECK_WINDOW (window); 1745 CHECK_WINDOW (window);
1757 MAYBE_FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, pix_x, pix_y)); 1753 MAYBE_FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, pix_x, pix_y));
1758 1754
1759 return Qnil; 1755 return Qnil;
1760 } 1756 }
1761 1757
1762 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, 1758 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, 3, 3, 0, /*
1763 Sset_mouse_pixel_position, 3, 3, 0 /*
1764 Move the mouse pointer to pixel position (X,Y) in WINDOW. 1759 Move the mouse pointer to pixel position (X,Y) in WINDOW.
1765 Note, this is a no-op for an X frame that is not visible. 1760 Note, this is a no-op for an X frame that is not visible.
1766 If you have just created a frame, you must wait for it to become visible 1761 If you have just created a frame, you must wait for it to become visible
1767 before calling this function on it, like this. 1762 before calling this function on it, like this.
1768 (while (not (frame-visible-p frame)) (sleep-for .5)) 1763 (while (not (frame-visible-p frame)) (sleep-for .5))
1769 */ ) 1764 */
1770 (window, x, y) 1765 (window, x, y))
1771 Lisp_Object window, x, y;
1772 { 1766 {
1773 struct window *w; 1767 struct window *w;
1774 1768
1775 CHECK_WINDOW (window); 1769 CHECK_WINDOW (window);
1776 CHECK_INT (x); 1770 CHECK_INT (x);
1781 FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, XINT (x), XINT (y))); 1775 FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, XINT (x), XINT (y)));
1782 1776
1783 return Qnil; 1777 return Qnil;
1784 } 1778 }
1785 1779
1786 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible, 1780 DEFUN ("make-frame-visible", Fmake_frame_visible, 0, 1, 0, /*
1787 0, 1, 0 /*
1788 Make the frame FRAME visible (assuming it is an X-window). 1781 Make the frame FRAME visible (assuming it is an X-window).
1789 If omitted, FRAME defaults to the currently selected frame. 1782 If omitted, FRAME defaults to the currently selected frame.
1790 Also raises the frame so that nothing obscures it. 1783 Also raises the frame so that nothing obscures it.
1791 */ ) 1784 */
1792 (frame) 1785 (frame))
1793 Lisp_Object frame;
1794 { 1786 {
1795 struct frame *f = decode_frame (frame); 1787 struct frame *f = decode_frame (frame);
1796 1788
1797 MAYBE_FRAMEMETH (f, make_frame_visible, (f)); 1789 MAYBE_FRAMEMETH (f, make_frame_visible, (f));
1798 return frame; 1790 return frame;
1799 } 1791 }
1800 1792
1801 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible, 1793 DEFUN ("make-frame-invisible", Fmake_frame_invisible, 0, 2, 0, /*
1802 0, 2, 0 /*
1803 Unconditionally removes frame from the display (assuming it is an X-window). 1794 Unconditionally removes frame from the display (assuming it is an X-window).
1804 If omitted, FRAME defaults to the currently selected frame. 1795 If omitted, FRAME defaults to the currently selected frame.
1805 If what you want to do is iconify the frame (if the window manager uses 1796 If what you want to do is iconify the frame (if the window manager uses
1806 icons) then you should call `iconify-frame' instead. 1797 icons) then you should call `iconify-frame' instead.
1807 Normally you may not make FRAME invisible if all other frames are invisible 1798 Normally you may not make FRAME invisible if all other frames are invisible
1808 and uniconified, but if the second optional argument FORCE is non-nil, 1799 and uniconified, but if the second optional argument FORCE is non-nil,
1809 you may do so. 1800 you may do so.
1810 */ ) 1801 */
1811 (frame, force) 1802 (frame, force))
1812 Lisp_Object frame, force;
1813 { 1803 {
1814 struct frame *f, *sel_frame; 1804 struct frame *f, *sel_frame;
1815 struct device *d; 1805 struct device *d;
1816 1806
1817 f = decode_frame (frame); 1807 f = decode_frame (frame);
1832 MAYBE_FRAMEMETH (f, make_frame_invisible, (f)); 1822 MAYBE_FRAMEMETH (f, make_frame_invisible, (f));
1833 1823
1834 return Qnil; 1824 return Qnil;
1835 } 1825 }
1836 1826
1837 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, 1827 DEFUN ("iconify-frame", Ficonify_frame, 0, 1, "", /*
1838 0, 1, "" /*
1839 Make the frame FRAME into an icon, if the window manager supports icons. 1828 Make the frame FRAME into an icon, if the window manager supports icons.
1840 If omitted, FRAME defaults to the currently selected frame. 1829 If omitted, FRAME defaults to the currently selected frame.
1841 */ ) 1830 */
1842 (frame) 1831 (frame))
1843 Lisp_Object frame;
1844 { 1832 {
1845 struct frame *f, *sel_frame; 1833 struct frame *f, *sel_frame;
1846 struct device *d; 1834 struct device *d;
1847 1835
1848 f = decode_frame (frame); 1836 f = decode_frame (frame);
1860 MAYBE_FRAMEMETH (f, iconify_frame, (f)); 1848 MAYBE_FRAMEMETH (f, iconify_frame, (f));
1861 1849
1862 return Qnil; 1850 return Qnil;
1863 } 1851 }
1864 1852
1865 DEFUN ("deiconify-frame", Fdeiconify_frame, Sdeiconify_frame, 1853 DEFUN ("deiconify-frame", Fdeiconify_frame, 0, 1, 0, /*
1866 0, 1, 0 /*
1867 Open (de-iconify) the iconified frame FRAME. 1854 Open (de-iconify) the iconified frame FRAME.
1868 Under X, this is currently the same as `make-frame-visible'. 1855 Under X, this is currently the same as `make-frame-visible'.
1869 If omitted, FRAME defaults to the currently selected frame. 1856 If omitted, FRAME defaults to the currently selected frame.
1870 Also raises the frame so that nothing obscures it. 1857 Also raises the frame so that nothing obscures it.
1871 */ ) 1858 */
1872 (frame) 1859 (frame))
1873 Lisp_Object frame;
1874 { 1860 {
1875 return Fmake_frame_visible (frame); 1861 return Fmake_frame_visible (frame);
1876 } 1862 }
1877 1863
1878 /* FSF returns 'icon for iconized frames. What a crock! */ 1864 /* FSF returns 'icon for iconized frames. What a crock! */
1879 1865
1880 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, 1866 DEFUN ("frame-visible-p", Fframe_visible_p, 0, 1, 0, /*
1881 1, 1, 0 /*
1882 Return t if FRAME is now \"visible\" (actually in use for display). 1867 Return t if FRAME is now \"visible\" (actually in use for display).
1883 A frame that is not visible is not updated, and, if it works through a 1868 A frame that is not visible is not updated, and, if it works through a
1884 window system, may not show at all. 1869 window system, may not show at all.
1885 */ ) 1870 */
1886 (frame) 1871 (frame))
1887 Lisp_Object frame;
1888 { 1872 {
1889 struct frame *f = decode_frame (frame); 1873 struct frame *f = decode_frame (frame);
1890 return (FRAMEMETH_OR_GIVEN (f, frame_visible_p, (f), f->visible) 1874 return (FRAMEMETH_OR_GIVEN (f, frame_visible_p, (f), f->visible)
1891 ? Qt : Qnil); 1875 ? Qt : Qnil);
1892 } 1876 }
1893 1877
1894 DEFUN ("frame-totally-visible-p", Fframe_totally_visible_p, 1878 DEFUN ("frame-totally-visible-p", Fframe_totally_visible_p, 0, 1, 0, /*
1895 Sframe_totally_visible_p, 0, 1, 0 /*
1896 Return T if frame is not obscured by any other X windows, NIL otherwise. 1879 Return T if frame is not obscured by any other X windows, NIL otherwise.
1897 Always returns t for tty frames. 1880 Always returns t for tty frames.
1898 */ ) 1881 */
1899 (frame) 1882 (frame))
1900 Lisp_Object frame;
1901 { 1883 {
1902 struct frame *f = decode_frame (frame); 1884 struct frame *f = decode_frame (frame);
1903 return (FRAMEMETH_OR_GIVEN (f, frame_totally_visible_p, (f), f->visible) 1885 return (FRAMEMETH_OR_GIVEN (f, frame_totally_visible_p, (f), f->visible)
1904 ? Qt : Qnil); 1886 ? Qt : Qnil);
1905 } 1887 }
1906 1888
1907 DEFUN ("frame-iconified-p", Fframe_iconified_p, Sframe_iconified_p, 1889 DEFUN ("frame-iconified-p", Fframe_iconified_p, 0, 1, 0, /*
1908 1, 1, 0 /*
1909 Return t if FRAME is iconified. 1890 Return t if FRAME is iconified.
1910 Not all window managers use icons; some merely unmap the window, so this 1891 Not all window managers use icons; some merely unmap the window, so this
1911 function is not the inverse of `frame-visible-p'. It is possible for a 1892 function is not the inverse of `frame-visible-p'. It is possible for a
1912 frame to not be visible and not be iconified either. However, if the 1893 frame to not be visible and not be iconified either. However, if the
1913 frame is iconified, it will not be visible. 1894 frame is iconified, it will not be visible.
1914 */ ) 1895 */
1915 (frame) 1896 (frame))
1916 Lisp_Object frame;
1917 { 1897 {
1918 struct frame *f = decode_frame (frame); 1898 struct frame *f = decode_frame (frame);
1919 if (f->visible) 1899 if (f->visible)
1920 return Qnil; 1900 return Qnil;
1921 f->iconified = FRAMEMETH_OR_GIVEN (f, frame_iconified_p, (f), 0); 1901 f->iconified = FRAMEMETH_OR_GIVEN (f, frame_iconified_p, (f), 0);
1922 return (f->iconified ? Qt : Qnil); 1902 return (f->iconified ? Qt : Qnil);
1923 } 1903 }
1924 1904
1925 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, 1905 DEFUN ("visible-frame-list", Fvisible_frame_list, 0, 1, 0, /*
1926 0, 1, 0 /*
1927 Return a list of all frames now \"visible\" (being updated). 1906 Return a list of all frames now \"visible\" (being updated).
1928 If DEVICE is specified only frames on that device will be returned. 1907 If DEVICE is specified only frames on that device will be returned.
1929 */ ) 1908 */
1930 (device) 1909 (device))
1931 Lisp_Object device;
1932 { 1910 {
1933 Lisp_Object devcons, concons; 1911 Lisp_Object devcons, concons;
1934 struct frame *f; 1912 struct frame *f;
1935 Lisp_Object value; 1913 Lisp_Object value;
1936 1914
1956 1934
1957 return value; 1935 return value;
1958 } 1936 }
1959 1937
1960 1938
1961 DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 0, 1, "" /* 1939 DEFUN ("raise-frame", Fraise_frame, 0, 1, "", /*
1962 Bring FRAME to the front, so it occludes any frames it overlaps. 1940 Bring FRAME to the front, so it occludes any frames it overlaps.
1963 If omitted, FRAME defaults to the currently selected frame. 1941 If omitted, FRAME defaults to the currently selected frame.
1964 If FRAME is invisible, make it visible. 1942 If FRAME is invisible, make it visible.
1965 If Emacs is displaying on an ordinary terminal or some other device which 1943 If Emacs is displaying on an ordinary terminal or some other device which
1966 doesn't support multiple overlapping frames, this function does nothing. 1944 doesn't support multiple overlapping frames, this function does nothing.
1967 */ ) 1945 */
1968 (frame) 1946 (frame))
1969 Lisp_Object frame;
1970 { 1947 {
1971 struct frame *f = decode_frame (frame); 1948 struct frame *f = decode_frame (frame);
1972 1949
1973 /* Do like the documentation says. */ 1950 /* Do like the documentation says. */
1974 Fmake_frame_visible (frame); 1951 Fmake_frame_visible (frame);
1975 MAYBE_FRAMEMETH (f, raise_frame, (f)); 1952 MAYBE_FRAMEMETH (f, raise_frame, (f));
1976 return Qnil; 1953 return Qnil;
1977 } 1954 }
1978 1955
1979 DEFUN ("lower-frame", Flower_frame, Slower_frame, 0, 1, "" /* 1956 DEFUN ("lower-frame", Flower_frame, 0, 1, "", /*
1980 Send FRAME to the back, so it is occluded by any frames that overlap it. 1957 Send FRAME to the back, so it is occluded by any frames that overlap it.
1981 If omitted, FRAME defaults to the currently selected frame. 1958 If omitted, FRAME defaults to the currently selected frame.
1982 If Emacs is displaying on an ordinary terminal or some other device which 1959 If Emacs is displaying on an ordinary terminal or some other device which
1983 doesn't support multiple overlapping frames, this function does nothing. 1960 doesn't support multiple overlapping frames, this function does nothing.
1984 */ ) 1961 */
1985 (frame) 1962 (frame))
1986 Lisp_Object frame;
1987 { 1963 {
1988 struct frame *f = decode_frame (frame); 1964 struct frame *f = decode_frame (frame);
1989 1965
1990 MAYBE_FRAMEMETH (f, lower_frame, (f)); 1966 MAYBE_FRAMEMETH (f, lower_frame, (f));
1991 return Qnil; 1967 return Qnil;
2115 other properties which this claims to handle, but doesn't? 2091 other properties which this claims to handle, but doesn't?
2116 2092
2117 But of course. This stuff needs more work, but it's a lot closer 2093 But of course. This stuff needs more work, but it's a lot closer
2118 to sanity now than before with the horrible frame-params stuff. */ 2094 to sanity now than before with the horrible frame-params stuff. */
2119 2095
2120 DEFUN ("set-frame-properties", Fset_frame_properties, Sset_frame_properties, 2096 DEFUN ("set-frame-properties", Fset_frame_properties, 2, 2, 0, /*
2121 2, 2, 0 /*
2122 Change some properties of a frame. 2097 Change some properties of a frame.
2123 PLIST is a property list. 2098 PLIST is a property list.
2124 You can also change frame properties individually using `set-frame-property', 2099 You can also change frame properties individually using `set-frame-property',
2125 but it may be more efficient to change many properties at once. 2100 but it may be more efficient to change many properties at once.
2126 2101
2181 frame property name to another. 2156 frame property name to another.
2182 2157
2183 See the variables `default-x-frame-plist' and `default-tty-frame-plist' 2158 See the variables `default-x-frame-plist' and `default-tty-frame-plist'
2184 for a description of the properties recognized for particular types of 2159 for a description of the properties recognized for particular types of
2185 frames. 2160 frames.
2186 */ ) 2161 */
2187 (frame, plist) 2162 (frame, plist))
2188 Lisp_Object frame, plist;
2189 { 2163 {
2190 struct frame *f = decode_frame (frame); 2164 struct frame *f = decode_frame (frame);
2191 Lisp_Object tail; 2165 Lisp_Object tail;
2192 Lisp_Object *tailp; 2166 Lisp_Object *tailp;
2193 struct gcpro gcpro1, gcpro2; 2167 struct gcpro gcpro1, gcpro2;
2268 Fcanonicalize_lax_plist (f->plist, Qnil); 2242 Fcanonicalize_lax_plist (f->plist, Qnil);
2269 UNGCPRO; 2243 UNGCPRO;
2270 return Qnil; 2244 return Qnil;
2271 } 2245 }
2272 2246
2273 DEFUN ("frame-property", Fframe_property, Sframe_property, 2, 3, 0 /* 2247 DEFUN ("frame-property", Fframe_property, 2, 3, 0, /*
2274 Return FRAME's value for property PROPERTY. 2248 Return FRAME's value for property PROPERTY.
2275 See `set-frame-properties' for the built-in property names. 2249 See `set-frame-properties' for the built-in property names.
2276 */ ) 2250 */
2277 (frame, property, defalt) 2251 (frame, property, defalt))
2278 Lisp_Object frame, property, defalt;
2279 { 2252 {
2280 struct frame *f = decode_frame (frame); 2253 struct frame *f = decode_frame (frame);
2281 2254
2282 XSETFRAME (frame, f); 2255 XSETFRAME (frame, f);
2283 2256
2335 return value; 2308 return value;
2336 return defalt; 2309 return defalt;
2337 } 2310 }
2338 } 2311 }
2339 2312
2340 DEFUN ("frame-properties", Fframe_properties, Sframe_properties, 1, 1, 0 /* 2313 DEFUN ("frame-properties", Fframe_properties, 0, 1, 0, /*
2341 Return a property list of the properties of FRAME. 2314 Return a property list of the properties of FRAME.
2342 Do not modify this list; use `set-frame-property' instead. 2315 Do not modify this list; use `set-frame-property' instead.
2343 */ ) 2316 */
2344 (frame) 2317 (frame))
2345 Lisp_Object frame;
2346 { 2318 {
2347 struct frame *f = decode_frame (frame); 2319 struct frame *f = decode_frame (frame);
2348 Lisp_Object result = Qnil; 2320 Lisp_Object result = Qnil;
2349 struct gcpro gcpro1; 2321 struct gcpro gcpro1;
2350 2322
2389 RETURN_UNGCPRO (result); 2361 RETURN_UNGCPRO (result);
2390 } 2362 }
2391 } 2363 }
2392 2364
2393 2365
2394 DEFUN ("frame-pixel-height", Fframe_pixel_height, Sframe_pixel_height, 0, 1, 0 /* 2366 DEFUN ("frame-pixel-height", Fframe_pixel_height, 0, 1, 0, /*
2395 Return the height in pixels of FRAME. 2367 Return the height in pixels of FRAME.
2396 */ ) 2368 */
2397 (frame) 2369 (frame))
2398 Lisp_Object frame;
2399 { 2370 {
2400 struct frame *f = decode_frame (frame); 2371 struct frame *f = decode_frame (frame);
2401 return (make_int (f->pixheight)); 2372 return (make_int (f->pixheight));
2402 } 2373 }
2403 2374
2404 DEFUN ("frame-pixel-width", Fframe_pixel_width, Sframe_pixel_width, 0, 1, 0 /* 2375 DEFUN ("frame-pixel-width", Fframe_pixel_width, 0, 1, 0, /*
2405 Return the width in pixels of FRAME. 2376 Return the width in pixels of FRAME.
2406 */ ) 2377 */
2407 (frame) 2378 (frame))
2408 Lisp_Object frame;
2409 { 2379 {
2410 struct frame *f = decode_frame (frame); 2380 struct frame *f = decode_frame (frame);
2411 return (make_int (f->pixwidth)); 2381 return (make_int (f->pixwidth));
2412 } 2382 }
2413 2383
2414 DEFUN ("frame-name", Fframe_name, Sframe_name, 0, 1, 0 /* 2384 DEFUN ("frame-name", Fframe_name, 0, 1, 0, /*
2415 Return the name of FRAME (defaulting to the selected frame). 2385 Return the name of FRAME (defaulting to the selected frame).
2416 This is not the same as the `title' of the frame. 2386 This is not the same as the `title' of the frame.
2417 */ ) 2387 */
2418 (frame) 2388 (frame))
2419 Lisp_Object frame;
2420 { 2389 {
2421 return (decode_frame (frame)->name); 2390 return (decode_frame (frame)->name);
2422 } 2391 }
2423 2392
2424 DEFUN ("frame-modified-tick", Fframe_modified_tick, Sframe_modified_tick, 2393 DEFUN ("frame-modified-tick", Fframe_modified_tick, 0, 1, 0, /*
2425 0, 1, 0 /*
2426 Return FRAME's tick counter, incremented for each change to the frame. 2394 Return FRAME's tick counter, incremented for each change to the frame.
2427 Each frame has a tick counter which is incremented each time the frame 2395 Each frame has a tick counter which is incremented each time the frame
2428 is resized, a window is resized, added, or deleted, a face is changed, 2396 is resized, a window is resized, added, or deleted, a face is changed,
2429 `set-window-buffer' or `select-window' is called on a window in the 2397 `set-window-buffer' or `select-window' is called on a window in the
2430 frame, the window-start of a window in the frame has changed, or 2398 frame, the window-start of a window in the frame has changed, or
2431 anything else interesting has happened. It wraps around occasionally. 2399 anything else interesting has happened. It wraps around occasionally.
2432 No argument or nil as argument means use selected frame as FRAME. 2400 No argument or nil as argument means use selected frame as FRAME.
2433 */ ) 2401 */
2434 (frame) 2402 (frame))
2435 Lisp_Object frame;
2436 { 2403 {
2437 return make_int (decode_frame (frame)->modiff); 2404 return make_int (decode_frame (frame)->modiff);
2438 } 2405 }
2439 2406
2440 static void 2407 static void
2444 change_frame_size (f, rows, cols, 0); 2411 change_frame_size (f, rows, cols, 0);
2445 else 2412 else
2446 FRAMEMETH (f, set_frame_size, (f, cols, rows)); 2413 FRAMEMETH (f, set_frame_size, (f, cols, rows));
2447 } 2414 }
2448 2415
2449 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0 /* 2416 DEFUN ("set-frame-height", Fset_frame_height, 2, 3, 0, /*
2450 Specify that the frame FRAME has LINES lines. 2417 Specify that the frame FRAME has LINES lines.
2451 Optional third arg non-nil means that redisplay should use LINES lines 2418 Optional third arg non-nil means that redisplay should use LINES lines
2452 but that the idea of the actual height of the frame should not be changed. 2419 but that the idea of the actual height of the frame should not be changed.
2453 */ ) 2420 */
2454 (frame, rows, pretend) 2421 (frame, rows, pretend))
2455 Lisp_Object frame, rows, pretend;
2456 { 2422 {
2457 struct frame *f = decode_frame (frame); 2423 struct frame *f = decode_frame (frame);
2458 XSETFRAME (frame, f); 2424 XSETFRAME (frame, f);
2459 CHECK_INT (rows); 2425 CHECK_INT (rows);
2460 2426
2461 internal_set_frame_size (f, FRAME_WIDTH (f), XINT (rows), 2427 internal_set_frame_size (f, FRAME_WIDTH (f), XINT (rows),
2462 !NILP (pretend)); 2428 !NILP (pretend));
2463 return frame; 2429 return frame;
2464 } 2430 }
2465 2431
2466 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0 /* 2432 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /*
2467 Specify that the frame FRAME has COLS columns. 2433 Specify that the frame FRAME has COLS columns.
2468 Optional third arg non-nil means that redisplay should use COLS columns 2434 Optional third arg non-nil means that redisplay should use COLS columns
2469 but that the idea of the actual width of the frame should not be changed. 2435 but that the idea of the actual width of the frame should not be changed.
2470 */ ) 2436 */
2471 (frame, cols, pretend) 2437 (frame, cols, pretend))
2472 Lisp_Object frame, cols, pretend;
2473 { 2438 {
2474 struct frame *f = decode_frame (frame); 2439 struct frame *f = decode_frame (frame);
2475 XSETFRAME (frame, f); 2440 XSETFRAME (frame, f);
2476 CHECK_INT (cols); 2441 CHECK_INT (cols);
2477 2442
2478 internal_set_frame_size (f, XINT (cols), FRAME_HEIGHT (f), 2443 internal_set_frame_size (f, XINT (cols), FRAME_HEIGHT (f),
2479 !NILP (pretend)); 2444 !NILP (pretend));
2480 return frame; 2445 return frame;
2481 } 2446 }
2482 2447
2483 DEFUN ("set-frame-size", Fset_frame_size, 2448 DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /*
2484 Sset_frame_size, 3, 4, 0 /*
2485 Sets size of FRAME to COLS by ROWS. 2449 Sets size of FRAME to COLS by ROWS.
2486 Optional fourth arg non-nil means that redisplay should use COLS by ROWS 2450 Optional fourth arg non-nil means that redisplay should use COLS by ROWS
2487 but that the idea of the actual size of the frame should not be changed. 2451 but that the idea of the actual size of the frame should not be changed.
2488 */ ) 2452 */
2489 (frame, cols, rows, pretend) 2453 (frame, cols, rows, pretend))
2490 Lisp_Object frame, cols, rows, pretend;
2491 { 2454 {
2492 struct frame *f = decode_frame (frame); 2455 struct frame *f = decode_frame (frame);
2493 XSETFRAME (frame, f); 2456 XSETFRAME (frame, f);
2494 CHECK_INT (cols); 2457 CHECK_INT (cols);
2495 CHECK_INT (rows); 2458 CHECK_INT (rows);
2496 2459
2497 internal_set_frame_size (f, XINT (cols), XINT (rows), !NILP (pretend)); 2460 internal_set_frame_size (f, XINT (cols), XINT (rows), !NILP (pretend));
2498 return frame; 2461 return frame;
2499 } 2462 }
2500 2463
2501 DEFUN ("set-frame-position", Fset_frame_position, 2464 DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /*
2502 Sset_frame_position, 3, 3, 0 /*
2503 Sets position of FRAME in pixels to XOFFSET by YOFFSET. 2465 Sets position of FRAME in pixels to XOFFSET by YOFFSET.
2504 This is actually the position of the upper left corner of the frame. 2466 This is actually the position of the upper left corner of the frame.
2505 Negative values for XOFFSET or YOFFSET are interpreted relative to 2467 Negative values for XOFFSET or YOFFSET are interpreted relative to
2506 the rightmost or bottommost possible position (that stays within the screen). 2468 the rightmost or bottommost possible position (that stays within the screen).
2507 */ ) 2469 */
2508 (frame, xoffset, yoffset) 2470 (frame, xoffset, yoffset))
2509 Lisp_Object frame, xoffset, yoffset;
2510 { 2471 {
2511 struct frame *f = decode_frame (frame); 2472 struct frame *f = decode_frame (frame);
2512 CHECK_INT (xoffset); 2473 CHECK_INT (xoffset);
2513 CHECK_INT (yoffset); 2474 CHECK_INT (yoffset);
2514 2475
2793 if (title) 2754 if (title)
2794 xfree (title); 2755 xfree (title);
2795 } 2756 }
2796 2757
2797 2758
2798 DEFUN ("set-frame-pointer", Fset_frame_pointer, Sset_frame_pointer, 2759 DEFUN ("set-frame-pointer", Fset_frame_pointer, 2, 2, 0, /*
2799 2, 2, 0 /*
2800 Set the mouse pointer of FRAME to the given pointer image instance. 2760 Set the mouse pointer of FRAME to the given pointer image instance.
2801 You should not call this function directly. Instead, set one of 2761 You should not call this function directly. Instead, set one of
2802 the variables `text-pointer-glyph', `nontext-pointer-glyph', 2762 the variables `text-pointer-glyph', `nontext-pointer-glyph',
2803 `modeline-pointer-glyph', `selection-pointer-glyph', 2763 `modeline-pointer-glyph', `selection-pointer-glyph',
2804 `busy-pointer-glyph', or `toolbar-pointer-glyph'. 2764 `busy-pointer-glyph', or `toolbar-pointer-glyph'.
2805 */ ) 2765 */
2806 (frame, image_instance) 2766 (frame, image_instance))
2807 Lisp_Object frame, image_instance;
2808 { 2767 {
2809 struct frame *f = decode_frame (frame); 2768 struct frame *f = decode_frame (frame);
2810 CHECK_POINTER_IMAGE_INSTANCE (image_instance); 2769 CHECK_POINTER_IMAGE_INSTANCE (image_instance);
2811 if (!EQ (f->pointer, image_instance)) 2770 if (!EQ (f->pointer, image_instance))
2812 { 2771 {
2915 defsymbol (&Qset_glyph_image, "set-glyph-image"); 2874 defsymbol (&Qset_glyph_image, "set-glyph-image");
2916 defsymbol (&Qset_face_property, "set-face-property"); 2875 defsymbol (&Qset_face_property, "set-face-property");
2917 defsymbol (&Qface_property_instance, "face-property-instance"); 2876 defsymbol (&Qface_property_instance, "face-property-instance");
2918 defsymbol (&Qframe_property_alias, "frame-property-alias"); 2877 defsymbol (&Qframe_property_alias, "frame-property-alias");
2919 2878
2920 defsubr (&Smake_frame); 2879 DEFSUBR (Fmake_frame);
2921 defsubr (&Sframep); 2880 DEFSUBR (Fframep);
2922 defsubr (&Sframe_live_p); 2881 DEFSUBR (Fframe_live_p);
2923 #if 0 /* FSFmacs */ 2882 #if 0 /* FSFmacs */
2924 defsubr (&Signore_event); 2883 DEFSUBR (Fignore_event);
2925 #endif 2884 #endif
2926 defsubr (&Sselect_frame); 2885 DEFSUBR (Fselect_frame);
2927 defsubr (&Sselected_frame); 2886 DEFSUBR (Fselected_frame);
2928 defsubr (&Sactive_minibuffer_window); 2887 DEFSUBR (Factive_minibuffer_window);
2929 defsubr (&Slast_nonminibuf_frame); 2888 DEFSUBR (Flast_nonminibuf_frame);
2930 defsubr (&Sframe_root_window); 2889 DEFSUBR (Fframe_root_window);
2931 defsubr (&Sframe_selected_window); 2890 DEFSUBR (Fframe_selected_window);
2932 defsubr (&Sset_frame_selected_window); 2891 DEFSUBR (Fset_frame_selected_window);
2933 defsubr (&Sframe_device); 2892 DEFSUBR (Fframe_device);
2934 defsubr (&Snext_frame); 2893 DEFSUBR (Fnext_frame);
2935 defsubr (&Sprevious_frame); 2894 DEFSUBR (Fprevious_frame);
2936 defsubr (&Sdelete_frame); 2895 DEFSUBR (Fdelete_frame);
2937 defsubr (&Smouse_position); 2896 DEFSUBR (Fmouse_position);
2938 defsubr (&Smouse_pixel_position); 2897 DEFSUBR (Fmouse_pixel_position);
2939 defsubr (&Smouse_position_as_motion_event); 2898 DEFSUBR (Fmouse_position_as_motion_event);
2940 defsubr (&Sset_mouse_position); 2899 DEFSUBR (Fset_mouse_position);
2941 defsubr (&Sset_mouse_pixel_position); 2900 DEFSUBR (Fset_mouse_pixel_position);
2942 defsubr (&Smake_frame_visible); 2901 DEFSUBR (Fmake_frame_visible);
2943 defsubr (&Smake_frame_invisible); 2902 DEFSUBR (Fmake_frame_invisible);
2944 defsubr (&Siconify_frame); 2903 DEFSUBR (Ficonify_frame);
2945 defsubr (&Sdeiconify_frame); 2904 DEFSUBR (Fdeiconify_frame);
2946 defsubr (&Sframe_visible_p); 2905 DEFSUBR (Fframe_visible_p);
2947 defsubr (&Sframe_totally_visible_p); 2906 DEFSUBR (Fframe_totally_visible_p);
2948 defsubr (&Sframe_iconified_p); 2907 DEFSUBR (Fframe_iconified_p);
2949 defsubr (&Svisible_frame_list); 2908 DEFSUBR (Fvisible_frame_list);
2950 defsubr (&Sraise_frame); 2909 DEFSUBR (Fraise_frame);
2951 defsubr (&Slower_frame); 2910 DEFSUBR (Flower_frame);
2952 defsubr (&Sframe_property); 2911 DEFSUBR (Fframe_property);
2953 defsubr (&Sframe_properties); 2912 DEFSUBR (Fframe_properties);
2954 defsubr (&Sset_frame_properties); 2913 DEFSUBR (Fset_frame_properties);
2955 defsubr (&Sframe_pixel_height); 2914 DEFSUBR (Fframe_pixel_height);
2956 defsubr (&Sframe_pixel_width); 2915 DEFSUBR (Fframe_pixel_width);
2957 defsubr (&Sframe_name); 2916 DEFSUBR (Fframe_name);
2958 defsubr (&Sframe_modified_tick); 2917 DEFSUBR (Fframe_modified_tick);
2959 defsubr (&Sset_frame_height); 2918 DEFSUBR (Fset_frame_height);
2960 defsubr (&Sset_frame_width); 2919 DEFSUBR (Fset_frame_width);
2961 defsubr (&Sset_frame_size); 2920 DEFSUBR (Fset_frame_size);
2962 defsubr (&Sset_frame_position); 2921 DEFSUBR (Fset_frame_position);
2963 defsubr (&Sset_frame_pointer); 2922 DEFSUBR (Fset_frame_pointer);
2964 } 2923 }
2965 2924
2966 void 2925 void
2967 vars_of_frame (void) 2926 vars_of_frame (void)
2968 { 2927 {
2969 /* */ 2928 /* */
2970 Vframe_being_created = Qnil; 2929 Vframe_being_created = Qnil;
2971 staticpro (&Vframe_being_created); 2930 staticpro (&Vframe_being_created);
2931
2932 #ifdef HAVE_CDE
2933 Vfeatures = Fcons (intern ("cde"), Vfeatures);
2934 #endif
2972 2935
2973 #if 0 /* FSFmacs stupidity */ 2936 #if 0 /* FSFmacs stupidity */
2974 xxDEFVAR_LISP ("emacs-iconified", &Vemacs_iconified /* 2937 xxDEFVAR_LISP ("emacs-iconified", &Vemacs_iconified /*
2975 Non-nil if all of emacs is iconified and frame updates are not needed. 2938 Non-nil if all of emacs is iconified and frame updates are not needed.
2976 */ ); 2939 */ );