annotate lisp/prim/glyphs.el @ 51:69ce12f60f55

Added tag r19-16b91 for changeset ee648375d8d6
author cvs
date Mon, 13 Aug 2007 08:56:44 +0200
parents c53a95d3c46d
children 2e6f5e180fb8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; glyphs.el --- Lisp interface to C glyphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Keywords: glyphs internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1994 Board of Trustees, University of Illinois
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Author: Chuck Thompson <cthomp@cs.uiuc.edu>,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Ben Wing <wing@666.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 8
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 8
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 8
diff changeset
25 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Synched up with: Not in FSF.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; font specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (defun make-image-specifier (spec-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 "Create a new `image' specifier object with the given specification list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 SPEC-LIST can be a list of specifications (each of which is a cons of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 locale and a list of instantiators), a single instantiator, or a list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 of instantiators. See `make-specifier' for more information about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 specifiers."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (make-specifier-and-init 'image spec-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; glyphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defconst built-in-glyph-specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 '(image contrib-p baseline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 "A list of the built-in face properties that are specifiers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (defun glyph-property (glyph property &optional locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 "Return GLYPH's value of the given PROPERTY.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 If LOCALE is omitted, the GLYPH's actual value for PROPERTY will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 returned. For built-in properties, this will be a specifier object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 of a type appropriate to the property (e.g. a font or color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 specifier). For other properties, this could be anything.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 If LOCALE is supplied, then instead of returning the actual value,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 the specification(s) for the given locale or locale type will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 be returned. This will only work if the actual value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 PROPERTY is a specifier (this will always be the case for built-in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 properties, but not or not may apply to user-defined properties).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 If the actual value of PROPERTY is not a specifier, this value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 will simply be returned regardless of LOCALE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 The return value will be a list of instantiators (e.g. strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 specifying a font or color name), or a list of specifications, each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 of which is a cons of a locale and a list of instantiators.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 Specifically, if LOCALE is a particular locale (a buffer, window,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 frame, device, or 'global), a list of instantiators for that locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 will be returned. Otherwise, if LOCALE is a locale type (one of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 the symbols 'buffer, 'window, 'frame, 'device, 'device-class, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 'device-type), the specifications for all locales of that type will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 be returned. Finally, if LOCALE is 'all, the specifications for all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 locales of all types will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 The specifications in a specifier determine what the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 PROPERTY will be in a particular \"domain\" or set of circumstances,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 which is typically a particular Emacs window along with the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 it contains and the frame and device it lies within. The value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 is derived from the instantiator associated with the most specific
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 locale (in the order buffer, window, frame, device, and 'global)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 that matches the domain in question. In other words, given a domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (i.e. an Emacs window, usually), the specifier for PROPERTY will first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 be searched for a specification whose locale is the buffer contained
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 within that window; then for a specification whose locale is the window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 itself; then for a specification whose locale is the frame that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 window is contained within; etc. The first instantiator that is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 valid for the domain (usually this means that the instantiator is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 recognized by the device [i.e. the X server or TTY device] that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 domain is on. The function `glyph-property-instance' actually does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 all this, and is used to determine how to display the glyph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 See `set-glyph-property' for the built-in property-names."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (check-argument-type 'glyphp glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (let ((value (get glyph property)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (if (and locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (or (memq property built-in-glyph-specifiers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (specifierp value)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (setq value (specifier-specs value locale)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 value))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (defun convert-glyph-property-into-specifier (glyph property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 "Convert PROPERTY on GLYPH into a specifier, if it's not already."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (check-argument-type 'glyphp glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (let ((specifier (get glyph property)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;; if a user-property does not have a specifier but a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;; locale was specified, put a specifier there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;; If there was already a value there, convert it to a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;; specifier with the value as its 'global instantiator.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (if (not (specifierp specifier))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (let ((new-specifier (make-specifier 'generic)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (if (or (not (null specifier))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;; make sure the nil returned from `get' wasn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ;; actually the value of the property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (null (get glyph property t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (add-spec-to-specifier new-specifier specifier))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (setq specifier new-specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (put glyph property specifier)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (defun glyph-property-instance (glyph property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 &optional domain default no-fallback)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 "Return the instance of GLYPH's PROPERTY in the specified DOMAIN.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 Under most circumstances, DOMAIN will be a particular window,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 and the returned instance describes how the specified property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 actually is displayed for that window and the particular buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 in it. Note that this may not be the same as how the property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 appears when the buffer is displayed in a different window or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 frame, or how the property appears in the same window if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 switch to another buffer in that window; and in those cases,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 the returned instance would be different.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 DOMAIN defaults to the selected window if omitted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 DOMAIN can be a frame or device, instead of a window. The value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 returned for a such a domain is used in special circumstances
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 when a more specific domain does not apply; for example, a frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 value might be used for coloring a toolbar, which is conceptually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 attached to a frame rather than a particular window. The value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 is also useful in determining what the value would be for a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 particular window within the frame or device, if it is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 overridden by a more specific specification.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 If PROPERTY does not name a built-in property, its value will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 simply be returned unless it is a specifier object, in which case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 it will be instanced using `specifier-instance'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 Optional arguments DEFAULT and NO-FALLBACK are the same as in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 `specifier-instance'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (check-argument-type 'glyphp glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (let ((value (get glyph property)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (if (specifierp value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (setq value (specifier-instance value domain default no-fallback)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 value))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (defun set-glyph-property (glyph property value &optional locale tag-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 how-to-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "Change a property of a GLYPH.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 NOTE: If you want to remove a property from a glyph, use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 `remove-glyph-property' rather than attempting to set a value of nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 for the property.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 For built-in properties, the actual value of the property is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 specifier and you cannot change this; but you can change the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 specifications within the specifier, and that is what this function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 will do. For user-defined properties, you can use this function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 to either change the actual value of the property or, if this value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 is a specifier, change the specifications within it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 If PROPERTY is a built-in property, the specifications to be added to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 this property can be supplied in many different ways:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 -- If VALUE is a simple instantiator (e.g. a string naming a font or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 color) or a list of instantiators, then the instantiator(s) will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 be added as a specification of the property for the given LOCALE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (which defaults to 'global if omitted).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 -- If VALUE is a list of specifications (each of which is a cons of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 a locale and a list of instantiators), then LOCALE must be nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (it does not make sense to explicitly specify a locale in this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 case), and specifications will be added as given.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 -- If VALUE is a specifier (as would be returned by `glyph-property'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 if no LOCALE argument is given), then some or all of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 specifications in the specifier will be added to the property.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 In this case, the function is really equivalent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 `copy-specifier' and LOCALE has the same semantics (if it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 a particular locale, the specification for the locale will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 copied; if a locale type, specifications for all locales of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 that type will be copied; if nil or 'all, then all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 specifications will be copied).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 HOW-TO-ADD should be either nil or one of the symbols 'prepend,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 'append, 'remove-tag-set-prepend, 'remove-tag-set-append, 'remove-locale,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 'remove-locale-type, or 'remove-all. See `copy-specifier' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 `add-spec-to-specifier' for a description of what each of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 these means. Most of the time, you do not need to worry about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 this argument; the default behavior usually is fine.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 In general, it is OK to pass an instance object (e.g. as returned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 by `glyph-property-instance') as an instantiator in place of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 an actual instantiator. In such a case, the instantiator used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 to create that instance object will be used (for example, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 you set a font-instance object as the value of the 'font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 property, then the font name used to create that object will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 be used instead). If some cases, however, doing this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 conversion does not make sense, and this will be noted in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 the documentation for particular types of instance objects.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 If PROPERTY is not a built-in property, then this function will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 simply set its value if LOCALE is nil. However, if LOCALE is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 given, then this function will attempt to add VALUE as the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 instantiator for the given LOCALE, using `add-spec-to-specifier'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 If the value of the property is not a specifier, it will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 automatically be converted into a 'generic specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 The following symbols have predefined meanings:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 image The image used to display the glyph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 baseline Percent above baseline that glyph is to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 contrib-p Whether the glyph contributes to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 height of the line it's on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 face Face of this glyph (*not* a specifier)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (check-argument-type 'glyphp glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (if (memq property built-in-glyph-specifiers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (set-specifier (get glyph property) value locale tag-set how-to-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ;; This section adds user defined properties.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (if (not locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (put glyph property value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (convert-glyph-property-into-specifier glyph property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (add-spec-to-specifier (get glyph property) value locale tag-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 how-to-add)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (defun remove-glyph-property (glyph property &optional locale tag-set exact-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 "Remove a property from a glyph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 For built-in properties, this is analogous to `remove-specifier'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 See `remove-specifier' for the meaning of the LOCALE, TAG-SET, and EXACT-P
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 arguments."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (or locale (setq locale 'all))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (if (memq property built-in-glyph-specifiers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (remove-specifier (glyph-property glyph property) locale tag-set exact-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (if (eq locale 'all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (remprop glyph property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (convert-glyph-property-into-specifier glyph property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (remove-specifier (glyph-property glyph property) locale tag-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 exact-p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (defun glyph-face (glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 "Return the face of GLYPH."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (glyph-property glyph 'face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (defun set-glyph-face (glyph face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 "Change the face of GLYPH to FACE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ; (interactive (glyph-interactive "face"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (set-glyph-property glyph 'face face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (defun glyph-image (glyph &optional locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 "Return the image of the given glyph, or nil if it is unspecified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 LOCALE may be a locale (the instantiators for that particular locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 will be returned), a locale type (the specifications for all locales
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 of that type will be returned), 'all (all specifications will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 returned), or nil (the actual specifier object will be returned).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 See `glyph-property' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (glyph-property glyph 'image locale))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (defun glyph-image-instance (glyph &optional domain default no-fallback)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 "Return the instance of the given glyph's image in the given domain.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 Normally DOMAIN will be a window or nil (meaning the selected window),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 and an instance object describing how the image appears in that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 particular window and buffer will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 See `glyph-property-instance' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (glyph-property-instance glyph 'image domain default no-fallback))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (defun set-glyph-image (glyph spec &optional locale tag-set how-to-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 "Change the image of the given glyph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 SPEC should be an instantiator (a string or vector; see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 `image-specifier-p' for a description of possible values here),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 a list of (possibly tagged) instantiators, an alist of specifications
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (each mapping a locale to an instantiator list), or an image specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 object.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 If SPEC is an alist, LOCALE must be omitted. If SPEC is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 specifier object, LOCALE can be a locale, a locale type, 'all,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 or nil; see `copy-specifier' for its semantics. Otherwise LOCALE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 specifies the locale under which the specified instantiator(s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 will be added, and defaults to 'global.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 See `set-glyph-property' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ; (interactive (glyph-interactive "image"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (set-glyph-property glyph 'image spec locale tag-set how-to-add))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (defun glyph-contrib-p (glyph &optional locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 "Return whether GLYPH contributes to its line height.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 LOCALE may be a locale (the instantiators for that particular locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 will be returned), a locale type (the specifications for all locales
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 of that type will be returned), 'all (all specifications will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 returned), or nil (the actual specifier object will be returned).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 See `glyph-property' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (glyph-property glyph 'contrib-p locale))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (defun glyph-contrib-p-instance (glyph &optional domain default no-fallback)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 "Return the instance of the GLYPH's 'contrib-p property in the given domain.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 Normally DOMAIN will be a window or nil (meaning the selected window),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 and an instance object describing what the 'contrib-p property is in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 that particular window and buffer will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 See `glyph-property-instance' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (glyph-property-instance glyph 'contrib-p domain default no-fallback))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (defun set-glyph-contrib-p (glyph spec &optional locale tag-set how-to-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 "Change the contrib-p of the given glyph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 SPEC should be an instantiator (t or nil), a list of (possibly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 tagged) instantiators, an alist of specifications (each mapping a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 locale to an instantiator list), or a boolean specifier object.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 If SPEC is an alist, LOCALE must be omitted. If SPEC is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 specifier object, LOCALE can be a locale, a locale type, 'all,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 or nil; see `copy-specifier' for its semantics. Otherwise LOCALE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 specifies the locale under which the specified instantiator(s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 will be added, and defaults to 'global.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 See `set-glyph-property' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 ; (interactive (glyph-interactive "contrib-p"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (set-glyph-property glyph 'contrib-p spec locale tag-set how-to-add))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (defun glyph-baseline (glyph &optional locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 "Return the baseline of the given glyph, or nil if it is unspecified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 LOCALE may be a locale (the instantiators for that particular locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 will be returned), a locale type (the specifications for all locales
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 of that type will be returned), 'all (all specifications will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 returned), or nil (the actual specifier object will be returned).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 See `glyph-property' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (glyph-property glyph 'baseline locale))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (defun glyph-baseline-instance (glyph &optional domain default no-fallback)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 "Return the instance of the given glyph's baseline in the given domain.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 Normally DOMAIN will be a window or nil (meaning the selected window),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 and an integer or nil (specifying the baseline in that particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 window and buffer) will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 See `glyph-property-instance' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (glyph-property-instance glyph 'baseline domain default no-fallback))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (defun set-glyph-baseline (glyph spec &optional locale tag-set how-to-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 "Change the baseline of the given glyph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 SPEC should be an instantiator (an integer [a percentage above the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 baseline of the line the glyph is on] or nil), a list of (possibly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 tagged) instantiators, an alist of specifications (each mapping a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 locale to an instantiator list), or a generic specifier object.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 If SPEC is an alist, LOCALE must be omitted. If SPEC is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 specifier object, LOCALE can be a locale, a locale type, 'all,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 or nil; see `copy-specifier' for its semantics. Otherwise LOCALE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 specifies the locale under which the specified instantiator(s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 will be added, and defaults to 'global.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 See `set-glyph-property' for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 ; (interactive (glyph-interactive "baseline"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (set-glyph-property glyph 'baseline spec locale tag-set how-to-add))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (defun make-glyph (&optional spec-list type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 "Create a new `glyph' object of type TYPE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 TYPE should be one of `buffer' (used for glyphs in an extent, the modeline,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 the toolbar, or elsewhere in a buffer), `pointer' (used for the mouse-pointer),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 or `icon' (used for a frame's icon), and defaults to `buffer'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 SPEC-LIST is used to initialize the glyph's image. It is typically an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 image instantiator (a string or a vector; see `image-specifier-p' for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 a detailed description of the valid image instantiators), but can also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 be a list of such instantiators (each one in turn is tried until an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 image is successfully produced), a cons of a locale (frame, buffer, etc.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 and an instantiator, a list of such conses, or any other form accepted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 by `canonicalize-spec-list'. See `make-specifier' for more information
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 about specifiers."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (let ((glyph (make-glyph-internal type)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (and spec-list (set-glyph-image glyph spec-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 glyph))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (defun buffer-glyph-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 "t if OBJECT is a glyph of type `buffer'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (and (glyphp object) (eq 'buffer (glyph-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (defun pointer-glyph-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 "t if OBJECT is a glyph of type `pointer'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (and (glyphp object) (eq 'pointer (glyph-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (defun icon-glyph-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 "t if OBJECT is a glyph of type `icon'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (and (glyphp object) (eq 'icon (glyph-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (defun make-pointer-glyph (&optional spec-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 "Create a new `pointer-glyph' object with the given specification list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 This is equivalent to calling `make-glyph' and specifying a type of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 `pointer'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 SPEC-LIST is used to initialize the glyph's image. It is typically an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 image instantiator (a string or a vector; see `image-specifier-p' for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 a detailed description of the valid image instantiators), but can also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 be a list of such instantiators (each one in turn is tried until an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 image is successfully produced), a cons of a locale (frame, buffer, etc.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 and an instantiator, a list of such conses, or any other form accepted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 by `canonicalize-spec-list'. See `make-specifier' for more information
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 about specifiers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 You can also create a glyph with an empty SPEC-LIST and add image
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 instantiators afterwards using `set-glyph-image'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (make-glyph spec-list 'pointer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (defun make-icon-glyph (&optional spec-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 "Create a new `icon-glyph' object with the given specification list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 This is equivalent to calling `make-glyph' and specifying a type of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 `icon'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 SPEC-LIST is used to initialize the glyph's image. It is typically an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 image instantiator (a string or a vector; see `image-specifier-p' for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 a detailed description of the valid image instantiators), but can also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 be a list of such instantiators (each one in turn is tried until an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 image is successfully produced), a cons of a locale (frame, buffer, etc.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 and an instantiator, a list of such conses, or any other form accepted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 by `canonicalize-spec-list'. See `make-specifier' for more information
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 about specifiers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 You can also create a glyph with an empty SPEC-LIST and add image
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 instantiators afterwards using `set-glyph-image'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (make-glyph spec-list 'icon))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (defun nothing-image-instance-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 "t if OBJECT is an image instance of type `nothing'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (and (image-instance-p object) (eq 'nothing (image-instance-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (defun text-image-instance-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 "t if OBJECT is an image instance of type `text'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (and (image-instance-p object) (eq 'text (image-instance-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (defun mono-pixmap-image-instance-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 "t if OBJECT is an image instance of type `mono-pixmap'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (and (image-instance-p object) (eq 'mono-pixmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (image-instance-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (defun color-pixmap-image-instance-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 "t if OBJECT is an image instance of type `color-pixmap'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (and (image-instance-p object) (eq 'color-pixmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (image-instance-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (defun pointer-image-instance-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 "t if OBJECT is an image instance of type `pointer'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (and (image-instance-p object) (eq 'pointer (image-instance-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (defun subwindow-image-instance-p (object)
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 22
diff changeset
468 "t if OBJECT is an image instance of type `subwindow'.
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 22
diff changeset
469 Subwindows are not implemented in this version of XEmacs."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (and (image-instance-p object) (eq 'subwindow (image-instance-type object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 ;;;;;;;;;; the built-in glyphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (defvar text-pointer-glyph (make-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 "*The shape of the mouse-pointer when over text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 This is a glyph; use `set-glyph-image' to change it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (set-glyph-face text-pointer-glyph 'pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (defvar nontext-pointer-glyph (make-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 "*The shape of the mouse-pointer when over a buffer, but not over text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 This is a glyph; use `set-glyph-image' to change it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 If unspecified in a particular domain, `text-pointer-glyph' is used.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (set-glyph-face nontext-pointer-glyph 'pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (defvar modeline-pointer-glyph (make-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 "*The shape of the mouse-pointer when over the modeline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 This is a glyph; use `set-glyph-image' to change it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 If unspecified in a particular domain, `nontext-pointer-glyph' is used.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (set-glyph-face modeline-pointer-glyph 'pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (defvar selection-pointer-glyph (make-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 "*The shape of the mouse-pointer when over a selectable text region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 This is a glyph; use `set-glyph-image' to change it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 If unspecified in a particular domain, `text-pointer-glyph' is used.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (set-glyph-face selection-pointer-glyph 'pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (defvar busy-pointer-glyph (make-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 "*The shape of the mouse-pointer when XEmacs is busy.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 This is a glyph; use `set-glyph-image' to change it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 If unspecified in a particular domain, the pointer is not changed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 when XEmacs is busy.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (set-glyph-face busy-pointer-glyph 'pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (defvar toolbar-pointer-glyph (make-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 "*The shape of the mouse-pointer when over a toolbar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 This is a glyph; use `set-glyph-image' to change it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 If unspecified in a particular domain, `nontext-pointer-glyph' is used.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (set-glyph-face toolbar-pointer-glyph 'pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 ;; The following three are in C.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (if (featurep 'menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (set-glyph-face menubar-pointer-glyph 'pointer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (if (featurep 'scrollbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (set-glyph-face scrollbar-pointer-glyph 'pointer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (set-glyph-face gc-pointer-glyph 'pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 ;; Now add the magic access/set behavior.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (defun dontusethis-set-value-glyph-handler (sym args fun harg handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (error "Use `set-glyph-image' to set `%s'" sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (defun dontusethis-make-unbound-glyph-handler (sym args fun harg handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (error "Can't `makunbound' `%s'" sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (defun dontusethis-make-local-glyph-handler (sym args fun harg handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (error "Use `set-glyph-image' to make local values for `%s'" sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (defun define-constant-glyph (sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (dontusethis-set-symbol-value-handler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 sym 'set-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 'dontusethis-set-value-glyph-handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (dontusethis-set-symbol-value-handler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 sym 'make-unbound
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 'dontusethis-make-unbound-glyph-handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (dontusethis-set-symbol-value-handler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 sym 'make-local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 'dontusethis-make-local-glyph-handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 ;; Make frame properties magically work with glyph variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (put sym 'const-glyph-variable t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (define-constant-glyph 'text-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (define-constant-glyph 'nontext-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (define-constant-glyph 'modeline-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (define-constant-glyph 'selection-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (define-constant-glyph 'busy-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (define-constant-glyph 'gc-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (define-constant-glyph 'toolbar-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (define-constant-glyph 'menubar-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (define-constant-glyph 'scrollbar-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (define-constant-glyph 'octal-escape-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (define-constant-glyph 'control-arrow-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (define-constant-glyph 'invisible-text-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (define-constant-glyph 'hscroll-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (define-constant-glyph 'truncation-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (define-constant-glyph 'continuation-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (define-constant-glyph 'frame-icon-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 ;; backwards compatibility garbage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (defun dontusethis-old-pointer-shape-handler (sym args fun harg handler)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (let ((value (car args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (if (null value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (remove-specifier harg 'global)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (set-glyph-image (symbol-value harg) value))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (defun define-obsolete-pointer-glyph (old new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (define-obsolete-variable-alias old new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (dontusethis-set-symbol-value-handler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 old 'set-value 'dontusethis-old-pointer-shape-handler new))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (defvar x-pointer-shape nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (define-obsolete-pointer-glyph 'x-pointer-shape 'text-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 (defvar x-nontext-pointer-shape nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (define-obsolete-pointer-glyph 'x-nontext-pointer-shape 'nontext-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (defvar x-mode-pointer-shape nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (define-obsolete-pointer-glyph 'x-mode-pointer-shape 'modeline-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (defvar x-selection-pointer-shape nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (define-obsolete-pointer-glyph 'x-selection-pointer-shape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 'selection-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (defvar x-busy-pointer-shape nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (define-obsolete-pointer-glyph 'x-busy-pointer-shape 'busy-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (defvar x-gc-pointer-shape nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (define-obsolete-pointer-glyph 'x-gc-pointer-shape 'gc-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (defvar x-toolbar-pointer-shape nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (define-obsolete-pointer-glyph 'x-toolbar-pointer-shape 'toolbar-pointer-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 ;;;;;;;;;; initialization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 (defun init-glyphs ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ;; initialize default image types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (if (featurep 'x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (set-console-type-image-conversion-list 'x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 `(,@(if (featurep 'xpm) '(("\.xpm$" [xpm :file nil] 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 ,@(if (featurep 'xpm) '(("^/\\* XPM \\*/" [xpm :data nil] 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 ,@(if (featurep 'xface) '(("^X-Face:" [xface :data nil] 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 ,@(if (featurep 'gif) '(("\.gif$" [gif :file nil] 2)))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
603 ,@(if (featurep 'gif) '(("^GIF8[79]" [gif :data nil] 2)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 ,@(if (featurep 'jpeg) '(("\.jpeg$" [jpeg :file nil] 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 ,@(if (featurep 'jpeg) '(("\.jpg$" [jpeg :file nil] 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 ;; all of the JFIF-format JPEG's that I've seen begin with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 ;; the following. I have no idea if this is standard.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 ,@(if (featurep 'jpeg) '(("^\377\330\340\000\020JFIF"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 [jpeg :data nil] 2)))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
610 ,@(if (featurep 'png) '(("\.png$" [png :file nil] 2)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
611 ,@(if (featurep 'png) '(("^\211PNG" [png :data nil] 2)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 ("" [autodetect :data nil] 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 ;; #### this should really be formatted-string, not string but we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 ;; don't have it implemented yet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 ;; #define could also mean a bitmap as well as a version 1 XPM. Who
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 ;; cares. We don't want the file contents getting converted to a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 ;; string in either case which is why the entry is there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 (if (featurep 'tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (set-console-type-image-conversion-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 'tty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 '(("^#define" [string :data "[xpm]"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 ("^X-Face:" [string :data "[xface]"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 ("^/\\* XPM \\*/" [string :data "[xpm]"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 ("^GIF87" [string :data "[gif]"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 ("^\377\330\340\000\020JFIF" [string :data "[jpeg]"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 ("" [string :data nil] 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 ;; this last one is here for pointers and icons and such --
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 ;; strings are not allowed so they will be ignored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 ("" [nothing])))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 ;; finish initializing truncation glyph -- created internally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 ;; because it has a built-in bitmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 (set-glyph-image truncation-glyph "$" 'global 'tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 ;; finish initializing continuation glyph -- created internally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 ;; because it has a built-in bitmap
8
4b173ad71786 Import from CVS: tag r19-15b5
cvs
parents: 0
diff changeset
639 (set-glyph-image continuation-glyph "\\" 'global 'tty)
4b173ad71786 Import from CVS: tag r19-15b5
cvs
parents: 0
diff changeset
640
4b173ad71786 Import from CVS: tag r19-15b5
cvs
parents: 0
diff changeset
641 ;; finish initializing continuation glyph -- created internally
4b173ad71786 Import from CVS: tag r19-15b5
cvs
parents: 0
diff changeset
642 ;; because it has a built-in bitmap
4b173ad71786 Import from CVS: tag r19-15b5
cvs
parents: 0
diff changeset
643 (set-glyph-image hscroll-glyph "$" 'global 'tty)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (set-glyph-image octal-escape-glyph "\\")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (set-glyph-image control-arrow-glyph "^")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (set-glyph-image invisible-text-glyph " ...")
8
4b173ad71786 Import from CVS: tag r19-15b5
cvs
parents: 0
diff changeset
648 ;; (set-glyph-image hscroll-glyph "$")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 ;; finish initializing xemacs logo -- created internally because it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 ;; has a built-in bitmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 (if (featurep 'xpm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 (set-glyph-image xemacs-logo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 (concat data-directory "xemacs.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 'global 'x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (cond ((featurep 'xpm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (set-glyph-image frame-icon-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (concat data-directory "xemacs-icon.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 'global 'x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 ((featurep 'x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (set-glyph-image frame-icon-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (concat data-directory "xemacs-icon2.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 'global 'x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (if (featurep 'tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (set-glyph-image xemacs-logo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 "XEmacs <insert spiffy graphic logo here>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 'global 'tty))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 ;;; glyphs.el ends here.