Mercurial > hg > xemacs-beta
annotate lisp/fontcolor.el @ 5176:8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
-------------------- ChangeLog entries follow: --------------------
etc/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* dbxrc.in:
Rename objects.c -> fontcolor.c.
lisp/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* dumped-lisp.el (preloaded-file-list):
* font.el (font-tty-find-closest-color):
* fontcolor.el:
* fontcolor.el (ws-object-property-1): Removed.
* fontcolor.el (fontcolor-property-1): New.
* fontcolor.el (font-name):
* fontcolor.el (font-ascent):
* fontcolor.el (font-descent):
* fontcolor.el (font-width):
* fontcolor.el (font-height):
* fontcolor.el (font-proportional-p):
* fontcolor.el (font-properties):
* fontcolor.el (font-truename):
* fontcolor.el (color-name):
* fontcolor.el (color-rgb-components):
* x-faces.el:
Rename objects.el -> fontcolor.el.
lwlib/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* lwlib-colors.h:
objects*.h -> fontcolor*.h.
man/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* internals/internals.texi (A Summary of the Various XEmacs Modules):
* internals/internals.texi (Modules for other Display-Related Lisp Objects):
objects*.[ch] -> fontcolor*.[ch].
nt/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* xemacs.dsp:
* xemacs.mak:
* xemacs.mak (OPT_OBJS):
objects*.[ch] -> fontcolor*.[ch].
src/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* EmacsFrame.c:
* Makefile.in.in (x_objs):
* Makefile.in.in (mswindows_objs):
* Makefile.in.in (tty_objs):
* Makefile.in.in (gtk_objs):
* Makefile.in.in (objs):
* console-tty.h:
* console-x-impl.h:
* console-x-impl.h (struct x_device):
* console-x.h:
* console-xlike-inc.h:
* depend:
* device-gtk.c:
* device-msw.c:
* device-x.c:
* device-x.c (x_init_device):
* device-x.c (x_finish_init_device):
* device.c:
* devslots.h (MARKED_SLOT):
* emacs.c (main_1):
* event-Xt.c:
* event-gtk.c:
* event-msw.c:
* faces.c:
* font-mgr.c:
* fontcolor-gtk-impl.h:
* fontcolor-gtk.c:
* fontcolor-gtk.c (syms_of_fontcolor_gtk):
* fontcolor-gtk.c (console_type_create_fontcolor_gtk):
* fontcolor-gtk.c (vars_of_fontcolor_gtk):
* fontcolor-gtk.h:
* fontcolor-impl.h:
* fontcolor-msw-impl.h:
* fontcolor-msw.c:
* fontcolor-msw.c (syms_of_fontcolor_mswindows):
* fontcolor-msw.c (console_type_create_fontcolor_mswindows):
* fontcolor-msw.c (reinit_vars_of_fontcolor_mswindows):
* fontcolor-msw.c (vars_of_fontcolor_mswindows):
* fontcolor-msw.h:
* fontcolor-msw.h (mswindows_color_to_string):
* fontcolor-tty-impl.h:
* fontcolor-tty.c:
* fontcolor-tty.c (syms_of_fontcolor_tty):
* fontcolor-tty.c (console_type_create_fontcolor_tty):
* fontcolor-tty.c (vars_of_fontcolor_tty):
* fontcolor-tty.h:
* fontcolor-x-impl.h:
* fontcolor-x.c:
* fontcolor-x.c (syms_of_fontcolor_x):
* fontcolor-x.c (console_type_create_fontcolor_x):
* fontcolor-x.c (vars_of_fontcolor_x):
* fontcolor-x.c (Xatoms_of_fontcolor_x):
* fontcolor-x.h:
* fontcolor.c:
* fontcolor.c (syms_of_fontcolor):
* fontcolor.c (specifier_type_create_fontcolor):
* fontcolor.c (reinit_specifier_type_create_fontcolor):
* fontcolor.c (reinit_vars_of_fontcolor):
* fontcolor.c (vars_of_fontcolor):
* fontcolor.h:
* fontcolor.h (set_face_boolean_attached_to):
* frame-gtk.c:
* frame-x.c:
* glyphs-eimage.c:
* glyphs-gtk.c:
* glyphs-msw.c:
* glyphs-widget.c:
* glyphs-x.c:
* glyphs.c:
* gtk-glue.c:
* gtk-glue.c (xemacs_type_register):
* gtk-xemacs.c:
* inline.c:
* intl-win32.c:
* lisp.h:
* lrecord.h:
* mule-charset.c:
* native-gtk-toolbar.c:
* redisplay-msw.c:
* redisplay-tty.c:
* redisplay.c:
* select-x.c:
* select.c:
* symsinit.h:
* toolbar-msw.c:
* toolbar-msw.c (TOOLBAR_ITEM_ID_BITS):
* toolbar-x.c:
* ui-gtk.c:
* window.c:
Rename objects*.[ch] -> fontcolor*.[ch]. Fix up all references to
the old files (e.g. in #include statements, Makefiles,
functions like syms_of_objects_x(), etc.).
tests/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* reproduce-crashes.el (8):
objects*.[ch] -> fontcolor*.[ch].
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 22 Feb 2010 06:49:30 -0600 |
parents | lisp/objects.el@6e9bd19ec103 |
children | 97eb4942aec8 |
rev | line source |
---|---|
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
1 ;;; fontcolor.el --- Lisp interface to fonts and colors |
428 | 2 |
3 ;; Copyright (C) 1994, 1997 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Ben Wing | |
5 | |
6 ;; Author: Chuck Thompson <cthomp@xemacs.org> | |
7 ;; Author: Ben Wing <ben@xemacs.org> | |
8 ;; Maintainer: XEmacs Development Team | |
9 ;; Keywords: faces, internal, dumped | |
10 | |
11 ;; This file is part of XEmacs. | |
12 | |
13 ;; XEmacs is free software; you can redistribute it and/or modify it | |
14 ;; under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; XEmacs is distributed in the hope that it will be useful, but | |
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 ;; General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with XEmacs; see the file COPYING. If not, write to the | |
25 ;; Free Software Foundation, 59 Temple Place - Suite 330, | |
26 ;; Boston, MA 02111-1307, USA. | |
27 | |
28 ;;; Synched up with: Not in FSF. | |
29 | |
30 ;;; Commentary: | |
31 | |
32 ;; This file is dumped with XEmacs. | |
33 | |
34 ;;; Code: | |
35 | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
36 (defun fontcolor-property-1 (function object domain &optional matchspec) |
428 | 37 (let ((instance (if matchspec |
38 (specifier-matching-instance object matchspec domain) | |
39 (specifier-instance object domain)))) | |
40 (and instance (funcall function instance)))) | |
41 | |
42 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; font specifiers | |
43 | |
44 (defun make-font-specifier (spec-list) | |
45 "Return a new `font' specifier object with the given specification list. | |
46 SPEC-LIST can be a list of specifications (each of which is a cons of a | |
47 locale and a list of instantiators), a single instantiator, or a list | |
48 of instantiators. See `make-specifier' for more information about | |
442 | 49 specifiers. |
50 | |
51 Valid instantiators for font specifiers are: | |
52 | |
3111 | 53 -- a string naming a font; syntax is platform dependent. Some examples for |
54 a 14-point upright medium-weight Courier font: | |
55 X11 (and GTK1): \"-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*\" | |
56 Xft (and GTK2): \"Courier-14\" | |
57 MS-Windows: \"Courier:14:Western\" | |
442 | 58 -- a font instance (use that instance directly if the device matches, |
59 or use the string that generated it) | |
60 -- a vector of no elements (only on TTY's; this means to set no font | |
61 at all, thus using the \"natural\" font of the terminal's text) | |
62 -- a vector of one element (a face to inherit from) | |
63 " | |
428 | 64 (make-specifier-and-init 'font spec-list)) |
65 | |
66 (defun font-name (font &optional domain charset) | |
67 "Return the name of the FONT in the specified DOMAIN, if any. | |
68 FONT should be a font specifier object and DOMAIN is normally a window | |
69 and defaults to the selected window if omitted. This is equivalent | |
70 to using `specifier-instance' and applying `font-instance-name' to | |
71 the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
72 (fontcolor-property-1 'font-instance-name font domain charset)) |
428 | 73 |
74 (defun font-ascent (font &optional domain charset) | |
75 "Return the ascent of the FONT in the specified DOMAIN, if any. | |
76 FONT should be a font specifier object and DOMAIN is normally a window | |
77 and defaults to the selected window if omitted. This is equivalent | |
78 to using `specifier-instance' and applying `font-instance-ascent' to | |
79 the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
80 (fontcolor-property-1 'font-instance-ascent font domain charset)) |
428 | 81 |
82 (defun font-descent (font &optional domain charset) | |
83 "Return the descent of the FONT in the specified DOMAIN, if any. | |
84 FONT should be a font specifier object and DOMAIN is normally a window | |
85 and defaults to the selected window if omitted. This is equivalent | |
86 to using `specifier-instance' and applying `font-instance-descent' to | |
87 the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
88 (fontcolor-property-1 'font-instance-descent font domain charset)) |
428 | 89 |
90 (defun font-width (font &optional domain charset) | |
91 "Return the width of the FONT in the specified DOMAIN, if any. | |
92 FONT should be a font specifier object and DOMAIN is normally a window | |
93 and defaults to the selected window if omitted. This is equivalent | |
94 to using `specifier-instance' and applying `font-instance-width' to | |
95 the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
96 (fontcolor-property-1 'font-instance-width font domain charset)) |
428 | 97 |
98 (defun font-height (font &optional domain charset) | |
99 "Return the height of the FONT in the specified DOMAIN, if any. | |
100 FONT should be a font specifier object and DOMAIN is normally a window | |
101 and defaults to the selected window if omitted. This is equivalent | |
102 to using `specifier-instance' and applying `font-instance-height' to | |
103 the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
104 (fontcolor-property-1 'font-instance-height font domain charset)) |
428 | 105 |
106 (defun font-proportional-p (font &optional domain charset) | |
107 "Return whether FONT is proportional in the specified DOMAIN, if known. | |
108 FONT should be a font specifier object and DOMAIN is normally a window | |
109 and defaults to the selected window if omitted. This is equivalent | |
110 to using `specifier-instance' and applying `font-instance-proportional-p' to | |
111 the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
112 (fontcolor-property-1 'font-instance-proportional-p font domain charset)) |
428 | 113 |
114 (defun font-properties (font &optional domain charset) | |
115 "Return the properties of the FONT in the specified DOMAIN, if any. | |
116 FONT should be a font specifier object and DOMAIN is normally a window | |
117 and defaults to the selected window if omitted. This is equivalent | |
118 to using `specifier-instance' and applying `font-instance-properties' | |
119 to the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
120 (fontcolor-property-1 'font-instance-properties font domain charset)) |
428 | 121 |
122 (defun font-truename (font &optional domain charset) | |
123 "Return the truename of the FONT in the specified DOMAIN, if any. | |
124 FONT should be a font specifier object and DOMAIN is normally a window | |
125 and defaults to the selected window if omitted. This is equivalent | |
126 to using `specifier-instance' and applying `font-instance-truename' | |
127 to the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
128 (fontcolor-property-1 'font-instance-truename font domain charset)) |
428 | 129 |
130 (defun font-instance-height (font-instance) | |
131 "Return the height in pixels of FONT-INSTANCE. | |
132 The returned value is the maximum height for all characters in the font,\n\ | |
133 and is equivalent to the sum of the font instance's ascent and descent." | |
134 (+ (font-instance-ascent font-instance) | |
135 (font-instance-descent font-instance))) | |
136 | |
137 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; color specifiers | |
138 | |
139 (defun make-color-specifier (spec-list) | |
140 "Return a new `color' specifier object with the given specification list. | |
141 SPEC-LIST can be a list of specifications (each of which is a cons of a | |
142 locale and a list of instantiators), a single instantiator, or a list | |
143 of instantiators. See `make-specifier' for a detailed description of | |
442 | 144 how specifiers work. |
145 | |
146 Valid instantiators for color specifiers are: | |
147 | |
148 -- a string naming a color (e.g. under X this might be \"lightseagreen2\" | |
149 or \"#F534B2\") | |
150 -- a color instance (use that instance directly if the device matches, | |
151 or use the string that generated it) | |
152 -- a vector of no elements (only on TTY's; this means to set no color | |
153 at all, thus using the \"natural\" color of the terminal's text) | |
154 -- a vector of one or two elements: a face to inherit from, and | |
155 optionally a symbol naming which property of that face to inherit, | |
156 either `foreground' or `background' (if omitted, defaults to the same | |
157 property that this color specifier is used for; if this specifier is | |
158 not part of a face, the instantiator would not be valid)." | |
428 | 159 (make-specifier-and-init 'color spec-list)) |
160 | |
161 (defun color-name (color &optional domain) | |
162 "Return the name of the COLOR in the specified DOMAIN, if any. | |
163 COLOR should be a color specifier object and DOMAIN is normally a window | |
164 and defaults to the selected window if omitted. This is equivalent | |
165 to using `specifier-instance' and applying `color-instance-name' to | |
166 the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
167 (fontcolor-property-1 'color-instance-name color domain)) |
428 | 168 |
169 (defun color-rgb-components (color &optional domain) | |
170 "Return the RGB components of the COLOR in the specified DOMAIN, if any. | |
171 COLOR should be a color specifier object and DOMAIN is normally a window | |
172 and defaults to the selected window if omitted. This is equivalent | |
173 to using `specifier-instance' and applying `color-instance-rgb-components' | |
174 to the result. See `make-specifier' for more information about specifiers." | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
175 (fontcolor-property-1 'color-instance-rgb-components color domain)) |
428 | 176 |
442 | 177 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; face-boolean specifiers |
178 | |
179 (defun make-face-boolean-specifier (spec-list) | |
180 "Return a new `face-boolean' specifier object with the given spec list. | |
181 SPEC-LIST can be a list of specifications (each of which is a cons of a | |
182 locale and a list of instantiators), a single instantiator, or a list | |
183 of instantiators. See `make-specifier' for a detailed description of | |
184 how specifiers work. | |
185 | |
186 Valid instantiators for face-boolean specifiers are | |
187 | |
188 -- t or nil | |
4201 | 189 -- a vector of one, two or three elements: a face to inherit from, |
442 | 190 optionally a symbol naming the property of that face to inherit from |
191 (if omitted, defaults to the same property that this face-boolean | |
192 specifier is used for; if this specifier is not part of a face, | |
193 the instantiator would not be valid), and optionally a value which, | |
194 if non-nil, means to invert the sense of the inherited property." | |
4201 | 195 (make-specifier-and-init 'face-boolean spec-list)) |
442 | 196 |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4201
diff
changeset
|
197 ;;; fontcolor.el ends here. |