aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-08-12 13:55:21 +0000
committerJim Blandy1992-08-12 13:55:21 +0000
commitfd0c2bd10961d18d61b7a09657da25518edcf944 (patch)
tree373b5585118eb25f5ba850e7f3b0c9832ff449a0 /src
parent509b05ed5e18691a8518dc4c2eaa712cefe23771 (diff)
downloademacs-fd0c2bd10961d18d61b7a09657da25518edcf944.tar.gz
emacs-fd0c2bd10961d18d61b7a09657da25518edcf944.zip
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Qunsplittable, Qwidth, Qx): New symbols, with lisp code to rebuild syms_of_frame. (syms_of_xfns): Initialize and staticpro them. (Fframep, Fframe_visible_p, Fframe_parameters): Use the new Q... variables, instead of interning things. (store_in_alist): Change the argument char *PROPNAME into a Lisp_Object PROP; let the caller take care of interning the atom. * frame.c (Fframe_visible_p): Doc fix. * frame.c (Fframe_parameters): When figuring the `minibuffer' parameter, if FRAME doesn't have a minibuffer, return `none', not nil. If it does have a minibuffer with other windows, return the window. * frame.c (Fmodify_frame_parameters): Don't write out the loop for processing X frame parameters here; do it in the x specific code. Call the function which deals with this stuff x_set_frame_parameters, not x_set_frame_parameter. * frame.c (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame, Fframe_parameters, Fmodify_frame_parameters, Fset_frame_height, Fset_frame_width, Fset_frame_size, Fset_frame_position): Place clauses controlled by FRAME_X_P inside `#ifdef HAVE_X_WINDOWS ... #endif' clauses. * frame.c (Fset_frame_position): Doc fix. * frame.c [MULTI_SCREEN] (Fset_frame_height, Fset_frame_width, Fset_frame_size): Call change_frame_size with a DELAY of 0. [not MULTI_SCREEN] (Fset_frame_height, Fset_frame_width, Fset_frame_size, Fset_screen_height, Fset_screen_width): Same. * frame.c [not MULTI_SCREEN] (Fset_frame_height, Fset_frame_width, Fset_frame_size, Fframe_height, Fframe_width): New functions, for use when Emacs is not compiled with multiple screens. [not MULTI_SCREEN] (Fset_screen_height, Fset_screen_width): Functions added for backward compatibility with Emacs 18. These would be just aliases, except that the version 18 functions don't take a FRAME argument. [not MULTI_SCREEN] (syms_of_frame): New function, to defsubr the above and add screen-height and screen-width as aliases for Fframe_height and Fframe_width. * frame.c (Fset_frame_width): Change the size of FRAME, not of selected_frame. * frame.c (Fset_frame_width, Fset_frame_height): Declare the `frame' argument to be a Lisp_Object. It used to be undeclared. * frame.c (FRAME_IS_TERMCAP, FRAME_IS_X, FRAME_HAS_MINIBUF): Renamed these to FRAME_TERMCAP_P, FRAME_X_P, and FRAME_HAS_MINIBUF_P, for consistency with the rest of the frame macros.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c277
1 files changed, 229 insertions, 48 deletions
diff --git a/src/frame.c b/src/frame.c
index 8f261184b6d..bd196b84c8b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,4 +1,3 @@
1
2/* Generic frame functions. 1/* Generic frame functions.
3 Copyright (C) 1989, 1992 Free Software Foundation. 2 Copyright (C) 1989, 1992 Free Software Foundation.
4 3
@@ -30,13 +29,57 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
30#include "termhooks.h" 29#include "termhooks.h"
31 30
32Lisp_Object Vemacs_iconified; 31Lisp_Object Vemacs_iconified;
33Lisp_Object Qframep;
34Lisp_Object Qlive_frame_p;
35Lisp_Object Vframe_list; 32Lisp_Object Vframe_list;
36Lisp_Object Vterminal_frame; 33Lisp_Object Vterminal_frame;
37Lisp_Object Vdefault_minibuffer_frame; 34Lisp_Object Vdefault_minibuffer_frame;
38Lisp_Object Vdefault_frame_alist; 35Lisp_Object Vdefault_frame_alist;
36
37/* Evaluate this expression to rebuild the section of syms_of_frame
38 that initializes and staticpros the symbols declared below. Note
39 that Emacs 18 has a bug that keeps C-x C-e from being able to
40 evaluate this expression.
41
42(progn
43 ;; Accumulate a list of the symbols we want to initialize from the
44 ;; declarations at the top of the file.
45 (goto-char (point-min))
46 (search-forward "/\*&&& symbols declared here &&&*\/\n")
47 (let (symbol-list)
48 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
49 (setq symbol-list
50 (cons (buffer-substring (match-beginning 1) (match-end 1))
51 symbol-list))
52 (forward-line 1))
53 (setq symbol-list (nreverse symbol-list))
54 ;; Delete the section of syms_of_... where we initialize the symbols.
55 (search-forward "\n /\*&&& init symbols here &&&*\/\n")
56 (let ((start (point)))
57 (while (looking-at "^ Q")
58 (forward-line 2))
59 (kill-region start (point)))
60 ;; Write a new symbol initialization section.
61 (while symbol-list
62 (insert (format " %s = intern (\"" (car symbol-list)))
63 (let ((start (point)))
64 (insert (substring (car symbol-list) 1))
65 (subst-char-in-region start (point) ?_ ?-))
66 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
67 (setq symbol-list (cdr symbol-list)))))
68 */
69
70/*&&& symbols declared here &&&*/
71Lisp_Object Qframep;
72Lisp_Object Qlive_frame_p;
73Lisp_Object Qheight;
74Lisp_Object Qicon;
39Lisp_Object Qminibuffer; 75Lisp_Object Qminibuffer;
76Lisp_Object Qmodeline;
77Lisp_Object Qname;
78Lisp_Object Qnone;
79Lisp_Object Qonly;
80Lisp_Object Qunsplittable;
81Lisp_Object Qwidth;
82Lisp_Object Qx;
40 83
41extern Lisp_Object Vminibuffer_list; 84extern Lisp_Object Vminibuffer_list;
42extern Lisp_Object get_minibuffer (); 85extern Lisp_Object get_minibuffer ();
@@ -56,7 +99,7 @@ Also see `live-frame-p'.")
56 case output_termcap: 99 case output_termcap:
57 return Qt; 100 return Qt;
58 case output_x_window: 101 case output_x_window:
59 return intern ("x"); 102 return Qx;
60 default: 103 default:
61 abort (); 104 abort ();
62 } 105 }
@@ -290,7 +333,7 @@ focus on that frame.")
290 333
291#ifdef HAVE_X_WINDOWS 334#ifdef HAVE_X_WINDOWS
292#ifdef MULTI_FRAME 335#ifdef MULTI_FRAME
293 if (FRAME_IS_X (XFRAME (frame)) 336 if (FRAME_X_P (XFRAME (frame))
294 && NILP (no_enter)) 337 && NILP (no_enter))
295 { 338 {
296 Ffocus_frame (frame); 339 Ffocus_frame (frame);
@@ -491,7 +534,7 @@ A frame may not be deleted if its minibuffer is used by other frames.")
491 534
492 /* Does this frame have a minibuffer, and is it the surrogate 535 /* Does this frame have a minibuffer, and is it the surrogate
493 minibuffer for any other frame? */ 536 minibuffer for any other frame? */
494 if (FRAME_HAS_MINIBUF (XFRAME (frame))) 537 if (FRAME_HAS_MINIBUF_P (XFRAME (frame)))
495 { 538 {
496 Lisp_Object frames; 539 Lisp_Object frames;
497 540
@@ -529,7 +572,7 @@ A frame may not be deleted if its minibuffer is used by other frames.")
529 f->display.nothing = 0; 572 f->display.nothing = 0;
530 573
531#ifdef HAVE_X_WINDOWS 574#ifdef HAVE_X_WINDOWS
532 if (FRAME_IS_X (f)) 575 if (FRAME_X_P (f))
533 x_destroy_window (f, displ); 576 x_destroy_window (f, displ);
534#endif 577#endif
535 578
@@ -574,7 +617,7 @@ A frame may not be deleted if its minibuffer is used by other frames.")
574 abort (); 617 abort ();
575 f = XFRAME (this); 618 f = XFRAME (this);
576 619
577 if (FRAME_HAS_MINIBUF (f)) 620 if (FRAME_HAS_MINIBUF_P (f))
578 { 621 {
579 frame_with_minibuf = this; 622 frame_with_minibuf = this;
580 if (FRAME_MINIBUF_ONLY_P (f)) 623 if (FRAME_MINIBUF_ONLY_P (f))
@@ -632,7 +675,7 @@ WARNING: If you use this under X, you should do `unfocus-frame' afterwards.")
632 CHECK_NUMBER (y, 1); 675 CHECK_NUMBER (y, 1);
633 676
634#ifdef HAVE_X_WINDOWS 677#ifdef HAVE_X_WINDOWS
635 if (FRAME_IS_X (XFRAME (frame))) 678 if (FRAME_X_P (XFRAME (frame)))
636 /* Warping the mouse will cause enternotify and focus events. */ 679 /* Warping the mouse will cause enternotify and focus events. */
637 x_set_mouse_position (XFRAME (frame), x, y); 680 x_set_mouse_position (XFRAME (frame), x, y);
638#endif 681#endif
@@ -708,8 +751,10 @@ Also raises the frame so that nothing obscures it.")
708 751
709 CHECK_LIVE_FRAME (frame, 0); 752 CHECK_LIVE_FRAME (frame, 0);
710 753
711 if (FRAME_IS_X (XFRAME (frame))) 754#ifdef HAVE_X_WINDOWS
755 if (FRAME_X_P (XFRAME (frame)))
712 x_make_frame_visible (XFRAME (frame)); 756 x_make_frame_visible (XFRAME (frame));
757#endif
713 758
714 return frame; 759 return frame;
715} 760}
@@ -725,8 +770,10 @@ DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible,
725 770
726 CHECK_LIVE_FRAME (frame, 0); 771 CHECK_LIVE_FRAME (frame, 0);
727 772
728 if (FRAME_IS_X (XFRAME (frame))) 773#ifdef HAVE_X_WINDOWS
774 if (FRAME_X_P (XFRAME (frame)))
729 x_make_frame_invisible (XFRAME (frame)); 775 x_make_frame_invisible (XFRAME (frame));
776#endif
730 777
731 return Qnil; 778 return Qnil;
732} 779}
@@ -742,8 +789,10 @@ DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
742 789
743 CHECK_LIVE_FRAME (frame, 0); 790 CHECK_LIVE_FRAME (frame, 0);
744 791
745 if (FRAME_IS_X (XFRAME (frame))) 792#ifdef HAVE_X_WINDOWS
793 if (FRAME_X_P (XFRAME (frame)))
746 x_iconify_frame (XFRAME (frame)); 794 x_iconify_frame (XFRAME (frame));
795#endif
747 796
748 return Qnil; 797 return Qnil;
749} 798}
@@ -753,7 +802,7 @@ DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p,
753 "Return t if FRAME is now \"visible\" (actually in use for display).\n\ 802 "Return t if FRAME is now \"visible\" (actually in use for display).\n\
754A frame that is not \"visible\" is not updated and, if it works through\n\ 803A frame that is not \"visible\" is not updated and, if it works through\n\
755a window system, it may not show at all.\n\ 804a window system, it may not show at all.\n\
756Return the symbol `icon' if window is visible only as an icon.") 805Return the symbol `icon' if frame is visible only as an icon.")
757 (frame) 806 (frame)
758 Lisp_Object frame; 807 Lisp_Object frame;
759{ 808{
@@ -762,7 +811,7 @@ Return the symbol `icon' if window is visible only as an icon.")
762 if (XFRAME (frame)->visible) 811 if (XFRAME (frame)->visible)
763 return Qt; 812 return Qt;
764 if (XFRAME (frame)->iconified) 813 if (XFRAME (frame)->iconified)
765 return intern ("icon"); 814 return Qicon;
766 return Qnil; 815 return Qnil;
767} 816}
768 817
@@ -849,14 +898,12 @@ get_frame_param (frame, prop)
849} 898}
850 899
851void 900void
852store_in_alist (alistptr, propname, val) 901store_in_alist (alistptr, prop, val)
853 Lisp_Object *alistptr, val; 902 Lisp_Object *alistptr, val;
854 char *propname; 903 Lisp_Object prop;
855{ 904{
856 register Lisp_Object tem; 905 register Lisp_Object tem;
857 register Lisp_Object prop;
858 906
859 prop = intern (propname);
860 tem = Fassq (prop, *alistptr); 907 tem = Fassq (prop, *alistptr);
861 if (EQ (tem, Qnil)) 908 if (EQ (tem, Qnil))
862 *alistptr = Fcons (Fcons (prop, val), *alistptr); 909 *alistptr = Fcons (Fcons (prop, val), *alistptr);
@@ -883,7 +930,7 @@ store_frame_param (f, prop, val)
883 if (! MINI_WINDOW_P (XWINDOW (val))) 930 if (! MINI_WINDOW_P (XWINDOW (val)))
884 error ("Surrogate minibuffer windows must be minibuffer windows."); 931 error ("Surrogate minibuffer windows must be minibuffer windows.");
885 932
886 if (FRAME_HAS_MINIBUF (f) || FRAME_MINIBUF_ONLY_P (f)) 933 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
887 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer."); 934 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer.");
888 935
889 /* Install the chosen minibuffer window, with proper buffer. */ 936 /* Install the chosen minibuffer window, with proper buffer. */
@@ -914,18 +961,20 @@ If FRAME is omitted, return information on the currently selected frame.")
914 return Qnil; 961 return Qnil;
915 962
916 alist = Fcopy_alist (f->param_alist); 963 alist = Fcopy_alist (f->param_alist);
917 store_in_alist (&alist, "name", f->name); 964 store_in_alist (&alist, Qname, f->name);
918 store_in_alist (&alist, "height", make_number (f->height)); 965 store_in_alist (&alist, Qheight, make_number (f->height));
919 store_in_alist (&alist, "width", make_number (f->width)); 966 store_in_alist (&alist, Qwidth, make_number (f->width));
920 store_in_alist (&alist, "modeline", (f->wants_modeline ? Qt : Qnil)); 967 store_in_alist (&alist, Qmodeline, (f->wants_modeline ? Qt : Qnil));
921 store_in_alist (&alist, "minibuffer", 968 store_in_alist (&alist, Qminibuffer,
922 (FRAME_HAS_MINIBUF (f) 969 (! FRAME_HAS_MINIBUF_P (f) ? Qnone
923 ? (FRAME_MINIBUF_ONLY_P (f) ? intern ("only") : Qt) 970 : (FRAME_MINIBUF_ONLY_P (f) ? Qonly
924 : FRAME_MINIBUF_WINDOW (f))); 971 : FRAME_MINIBUF_WINDOW (f))));
925 store_in_alist (&alist, "unsplittable", (f->no_split ? Qt : Qnil)); 972 store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil));
926 973
927 if (FRAME_IS_X (f)) 974#ifdef HAVE_X_WINDOWS
975 if (FRAME_X_P (f))
928 x_report_frame_params (f, &alist); 976 x_report_frame_params (f, &alist);
977#endif
929 return alist; 978 return alist;
930} 979}
931 980
@@ -938,7 +987,7 @@ The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.")
938 (frame, alist) 987 (frame, alist)
939 Lisp_Object frame, alist; 988 Lisp_Object frame, alist;
940{ 989{
941 register struct frame *f; 990 FRAME_PTR f;
942 register Lisp_Object tail, elt, prop, val; 991 register Lisp_Object tail, elt, prop, val;
943 992
944 if (EQ (frame, Qnil)) 993 if (EQ (frame, Qnil))
@@ -949,16 +998,21 @@ The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.")
949 f = XFRAME (frame); 998 f = XFRAME (frame);
950 } 999 }
951 1000
952 if (FRAME_IS_X (f)) 1001#ifdef HAVE_X_WINDOWS
1002 if (FRAME_X_P (f))
1003#if 1
1004 x_set_frame_parameters (f, alist);
1005#else
953 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) 1006 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail))
954 { 1007 {
955 elt = Fcar (tail); 1008 elt = Fcar (tail);
956 prop = Fcar (elt); 1009 prop = Fcar (elt);
957 val = Fcdr (elt); 1010 val = Fcdr (elt);
958 x_set_frame_param (f, prop, val, 1011 x_set_frame_param (f, prop, val, get_frame_param (f, prop));
959 get_frame_param (f, prop));
960 store_frame_param (f, prop, val); 1012 store_frame_param (f, prop, val);
961 } 1013 }
1014#endif
1015#endif
962 1016
963 return Qnil; 1017 return Qnil;
964} 1018}
@@ -1009,7 +1063,7 @@ DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
1009Optional third arg non-nil means that redisplay should use LINES lines\n\ 1063Optional third arg non-nil means that redisplay should use LINES lines\n\
1010but that the idea of the actual height of the frame should not be changed.") 1064but that the idea of the actual height of the frame should not be changed.")
1011 (frame, rows, pretend) 1065 (frame, rows, pretend)
1012 Lisp_Object rows, pretend; 1066 Lisp_Object frame, rows, pretend;
1013{ 1067{
1014 register struct frame *f; 1068 register struct frame *f;
1015 1069
@@ -1022,13 +1076,15 @@ but that the idea of the actual height of the frame should not be changed.")
1022 f = XFRAME (frame); 1076 f = XFRAME (frame);
1023 } 1077 }
1024 1078
1025 if (FRAME_IS_X (f)) 1079#ifdef HAVE_X_WINDOWS
1080 if (FRAME_X_P (f))
1026 { 1081 {
1027 if (XINT (rows) != f->width) 1082 if (XINT (rows) != f->width)
1028 x_set_window_size (f, f->width, XINT (rows)); 1083 x_set_window_size (f, f->width, XINT (rows));
1029 } 1084 }
1030 else 1085 else
1031 change_frame_size (f, XINT (rows), 0, !NILP (pretend)); 1086#endif
1087 change_frame_size (f, XINT (rows), 0, !NILP (pretend), 0);
1032 return Qnil; 1088 return Qnil;
1033} 1089}
1034 1090
@@ -1037,7 +1093,7 @@ DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
1037Optional third arg non-nil means that redisplay should use COLS columns\n\ 1093Optional third arg non-nil means that redisplay should use COLS columns\n\
1038but that the idea of the actual width of the frame should not be changed.") 1094but that the idea of the actual width of the frame should not be changed.")
1039 (frame, cols, pretend) 1095 (frame, cols, pretend)
1040 Lisp_Object cols, pretend; 1096 Lisp_Object frame, cols, pretend;
1041{ 1097{
1042 register struct frame *f; 1098 register struct frame *f;
1043 CHECK_NUMBER (cols, 0); 1099 CHECK_NUMBER (cols, 0);
@@ -1049,13 +1105,15 @@ but that the idea of the actual width of the frame should not be changed.")
1049 f = XFRAME (frame); 1105 f = XFRAME (frame);
1050 } 1106 }
1051 1107
1052 if (FRAME_IS_X (f)) 1108#ifdef HAVE_X_WINDOWS
1109 if (FRAME_X_P (f))
1053 { 1110 {
1054 if (XINT (cols) != f->width) 1111 if (XINT (cols) != f->width)
1055 x_set_window_size (f, XINT (cols), f->height); 1112 x_set_window_size (f, XINT (cols), f->height);
1056 } 1113 }
1057 else 1114 else
1058 change_frame_size (selected_frame, 0, XINT (cols), !NILP (pretend)); 1115#endif
1116 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0);
1059 return Qnil; 1117 return Qnil;
1060} 1118}
1061 1119
@@ -1072,13 +1130,15 @@ DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
1072 CHECK_NUMBER (rows, 1); 1130 CHECK_NUMBER (rows, 1);
1073 f = XFRAME (frame); 1131 f = XFRAME (frame);
1074 1132
1075 if (FRAME_IS_X (f)) 1133#ifdef HAVE_X_WINDOWS
1134 if (FRAME_X_P (f))
1076 { 1135 {
1077 if (XINT (rows) != f->height || XINT (cols) != f->width) 1136 if (XINT (rows) != f->height || XINT (cols) != f->width)
1078 x_set_window_size (f, XINT (cols), XINT (rows)); 1137 x_set_window_size (f, XINT (cols), XINT (rows));
1079 } 1138 }
1080 else 1139 else
1081 change_frame_size (f, XINT (rows), XINT (cols), 0); 1140#endif
1141 change_frame_size (f, XINT (rows), XINT (cols), 0, 0);
1082 1142
1083 return Qnil; 1143 return Qnil;
1084} 1144}
@@ -1088,7 +1148,7 @@ DEFUN ("set-frame-position", Fset_frame_position,
1088 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\ 1148 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\
1089If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\ 1149If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\
1090the leftmost or bottommost position FRAME could occupy without going\n\ 1150the leftmost or bottommost position FRAME could occupy without going\n\
1091off the frame.") 1151off the screen.")
1092 (frame, xoffset, yoffset) 1152 (frame, xoffset, yoffset)
1093 Lisp_Object frame, xoffset, yoffset; 1153 Lisp_Object frame, xoffset, yoffset;
1094{ 1154{
@@ -1100,8 +1160,10 @@ off the frame.")
1100 CHECK_NUMBER (yoffset, 2); 1160 CHECK_NUMBER (yoffset, 2);
1101 f = XFRAME (frame); 1161 f = XFRAME (frame);
1102 1162
1103 if (FRAME_IS_X (f)) 1163#ifdef HAVE_X_WINDOWS
1164 if (FRAME_X_P (f))
1104 x_set_offset (f, XINT (xoffset), XINT (yoffset)); 1165 x_set_offset (f, XINT (xoffset), XINT (yoffset));
1166#endif
1105 1167
1106 return Qt; 1168 return Qt;
1107} 1169}
@@ -1164,13 +1226,31 @@ choose_minibuf_frame ()
1164 1226
1165syms_of_frame () 1227syms_of_frame ()
1166{ 1228{
1229 /*&&& init symbols here &&&*/
1167 Qframep = intern ("framep"); 1230 Qframep = intern ("framep");
1168 Qlive_frame_p = intern ("live_frame_p");
1169 Qminibuffer = intern ("minibuffer");
1170
1171 staticpro (&Qframep); 1231 staticpro (&Qframep);
1232 Qlive_frame_p = intern ("live-frame-p");
1172 staticpro (&Qlive_frame_p); 1233 staticpro (&Qlive_frame_p);
1234 Qheight = intern ("height");
1235 staticpro (&Qheight);
1236 Qicon = intern ("icon");
1237 staticpro (&Qicon);
1238 Qminibuffer = intern ("minibuffer");
1173 staticpro (&Qminibuffer); 1239 staticpro (&Qminibuffer);
1240 Qmodeline = intern ("modeline");
1241 staticpro (&Qmodeline);
1242 Qname = intern ("name");
1243 staticpro (&Qname);
1244 Qnone = intern ("none");
1245 staticpro (&Qnone);
1246 Qonly = intern ("only");
1247 staticpro (&Qonly);
1248 Qunsplittable = intern ("unsplittable");
1249 staticpro (&Qunsplittable);
1250 Qwidth = intern ("width");
1251 staticpro (&Qwidth);
1252 Qx = intern ("x");
1253 staticpro (&Qx);
1174 1254
1175 staticpro (&Vframe_list); 1255 staticpro (&Vframe_list);
1176 1256
@@ -1245,4 +1325,105 @@ For values specific to the separate minibuffer frame, see\n\
1245#endif /* HAVE_X11 */ 1325#endif /* HAVE_X11 */
1246} 1326}
1247 1327
1248#endif 1328#else /* not MULTI_SCREEN */
1329
1330/* If we're not using multi-frame stuff, we still need to provide
1331 some support functions. These were present in Emacs 18. */
1332
1333DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
1334 "Specify that the frame FRAME has LINES lines.\n\
1335Optional third arg non-nil means that redisplay should use LINES lines\n\
1336but that the idea of the actual height of the frame should not be changed.")
1337 (frame, rows, pretend)
1338 Lisp_Object frame, rows, pretend;
1339{
1340 CHECK_NUMBER (rows, 0);
1341
1342 change_frame_size (0, XINT (rows), 0, !NILP (pretend), 0);
1343 return Qnil;
1344}
1345
1346DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
1347 "Specify that the frame FRAME has COLS columns.\n\
1348Optional third arg non-nil means that redisplay should use COLS columns\n\
1349but that the idea of the actual width of the frame should not be changed.")
1350 (frame, cols, pretend)
1351 Lisp_Object frame, cols, pretend;
1352{
1353 CHECK_NUMBER (cols, 0);
1354
1355 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0);
1356 return Qnil;
1357}
1358
1359DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
1360 "Sets size of FRAME to COLS by ROWS, measured in characters.")
1361 (frame, cols, rows)
1362 Lisp_Object frame, cols, rows;
1363{
1364 CHECK_NUMBER (cols, 2);
1365 CHECK_NUMBER (rows, 1);
1366
1367 change_frame_size (0, XINT (rows), XINT (cols), 0, 0);
1368
1369 return Qnil;
1370}
1371
1372DEFUN ("set-screen-height", Fset_screen_height, Sset_screen_height, 1, 2, 0,
1373 "Tell redisplay that the screen has LINES lines.\n\
1374Optional second arg non-nil means that redisplay should use LINES lines\n\
1375but that the idea of the actual height of the screen should not be changed.")
1376 (lines, pretend)
1377 Lisp_Object lines, pretend;
1378{
1379 CHECK_NUMBER (lines, 0);
1380
1381 change_frame_size (0, XINT (lines), 0, !NILP (pretend), 0);
1382 return Qnil;
1383}
1384
1385DEFUN ("set-screen-width", Fset_screen_width, Sset_screen_width, 1, 2, 0,
1386 "Tell redisplay that the screen has COLS columns.\n\
1387Optional second arg non-nil means that redisplay should use COLS columns\n\
1388but that the idea of the actual width of the screen should not be changed.")
1389 (cols, pretend)
1390 Lisp_Object cols, pretend;
1391{
1392 CHECK_NUMBER (cols, 0);
1393
1394 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0);
1395 return Qnil;
1396}
1397
1398DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0,
1399 "Return number of lines available for display on selected frame.")
1400 ()
1401{
1402 return make_number (FRAME_HEIGHT (selected_frame));
1403}
1404
1405DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0,
1406 "Return number of columns available for display on selected frame.")
1407 ()
1408{
1409 return make_number (FRAME_WIDTH (selected_frame));
1410}
1411
1412syms_of_frame ()
1413{
1414 defsubr (&Sset_frame_height);
1415 defsubr (&Sset_frame_width);
1416 defsubr (&Sset_frame_size);
1417 defsubr (&Sset_screen_height);
1418 defsubr (&Sset_screen_width);
1419 defsubr (&Sframe_height);
1420 Ffset (intern ("screen-height"), intern ("frame-height"));
1421 defsubr (&Sframe_width);
1422 Ffset (intern ("screen-width"), intern ("frame-width"));
1423}
1424
1425#endif /* not MULTI_FRAME */
1426
1427
1428
1429