comparison lisp/faces.el @ 95841:b4e36ff621b3

Add some compiler declarations, for builds without X.
author Glenn Morris <rgm@gnu.org>
date Thu, 12 Jun 2008 03:56:20 +0000
parents 09e6bd8a641a
children afdd781501c8
comparison
equal deleted inserted replaced
95840:0e3c2e18b9c3 95841:b4e36ff621b3
296 \(RESOURCE . CLASS) with RESOURCE being the resource and CLASS being the 296 \(RESOURCE . CLASS) with RESOURCE being the resource and CLASS being the
297 X resource class for the attribute." 297 X resource class for the attribute."
298 :type '(repeat (cons symbol (repeat (cons string string)))) 298 :type '(repeat (cons symbol (repeat (cons string string))))
299 :group 'faces) 299 :group 'faces)
300 300
301
302 (declare-function internal-face-x-get-resource "xfaces.c"
303 (resource class frame))
304
305 (declare-function internal-set-lisp-face-attribute-from-resource "xfaces.c"
306 (face attr value &optional frame))
301 307
302 (defun set-face-attribute-from-resource (face attribute resource class frame) 308 (defun set-face-attribute-from-resource (face attribute resource class frame)
303 "Set FACE's ATTRIBUTE from X resource RESOURCE, class CLASS on FRAME. 309 "Set FACE's ATTRIBUTE from X resource RESOURCE, class CLASS on FRAME.
304 Value is the attribute value specified by the resource, or nil 310 Value is the attribute value specified by the resource, or nil
305 if not present. This function displays a message if the resource 311 if not present. This function displays a message if the resource
928 ;; Return either a list of faces or just one face. 934 ;; Return either a list of faces or just one face.
929 (if multiple 935 (if multiple
930 output 936 output
931 (car output))))) 937 (car output)))))
932 938
939 ;; Not defined without X, but behind window-system test.
940 (defvar x-bitmap-file-path)
933 941
934 (defun face-valid-attribute-values (attribute &optional frame) 942 (defun face-valid-attribute-values (attribute &optional frame)
935 "Return valid values for face attribute ATTRIBUTE. 943 "Return valid values for face attribute ATTRIBUTE.
936 The optional argument FRAME is used to determine available fonts 944 The optional argument FRAME is used to determine available fonts
937 and colors. If it is nil or not specified, the selected frame is 945 and colors. If it is nil or not specified, the selected frame is
1108 (stringp new-value) 1116 (stringp new-value)
1109 (string-match "^[[(]" new-value)) 1117 (string-match "^[[(]" new-value))
1110 (setq new-value (read new-value))) 1118 (setq new-value (read new-value)))
1111 new-value)) 1119 new-value))
1112 1120
1121 (declare-function fontset-list "fontset.c" ())
1122 (declare-function x-list-fonts "xfaces.c"
1123 (pattern &optional face frame maximum width))
1113 1124
1114 (defun read-face-font (face &optional frame) 1125 (defun read-face-font (face &optional frame)
1115 "Read the name of a font for FACE on FRAME. 1126 "Read the name of a font for FACE on FRAME.
1116 If optional argument FRAME is nil or omitted, use the selected frame." 1127 If optional argument FRAME is nil or omitted, use the selected frame."
1117 (let ((completion-ignore-case t)) 1128 (let ((completion-ignore-case t))
1584 (if (memq (framep (or frame (selected-frame))) '(x w32 mac)) 1595 (if (memq (framep (or frame (selected-frame))) '(x w32 mac))
1585 (xw-defined-colors frame) 1596 (xw-defined-colors frame)
1586 (mapcar 'car (tty-color-alist frame)))) 1597 (mapcar 'car (tty-color-alist frame))))
1587 (defalias 'x-defined-colors 'defined-colors) 1598 (defalias 'x-defined-colors 'defined-colors)
1588 1599
1600 (declare-function xw-color-defined-p "xfns.c" (color &optional frame))
1601
1589 (defun color-defined-p (color &optional frame) 1602 (defun color-defined-p (color &optional frame)
1590 "Return non-nil if color COLOR is supported on frame FRAME. 1603 "Return non-nil if color COLOR is supported on frame FRAME.
1591 If FRAME is omitted or nil, use the selected frame. 1604 If FRAME is omitted or nil, use the selected frame.
1592 If COLOR is the symbol `unspecified' or one of the strings 1605 If COLOR is the symbol `unspecified' or one of the strings
1593 \"unspecified-fg\" or \"unspecified-bg\", the value is nil." 1606 \"unspecified-fg\" or \"unspecified-bg\", the value is nil."
1595 nil 1608 nil
1596 (if (member (framep (or frame (selected-frame))) '(x w32 mac)) 1609 (if (member (framep (or frame (selected-frame))) '(x w32 mac))
1597 (xw-color-defined-p color frame) 1610 (xw-color-defined-p color frame)
1598 (numberp (tty-color-translate color frame))))) 1611 (numberp (tty-color-translate color frame)))))
1599 (defalias 'x-color-defined-p 'color-defined-p) 1612 (defalias 'x-color-defined-p 'color-defined-p)
1613
1614 (declare-function xw-color-values "xfns.c" (color &optional frame))
1600 1615
1601 (defun color-values (color &optional frame) 1616 (defun color-values (color &optional frame)
1602 "Return a description of the color named COLOR on frame FRAME. 1617 "Return a description of the color named COLOR on frame FRAME.
1603 The value is a list of integer RGB values--(RED GREEN BLUE). 1618 The value is a list of integer RGB values--(RED GREEN BLUE).
1604 These values appear to range from 0 to 65280 or 65535, depending 1619 These values appear to range from 0 to 65280 or 65535, depending
1612 (if (memq (framep (or frame (selected-frame))) '(x w32 mac)) 1627 (if (memq (framep (or frame (selected-frame))) '(x w32 mac))
1613 (xw-color-values color frame) 1628 (xw-color-values color frame)
1614 (tty-color-values color frame)))) 1629 (tty-color-values color frame))))
1615 (defalias 'x-color-values 'color-values) 1630 (defalias 'x-color-values 'color-values)
1616 1631
1632 (declare-function xw-display-color-p "xfns.c" (&optional terminal))
1633
1617 (defun display-color-p (&optional display) 1634 (defun display-color-p (&optional display)
1618 "Return t if DISPLAY supports color. 1635 "Return t if DISPLAY supports color.
1619 The optional argument DISPLAY specifies which display to ask about. 1636 The optional argument DISPLAY specifies which display to ask about.
1620 DISPLAY should be either a frame or a display name (a string). 1637 DISPLAY should be either a frame or a display name (a string).
1621 If omitted or nil, that stands for the selected frame's display." 1638 If omitted or nil, that stands for the selected frame's display."
1622 (if (memq (framep-on-display display) '(x w32 mac)) 1639 (if (memq (framep-on-display display) '(x w32 mac))
1623 (xw-display-color-p display) 1640 (xw-display-color-p display)
1624 (tty-display-color-p display))) 1641 (tty-display-color-p display)))
1625 (defalias 'x-display-color-p 'display-color-p) 1642 (defalias 'x-display-color-p 'display-color-p)
1643
1644 (declare-function x-display-grayscale-p "xfns.c" (&optional terminal))
1626 1645
1627 (defun display-grayscale-p (&optional display) 1646 (defun display-grayscale-p (&optional display)
1628 "Return non-nil if frames on DISPLAY can display shades of gray." 1647 "Return non-nil if frames on DISPLAY can display shades of gray."
1629 (let ((frame-type (framep-on-display display))) 1648 (let ((frame-type (framep-on-display display)))
1630 (cond 1649 (cond
1785 :initialize 'custom-initialize-changed 1804 :initialize 'custom-initialize-changed
1786 :type '(choice (const dark) 1805 :type '(choice (const dark)
1787 (const light) 1806 (const light)
1788 (const :tag "automatic" nil))) 1807 (const :tag "automatic" nil)))
1789 1808
1809
1810 (declare-function x-get-resource "frame.c"
1811 (attribute class &optional component subclass))
1790 1812
1791 (defun frame-set-background-mode (frame) 1813 (defun frame-set-background-mode (frame)
1792 "Set up display-dependent faces on FRAME. 1814 "Set up display-dependent faces on FRAME.
1793 Display-dependent faces are those which have different definitions 1815 Display-dependent faces are those which have different definitions
1794 according to the `background-mode' and `display-type' frame parameters." 1816 according to the `background-mode' and `display-type' frame parameters."
1868 1890
1869 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1891 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1870 ;;; Frame creation. 1892 ;;; Frame creation.
1871 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1893 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1872 1894
1895 (declare-function x-parse-geometry "frame.c" (string))
1896
1873 (defun x-handle-named-frame-geometry (parameters) 1897 (defun x-handle-named-frame-geometry (parameters)
1874 "Add geometry parameters for a named frame to parameter list PARAMETERS. 1898 "Add geometry parameters for a named frame to parameter list PARAMETERS.
1875 Value is the new parameter list." 1899 Value is the new parameter list."
1876 (let* ((name (or (cdr (assq 'name parameters)) 1900 (let* ((name (or (cdr (assq 'name parameters))
1877 (cdr (assq 'name default-frame-alist)))) 1901 (cdr (assq 'name default-frame-alist))))
1914 (list (cons 'mouse-color fg)))) 1938 (list (cons 'mouse-color fg))))
1915 (if (equal bg (cdr (assq 'cursor-color params))) 1939 (if (equal bg (cdr (assq 'cursor-color params)))
1916 (modify-frame-parameters frame 1940 (modify-frame-parameters frame
1917 (list (cons 'cursor-color fg))))))) 1941 (list (cons 'cursor-color fg)))))))
1918 1942
1943 (declare-function x-create-frame "xfns.c" (parms))
1944 (declare-function x-setup-function-keys "term/x-win" (frame))
1945 (declare-function tool-bar-setup "tool-bar" (&optional frame))
1919 1946
1920 (defun x-create-frame-with-faces (&optional parameters) 1947 (defun x-create-frame-with-faces (&optional parameters)
1921 "Create a frame from optional frame parameters PARAMETERS. 1948 "Create a frame from optional frame parameters PARAMETERS.
1922 Parameters not specified by PARAMETERS are taken from 1949 Parameters not specified by PARAMETERS are taken from
1923 `default-frame-alist'. If PARAMETERS specify a frame name, 1950 `default-frame-alist'. If PARAMETERS specify a frame name,