comparison src/nsfns.m @ 96878:21843c5dd16a

fix compile error in nsfns.m
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Mon, 21 Jul 2008 20:27:57 +0000
parents 30f1368d9cf6
children f669b344e719
comparison
equal deleted inserted replaced
96877:feac6d588d82 96878:21843c5dd16a
1044 }; 1044 };
1045 1045
1046 1046
1047 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 1047 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1048 1, 1, 0, 1048 1, 1, 0,
1049 "Make a new Nextstep window, called a \"frame\" in Emacs terms. 1049 doc: /* Make a new Nextstep window, called a \"frame\" in Emacs terms.
1050 Return an Emacs frame object. 1050 Return an Emacs frame object.
1051 PARMS is an alist of frame parameters. 1051 PARMS is an alist of frame parameters.
1052 If the parameters specify that the frame should not have a minibuffer, 1052 If the parameters specify that the frame should not have a minibuffer,
1053 and do not specify a specific minibuffer window to use, 1053 and do not specify a specific minibuffer window to use,
1054 then `default-minibuffer-frame' must be a frame whose minibuffer can 1054 then `default-minibuffer-frame' must be a frame whose minibuffer can
1055 be shared by the new frame.") 1055 be shared by the new frame. */)
1056 (parms) 1056 (parms)
1057 Lisp_Object parms; 1057 Lisp_Object parms;
1058 { 1058 {
1059 static int desc_ctr = 1; 1059 static int desc_ctr = 1;
1060 struct frame *f; 1060 struct frame *f;
1366 return Qnil; 1366 return Qnil;
1367 } 1367 }
1368 1368
1369 1369
1370 DEFUN ("ns-popup-prefs-panel", Fns_popup_prefs_panel, Sns_popup_prefs_panel, 1370 DEFUN ("ns-popup-prefs-panel", Fns_popup_prefs_panel, Sns_popup_prefs_panel,
1371 0, 0, "", "Pop up the preferences panel.") 1371 0, 0, "",
1372 doc: /* Pop up the preferences panel. */)
1372 () 1373 ()
1373 { 1374 {
1374 check_ns (); 1375 check_ns ();
1375 [(EmacsApp *)NSApp showPreferencesWindow: NSApp]; 1376 [(EmacsApp *)NSApp showPreferencesWindow: NSApp];
1376 return Qnil; 1377 return Qnil;
1377 } 1378 }
1378 1379
1379 1380
1380 DEFUN ("ns-popup-font-panel", Fns_popup_font_panel, Sns_popup_font_panel, 1381 DEFUN ("ns-popup-font-panel", Fns_popup_font_panel, Sns_popup_font_panel,
1381 0, 1, "", "Pop up the font panel.") 1382 0, 1, "",
1383 doc: /* Pop up the font panel. */)
1382 (frame) 1384 (frame)
1383 Lisp_Object frame; 1385 Lisp_Object frame;
1384 { 1386 {
1385 id fm; 1387 id fm;
1386 struct frame *f; 1388 struct frame *f;
1401 return Qnil; 1403 return Qnil;
1402 } 1404 }
1403 1405
1404 1406
1405 DEFUN ("ns-popup-color-panel", Fns_popup_color_panel, Sns_popup_color_panel, 1407 DEFUN ("ns-popup-color-panel", Fns_popup_color_panel, Sns_popup_color_panel,
1406 0, 1, "", "Pop up the color panel.") 1408 0, 1, "",
1409 doc: /* Pop up the color panel. */)
1407 (frame) 1410 (frame)
1408 Lisp_Object frame; 1411 Lisp_Object frame;
1409 { 1412 {
1410 struct frame *f; 1413 struct frame *f;
1411 1414
1422 return Qnil; 1425 return Qnil;
1423 } 1426 }
1424 1427
1425 1428
1426 DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 4, 0, 1429 DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 4, 0,
1427 "Use a graphical panel to read a file name, using prompt PROMPT. 1430 doc: /* Use a graphical panel to read a file name, using prompt PROMPT.
1428 Optional arg DIR, if non-nil, supplies a default directory. 1431 Optional arg DIR, if non-nil, supplies a default directory.
1429 Optional arg ISLOAD, if non-nil, means read a file name for saving. 1432 Optional arg ISLOAD, if non-nil, means read a file name for saving.
1430 Optional arg INIT, if non-nil, provides a default file name to use.") 1433 Optional arg INIT, if non-nil, provides a default file name to use. */)
1431 (prompt, dir, isLoad, init) 1434 (prompt, dir, isLoad, init)
1432 Lisp_Object prompt, dir, isLoad, init; 1435 Lisp_Object prompt, dir, isLoad, init;
1433 { 1436 {
1434 static id fileDelegate = nil; 1437 static id fileDelegate = nil;
1435 int ret; 1438 int ret;
1486 return ret ? build_string ([fname UTF8String]) : Qnil; 1489 return ret ? build_string ([fname UTF8String]) : Qnil;
1487 } 1490 }
1488 1491
1489 1492
1490 DEFUN ("ns-get-resource", Fns_get_resource, Sns_get_resource, 2, 2, 0, 1493 DEFUN ("ns-get-resource", Fns_get_resource, Sns_get_resource, 2, 2, 0,
1491 "Return the value of the property NAME of OWNER from the defaults database. 1494 doc: /* Return the value of the property NAME of OWNER from the defaults database.
1492 If OWNER is nil, Emacs is assumed.") 1495 If OWNER is nil, Emacs is assumed. */)
1493 (owner, name) 1496 (owner, name)
1494 Lisp_Object owner, name; 1497 Lisp_Object owner, name;
1495 { 1498 {
1496 const char *value; 1499 const char *value;
1497 1500
1512 return Qnil; 1515 return Qnil;
1513 } 1516 }
1514 1517
1515 1518
1516 DEFUN ("ns-set-resource", Fns_set_resource, Sns_set_resource, 3, 3, 0, 1519 DEFUN ("ns-set-resource", Fns_set_resource, Sns_set_resource, 3, 3, 0,
1517 "Set property NAME of OWNER to VALUE, from the defaults database. 1520 doc: /* Set property NAME of OWNER to VALUE, from the defaults database.
1518 If OWNER is nil, Emacs is assumed. 1521 If OWNER is nil, Emacs is assumed.
1519 If VALUE is nil, the default is removed.") 1522 If VALUE is nil, the default is removed. */)
1520 (owner, name, value) 1523 (owner, name, value)
1521 Lisp_Object owner, name, value; 1524 Lisp_Object owner, name, value;
1522 { 1525 {
1523 check_ns (); 1526 check_ns ();
1524 if (NILP (owner)) 1527 if (NILP (owner))
1543 return Qnil; 1546 return Qnil;
1544 } 1547 }
1545 1548
1546 1549
1547 DEFUN ("ns-set-alpha", Fns_set_alpha, Sns_set_alpha, 2, 2, 0, 1550 DEFUN ("ns-set-alpha", Fns_set_alpha, Sns_set_alpha, 2, 2, 0,
1548 "Return a color equivalent to COLOR with alpha setting ALPHA. 1551 doc: /* Return a color equivalent to COLOR with alpha setting ALPHA.
1549 The argument ALPHA should be a number between 0 and 1, where 0 is full 1552 The argument ALPHA should be a number between 0 and 1, where 0 is full
1550 transparency and 1 is opaque.") 1553 transparency and 1 is opaque. */)
1551 (color, alpha) 1554 (color, alpha)
1552 Lisp_Object color; 1555 Lisp_Object color;
1553 Lisp_Object alpha; 1556 Lisp_Object alpha;
1554 { 1557 {
1555 NSColor *col; 1558 NSColor *col;
1571 1574
1572 1575
1573 DEFUN ("ns-server-max-request-size", Fns_server_max_request_size, 1576 DEFUN ("ns-server-max-request-size", Fns_server_max_request_size,
1574 Sns_server_max_request_size, 1577 Sns_server_max_request_size,
1575 0, 1, 0, 1578 0, 1, 0,
1576 "This function is a no-op. It is only present for completeness.") 1579 doc: /* This function is a no-op. It is only present for completeness. */)
1577 (display) 1580 (display)
1578 Lisp_Object display; 1581 Lisp_Object display;
1579 { 1582 {
1580 check_ns (); 1583 check_ns ();
1581 /* This function has no real equivalent under NeXTstep. Return nil to 1584 /* This function has no real equivalent under NeXTstep. Return nil to
1583 return Qnil; 1586 return Qnil;
1584 } 1587 }
1585 1588
1586 1589
1587 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 1590 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
1588 "Return the vendor ID string of Nextstep display server DISPLAY. 1591 doc: /* Return the vendor ID string of Nextstep display server DISPLAY.
1589 DISPLAY should be either a frame or a display name (a string). 1592 DISPLAY should be either a frame or a display name (a string).
1590 If omitted or nil, the selected frame's display is used.") 1593 If omitted or nil, the selected frame's display is used. */)
1591 (display) 1594 (display)
1592 Lisp_Object display; 1595 Lisp_Object display;
1593 { 1596 {
1594 check_ns (); 1597 check_ns ();
1595 #ifdef NS_IMPL_GNUSTEP 1598 #ifdef NS_IMPL_GNUSTEP
1599 #endif 1602 #endif
1600 } 1603 }
1601 1604
1602 1605
1603 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 1606 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
1604 "Return the version number of Nextstep display server DISPLAY. 1607 doc: /* Return the version number of Nextstep display server DISPLAY.
1605 DISPLAY should be either a frame or a display name (a string). 1608 DISPLAY should be either a frame or a display name (a string).
1606 If omitted or nil, the selected frame's display is used. 1609 If omitted or nil, the selected frame's display is used.
1607 See also the function `ns-server-vendor'.") 1610 See also the function `ns-server-vendor'. */)
1608 (display) 1611 (display)
1609 Lisp_Object display; 1612 Lisp_Object display;
1610 { 1613 {
1611 /* FIXME: return GUI version on GNUSTEP, ?? on OS X */ 1614 /* FIXME: return GUI version on GNUSTEP, ?? on OS X */
1612 return build_string ("1.0"); 1615 return build_string ("1.0");
1613 } 1616 }
1614 1617
1615 1618
1616 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, 1619 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
1617 "Return the number of screens on Nextstep display server DISPLAY. 1620 doc: /* Return the number of screens on Nextstep display server DISPLAY.
1618 DISPLAY should be a frame, the display name as a string, or a terminal ID. 1621 DISPLAY should be a frame, the display name as a string, or a terminal ID.
1619 If omitted or nil, the selected frame's display is used.") 1622 If omitted or nil, the selected frame's display is used. */)
1620 (display) 1623 (display)
1621 Lisp_Object display; 1624 Lisp_Object display;
1622 { 1625 {
1623 int num; 1626 int num;
1624 1627
1629 } 1632 }
1630 1633
1631 1634
1632 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 1635 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height,
1633 0, 1, 0, 1636 0, 1, 0,
1634 "Return the height of Nextstep display server DISPLAY, in millimeters. 1637 doc: /* Return the height of Nextstep display server DISPLAY, in millimeters.
1635 DISPLAY should be a frame, the display name as a string, or a terminal ID. 1638 DISPLAY should be a frame, the display name as a string, or a terminal ID.
1636 If omitted or nil, the selected frame's display is used.") 1639 If omitted or nil, the selected frame's display is used. */)
1637 (display) 1640 (display)
1638 Lisp_Object display; 1641 Lisp_Object display;
1639 { 1642 {
1640 check_ns (); 1643 check_ns ();
1641 return make_number ((int) 1644 return make_number ((int)
1643 } 1646 }
1644 1647
1645 1648
1646 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 1649 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width,
1647 0, 1, 0, 1650 0, 1, 0,
1648 "Return the width of Nextstep display server DISPLAY, in millimeters. 1651 doc: /* Return the width of Nextstep display server DISPLAY, in millimeters.
1649 DISPLAY should be a frame, the display name as a string, or a terminal ID. 1652 DISPLAY should be a frame, the display name as a string, or a terminal ID.
1650 If omitted or nil, the selected frame's display is used.") 1653 If omitted or nil, the selected frame's display is used. */)
1651 (display) 1654 (display)
1652 Lisp_Object display; 1655 Lisp_Object display;
1653 { 1656 {
1654 check_ns (); 1657 check_ns ();
1655 return make_number ((int) 1658 return make_number ((int)
1656 ([ns_get_screen (display) frame].size.width/(92.0/25.4))); 1659 ([ns_get_screen (display) frame].size.width/(92.0/25.4)));
1657 } 1660 }
1658 1661
1659 1662
1660 DEFUN ("x-display-backing-store", Fx_display_backing_store, 1663 DEFUN ("x-display-backing-store", Fx_display_backing_store,
1661 Sns_display_backing_store, 0, 1, 0, 1664 Sx_display_backing_store, 0, 1, 0,
1662 "Return whether the Nexstep display DISPLAY supports backing store. 1665 doc: /* Return whether the Nexstep display DISPLAY supports backing store.
1663 The value may be `buffered', `retained', or `non-retained'. 1666 The value may be `buffered', `retained', or `non-retained'.
1664 DISPLAY should be a frame, the display name as a string, or a terminal ID. 1667 DISPLAY should be a frame, the display name as a string, or a terminal ID.
1665 If omitted or nil, the selected frame's display is used.") 1668 If omitted or nil, the selected frame's display is used. */)
1666 (display) 1669 (display)
1667 Lisp_Object display; 1670 Lisp_Object display;
1668 { 1671 {
1669 check_ns (); 1672 check_ns ();
1670 switch ([ns_get_window (display) backingType]) 1673 switch ([ns_get_window (display) backingType])
1681 return Qnil; /* not reached, shut compiler up */ 1684 return Qnil; /* not reached, shut compiler up */
1682 } 1685 }
1683 1686
1684 1687
1685 DEFUN ("x-display-visual-class", Fx_display_visual_class, 1688 DEFUN ("x-display-visual-class", Fx_display_visual_class,
1686 Sns_display_visual_class, 0, 1, 0, 1689 Sx_display_visual_class, 0, 1, 0,
1687 "Return the visual class of the Nextstep display server DISPLAY. 1690 doc: /* Return the visual class of the Nextstep display server DISPLAY.
1688 The value is one of the symbols `static-gray', `gray-scale', 1691 The value is one of the symbols `static-gray', `gray-scale',
1689 `static-color', `pseudo-color', `true-color', or `direct-color'. 1692 `static-color', `pseudo-color', `true-color', or `direct-color'.
1690 DISPLAY should be a frame, the display name as a string, or a terminal ID. 1693 DISPLAY should be a frame, the display name as a string, or a terminal ID.
1691 If omitted or nil, the selected frame's display is used.") 1694 If omitted or nil, the selected frame's display is used. */)
1692 (display) 1695 (display)
1693 Lisp_Object display; 1696 Lisp_Object display;
1694 { 1697 {
1695 NSWindowDepth depth; 1698 NSWindowDepth depth;
1696 check_ns (); 1699 check_ns ();
1711 return intern ("direct-color"); 1714 return intern ("direct-color");
1712 } 1715 }
1713 1716
1714 1717
1715 DEFUN ("x-display-save-under", Fx_display_save_under, 1718 DEFUN ("x-display-save-under", Fx_display_save_under,
1716 Sns_display_save_under, 0, 1, 0, 1719 Sx_display_save_under, 0, 1, 0,
1717 "Non-nil if the Nextstep display server supports the save-under feature. 1720 doc: /* Non-nil if the Nextstep display server supports the save-under feature.
1718 The optional argument DISPLAY specifies which display to ask about. 1721 The optional argument DISPLAY specifies which display to ask about.
1719 DISPLAY should be a frame, the display name as a string, or a terminal ID. 1722 DISPLAY should be a frame, the display name as a string, or a terminal ID.
1720 If omitted or nil, the selected frame's display is used.") 1723 If omitted or nil, the selected frame's display is used. */)
1721 (display) 1724 (display)
1722 Lisp_Object display; 1725 Lisp_Object display;
1723 { 1726 {
1724 check_ns (); 1727 check_ns ();
1725 switch ([ns_get_window (display) backingType]) 1728 switch ([ns_get_window (display) backingType])
1737 return Qnil; /* not reached, shut compiler up */ 1740 return Qnil; /* not reached, shut compiler up */
1738 } 1741 }
1739 1742
1740 1743
1741 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, 1744 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection,
1742 1, 3, 0, "Open a connection to a Nextstep display server. 1745 1, 3, 0,
1746 doc: /* Open a connection to a Nextstep display server.
1743 DISPLAY is the name of the display to connect to. 1747 DISPLAY is the name of the display to connect to.
1744 Optional arguments XRM-STRING and MUST-SUCCEED are currently ignored.") 1748 Optional arguments XRM-STRING and MUST-SUCCEED are currently ignored. */)
1745 (display, resource_string, must_succeed) 1749 (display, resource_string, must_succeed)
1746 Lisp_Object display, resource_string, must_succeed; 1750 Lisp_Object display, resource_string, must_succeed;
1747 { 1751 {
1748 struct ns_display_info *dpyinfo; 1752 struct ns_display_info *dpyinfo;
1749 1753
1776 return Qnil; 1780 return Qnil;
1777 } 1781 }
1778 1782
1779 1783
1780 DEFUN ("x-close-connection", Fx_close_connection, Sx_close_connection, 1784 DEFUN ("x-close-connection", Fx_close_connection, Sx_close_connection,
1781 1, 1, 0, "Close the connection to the current Nextstep display server. 1785 1, 1, 0,
1782 The second argument DISPLAY is currently ignored.") 1786 doc: /* Close the connection to the current Nextstep display server.
1787 The second argument DISPLAY is currently ignored. */)
1783 (display) 1788 (display)
1784 Lisp_Object display; 1789 Lisp_Object display;
1785 { 1790 {
1786 check_ns (); 1791 check_ns ();
1787 #ifdef NS_IMPL_COCOA 1792 #ifdef NS_IMPL_COCOA
1792 return Qnil; 1797 return Qnil;
1793 } 1798 }
1794 1799
1795 1800
1796 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, 1801 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
1797 "Return the list of display names that Emacs has connections to.") 1802 doc: /* Return the list of display names that Emacs has connections to. */)
1798 () 1803 ()
1799 { 1804 {
1800 Lisp_Object tail, result; 1805 Lisp_Object tail, result;
1801 1806
1802 result = Qnil; 1807 result = Qnil;
1806 return result; 1811 return result;
1807 } 1812 }
1808 1813
1809 1814
1810 DEFUN ("ns-hide-others", Fns_hide_others, Sns_hide_others, 1815 DEFUN ("ns-hide-others", Fns_hide_others, Sns_hide_others,
1811 0, 0, 0, "Hides all applications other than emacs.") 1816 0, 0, 0,
1817 doc: /* Hides all applications other than emacs. */)
1812 () 1818 ()
1813 { 1819 {
1814 check_ns (); 1820 check_ns ();
1815 [NSApp hideOtherApplications: NSApp]; 1821 [NSApp hideOtherApplications: NSApp];
1816 return Qnil; 1822 return Qnil;
1817 } 1823 }
1818 1824
1819 DEFUN ("ns-hide-emacs", Fns_hide_emacs, Sns_hide_emacs, 1825 DEFUN ("ns-hide-emacs", Fns_hide_emacs, Sns_hide_emacs,
1820 1, 1, 0, "If ON is non-nil, the entire emacs application is hidden. 1826 1, 1, 0,
1827 doc: /* If ON is non-nil, the entire emacs application is hidden.
1821 Otherwise if emacs is hidden, it is unhidden. 1828 Otherwise if emacs is hidden, it is unhidden.
1822 If ON is equal to `activate', emacs is unhidden and becomes 1829 If ON is equal to `activate', emacs is unhidden and becomes
1823 the active application.") 1830 the active application. */)
1824 (on) 1831 (on)
1825 Lisp_Object on; 1832 Lisp_Object on;
1826 { 1833 {
1827 check_ns (); 1834 check_ns ();
1828 if (EQ (on, intern ("activate"))) 1835 if (EQ (on, intern ("activate")))
1837 return Qnil; 1844 return Qnil;
1838 } 1845 }
1839 1846
1840 1847
1841 DEFUN ("ns-emacs-info-panel", Fns_emacs_info_panel, Sns_emacs_info_panel, 1848 DEFUN ("ns-emacs-info-panel", Fns_emacs_info_panel, Sns_emacs_info_panel,
1842 0, 0, 0, "Shows the 'Info' or 'About' panel for Emacs.") 1849 0, 0, 0,
1850 doc: /* Shows the 'Info' or 'About' panel for Emacs. */)
1843 () 1851 ()
1844 { 1852 {
1845 check_ns (); 1853 check_ns ();
1846 [NSApp orderFrontStandardAboutPanel: nil]; 1854 [NSApp orderFrontStandardAboutPanel: nil];
1847 return Qnil; 1855 return Qnil;
1904 return olist; 1912 return olist;
1905 } 1913 }
1906 1914
1907 1915
1908 DEFUN ("ns-font-name", Fns_font_name, Sns_font_name, 1, 1, 0, 1916 DEFUN ("ns-font-name", Fns_font_name, Sns_font_name, 1, 1, 0,
1909 "Determine font postscript or family name for font NAME. 1917 doc: /* Determine font postscript or family name for font NAME.
1910 NAME should be a string containing either the font name or an XLFD 1918 NAME should be a string containing either the font name or an XLFD
1911 font descriptor. If string contains `fontset' and not 1919 font descriptor. If string contains `fontset' and not
1912 `fontset-startup', it is left alone.") 1920 `fontset-startup', it is left alone. */)
1913 (name) 1921 (name)
1914 Lisp_Object name; 1922 Lisp_Object name;
1915 { 1923 {
1916 char *nm; 1924 char *nm;
1917 CHECK_STRING (name); 1925 CHECK_STRING (name);
1925 return build_string (ns_xlfd_to_fontname (SDATA (name))); 1933 return build_string (ns_xlfd_to_fontname (SDATA (name)));
1926 } 1934 }
1927 1935
1928 1936
1929 DEFUN ("ns-list-colors", Fns_list_colors, Sns_list_colors, 0, 1, 0, 1937 DEFUN ("ns-list-colors", Fns_list_colors, Sns_list_colors, 0, 1, 0,
1930 "Return a list of all available colors. 1938 doc: /* Return a list of all available colors.
1931 The optional argument FRAME is currently ignored.") 1939 The optional argument FRAME is currently ignored. */)
1932 (frame) 1940 (frame)
1933 Lisp_Object frame; 1941 Lisp_Object frame;
1934 { 1942 {
1935 Lisp_Object list = Qnil; 1943 Lisp_Object list = Qnil;
1936 NSEnumerator *colorlists; 1944 NSEnumerator *colorlists;
1966 return list; 1974 return list;
1967 } 1975 }
1968 1976
1969 1977
1970 DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0, 1978 DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0,
1971 "List available Nextstep services by querying NSApp.") 1979 doc: /* List available Nextstep services by querying NSApp. */)
1972 () 1980 ()
1973 { 1981 {
1974 Lisp_Object ret = Qnil; 1982 Lisp_Object ret = Qnil;
1975 NSMenu *svcs; 1983 NSMenu *svcs;
1976 id delegate; 1984 id delegate;
2016 return ret; 2024 return ret;
2017 } 2025 }
2018 2026
2019 2027
2020 DEFUN ("ns-perform-service", Fns_perform_service, Sns_perform_service, 2028 DEFUN ("ns-perform-service", Fns_perform_service, Sns_perform_service,
2021 2, 2, 0, "Perform Nextstep SERVICE on SEND. 2029 2, 2, 0,
2030 doc: /* Perform Nextstep SERVICE on SEND.
2022 SEND should be either a string or nil. 2031 SEND should be either a string or nil.
2023 The return value is the result of the service, as string, or nil if 2032 The return value is the result of the service, as string, or nil if
2024 there was no result.") 2033 there was no result. */)
2025 (service, send) 2034 (service, send)
2026 Lisp_Object service, send; 2035 Lisp_Object service, send;
2027 { 2036 {
2028 id pb; 2037 id pb;
2029 NSString *svcName; 2038 NSString *svcName;
2048 } 2057 }
2049 2058
2050 2059
2051 DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc, 2060 DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc,
2052 Sns_convert_utf8_nfd_to_nfc, 1, 1, 0, 2061 Sns_convert_utf8_nfd_to_nfc, 1, 1, 0,
2053 "Return an NFC string that matches the UTF-8 NFD string STR.") 2062 doc: /* Return an NFC string that matches the UTF-8 NFD string STR. */)
2054 (str) 2063 (str)
2055 Lisp_Object str; 2064 Lisp_Object str;
2056 { 2065 {
2057 NSString *utfStr; 2066 NSString *utfStr;
2058 2067
2184 2193
2185 ========================================================================== */ 2194 ========================================================================== */
2186 2195
2187 2196
2188 DEFUN ("xw-color-defined-p", Fns_color_defined_p, Sns_color_defined_p, 1, 2, 0, 2197 DEFUN ("xw-color-defined-p", Fns_color_defined_p, Sns_color_defined_p, 1, 2, 0,
2189 "Return t if the current Nextstep display supports the color COLOR. 2198 doc: /* Return t if the current Nextstep display supports the color COLOR.
2190 The optional argument FRAME is currently ignored.") 2199 The optional argument FRAME is currently ignored. */)
2191 (color, frame) 2200 (color, frame)
2192 Lisp_Object color, frame; 2201 Lisp_Object color, frame;
2193 { 2202 {
2194 NSColor * col; 2203 NSColor * col;
2195 check_ns (); 2204 check_ns ();
2196 return ns_lisp_to_color (color, &col) ? Qnil : Qt; 2205 return ns_lisp_to_color (color, &col) ? Qnil : Qt;
2197 } 2206 }
2198 2207
2199 2208
2200 DEFUN ("xw-color-values", Fns_color_values, Sns_color_values, 1, 2, 0, 2209 DEFUN ("xw-color-values", Fns_color_values, Sns_color_values, 1, 2, 0,
2201 "Return a description of the color named COLOR. 2210 doc: /* Return a description of the color named COLOR.
2202 The value is a list of integer RGBA values--(RED GREEN BLUE ALPHA). 2211 The value is a list of integer RGBA values--(RED GREEN BLUE ALPHA).
2203 These values appear to range from 0 to 65280; white is (65280 65280 65280 0). 2212 These values appear to range from 0 to 65280; white is (65280 65280 65280 0).
2204 The optional argument FRAME is currently ignored.") 2213 The optional argument FRAME is currently ignored. */)
2205 (color, frame) 2214 (color, frame)
2206 Lisp_Object color, frame; 2215 Lisp_Object color, frame;
2207 { 2216 {
2208 NSColor * col; 2217 NSColor * col;
2209 float red, green, blue, alpha; 2218 float red, green, blue, alpha;
2225 return Flist (4, rgba); 2234 return Flist (4, rgba);
2226 } 2235 }
2227 2236
2228 2237
2229 DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, 2238 DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
2230 "Return t if the Nextstep display supports color. 2239 doc: /* Return t if the Nextstep display supports color.
2231 The optional argument DISPLAY specifies which display to ask about. 2240 The optional argument DISPLAY specifies which display to ask about.
2232 DISPLAY should be either a frame, a display name (a string), or terminal ID. 2241 DISPLAY should be either a frame, a display name (a string), or terminal ID.
2233 If omitted or nil, that stands for the selected frame's display.") 2242 If omitted or nil, that stands for the selected frame's display. */)
2234 (display) 2243 (display)
2235 Lisp_Object display; 2244 Lisp_Object display;
2236 { 2245 {
2237 NSWindowDepth depth; 2246 NSWindowDepth depth;
2238 NSString *colorSpace; 2247 NSString *colorSpace;
2246 } 2255 }
2247 2256
2248 2257
2249 DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, 2258 DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p,
2250 Sx_display_grayscale_p, 0, 1, 0, 2259 Sx_display_grayscale_p, 0, 1, 0,
2251 "Return t if the Nextstep display supports shades of gray. 2260 doc: /* Return t if the Nextstep display supports shades of gray.
2252 Note that color displays do support shades of gray. 2261 Note that color displays do support shades of gray.
2253 The optional argument DISPLAY specifies which display to ask about. 2262 The optional argument DISPLAY specifies which display to ask about.
2254 DISPLAY should be either a frame, a display name (a string), or terminal ID. 2263 DISPLAY should be either a frame, a display name (a string), or terminal ID.
2255 If omitted or nil, that stands for the selected frame's display.") 2264 If omitted or nil, that stands for the selected frame's display. */)
2256 (display) 2265 (display)
2257 Lisp_Object display; 2266 Lisp_Object display;
2258 { 2267 {
2259 NSWindowDepth depth; 2268 NSWindowDepth depth;
2260 check_ns (); 2269 check_ns ();
2264 } 2273 }
2265 2274
2266 2275
2267 DEFUN ("x-display-pixel-width", Fns_display_pixel_width, Sns_display_pixel_width, 2276 DEFUN ("x-display-pixel-width", Fns_display_pixel_width, Sns_display_pixel_width,
2268 0, 1, 0, 2277 0, 1, 0,
2269 "Returns the width in pixels of the Nextstep display DISPLAY. 2278 doc: /* Returns the width in pixels of the Nextstep display DISPLAY.
2270 The optional argument DISPLAY specifies which display to ask about. 2279 The optional argument DISPLAY specifies which display to ask about.
2271 DISPLAY should be either a frame, a display name (a string), or terminal ID. 2280 DISPLAY should be either a frame, a display name (a string), or terminal ID.
2272 If omitted or nil, that stands for the selected frame's display.") 2281 If omitted or nil, that stands for the selected frame's display. */)
2273 (display) 2282 (display)
2274 Lisp_Object display; 2283 Lisp_Object display;
2275 { 2284 {
2276 check_ns (); 2285 check_ns ();
2277 return make_number ((int) [ns_get_screen (display) frame].size.width); 2286 return make_number ((int) [ns_get_screen (display) frame].size.width);
2278 } 2287 }
2279 2288
2280 2289
2281 DEFUN ("x-display-pixel-height", Fns_display_pixel_height, 2290 DEFUN ("x-display-pixel-height", Fns_display_pixel_height,
2282 Sns_display_pixel_height, 0, 1, 0, 2291 Sns_display_pixel_height, 0, 1, 0,
2283 "Returns the height in pixels of the Nextstep display DISPLAY. 2292 doc: /* Returns the height in pixels of the Nextstep display DISPLAY.
2284 The optional argument DISPLAY specifies which display to ask about. 2293 The optional argument DISPLAY specifies which display to ask about.
2285 DISPLAY should be either a frame, a display name (a string), or terminal ID. 2294 DISPLAY should be either a frame, a display name (a string), or terminal ID.
2286 If omitted or nil, that stands for the selected frame's display.") 2295 If omitted or nil, that stands for the selected frame's display. */)
2287 (display) 2296 (display)
2288 Lisp_Object display; 2297 Lisp_Object display;
2289 { 2298 {
2290 check_ns (); 2299 check_ns ();
2291 return make_number ((int) [ns_get_screen (display) frame].size.height); 2300 return make_number ((int) [ns_get_screen (display) frame].size.height);
2292 } 2301 }
2293 2302
2294 DEFUN ("display-usable-bounds", Fns_display_usable_bounds, 2303 DEFUN ("display-usable-bounds", Fns_display_usable_bounds,
2295 Sns_display_usable_bounds, 0, 1, 0, 2304 Sns_display_usable_bounds, 0, 1, 0,
2296 "Return the bounds of the usable part of the screen. 2305 doc: /*Return the bounds of the usable part of the screen.
2297 The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which 2306 The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which
2298 are the boundaries of the usable part of the screen, excluding areas 2307 are the boundaries of the usable part of the screen, excluding areas
2299 reserved for the Mac menu, dock, and so forth. 2308 reserved for the Mac menu, dock, and so forth.
2300 2309
2301 The screen queried corresponds to DISPLAY, which should be either a 2310 The screen queried corresponds to DISPLAY, which should be either a
2302 frame, a display name (a string), or terminal ID. If omitted or nil, 2311 frame, a display name (a string), or terminal ID. If omitted or nil,
2303 that stands for the selected frame's display.") 2312 that stands for the selected frame's display. */)
2304 (display) 2313 (display)
2305 Lisp_Object display; 2314 Lisp_Object display;
2306 { 2315 {
2307 int top; 2316 int top;
2308 NSRect vScreen; 2317 NSRect vScreen;
2319 } 2328 }
2320 2329
2321 2330
2322 DEFUN ("x-display-planes", Fx_display_planes, Sns_display_planes, 2331 DEFUN ("x-display-planes", Fx_display_planes, Sns_display_planes,
2323 0, 1, 0, 2332 0, 1, 0,
2324 "Returns the number of bitplanes of the Nextstep display DISPLAY. 2333 doc: /* Returns the number of bitplanes of the Nextstep display DISPLAY.
2325 The optional argument DISPLAY specifies which display to ask about. 2334 The optional argument DISPLAY specifies which display to ask about.
2326 DISPLAY should be either a frame, a display name (a string), or terminal ID. 2335 DISPLAY should be either a frame, a display name (a string), or terminal ID.
2327 If omitted or nil, that stands for the selected frame's display.") 2336 If omitted or nil, that stands for the selected frame's display. */)
2328 (display) 2337 (display)
2329 Lisp_Object display; 2338 Lisp_Object display;
2330 { 2339 {
2331 check_ns (); 2340 check_ns ();
2332 return make_number 2341 return make_number
2334 } 2343 }
2335 2344
2336 2345
2337 DEFUN ("x-display-color-cells", Fns_display_color_cells, 2346 DEFUN ("x-display-color-cells", Fns_display_color_cells,
2338 Sns_display_color_cells, 0, 1, 0, 2347 Sns_display_color_cells, 0, 1, 0,
2339 "Returns the number of color cells of the Nextstep display DISPLAY. 2348 doc: /* Returns the number of color cells of the Nextstep display DISPLAY.
2340 The optional argument DISPLAY specifies which display to ask about. 2349 The optional argument DISPLAY specifies which display to ask about.
2341 DISPLAY should be either a frame, a display name (a string), or terminal ID. 2350 DISPLAY should be either a frame, a display name (a string), or terminal ID.
2342 If omitted or nil, that stands for the selected frame's display.") 2351 If omitted or nil, that stands for the selected frame's display. */)
2343 (display) 2352 (display)
2344 Lisp_Object display; 2353 Lisp_Object display;
2345 { 2354 {
2346 check_ns (); 2355 check_ns ();
2347 struct ns_display_info *dpyinfo = check_ns_display_info (display); 2356 struct ns_display_info *dpyinfo = check_ns_display_info (display);
2515 staticpro (&Qbuffered); 2524 staticpro (&Qbuffered);
2516 Qfontsize = intern ("fontsize"); 2525 Qfontsize = intern ("fontsize");
2517 staticpro (&Qfontsize); 2526 staticpro (&Qfontsize);
2518 2527
2519 DEFVAR_LISP ("ns-icon-type-alist", &Vns_icon_type_alist, 2528 DEFVAR_LISP ("ns-icon-type-alist", &Vns_icon_type_alist,
2520 "Alist of elements (REGEXP . IMAGE) for images of icons associated to frames. 2529 doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames.
2521 If the title of a frame matches REGEXP, then IMAGE.tiff is 2530 If the title of a frame matches REGEXP, then IMAGE.tiff is
2522 selected as the image of the icon representing the frame when it's 2531 selected as the image of the icon representing the frame when it's
2523 miniaturized. If an element is t, then Emacs tries to select an icon 2532 miniaturized. If an element is t, then Emacs tries to select an icon
2524 based on the filetype of the visited file. 2533 based on the filetype of the visited file.
2525 2534
2532 (append ns-icon-type-alist 2541 (append ns-icon-type-alist
2533 '((\"^\\\\*\\\\(Group\\\\*$\\\\|Summary \\\\|Article\\\\*$\\\\)\" 2542 '((\"^\\\\*\\\\(Group\\\\*$\\\\|Summary \\\\|Article\\\\*$\\\\)\"
2534 . \"Gnus\")))) 2543 . \"Gnus\"))))
2535 2544
2536 When you miniaturize a Group, Summary or Article frame, Gnus.tiff will 2545 When you miniaturize a Group, Summary or Article frame, Gnus.tiff will
2537 be used as the image of the icon representing the frame."); 2546 be used as the image of the icon representing the frame. */);
2538 Vns_icon_type_alist = Fcons (Qt, Qnil); 2547 Vns_icon_type_alist = Fcons (Qt, Qnil);
2539 2548
2540 defsubr (&Sns_read_file_name); 2549 defsubr (&Sns_read_file_name);
2541 defsubr (&Sns_get_resource); 2550 defsubr (&Sns_get_resource);
2542 defsubr (&Sns_set_resource); 2551 defsubr (&Sns_set_resource);