Mercurial > hg > xemacs-beta
comparison src/frame.c @ 173:8eaf7971accc r20-3b13
Import from CVS: tag r20-3b13
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:49:09 +0200 |
parents | 5a88923fcbfe |
children | e121b013d1f0 |
comparison
equal
deleted
inserted
replaced
172:a38aed19690b | 173:8eaf7971accc |
---|---|
168 static void | 168 static void |
169 print_frame (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 169 print_frame (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
170 { | 170 { |
171 struct frame *frm = XFRAME (obj); | 171 struct frame *frm = XFRAME (obj); |
172 char buf[200]; | 172 char buf[200]; |
173 | 173 |
174 if (print_readably) | 174 if (print_readably) |
175 error ("printing unreadable object #<frame %s 0x%x>", | 175 error ("printing unreadable object #<frame %s 0x%x>", |
176 XSTRING_DATA (frm->name), frm->header.uid); | 176 XSTRING_DATA (frm->name), frm->header.uid); |
177 | 177 |
178 sprintf (buf, "#<%s-frame ", !FRAME_LIVE_P (frm) ? "dead" : | 178 sprintf (buf, "#<%s-frame ", !FRAME_LIVE_P (frm) ? "dead" : |
295 /* This function can GC */ | 295 /* This function can GC */ |
296 Lisp_Object device = f->device; | 296 Lisp_Object device = f->device; |
297 | 297 |
298 if (!NILP (mini_window)) | 298 if (!NILP (mini_window)) |
299 CHECK_LIVE_WINDOW (mini_window); | 299 CHECK_LIVE_WINDOW (mini_window); |
300 | 300 |
301 if (!NILP (mini_window) | 301 if (!NILP (mini_window) |
302 && !EQ (DEVICE_CONSOLE (XDEVICE (device)), | 302 && !EQ (DEVICE_CONSOLE (XDEVICE (device)), |
303 FRAME_CONSOLE (XFRAME (XWINDOW (mini_window)->frame)))) | 303 FRAME_CONSOLE (XFRAME (XWINDOW (mini_window)->frame)))) |
304 error ("frame and minibuffer must be on the same console"); | 304 error ("frame and minibuffer must be on the same console"); |
305 | 305 |
562 struct frame * | 562 struct frame * |
563 decode_frame (Lisp_Object frame) | 563 decode_frame (Lisp_Object frame) |
564 { | 564 { |
565 if (NILP (frame)) | 565 if (NILP (frame)) |
566 return selected_frame (); | 566 return selected_frame (); |
567 | 567 |
568 CHECK_LIVE_FRAME (frame); | 568 CHECK_LIVE_FRAME (frame); |
569 return (XFRAME (frame)); | 569 return XFRAME (frame); |
570 } | 570 } |
571 | 571 |
572 struct frame * | 572 struct frame * |
573 decode_frame_or_selected (Lisp_Object cdf) | 573 decode_frame_or_selected (Lisp_Object cdf) |
574 { | 574 { |
733 run_hook (Qmouse_leave_buffer_hook); | 733 run_hook (Qmouse_leave_buffer_hook); |
734 #endif | 734 #endif |
735 return do_switch_frame (frame, no_enter, 0); | 735 return do_switch_frame (frame, no_enter, 0); |
736 } | 736 } |
737 | 737 |
738 /* A load of garbage. */ | 738 /* A load of garbage. */ |
739 xxDEFUN ("ignore-event", Fignore_event, 0, 0, "", /* | 739 xxDEFUN ("ignore-event", Fignore_event, 0, 0, "", /* |
740 Do nothing, but preserve any prefix argument already specified. | 740 Do nothing, but preserve any prefix argument already specified. |
741 This is a suitable binding for iconify-frame and make-frame-visible. | 741 This is a suitable binding for iconify-frame and make-frame-visible. |
742 */ | 742 */ |
743 ()) | 743 ()) |
812 Return the root-window of FRAME. | 812 Return the root-window of FRAME. |
813 If omitted, FRAME defaults to the currently selected frame. | 813 If omitted, FRAME defaults to the currently selected frame. |
814 */ | 814 */ |
815 (frame)) | 815 (frame)) |
816 { | 816 { |
817 return (FRAME_ROOT_WINDOW (decode_frame (frame))); | 817 return FRAME_ROOT_WINDOW (decode_frame (frame)); |
818 } | 818 } |
819 | 819 |
820 DEFUN ("frame-selected-window", Fframe_selected_window, 0, 1, 0, /* | 820 DEFUN ("frame-selected-window", Fframe_selected_window, 0, 1, 0, /* |
821 Return the selected window of frame object FRAME. | 821 Return the selected window of frame object FRAME. |
822 If omitted, FRAME defaults to the currently selected frame. | 822 If omitted, FRAME defaults to the currently selected frame. |
823 */ | 823 */ |
824 (frame)) | 824 (frame)) |
825 { | 825 { |
826 return (FRAME_SELECTED_WINDOW (decode_frame (frame))); | 826 return FRAME_SELECTED_WINDOW (decode_frame (frame)); |
827 } | 827 } |
828 | 828 |
829 void | 829 void |
830 set_frame_selected_window (struct frame *f, Lisp_Object window) | 830 set_frame_selected_window (struct frame *f, Lisp_Object window) |
831 { | 831 { |
860 Return the device that FRAME is on. | 860 Return the device that FRAME is on. |
861 If omitted, FRAME defaults to the currently selected frame. | 861 If omitted, FRAME defaults to the currently selected frame. |
862 */ | 862 */ |
863 (frame)) | 863 (frame)) |
864 { | 864 { |
865 return (FRAME_DEVICE (decode_frame (frame))); | 865 return FRAME_DEVICE (decode_frame (frame)); |
866 } | 866 } |
867 | 867 |
868 int | 868 int |
869 is_surrogate_for_selected_frame (struct frame *f) | 869 is_surrogate_for_selected_frame (struct frame *f) |
870 { | 870 { |
937 if (EQ (type, Qvisible_iconic_nomini)) | 937 if (EQ (type, Qvisible_iconic_nomini)) |
938 return ((FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) | 938 return ((FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) |
939 && !FRAME_MINIBUF_ONLY_P (f)); | 939 && !FRAME_MINIBUF_ONLY_P (f)); |
940 if (EQ (type, Qinvisible_iconic_nomini)) | 940 if (EQ (type, Qinvisible_iconic_nomini)) |
941 return !FRAME_VISIBLE_P (f) && !FRAME_MINIBUF_ONLY_P (f); | 941 return !FRAME_VISIBLE_P (f) && !FRAME_MINIBUF_ONLY_P (f); |
942 | 942 |
943 return 1; | 943 return 1; |
944 } | 944 } |
945 | 945 |
946 int | 946 int |
947 device_matches_console_spec (Lisp_Object frame, Lisp_Object device, | 947 device_matches_console_spec (Lisp_Object frame, Lisp_Object device, |
1009 Fframe_visible_p (f); | 1009 Fframe_visible_p (f); |
1010 } | 1010 } |
1011 #endif | 1011 #endif |
1012 | 1012 |
1013 /* Decide whether this frame is eligible to be returned. */ | 1013 /* Decide whether this frame is eligible to be returned. */ |
1014 | 1014 |
1015 /* If we've looped all the way around without finding any | 1015 /* If we've looped all the way around without finding any |
1016 eligible frames, return the original frame. */ | 1016 eligible frames, return the original frame. */ |
1017 if (EQ (f, frame)) | 1017 if (EQ (f, frame)) |
1018 return f; | 1018 return f; |
1019 | 1019 |
1020 if (frame_matches_frametype (f, frametype)) | 1020 if (frame_matches_frametype (f, frametype)) |
1021 return f; | 1021 return f; |
1022 } | 1022 } |
1023 | 1023 |
1024 if (EQ (frame, f)) | 1024 if (EQ (frame, f)) |
1025 passed++; | 1025 passed++; |
1026 } | 1026 } |
1027 } | 1027 } |
1028 /* We hit the end of the list, and need to start over again. */ | 1028 /* We hit the end of the list, and need to start over again. */ |
1062 continue; | 1062 continue; |
1063 | 1063 |
1064 DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) | 1064 DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) |
1065 { | 1065 { |
1066 Lisp_Object f = XCAR (frmcons); | 1066 Lisp_Object f = XCAR (frmcons); |
1067 | 1067 |
1068 if (EQ (frame, f) && !NILP (prev)) | 1068 if (EQ (frame, f) && !NILP (prev)) |
1069 return prev; | 1069 return prev; |
1070 | 1070 |
1071 /* Decide whether this frame is eligible to be returned, | 1071 /* Decide whether this frame is eligible to be returned, |
1072 according to frametype. */ | 1072 according to frametype. */ |
1073 | 1073 |
1074 if (frame_matches_frametype (f, frametype)) | 1074 if (frame_matches_frametype (f, frametype)) |
1075 prev = f; | 1075 prev = f; |
1131 */ | 1131 */ |
1132 (frame, frametype, console)) | 1132 (frame, frametype, console)) |
1133 { | 1133 { |
1134 XSETFRAME (frame, decode_frame (frame)); | 1134 XSETFRAME (frame, decode_frame (frame)); |
1135 | 1135 |
1136 return (next_frame (frame, frametype, console)); | 1136 return next_frame (frame, frametype, console); |
1137 } | 1137 } |
1138 | 1138 |
1139 DEFUN ("previous-frame", Fprevious_frame, 0, 3, 0, /* | 1139 DEFUN ("previous-frame", Fprevious_frame, 0, 3, 0, /* |
1140 Return the next frame of the right type in the frame list after FRAME. | 1140 Return the next frame of the right type in the frame list after FRAME. |
1141 FRAMETYPE controls which frames are eligible to be returned; all | 1141 FRAMETYPE controls which frames are eligible to be returned; all |
1149 */ | 1149 */ |
1150 (frame, frametype, console)) | 1150 (frame, frametype, console)) |
1151 { | 1151 { |
1152 XSETFRAME (frame, decode_frame (frame)); | 1152 XSETFRAME (frame, decode_frame (frame)); |
1153 | 1153 |
1154 return (prev_frame (frame, frametype, console)); | 1154 return prev_frame (frame, frametype, console); |
1155 } | 1155 } |
1156 | 1156 |
1157 /* Return any frame for which PREDICATE is non-zero, or return Qnil | 1157 /* Return any frame for which PREDICATE is non-zero, or return Qnil |
1158 if there aren't any. */ | 1158 if there aren't any. */ |
1159 | 1159 |
1417 Fselect_frame (next); | 1417 Fselect_frame (next); |
1418 did_select = 1; | 1418 did_select = 1; |
1419 } | 1419 } |
1420 /* | 1420 /* |
1421 * If the new frame we just selected is on a different | 1421 * If the new frame we just selected is on a different |
1422 * device then we still need to change DEVICE_SELECTED_FRAME(d) | 1422 * device then we still need to change DEVICE_SELECTED_FRAME(d) |
1423 * to a live frame, if there are any left on this device. | 1423 * to a live frame, if there are any left on this device. |
1424 */ | 1424 */ |
1425 if (!EQ (device, FRAME_DEVICE(XFRAME(next)))) | 1425 if (!EQ (device, FRAME_DEVICE(XFRAME(next)))) |
1426 { | 1426 { |
1427 Lisp_Object next_f = | 1427 Lisp_Object next_f = |
1491 /* If we've deleted the last non-minibuf frame, then try to find | 1491 /* If we've deleted the last non-minibuf frame, then try to find |
1492 another one. */ | 1492 another one. */ |
1493 if (EQ (frame, CONSOLE_LAST_NONMINIBUF_FRAME (con))) | 1493 if (EQ (frame, CONSOLE_LAST_NONMINIBUF_FRAME (con))) |
1494 { | 1494 { |
1495 Lisp_Object frmcons, devcons; | 1495 Lisp_Object frmcons, devcons; |
1496 | 1496 |
1497 set_console_last_nonminibuf_frame (con, Qnil); | 1497 set_console_last_nonminibuf_frame (con, Qnil); |
1498 | 1498 |
1499 CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, con) | 1499 CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, con) |
1500 { | 1500 { |
1501 Lisp_Object ecran = XCAR (frmcons); | 1501 Lisp_Object ecran = XCAR (frmcons); |
1502 if (!FRAME_MINIBUF_ONLY_P (XFRAME (ecran))) | 1502 if (!FRAME_MINIBUF_ONLY_P (XFRAME (ecran))) |
1503 { | 1503 { |
1905 N.B. Under X \"visible\" means Mapped. It the window is mapped but not | 1905 N.B. Under X \"visible\" means Mapped. It the window is mapped but not |
1906 actually visible on screen then frame_visible returns 'hidden. | 1906 actually visible on screen then frame_visible returns 'hidden. |
1907 */ | 1907 */ |
1908 (frame)) | 1908 (frame)) |
1909 { | 1909 { |
1910 int visible; | |
1911 | |
1912 struct frame *f = decode_frame (frame); | 1910 struct frame *f = decode_frame (frame); |
1913 visible = FRAMEMETH_OR_GIVEN (f, frame_visible_p, (f), f->visible); | 1911 int visible = FRAMEMETH_OR_GIVEN (f, frame_visible_p, (f), f->visible); |
1914 return ( visible ? ( visible > 0 ? Qt : Qhidden ) | 1912 return visible ? ( visible > 0 ? Qt : Qhidden ) : Qnil; |
1915 : Qnil); | |
1916 } | 1913 } |
1917 | 1914 |
1918 DEFUN ("frame-totally-visible-p", Fframe_totally_visible_p, 0, 1, 0, /* | 1915 DEFUN ("frame-totally-visible-p", Fframe_totally_visible_p, 0, 1, 0, /* |
1919 Return T if frame is not obscured by any other X windows, NIL otherwise. | 1916 Return T if frame is not obscured by any other X windows, NIL otherwise. |
1920 Always returns t for tty frames. | 1917 Always returns t for tty frames. |
1921 */ | 1918 */ |
1922 (frame)) | 1919 (frame)) |
1923 { | 1920 { |
1924 struct frame *f = decode_frame (frame); | 1921 struct frame *f = decode_frame (frame); |
1925 return (FRAMEMETH_OR_GIVEN (f, frame_totally_visible_p, (f), f->visible) | 1922 return (FRAMEMETH_OR_GIVEN (f, frame_totally_visible_p, (f), f->visible) |
1926 ? Qt : Qnil); | 1923 ? Qt : Qnil); |
1927 } | 1924 } |
1928 | 1925 |
1929 DEFUN ("frame-iconified-p", Fframe_iconified_p, 0, 1, 0, /* | 1926 DEFUN ("frame-iconified-p", Fframe_iconified_p, 0, 1, 0, /* |
1930 Return t if FRAME is iconified. | 1927 Return t if FRAME is iconified. |
1931 Not all window managers use icons; some merely unmap the window, so this | 1928 Not all window managers use icons; some merely unmap the window, so this |
1937 { | 1934 { |
1938 struct frame *f = decode_frame (frame); | 1935 struct frame *f = decode_frame (frame); |
1939 if (f->visible) | 1936 if (f->visible) |
1940 return Qnil; | 1937 return Qnil; |
1941 f->iconified = FRAMEMETH_OR_GIVEN (f, frame_iconified_p, (f), 0); | 1938 f->iconified = FRAMEMETH_OR_GIVEN (f, frame_iconified_p, (f), 0); |
1942 return (f->iconified ? Qt : Qnil); | 1939 return f->iconified ? Qt : Qnil; |
1943 } | 1940 } |
1944 | 1941 |
1945 DEFUN ("visible-frame-list", Fvisible_frame_list, 0, 1, 0, /* | 1942 DEFUN ("visible-frame-list", Fvisible_frame_list, 0, 1, 0, /* |
1946 Return a list of all frames now \"visible\" (being updated). | 1943 Return a list of all frames now \"visible\" (being updated). |
1947 If DEVICE is specified only frames on that device will be returned. | 1944 If DEVICE is specified only frames on that device will be returned. |
2034 val); | 2031 val); |
2035 | 2032 |
2036 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) | 2033 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) |
2037 signal_simple_error | 2034 signal_simple_error |
2038 ("Can't change the surrogate minibuffer of a frame with its own minibuffer", frame); | 2035 ("Can't change the surrogate minibuffer of a frame with its own minibuffer", frame); |
2039 | 2036 |
2040 /* Install the chosen minibuffer window, with proper buffer. */ | 2037 /* Install the chosen minibuffer window, with proper buffer. */ |
2041 f->minibuffer_window = val; | 2038 f->minibuffer_window = val; |
2042 } | 2039 } |
2043 else if (EQ (val, Qt)) | 2040 else if (EQ (val, Qt)) |
2044 { | 2041 { |
2239 if (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop), | 2236 if (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop), |
2240 Qconst_specifier)) | 2237 Qconst_specifier)) |
2241 call3 (Qset_specifier, Fsymbol_value (prop), val, frame); | 2238 call3 (Qset_specifier, Fsymbol_value (prop), val, frame); |
2242 if (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable, Qnil))) | 2239 if (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable, Qnil))) |
2243 call3 (Qset_glyph_image, Fsymbol_value (prop), val, frame); | 2240 call3 (Qset_glyph_image, Fsymbol_value (prop), val, frame); |
2244 if (VECTORP (prop) && vector_length (XVECTOR (prop)) == 2) | 2241 if (VECTORP (prop) && XVECTOR_LENGTH (prop) == 2) |
2245 { | 2242 { |
2246 Lisp_Object face_prop = vector_data (XVECTOR (prop))[1]; | 2243 Lisp_Object face_prop = XVECTOR_DATA (prop)[1]; |
2247 CHECK_SYMBOL (face_prop); | 2244 CHECK_SYMBOL (face_prop); |
2248 call4 (Qset_face_property, | 2245 call4 (Qset_face_property, |
2249 Fget_face (vector_data (XVECTOR (prop))[0]), | 2246 Fget_face (XVECTOR_DATA (prop)[0]), |
2250 face_prop, val, frame); | 2247 face_prop, val, frame); |
2251 } | 2248 } |
2252 } | 2249 } |
2253 | 2250 |
2254 MAYBE_FRAMEMETH (f, set_frame_properties, (f, plist)); | 2251 MAYBE_FRAMEMETH (f, set_frame_properties, (f, plist)); |
2272 || EQ (prop, Qwidth) | 2269 || EQ (prop, Qwidth) |
2273 || (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop), | 2270 || (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop), |
2274 Qconst_specifier)) | 2271 Qconst_specifier)) |
2275 || (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable, | 2272 || (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable, |
2276 Qnil))) | 2273 Qnil))) |
2277 || (VECTORP (prop) && vector_length (XVECTOR (prop)) == 2) | 2274 || (VECTORP (prop) && XVECTOR_LENGTH (prop) == 2) |
2278 || FRAMEMETH_OR_GIVEN (f, internal_frame_property_p, (f, prop), 0)) | 2275 || FRAMEMETH_OR_GIVEN (f, internal_frame_property_p, (f, prop), 0)) |
2279 *tailp = *next_tailp; | 2276 *tailp = *next_tailp; |
2280 tailp = next_tailp; | 2277 tailp = next_tailp; |
2281 } | 2278 } |
2282 | 2279 |
2288 | 2285 |
2289 DEFUN ("frame-property", Fframe_property, 2, 3, 0, /* | 2286 DEFUN ("frame-property", Fframe_property, 2, 3, 0, /* |
2290 Return FRAME's value for property PROPERTY. | 2287 Return FRAME's value for property PROPERTY. |
2291 See `set-frame-properties' for the built-in property names. | 2288 See `set-frame-properties' for the built-in property names. |
2292 */ | 2289 */ |
2293 (frame, property, defalt)) | 2290 (frame, property, default_)) |
2294 { | 2291 { |
2295 struct frame *f = decode_frame (frame); | 2292 struct frame *f = decode_frame (frame); |
2296 | 2293 |
2297 XSETFRAME (frame, f); | 2294 XSETFRAME (frame, f); |
2298 | 2295 |
2299 property = get_property_alias (property); | 2296 property = get_property_alias (property); |
2300 | 2297 |
2301 #define FROB(propprop, value) \ | 2298 #define FROB(propprop, value) \ |
2302 do { \ | 2299 do { \ |
2303 if (EQ (property, propprop)) \ | 2300 if (EQ (property, propprop)) \ |
2304 return (value); \ | 2301 return value; \ |
2305 } while (0) | 2302 } while (0) |
2306 | 2303 |
2307 FROB (Qname, f->name); | 2304 FROB (Qname, f->name); |
2308 FROB (Qheight, make_int (FRAME_HEIGHT (f))); | 2305 FROB (Qheight, make_int (FRAME_HEIGHT (f))); |
2309 FROB (Qwidth, make_int (FRAME_WIDTH (f))); | 2306 FROB (Qwidth, make_int (FRAME_WIDTH (f))); |
2319 | 2316 |
2320 #undef FROB | 2317 #undef FROB |
2321 | 2318 |
2322 if (SYMBOLP (property) && EQ (Fbuilt_in_variable_type (property), | 2319 if (SYMBOLP (property) && EQ (Fbuilt_in_variable_type (property), |
2323 Qconst_specifier)) | 2320 Qconst_specifier)) |
2324 return Fspecifier_instance (Fsymbol_value (property), frame, defalt, Qnil); | 2321 return Fspecifier_instance (Fsymbol_value (property), frame, default_, Qnil); |
2325 if (SYMBOLP (property) && !NILP (Fget (property, Qconst_glyph_variable, | 2322 if (SYMBOLP (property) && !NILP (Fget (property, Qconst_glyph_variable, |
2326 Qnil))) | 2323 Qnil))) |
2327 { | 2324 { |
2328 Lisp_Object glyph = Fsymbol_value (property); | 2325 Lisp_Object glyph = Fsymbol_value (property); |
2329 CHECK_GLYPH (glyph); | 2326 CHECK_GLYPH (glyph); |
2330 return Fspecifier_instance (XGLYPH_IMAGE (glyph), frame, defalt, Qnil); | 2327 return Fspecifier_instance (XGLYPH_IMAGE (glyph), frame, default_, Qnil); |
2331 } | 2328 } |
2332 if (VECTORP (property) && vector_length (XVECTOR (property)) == 2) | 2329 if (VECTORP (property) && XVECTOR_LENGTH (property) == 2) |
2333 { | 2330 { |
2334 Lisp_Object face_prop = vector_data (XVECTOR (property))[1]; | 2331 Lisp_Object face_prop = XVECTOR_DATA (property)[1]; |
2335 CHECK_SYMBOL (face_prop); | 2332 CHECK_SYMBOL (face_prop); |
2336 return call3 (Qface_property_instance, | 2333 return call3 (Qface_property_instance, |
2337 Fget_face (vector_data (XVECTOR (property))[0]), | 2334 Fget_face (XVECTOR_DATA (property)[0]), |
2338 face_prop, frame); | 2335 face_prop, frame); |
2339 } | 2336 } |
2340 | 2337 |
2341 { | 2338 { |
2342 Lisp_Object value; | 2339 Lisp_Object value; |
2346 return value; | 2343 return value; |
2347 | 2344 |
2348 value = external_plist_get (&f->plist, property, 1, ERROR_ME); | 2345 value = external_plist_get (&f->plist, property, 1, ERROR_ME); |
2349 if (!UNBOUNDP (value)) | 2346 if (!UNBOUNDP (value)) |
2350 return value; | 2347 return value; |
2351 return defalt; | 2348 return default_; |
2352 } | 2349 } |
2353 } | 2350 } |
2354 | 2351 |
2355 DEFUN ("frame-properties", Fframe_properties, 0, 1, 0, /* | 2352 DEFUN ("frame-properties", Fframe_properties, 0, 1, 0, /* |
2356 Return a property list of the properties of FRAME. | 2353 Return a property list of the properties of FRAME. |
2361 struct frame *f = decode_frame (frame); | 2358 struct frame *f = decode_frame (frame); |
2362 Lisp_Object result = Qnil; | 2359 Lisp_Object result = Qnil; |
2363 struct gcpro gcpro1; | 2360 struct gcpro gcpro1; |
2364 | 2361 |
2365 GCPRO1 (result); | 2362 GCPRO1 (result); |
2366 | 2363 |
2367 #define FROB(propprop, value) \ | 2364 #define FROB(propprop, value) \ |
2368 do { \ | 2365 do { \ |
2369 Lisp_Object temtem = (value); \ | 2366 Lisp_Object temtem = (value); \ |
2370 if (!NILP (temtem)) \ | 2367 if (!NILP (temtem)) \ |
2371 /* backwards order; we reverse it below */ \ | 2368 /* backwards order; we reverse it below */ \ |
2409 Return the height in pixels of FRAME. | 2406 Return the height in pixels of FRAME. |
2410 */ | 2407 */ |
2411 (frame)) | 2408 (frame)) |
2412 { | 2409 { |
2413 struct frame *f = decode_frame (frame); | 2410 struct frame *f = decode_frame (frame); |
2414 return (make_int (f->pixheight)); | 2411 return make_int (f->pixheight); |
2415 } | 2412 } |
2416 | 2413 |
2417 DEFUN ("frame-pixel-width", Fframe_pixel_width, 0, 1, 0, /* | 2414 DEFUN ("frame-pixel-width", Fframe_pixel_width, 0, 1, 0, /* |
2418 Return the width in pixels of FRAME. | 2415 Return the width in pixels of FRAME. |
2419 */ | 2416 */ |
2420 (frame)) | 2417 (frame)) |
2421 { | 2418 { |
2422 struct frame *f = decode_frame (frame); | 2419 struct frame *f = decode_frame (frame); |
2423 return (make_int (f->pixwidth)); | 2420 return make_int (f->pixwidth); |
2424 } | 2421 } |
2425 | 2422 |
2426 DEFUN ("frame-name", Fframe_name, 0, 1, 0, /* | 2423 DEFUN ("frame-name", Fframe_name, 0, 1, 0, /* |
2427 Return the name of FRAME (defaulting to the selected frame). | 2424 Return the name of FRAME (defaulting to the selected frame). |
2428 This is not the same as the `title' of the frame. | 2425 This is not the same as the `title' of the frame. |
2429 */ | 2426 */ |
2430 (frame)) | 2427 (frame)) |
2431 { | 2428 { |
2432 return (decode_frame (frame)->name); | 2429 return decode_frame (frame)->name; |
2433 } | 2430 } |
2434 | 2431 |
2435 DEFUN ("frame-modified-tick", Fframe_modified_tick, 0, 1, 0, /* | 2432 DEFUN ("frame-modified-tick", Fframe_modified_tick, 0, 1, 0, /* |
2436 Return FRAME's tick counter, incremented for each change to the frame. | 2433 Return FRAME's tick counter, incremented for each change to the frame. |
2437 Each frame has a tick counter which is incremented each time the frame | 2434 Each frame has a tick counter which is incremented each time the frame |
2463 (frame, rows, pretend)) | 2460 (frame, rows, pretend)) |
2464 { | 2461 { |
2465 struct frame *f = decode_frame (frame); | 2462 struct frame *f = decode_frame (frame); |
2466 XSETFRAME (frame, f); | 2463 XSETFRAME (frame, f); |
2467 CHECK_INT (rows); | 2464 CHECK_INT (rows); |
2468 | 2465 |
2469 internal_set_frame_size (f, FRAME_WIDTH (f), XINT (rows), | 2466 internal_set_frame_size (f, FRAME_WIDTH (f), XINT (rows), |
2470 !NILP (pretend)); | 2467 !NILP (pretend)); |
2471 return frame; | 2468 return frame; |
2472 } | 2469 } |
2473 | 2470 |
2474 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /* | 2471 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /* |
2559 { | 2556 { |
2560 *pixel_width = (*char_width - 1) * cpw + egw + bdr + obw; | 2557 *pixel_width = (*char_width - 1) * cpw + egw + bdr + obw; |
2561 *pixel_height = *char_height * cph + bdr + obh; | 2558 *pixel_height = *char_height * cph + bdr + obh; |
2562 } | 2559 } |
2563 } | 2560 } |
2564 | 2561 |
2565 /* This takes the size in pixels of the text area, and returns the number | 2562 /* This takes the size in pixels of the text area, and returns the number |
2566 of characters that will fit there, taking into account the internal | 2563 of characters that will fit there, taking into account the internal |
2567 border width, and the pixel width of the line terminator glyphs (which | 2564 border width, and the pixel width of the line terminator glyphs (which |
2568 always count as one "character" wide, even if they are not the same size | 2565 always count as one "character" wide, even if they are not the same size |
2569 as the default character size of the default font). The frame scrollbar | 2566 as the default character size of the default font). The frame scrollbar |
2702 /* - font_height for minibuffer */ | 2699 /* - font_height for minibuffer */ |
2703 new_pixheight - minibuf_height, 0); | 2700 new_pixheight - minibuf_height, 0); |
2704 | 2701 |
2705 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = | 2702 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = |
2706 new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f); | 2703 new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f); |
2707 | 2704 |
2708 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); | 2705 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); |
2709 } | 2706 } |
2710 else | 2707 else |
2711 /* Frame has just one top-level window. */ | 2708 /* Frame has just one top-level window. */ |
2712 set_window_pixheight (FRAME_ROOT_WINDOW (f), new_pixheight, 0); | 2709 set_window_pixheight (FRAME_ROOT_WINDOW (f), new_pixheight, 0); |