Mercurial > hg > xemacs-beta
comparison src/toolbar.c @ 282:c42ec1d1cded r21-0b39
Import from CVS: tag r21-0b39
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:33:18 +0200 |
parents | 7df0dd720c89 |
children | 558f606b08ae |
comparison
equal
deleted
inserted
replaced
281:090b52736db2 | 282:c42ec1d1cded |
---|---|
757 { | 757 { |
758 set_frame_toolbar (f, TOP_TOOLBAR); | 758 set_frame_toolbar (f, TOP_TOOLBAR); |
759 set_frame_toolbar (f, BOTTOM_TOOLBAR); | 759 set_frame_toolbar (f, BOTTOM_TOOLBAR); |
760 set_frame_toolbar (f, LEFT_TOOLBAR); | 760 set_frame_toolbar (f, LEFT_TOOLBAR); |
761 set_frame_toolbar (f, RIGHT_TOOLBAR); | 761 set_frame_toolbar (f, RIGHT_TOOLBAR); |
762 | |
763 if (!first_time_p) | |
764 { | |
765 int height, width; | |
766 pixel_to_char_size (f, FRAME_PIXWIDTH(f), FRAME_PIXHEIGHT(f), | |
767 &width, &height); | |
768 change_frame_size (f, height, width, 0); | |
769 } | |
770 } | 762 } |
771 | 763 |
772 void | 764 void |
773 update_frame_toolbars (struct frame *f) | 765 update_frame_toolbars (struct frame *f) |
774 { | 766 { |
1231 { | 1223 { |
1232 recompute_overlaying_specifier (Vtoolbar); | 1224 recompute_overlaying_specifier (Vtoolbar); |
1233 } | 1225 } |
1234 | 1226 |
1235 static void | 1227 static void |
1236 toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, | |
1237 Lisp_Object oldval) | |
1238 { | |
1239 int pos; | |
1240 | |
1241 for (pos = 0; pos < countof (Vtoolbar_size); pos++) | |
1242 if (EQ (specifier, Vtoolbar_size[(enum toolbar_pos) pos])) | |
1243 break; | |
1244 | |
1245 assert (pos < countof (Vtoolbar_size)); | |
1246 | |
1247 MAYBE_FRAMEMETH (f, toolbar_size_changed_in_frame, | |
1248 (f, (enum toolbar_pos) pos, oldval)); | |
1249 | |
1250 /* Let redisplay know that something has possibly changed. */ | |
1251 MARK_TOOLBAR_CHANGED; | |
1252 } | |
1253 | |
1254 static void | |
1255 toolbar_border_width_changed_in_frame (Lisp_Object specifier, struct frame *f, | |
1256 Lisp_Object oldval) | |
1257 { | |
1258 int pos; | |
1259 | |
1260 for (pos = 0; pos < countof (Vtoolbar_border_width); pos++) | |
1261 { | |
1262 if (EQ (specifier, Vtoolbar_border_width[(enum toolbar_pos) pos])) | |
1263 break; | |
1264 } | |
1265 | |
1266 assert (pos < countof (Vtoolbar_border_width)); | |
1267 | |
1268 MAYBE_FRAMEMETH (f, toolbar_border_width_changed_in_frame, | |
1269 (f, (enum toolbar_pos) pos, oldval)); | |
1270 | |
1271 /* Let redisplay know that something has possibly changed. */ | |
1272 MARK_TOOLBAR_CHANGED; | |
1273 } | |
1274 | |
1275 static void | |
1276 toolbar_visible_p_changed_in_frame (Lisp_Object specifier, struct frame *f, | |
1277 Lisp_Object oldval) | |
1278 { | |
1279 int pos; | |
1280 | |
1281 for (pos = 0; pos < countof (Vtoolbar_visible_p); pos++) | |
1282 if (EQ (specifier, Vtoolbar_visible_p[(enum toolbar_pos) pos])) | |
1283 break; | |
1284 | |
1285 assert (pos < countof (Vtoolbar_visible_p)); | |
1286 | |
1287 MAYBE_FRAMEMETH (f, toolbar_visible_p_changed_in_frame, | |
1288 (f, (enum toolbar_pos) pos, oldval)); | |
1289 | |
1290 /* Let redisplay know that something has possibly changed. */ | |
1291 MARK_TOOLBAR_CHANGED; | |
1292 } | |
1293 | |
1294 static void | |
1295 default_toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, | 1228 default_toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, |
1296 Lisp_Object oldval) | 1229 Lisp_Object oldval) |
1297 { | 1230 { |
1298 recompute_overlaying_specifier (Vtoolbar_size); | 1231 recompute_overlaying_specifier (Vtoolbar_size); |
1299 } | 1232 } |
1671 slot_offset (struct window, | 1604 slot_offset (struct window, |
1672 toolbar_size[TOP_TOOLBAR]), | 1605 toolbar_size[TOP_TOOLBAR]), |
1673 toolbar_geometry_changed_in_window, | 1606 toolbar_geometry_changed_in_window, |
1674 slot_offset (struct frame, | 1607 slot_offset (struct frame, |
1675 toolbar_size[TOP_TOOLBAR]), | 1608 toolbar_size[TOP_TOOLBAR]), |
1676 toolbar_size_changed_in_frame); | 1609 frame_size_slipped); |
1677 | 1610 |
1678 DEFVAR_SPECIFIER ("bottom-toolbar-height", | 1611 DEFVAR_SPECIFIER ("bottom-toolbar-height", |
1679 &Vtoolbar_size[BOTTOM_TOOLBAR] /* | 1612 &Vtoolbar_size[BOTTOM_TOOLBAR] /* |
1680 *Height of the bottom toolbar. | 1613 *Height of the bottom toolbar. |
1681 This is a specifier; use `set-specifier' to change it. | 1614 This is a specifier; use `set-specifier' to change it. |
1687 slot_offset (struct window, | 1620 slot_offset (struct window, |
1688 toolbar_size[BOTTOM_TOOLBAR]), | 1621 toolbar_size[BOTTOM_TOOLBAR]), |
1689 toolbar_geometry_changed_in_window, | 1622 toolbar_geometry_changed_in_window, |
1690 slot_offset (struct frame, | 1623 slot_offset (struct frame, |
1691 toolbar_size[BOTTOM_TOOLBAR]), | 1624 toolbar_size[BOTTOM_TOOLBAR]), |
1692 toolbar_size_changed_in_frame); | 1625 frame_size_slipped); |
1693 | 1626 |
1694 DEFVAR_SPECIFIER ("left-toolbar-width", | 1627 DEFVAR_SPECIFIER ("left-toolbar-width", |
1695 &Vtoolbar_size[LEFT_TOOLBAR] /* | 1628 &Vtoolbar_size[LEFT_TOOLBAR] /* |
1696 *Width of left toolbar. | 1629 *Width of left toolbar. |
1697 This is a specifier; use `set-specifier' to change it. | 1630 This is a specifier; use `set-specifier' to change it. |
1703 slot_offset (struct window, | 1636 slot_offset (struct window, |
1704 toolbar_size[LEFT_TOOLBAR]), | 1637 toolbar_size[LEFT_TOOLBAR]), |
1705 toolbar_geometry_changed_in_window, | 1638 toolbar_geometry_changed_in_window, |
1706 slot_offset (struct frame, | 1639 slot_offset (struct frame, |
1707 toolbar_size[LEFT_TOOLBAR]), | 1640 toolbar_size[LEFT_TOOLBAR]), |
1708 toolbar_size_changed_in_frame); | 1641 frame_size_slipped); |
1709 | 1642 |
1710 DEFVAR_SPECIFIER ("right-toolbar-width", | 1643 DEFVAR_SPECIFIER ("right-toolbar-width", |
1711 &Vtoolbar_size[RIGHT_TOOLBAR] /* | 1644 &Vtoolbar_size[RIGHT_TOOLBAR] /* |
1712 *Width of right toolbar. | 1645 *Width of right toolbar. |
1713 This is a specifier; use `set-specifier' to change it. | 1646 This is a specifier; use `set-specifier' to change it. |
1719 slot_offset (struct window, | 1652 slot_offset (struct window, |
1720 toolbar_size[RIGHT_TOOLBAR]), | 1653 toolbar_size[RIGHT_TOOLBAR]), |
1721 toolbar_geometry_changed_in_window, | 1654 toolbar_geometry_changed_in_window, |
1722 slot_offset (struct frame, | 1655 slot_offset (struct frame, |
1723 toolbar_size[RIGHT_TOOLBAR]), | 1656 toolbar_size[RIGHT_TOOLBAR]), |
1724 toolbar_size_changed_in_frame); | 1657 frame_size_slipped); |
1725 | 1658 |
1726 fb = Qnil; | 1659 fb = Qnil; |
1727 #ifdef HAVE_TTY | 1660 #ifdef HAVE_TTY |
1728 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | 1661 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); |
1729 #endif | 1662 #endif |
1800 slot_offset (struct window, | 1733 slot_offset (struct window, |
1801 toolbar_border_width[TOP_TOOLBAR]), | 1734 toolbar_border_width[TOP_TOOLBAR]), |
1802 toolbar_geometry_changed_in_window, | 1735 toolbar_geometry_changed_in_window, |
1803 slot_offset (struct frame, | 1736 slot_offset (struct frame, |
1804 toolbar_border_width[TOP_TOOLBAR]), | 1737 toolbar_border_width[TOP_TOOLBAR]), |
1805 toolbar_border_width_changed_in_frame); | 1738 frame_size_slipped); |
1806 | 1739 |
1807 DEFVAR_SPECIFIER ("bottom-toolbar-border-width", | 1740 DEFVAR_SPECIFIER ("bottom-toolbar-border-width", |
1808 &Vtoolbar_border_width[BOTTOM_TOOLBAR] /* | 1741 &Vtoolbar_border_width[BOTTOM_TOOLBAR] /* |
1809 *Border width of the bottom toolbar. | 1742 *Border width of the bottom toolbar. |
1810 This is a specifier; use `set-specifier' to change it. | 1743 This is a specifier; use `set-specifier' to change it. |
1816 slot_offset (struct window, | 1749 slot_offset (struct window, |
1817 toolbar_border_width[BOTTOM_TOOLBAR]), | 1750 toolbar_border_width[BOTTOM_TOOLBAR]), |
1818 toolbar_geometry_changed_in_window, | 1751 toolbar_geometry_changed_in_window, |
1819 slot_offset (struct frame, | 1752 slot_offset (struct frame, |
1820 toolbar_border_width[BOTTOM_TOOLBAR]), | 1753 toolbar_border_width[BOTTOM_TOOLBAR]), |
1821 toolbar_border_width_changed_in_frame); | 1754 frame_size_slipped); |
1822 | 1755 |
1823 DEFVAR_SPECIFIER ("left-toolbar-border-width", | 1756 DEFVAR_SPECIFIER ("left-toolbar-border-width", |
1824 &Vtoolbar_border_width[LEFT_TOOLBAR] /* | 1757 &Vtoolbar_border_width[LEFT_TOOLBAR] /* |
1825 *Border width of left toolbar. | 1758 *Border width of left toolbar. |
1826 This is a specifier; use `set-specifier' to change it. | 1759 This is a specifier; use `set-specifier' to change it. |
1832 slot_offset (struct window, | 1765 slot_offset (struct window, |
1833 toolbar_border_width[LEFT_TOOLBAR]), | 1766 toolbar_border_width[LEFT_TOOLBAR]), |
1834 toolbar_geometry_changed_in_window, | 1767 toolbar_geometry_changed_in_window, |
1835 slot_offset (struct frame, | 1768 slot_offset (struct frame, |
1836 toolbar_border_width[LEFT_TOOLBAR]), | 1769 toolbar_border_width[LEFT_TOOLBAR]), |
1837 toolbar_border_width_changed_in_frame); | 1770 frame_size_slipped); |
1838 | 1771 |
1839 DEFVAR_SPECIFIER ("right-toolbar-border-width", | 1772 DEFVAR_SPECIFIER ("right-toolbar-border-width", |
1840 &Vtoolbar_border_width[RIGHT_TOOLBAR] /* | 1773 &Vtoolbar_border_width[RIGHT_TOOLBAR] /* |
1841 *Border width of right toolbar. | 1774 *Border width of right toolbar. |
1842 This is a specifier; use `set-specifier' to change it. | 1775 This is a specifier; use `set-specifier' to change it. |
1848 slot_offset (struct window, | 1781 slot_offset (struct window, |
1849 toolbar_border_width[RIGHT_TOOLBAR]), | 1782 toolbar_border_width[RIGHT_TOOLBAR]), |
1850 toolbar_geometry_changed_in_window, | 1783 toolbar_geometry_changed_in_window, |
1851 slot_offset (struct frame, | 1784 slot_offset (struct frame, |
1852 toolbar_border_width[RIGHT_TOOLBAR]), | 1785 toolbar_border_width[RIGHT_TOOLBAR]), |
1853 toolbar_border_width_changed_in_frame); | 1786 frame_size_slipped); |
1854 | 1787 |
1855 fb = Qnil; | 1788 fb = Qnil; |
1856 #ifdef HAVE_TTY | 1789 #ifdef HAVE_TTY |
1857 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | 1790 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); |
1858 #endif | 1791 #endif |
1912 slot_offset (struct window, | 1845 slot_offset (struct window, |
1913 toolbar_visible_p[TOP_TOOLBAR]), | 1846 toolbar_visible_p[TOP_TOOLBAR]), |
1914 toolbar_geometry_changed_in_window, | 1847 toolbar_geometry_changed_in_window, |
1915 slot_offset (struct frame, | 1848 slot_offset (struct frame, |
1916 toolbar_visible_p[TOP_TOOLBAR]), | 1849 toolbar_visible_p[TOP_TOOLBAR]), |
1917 toolbar_visible_p_changed_in_frame); | 1850 frame_size_slipped); |
1918 | 1851 |
1919 DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", | 1852 DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", |
1920 &Vtoolbar_visible_p[BOTTOM_TOOLBAR] /* | 1853 &Vtoolbar_visible_p[BOTTOM_TOOLBAR] /* |
1921 *Whether the bottom toolbar is visible. | 1854 *Whether the bottom toolbar is visible. |
1922 This is a specifier; use `set-specifier' to change it. | 1855 This is a specifier; use `set-specifier' to change it. |
1928 slot_offset (struct window, | 1861 slot_offset (struct window, |
1929 toolbar_visible_p[BOTTOM_TOOLBAR]), | 1862 toolbar_visible_p[BOTTOM_TOOLBAR]), |
1930 toolbar_geometry_changed_in_window, | 1863 toolbar_geometry_changed_in_window, |
1931 slot_offset (struct frame, | 1864 slot_offset (struct frame, |
1932 toolbar_visible_p[BOTTOM_TOOLBAR]), | 1865 toolbar_visible_p[BOTTOM_TOOLBAR]), |
1933 toolbar_visible_p_changed_in_frame); | 1866 frame_size_slipped); |
1934 | 1867 |
1935 DEFVAR_SPECIFIER ("left-toolbar-visible-p", | 1868 DEFVAR_SPECIFIER ("left-toolbar-visible-p", |
1936 &Vtoolbar_visible_p[LEFT_TOOLBAR] /* | 1869 &Vtoolbar_visible_p[LEFT_TOOLBAR] /* |
1937 *Whether the left toolbar is visible. | 1870 *Whether the left toolbar is visible. |
1938 This is a specifier; use `set-specifier' to change it. | 1871 This is a specifier; use `set-specifier' to change it. |
1944 slot_offset (struct window, | 1877 slot_offset (struct window, |
1945 toolbar_visible_p[LEFT_TOOLBAR]), | 1878 toolbar_visible_p[LEFT_TOOLBAR]), |
1946 toolbar_geometry_changed_in_window, | 1879 toolbar_geometry_changed_in_window, |
1947 slot_offset (struct frame, | 1880 slot_offset (struct frame, |
1948 toolbar_visible_p[LEFT_TOOLBAR]), | 1881 toolbar_visible_p[LEFT_TOOLBAR]), |
1949 toolbar_visible_p_changed_in_frame); | 1882 frame_size_slipped); |
1950 | 1883 |
1951 DEFVAR_SPECIFIER ("right-toolbar-visible-p", | 1884 DEFVAR_SPECIFIER ("right-toolbar-visible-p", |
1952 &Vtoolbar_visible_p[RIGHT_TOOLBAR] /* | 1885 &Vtoolbar_visible_p[RIGHT_TOOLBAR] /* |
1953 *Whether the right toolbar is visible. | 1886 *Whether the right toolbar is visible. |
1954 This is a specifier; use `set-specifier' to change it. | 1887 This is a specifier; use `set-specifier' to change it. |
1960 slot_offset (struct window, | 1893 slot_offset (struct window, |
1961 toolbar_visible_p[RIGHT_TOOLBAR]), | 1894 toolbar_visible_p[RIGHT_TOOLBAR]), |
1962 toolbar_geometry_changed_in_window, | 1895 toolbar_geometry_changed_in_window, |
1963 slot_offset (struct frame, | 1896 slot_offset (struct frame, |
1964 toolbar_visible_p[RIGHT_TOOLBAR]), | 1897 toolbar_visible_p[RIGHT_TOOLBAR]), |
1965 toolbar_visible_p_changed_in_frame); | 1898 frame_size_slipped); |
1966 | 1899 |
1967 /* initially, top inherits from default; this can be | 1900 /* initially, top inherits from default; this can be |
1968 changed with `set-default-toolbar-position'. */ | 1901 changed with `set-default-toolbar-position'. */ |
1969 fb = list1 (Fcons (Qnil, Qt)); | 1902 fb = list1 (Fcons (Qnil, Qt)); |
1970 set_specifier_fallback (Vdefault_toolbar_visible_p, fb); | 1903 set_specifier_fallback (Vdefault_toolbar_visible_p, fb); |