diff options
| author | Geoff Voelker | 1995-11-07 07:19:52 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1995-11-07 07:19:52 +0000 |
| commit | 032d78fe789abe27c2d01fe60a47c83dbe4f1388 (patch) | |
| tree | 99d44b0a91e272f1d9f47dd6c088c8798810bea5 /src | |
| parent | efa7f0f9eb98616bde573b7f1ad630abf659b884 (diff) | |
| download | emacs-032d78fe789abe27c2d01fe60a47c83dbe4f1388.tar.gz emacs-032d78fe789abe27c2d01fe60a47c83dbe4f1388.zip | |
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Use FRAME_WINDOW_P instead of testing for specific window system frames.
Use HAVE_WINDOW_SYSTEM instead of testing for specific window systems.
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 85 |
1 files changed, 45 insertions, 40 deletions
diff --git a/src/frame.c b/src/frame.c index 88ca8377475..574dc0a8ad8 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -76,6 +76,7 @@ Lisp_Object Qunsplittable; | |||
| 76 | Lisp_Object Qmenu_bar_lines; | 76 | Lisp_Object Qmenu_bar_lines; |
| 77 | Lisp_Object Qwidth; | 77 | Lisp_Object Qwidth; |
| 78 | Lisp_Object Qx; | 78 | Lisp_Object Qx; |
| 79 | Lisp_Object Qwin32; | ||
| 79 | Lisp_Object Qvisible; | 80 | Lisp_Object Qvisible; |
| 80 | Lisp_Object Qbuffer_predicate; | 81 | Lisp_Object Qbuffer_predicate; |
| 81 | 82 | ||
| @@ -111,6 +112,8 @@ syms_of_frame_1 () | |||
| 111 | staticpro (&Qwidth); | 112 | staticpro (&Qwidth); |
| 112 | Qx = intern ("x"); | 113 | Qx = intern ("x"); |
| 113 | staticpro (&Qx); | 114 | staticpro (&Qx); |
| 115 | Qwin32 = intern ("win32"); | ||
| 116 | staticpro (&Qwin32); | ||
| 114 | Qvisible = intern ("visible"); | 117 | Qvisible = intern ("visible"); |
| 115 | staticpro (&Qvisible); | 118 | staticpro (&Qvisible); |
| 116 | Qbuffer_predicate = intern ("buffer-predicate"); | 119 | Qbuffer_predicate = intern ("buffer-predicate"); |
| @@ -201,6 +204,8 @@ See also `frame-live-p'.") | |||
| 201 | return Qt; | 204 | return Qt; |
| 202 | case output_x_window: | 205 | case output_x_window: |
| 203 | return Qx; | 206 | return Qx; |
| 207 | case output_win32: | ||
| 208 | return Qwin32; | ||
| 204 | /* The `pc' case is in the Fframep below. */ | 209 | /* The `pc' case is in the Fframep below. */ |
| 205 | default: | 210 | default: |
| 206 | abort (); | 211 | abort (); |
| @@ -547,8 +552,8 @@ do_switch_frame (frame, no_enter, track) | |||
| 547 | } | 552 | } |
| 548 | #else /* ! 0 */ | 553 | #else /* ! 0 */ |
| 549 | /* Instead, apply it only to the frame we're pointing to. */ | 554 | /* Instead, apply it only to the frame we're pointing to. */ |
| 550 | #ifdef HAVE_X_WINDOWS | 555 | #ifdef HAVE_WINDOW_SYSTEM |
| 551 | if (track && FRAME_X_P (XFRAME (frame))) | 556 | if (track && (FRAME_WINDOW_P (XFRAME (frame)))) |
| 552 | { | 557 | { |
| 553 | Lisp_Object focus, xfocus; | 558 | Lisp_Object focus, xfocus; |
| 554 | 559 | ||
| @@ -968,8 +973,8 @@ other_visible_frames (f) | |||
| 968 | /* Verify that the frame's window still exists | 973 | /* Verify that the frame's window still exists |
| 969 | and we can still talk to it. And note any recent change | 974 | and we can still talk to it. And note any recent change |
| 970 | in visibility. */ | 975 | in visibility. */ |
| 971 | #ifdef HAVE_X_WINDOWS | 976 | #ifdef HAVE_WINDOW_SYSTEM |
| 972 | if (FRAME_X_P (XFRAME (this))) | 977 | if (FRAME_WINDOW_P (XFRAME (this))) |
| 973 | { | 978 | { |
| 974 | x_sync (XFRAME (this)); | 979 | x_sync (XFRAME (this)); |
| 975 | FRAME_SAMPLE_VISIBILITY (XFRAME (this)); | 980 | FRAME_SAMPLE_VISIBILITY (XFRAME (this)); |
| @@ -980,7 +985,7 @@ other_visible_frames (f) | |||
| 980 | || FRAME_ICONIFIED_P (XFRAME (this)) | 985 | || FRAME_ICONIFIED_P (XFRAME (this)) |
| 981 | /* Allow deleting the terminal frame when at least | 986 | /* Allow deleting the terminal frame when at least |
| 982 | one X frame exists! */ | 987 | one X frame exists! */ |
| 983 | || (FRAME_X_P (XFRAME (this)) && !FRAME_X_P (f))) | 988 | || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f))) |
| 984 | count++; | 989 | count++; |
| 985 | } | 990 | } |
| 986 | return count > 1; | 991 | return count > 1; |
| @@ -1112,8 +1117,8 @@ but if the second optional argument FORCE is non-nil, you may do so.") | |||
| 1112 | called the window-system-dependent frame destruction routine. */ | 1117 | called the window-system-dependent frame destruction routine. */ |
| 1113 | 1118 | ||
| 1114 | /* I think this should be done with a hook. */ | 1119 | /* I think this should be done with a hook. */ |
| 1115 | #ifdef HAVE_X_WINDOWS | 1120 | #ifdef HAVE_WINDOW_SYSTEM |
| 1116 | if (FRAME_X_P (f)) | 1121 | if (FRAME_WINDOW_P (f)) |
| 1117 | x_destroy_window (f); | 1122 | x_destroy_window (f); |
| 1118 | #endif | 1123 | #endif |
| 1119 | 1124 | ||
| @@ -1289,8 +1294,8 @@ before calling this function on it, like this.\n\ | |||
| 1289 | CHECK_NUMBER (y, 1); | 1294 | CHECK_NUMBER (y, 1); |
| 1290 | 1295 | ||
| 1291 | /* I think this should be done with a hook. */ | 1296 | /* I think this should be done with a hook. */ |
| 1292 | #ifdef HAVE_X_WINDOWS | 1297 | #ifdef HAVE_WINDOW_SYSTEM |
| 1293 | if (FRAME_X_P (XFRAME (frame))) | 1298 | if (FRAME_WINDOW_P (XFRAME (frame))) |
| 1294 | /* Warping the mouse will cause enternotify and focus events. */ | 1299 | /* Warping the mouse will cause enternotify and focus events. */ |
| 1295 | x_set_mouse_position (XFRAME (frame), x, y); | 1300 | x_set_mouse_position (XFRAME (frame), x, y); |
| 1296 | #endif | 1301 | #endif |
| @@ -1313,8 +1318,8 @@ before calling this function on it, like this.\n\ | |||
| 1313 | CHECK_NUMBER (y, 1); | 1318 | CHECK_NUMBER (y, 1); |
| 1314 | 1319 | ||
| 1315 | /* I think this should be done with a hook. */ | 1320 | /* I think this should be done with a hook. */ |
| 1316 | #ifdef HAVE_X_WINDOWS | 1321 | #ifdef HAVE_WINDOW_SYSTEM |
| 1317 | if (FRAME_X_P (XFRAME (frame))) | 1322 | if (FRAME_WINDOW_P (XFRAME (frame))) |
| 1318 | /* Warping the mouse will cause enternotify and focus events. */ | 1323 | /* Warping the mouse will cause enternotify and focus events. */ |
| 1319 | x_set_mouse_pixel_position (XFRAME (frame), x, y); | 1324 | x_set_mouse_pixel_position (XFRAME (frame), x, y); |
| 1320 | #endif | 1325 | #endif |
| @@ -1335,8 +1340,8 @@ If omitted, FRAME defaults to the currently selected frame.") | |||
| 1335 | CHECK_LIVE_FRAME (frame, 0); | 1340 | CHECK_LIVE_FRAME (frame, 0); |
| 1336 | 1341 | ||
| 1337 | /* I think this should be done with a hook. */ | 1342 | /* I think this should be done with a hook. */ |
| 1338 | #ifdef HAVE_X_WINDOWS | 1343 | #ifdef HAVE_WINDOW_SYSTEM |
| 1339 | if (FRAME_X_P (XFRAME (frame))) | 1344 | if (FRAME_WINDOW_P (XFRAME (frame))) |
| 1340 | { | 1345 | { |
| 1341 | FRAME_SAMPLE_VISIBILITY (XFRAME (frame)); | 1346 | FRAME_SAMPLE_VISIBILITY (XFRAME (frame)); |
| 1342 | x_make_frame_visible (XFRAME (frame)); | 1347 | x_make_frame_visible (XFRAME (frame)); |
| @@ -1381,8 +1386,8 @@ but if the second optional argument FORCE is non-nil, you may do so.") | |||
| 1381 | } | 1386 | } |
| 1382 | 1387 | ||
| 1383 | /* I think this should be done with a hook. */ | 1388 | /* I think this should be done with a hook. */ |
| 1384 | #ifdef HAVE_X_WINDOWS | 1389 | #ifdef HAVE_WINDOW_SYSTEM |
| 1385 | if (FRAME_X_P (XFRAME (frame))) | 1390 | if (FRAME_WINDOW_P (XFRAME (frame))) |
| 1386 | x_make_frame_invisible (XFRAME (frame)); | 1391 | x_make_frame_invisible (XFRAME (frame)); |
| 1387 | #endif | 1392 | #endif |
| 1388 | 1393 | ||
| @@ -1419,8 +1424,8 @@ If omitted, FRAME defaults to the currently selected frame.") | |||
| 1419 | } | 1424 | } |
| 1420 | 1425 | ||
| 1421 | /* I think this should be done with a hook. */ | 1426 | /* I think this should be done with a hook. */ |
| 1422 | #ifdef HAVE_X_WINDOWS | 1427 | #ifdef HAVE_WINDOW_SYSTEM |
| 1423 | if (FRAME_X_P (XFRAME (frame))) | 1428 | if (FRAME_WINDOW_P (XFRAME (frame))) |
| 1424 | x_iconify_frame (XFRAME (frame)); | 1429 | x_iconify_frame (XFRAME (frame)); |
| 1425 | #endif | 1430 | #endif |
| 1426 | 1431 | ||
| @@ -1556,9 +1561,9 @@ The redirection lasts until `redirect-frame-focus' is called to change it.") | |||
| 1556 | XFRAME (frame)->focus_frame = focus_frame; | 1561 | XFRAME (frame)->focus_frame = focus_frame; |
| 1557 | 1562 | ||
| 1558 | /* I think this should be done with a hook. */ | 1563 | /* I think this should be done with a hook. */ |
| 1559 | #ifdef HAVE_X_WINDOWS | 1564 | #ifdef HAVE_WINDOW_SYSTEM |
| 1560 | if (!NILP (focus_frame) && ! EQ (focus_frame, frame) | 1565 | if (!NILP (focus_frame) && ! EQ (focus_frame, frame) |
| 1561 | && FRAME_X_P (XFRAME (focus_frame))) | 1566 | && (FRAME_WINDOW_P (XFRAME (focus_frame)))) |
| 1562 | Ffocus_frame (focus_frame); | 1567 | Ffocus_frame (focus_frame); |
| 1563 | #endif | 1568 | #endif |
| 1564 | 1569 | ||
| @@ -1639,7 +1644,7 @@ store_frame_param (f, prop, val) | |||
| 1639 | if (EQ (prop, Qbuffer_predicate)) | 1644 | if (EQ (prop, Qbuffer_predicate)) |
| 1640 | f->buffer_predicate = val; | 1645 | f->buffer_predicate = val; |
| 1641 | 1646 | ||
| 1642 | if (! FRAME_X_P (f)) | 1647 | if (! FRAME_WINDOW_P (f)) |
| 1643 | if (EQ (prop, Qmenu_bar_lines)) | 1648 | if (EQ (prop, Qmenu_bar_lines)) |
| 1644 | set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f))); | 1649 | set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f))); |
| 1645 | 1650 | ||
| @@ -1690,8 +1695,8 @@ If FRAME is omitted, return information on the currently selected frame.") | |||
| 1690 | store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); | 1695 | store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); |
| 1691 | 1696 | ||
| 1692 | /* I think this should be done with a hook. */ | 1697 | /* I think this should be done with a hook. */ |
| 1693 | #ifdef HAVE_X_WINDOWS | 1698 | #ifdef HAVE_WINDOW_SYSTEM |
| 1694 | if (FRAME_X_P (f)) | 1699 | if (FRAME_WINDOW_P (f)) |
| 1695 | x_report_frame_params (f, &alist); | 1700 | x_report_frame_params (f, &alist); |
| 1696 | else | 1701 | else |
| 1697 | #endif | 1702 | #endif |
| @@ -1725,8 +1730,8 @@ The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.") | |||
| 1725 | } | 1730 | } |
| 1726 | 1731 | ||
| 1727 | /* I think this should be done with a hook. */ | 1732 | /* I think this should be done with a hook. */ |
| 1728 | #ifdef HAVE_X_WINDOWS | 1733 | #ifdef HAVE_WINDOW_SYSTEM |
| 1729 | if (FRAME_X_P (f)) | 1734 | if (FRAME_WINDOW_P (f)) |
| 1730 | x_set_frame_parameters (f, alist); | 1735 | x_set_frame_parameters (f, alist); |
| 1731 | else | 1736 | else |
| 1732 | #endif | 1737 | #endif |
| @@ -1759,8 +1764,8 @@ For a terminal frame, the value is always 1.") | |||
| 1759 | f = XFRAME (frame); | 1764 | f = XFRAME (frame); |
| 1760 | } | 1765 | } |
| 1761 | 1766 | ||
| 1762 | #ifdef HAVE_X_WINDOWS | 1767 | #ifdef HAVE_WINDOW_SYSTEM |
| 1763 | if (FRAME_X_P (f)) | 1768 | if (FRAME_WINDOW_P (f)) |
| 1764 | return make_number (x_char_height (f)); | 1769 | return make_number (x_char_height (f)); |
| 1765 | else | 1770 | else |
| 1766 | #endif | 1771 | #endif |
| @@ -1788,8 +1793,8 @@ For a terminal screen, the value is always 1.") | |||
| 1788 | f = XFRAME (frame); | 1793 | f = XFRAME (frame); |
| 1789 | } | 1794 | } |
| 1790 | 1795 | ||
| 1791 | #ifdef HAVE_X_WINDOWS | 1796 | #ifdef HAVE_WINDOW_SYSTEM |
| 1792 | if (FRAME_X_P (f)) | 1797 | if (FRAME_WINDOW_P (f)) |
| 1793 | return make_number (x_char_width (f)); | 1798 | return make_number (x_char_width (f)); |
| 1794 | else | 1799 | else |
| 1795 | #endif | 1800 | #endif |
| @@ -1814,8 +1819,8 @@ If FRAME is omitted, the selected frame is used.") | |||
| 1814 | f = XFRAME (frame); | 1819 | f = XFRAME (frame); |
| 1815 | } | 1820 | } |
| 1816 | 1821 | ||
| 1817 | #ifdef HAVE_X_WINDOWS | 1822 | #ifdef HAVE_WINDOW_SYSTEM |
| 1818 | if (FRAME_X_P (f)) | 1823 | if (FRAME_WINDOW_P (f)) |
| 1819 | return make_number (x_pixel_height (f)); | 1824 | return make_number (x_pixel_height (f)); |
| 1820 | else | 1825 | else |
| 1821 | #endif | 1826 | #endif |
| @@ -1840,8 +1845,8 @@ If FRAME is omitted, the selected frame is used.") | |||
| 1840 | f = XFRAME (frame); | 1845 | f = XFRAME (frame); |
| 1841 | } | 1846 | } |
| 1842 | 1847 | ||
| 1843 | #ifdef HAVE_X_WINDOWS | 1848 | #ifdef HAVE_WINDOW_SYSTEM |
| 1844 | if (FRAME_X_P (f)) | 1849 | if (FRAME_WINDOW_P (f)) |
| 1845 | return make_number (x_pixel_width (f)); | 1850 | return make_number (x_pixel_width (f)); |
| 1846 | else | 1851 | else |
| 1847 | #endif | 1852 | #endif |
| @@ -1867,8 +1872,8 @@ but that the idea of the actual height of the frame should not be changed.") | |||
| 1867 | } | 1872 | } |
| 1868 | 1873 | ||
| 1869 | /* I think this should be done with a hook. */ | 1874 | /* I think this should be done with a hook. */ |
| 1870 | #ifdef HAVE_X_WINDOWS | 1875 | #ifdef HAVE_WINDOW_SYSTEM |
| 1871 | if (FRAME_X_P (f)) | 1876 | if (FRAME_WINDOW_P (f)) |
| 1872 | { | 1877 | { |
| 1873 | if (XINT (rows) != f->height) | 1878 | if (XINT (rows) != f->height) |
| 1874 | x_set_window_size (f, 1, f->width, XINT (rows)); | 1879 | x_set_window_size (f, 1, f->width, XINT (rows)); |
| @@ -1897,8 +1902,8 @@ but that the idea of the actual width of the frame should not be changed.") | |||
| 1897 | } | 1902 | } |
| 1898 | 1903 | ||
| 1899 | /* I think this should be done with a hook. */ | 1904 | /* I think this should be done with a hook. */ |
| 1900 | #ifdef HAVE_X_WINDOWS | 1905 | #ifdef HAVE_WINDOW_SYSTEM |
| 1901 | if (FRAME_X_P (f)) | 1906 | if (FRAME_WINDOW_P (f)) |
| 1902 | { | 1907 | { |
| 1903 | if (XINT (cols) != f->width) | 1908 | if (XINT (cols) != f->width) |
| 1904 | x_set_window_size (f, 1, XINT (cols), f->height); | 1909 | x_set_window_size (f, 1, XINT (cols), f->height); |
| @@ -1923,8 +1928,8 @@ DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, | |||
| 1923 | f = XFRAME (frame); | 1928 | f = XFRAME (frame); |
| 1924 | 1929 | ||
| 1925 | /* I think this should be done with a hook. */ | 1930 | /* I think this should be done with a hook. */ |
| 1926 | #ifdef HAVE_X_WINDOWS | 1931 | #ifdef HAVE_WINDOW_SYSTEM |
| 1927 | if (FRAME_X_P (f)) | 1932 | if (FRAME_WINDOW_P (f)) |
| 1928 | { | 1933 | { |
| 1929 | if (XINT (rows) != f->height || XINT (cols) != f->width) | 1934 | if (XINT (rows) != f->height || XINT (cols) != f->width) |
| 1930 | x_set_window_size (f, 1, XINT (cols), XINT (rows)); | 1935 | x_set_window_size (f, 1, XINT (cols), XINT (rows)); |
| @@ -1954,8 +1959,8 @@ the rightmost or bottommost possible position (that stays within the screen).") | |||
| 1954 | f = XFRAME (frame); | 1959 | f = XFRAME (frame); |
| 1955 | 1960 | ||
| 1956 | /* I think this should be done with a hook. */ | 1961 | /* I think this should be done with a hook. */ |
| 1957 | #ifdef HAVE_X_WINDOWS | 1962 | #ifdef HAVE_WINDOW_SYSTEM |
| 1958 | if (FRAME_X_P (f)) | 1963 | if (FRAME_WINDOW_P (f)) |
| 1959 | x_set_offset (f, XINT (xoffset), XINT (yoffset), 1); | 1964 | x_set_offset (f, XINT (xoffset), XINT (yoffset), 1); |
| 1960 | #endif | 1965 | #endif |
| 1961 | 1966 | ||