annotate src/specifier.h @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents d00347ec8289
children d1247f3cc363
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Generic specifier list implementation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
3 Copyright (C) 1995, 1996, 2002 Ben Wing
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
24 #ifndef INCLUDED_specifier_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
25 #define INCLUDED_specifier_h_
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 MAGIC SPECIFIERS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ================
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 Magic specifiers are used to provide fallback values for window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 system provided specifications, reflecting user preferences on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 window system, such as default fonts, colors, scrollbar thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 A magic specifier consists of two specifier objects. The first one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 behaves like a normal specifier in all senses. The second one, a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 ghost specifier, is a fallback value for the first one, and contains
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 values provided by window system, resources etc. which reflect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 default settings for values being specified.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 A magic specifier has an "ultimate" fallback value, as any usual
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 specifier does. This value, an inst-list, is stored in the fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 slot of the ghost specifier object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 Ghost specifiers have the following properties:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 - Have back pointers to their parent specifiers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 - Do not have instance data. Instead, they share parent's instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 data.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 - Have the same methods structure pointer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 - Share parent's caching scheme.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 - Store fallback value instead of their parents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 Ghost specifiers normally are not modifiable at the lisp level, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 only used to supply fallback instance values. They are accessible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 via (specifier-fallback), but are read-only. Although, under
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 certain rare conditions, modification of ghost objects is allowed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 This behavior is controlled by the global variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 Vunlock_ghost_specifiers. It is not exposed to lisp, and is set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 during calls to lisp functions which initialize global, device and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 frame defaults, such as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 init-{global,frame,device}-{faces,toolbars,etc}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 Thus, values supplied by resources or other means of a window system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 stored in externally unmodifiable ghost objects. Regular lisp code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 may thus freely modify the normal part of a magic specifier, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 removing a specification for a particular domain causes the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 specification to consider ghost-provided fallback values, or its own
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 fallback value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 Rules of conduct for magic specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 -------------------------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 1. recompute_*() functions always operate on the whole specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 when passed only a ghost object, by substituting it with their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 parent bodily object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 2. All specifier methods, except for instantiate method, are passed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 the bodily object of the magic specifier. Instantiate method is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 passed the specifier being instantiated.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 3. Only bodily objects are passed to set_specifier_caching function,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 and only these may be cached.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 4. All specifiers are added to Vall_specifiers list, both bodily and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 ghost. The pair of objects is always removed from the list at the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 same time.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
86 extern const struct sized_memory_description specifier_methods_description;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 struct specifier_methods
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
90 const char *name;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 Lisp_Object predicate_symbol;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 /* Implementation specific methods: */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 /* Create method: Initialize specifier data. Optional. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 void (*create_method) (Lisp_Object specifier);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 /* Mark method: Mark any lisp object within specifier data
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 structure. Not required if no specifier data are Lisp_Objects. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 void (*mark_method) (Lisp_Object specifier);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 /* Equal method: Compare two specifiers. This is called after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 ensuring that the two specifiers are of the same type, and have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 the same specs. Quit is inhibited during the call so it is safe
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 to call internal_equal().
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 If this function is not present, specifiers considered equal when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 the above conditions are met, i.e. as if the method returned
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 non-zero. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 int (*equal_method) (Lisp_Object sp1, Lisp_Object sp2, int depth);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 /* Hash method: Hash specifier instance data. This has to hash only
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 data structure of the specifier, as specs are hashed by the core
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 If this function is not present, hashing behaves as if it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 returned zero. */
2515
de9952d2ed18 [xemacs-hg @ 2005-01-26 10:22:19 by ben]
ben
parents: 2500
diff changeset
118 Hashcode (*hash_method) (Lisp_Object specifier, int depth);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 /* Validate method: Given an instantiator, verify that it's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 valid for this specifier type. If not, signal an error.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 If this function is not present, all instantiators are considered
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 valid. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 void (*validate_method) (Lisp_Object instantiator);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126
434
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
127
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
128 /* Copy method: Given an instantiator, copy the bits that we need to
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
129 for this specifier type.
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
130
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
131 If this function is not present, then Fcopy_tree is used. */
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
132 Lisp_Object (*copy_instantiator_method) (Lisp_Object instantiator);
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
133
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 /* Validate-matchspec method: Given a matchspec, verify that it's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 valid for this specifier type. If not, signal an error.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 If this function is not present, *no* matchspecs are considered
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 valid. Note that this differs from validate_method(). */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 void (*validate_matchspec_method) (Lisp_Object matchspec);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 /* Instantiate method: Return SPECIFIER instance in DOMAIN,
4430
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
142 specified by INSTANTIATOR. MATCHSPEC specifies additional
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 constraints on the instance value (see the docstring for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 Fspecifier_matching_instance function). MATCHSPEC is passed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 Qunbound when no matching constraints are imposed. The method is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 called via call_with_suspended_errors(), so allowed to eval
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 safely.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 DEPTH is a lisp integer denoting current depth of instantiation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 calls. This parameter should be passed as the initial depth value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 to functions which also instantiate specifiers (of which I can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 name specifier_instance) to avoid creating "external"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 specification loops.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154
4430
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
155 NO_FALLBACK indicates that the method should not try the fallbacks
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
156 (and thus simply return Qunbound) in case of a failure to instantiate.
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
157
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
158 This method must presume that both INSTANTIATOR and MATCHSPEC are
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 already validated by the corresponding validate_* methods, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 may abort if they are invalid.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 Return value is an instance, which is returned immediately to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 caller, or Qunbound to continue instantiation lookup chain.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 If this function is not present, INSTANTIATOR is used as the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 specifier instance. This is the usual case for "simple"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 specifiers, like integer and boolean. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 Lisp_Object (*instantiate_method) (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 Lisp_Object matchspec,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 Lisp_Object domain,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 Lisp_Object instantiator,
4430
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
172 Lisp_Object depth,
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
173 int no_fallback);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 /* Going-to-add method: Called when an instantiator is about
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 to be added to a specifier. This function can specify
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 that different instantiators should be used instead by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 returning an inst-list (possibly containing zero elements).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 If the instantiator is fine as-is, return Qt. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 instantiator has been copied with copy-tree, so feel
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 free to reuse parts of it to create a new instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 The tag-set, however, is not copied and is not canonicalized
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 (that will be done on the result of this function). */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 Lisp_Object (*going_to_add_method) (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 Lisp_Object locale,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 Lisp_Object tag_set,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 Lisp_Object instantiator);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 /* After-change method: Called when the SPECIFIER has just been
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 changed in LOCALE. The method is called upon:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 * Removing and adding specs to/from the specifier;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 * Changing the specifier fallback.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 #### The method may have called more than once per each specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 change.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 #### Do not still know if this can safely eval. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 void (*after_change_method) (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 Lisp_Object locale);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
201 /* Specifier extra data: Specifier objects can have extra data, specific
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
202 to the type of specifier, stored at the end of the object. To have
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
203 this, a specifier declares a structure of type `struct TYPE_specifier'
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
204 containing the data and uses DEFINE_SPECIFIER_TYPE_WITH_DATA and
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
205 INITIALIZE_SPECIFIER_TYPE_WITH_DATA instead of the plain versions.
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
206 Then, a pointer to the `struct TYPE_specifier' can be obtained from a
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
207 specifier object using SPECIFIER_TYPE_DATA.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
208
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
209 A data description of the extra data must also be provided, in the
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
210 form of a memory_description named TYPE_specifier_description. */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
211
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
212 /* Description of extra data structure; initialized when
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
213 INITIALIZE_SPECIFIER_TYPE_WITH_DATA is called. */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
214 const struct sized_memory_description *extra_description;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
215
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
216 /* Size of extra data structure; initialized when
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
217 INITIALIZE_SPECIFIER_TYPE_WITH_DATA is called. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 int extra_data_size;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 struct Lisp_Specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 {
3017
1e7cc382eb16 [xemacs-hg @ 2005-10-24 10:07:26 by ben]
ben
parents: 2720
diff changeset
223 struct LCRECORD_HEADER header;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 struct specifier_methods *methods;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 /* we keep a chained list of all current specifiers, for GC cleanup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 purposes. Do NOT mark through this, or specifiers will never
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 be GC'd. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 Lisp_Object next_specifier;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 /* This is a straight list of instantiators. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 Lisp_Object global_specs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 /* These are all assoc lists where the key is the type of object the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 list represents (buffer, window, etc.) and the associated list is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 the actual list of instantiators. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 Lisp_Object device_specs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 Lisp_Object frame_specs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 /* window_specs is actually a key-assoc weak list. See specifier.c
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 for an explanation of why (it boils down to the fact that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 dead windows can become live again through window configurations).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 Lisp_Object window_specs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 Lisp_Object buffer_specs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 struct specifier_caching *caching;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 /* This can be either nil, for a plain, non-magic specifier object,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 t for the normal part of the magic specifier, or #<specifier> for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 the ghost part of the magic specifier, a pointer to its parent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 object */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 Lisp_Object magic_parent;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 /* Fallback value. For magic specifiers, it is a pointer to the ghost. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 Lisp_Object fallback;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 /* type-specific extra data attached to a specifier */
456
e7ef97881643 Import from CVS: tag r21-2-43
cvs
parents: 452
diff changeset
258 max_align_t data[1];
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 };
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
260 typedef struct Lisp_Specifier Lisp_Specifier;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261
5118
e0db3c197671 merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents: 4430
diff changeset
262 DECLARE_LISP_OBJECT (specifier, Lisp_Specifier);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
263 #define XSPECIFIER(x) XRECORD (x, specifier, Lisp_Specifier)
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 456
diff changeset
264 #define wrap_specifier(p) wrap_record (p, specifier)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 #define SPECIFIERP(x) RECORDP (x, specifier)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 #define CHECK_SPECIFIER(x) CHECK_RECORD (x, specifier)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 #define CONCHECK_SPECIFIER(x) CONCHECK_RECORD (x, specifier)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 /***** Calling a specifier method *****/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 #define RAW_SPECMETH(sp, m) ((sp)->methods->m##_method)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 #define HAS_SPECMETH_P(sp, m) (!!RAW_SPECMETH (sp, m))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 #define SPECMETH(sp, m, args) (((sp)->methods->m##_method) args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 /* Call a void-returning specifier method, if it exists. */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
276 #define MAYBE_SPECMETH(sp, m, args) do { \
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
277 Lisp_Specifier *maybe_specmeth_sp = (sp); \
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
278 if (HAS_SPECMETH_P (maybe_specmeth_sp, m)) \
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
279 SPECMETH (maybe_specmeth_sp, m, args); \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 /***** Defining new specifier types *****/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
284 extern const struct sized_memory_description specifier_empty_extra_description;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
286 #ifdef ERROR_CHECK_TYPES
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 #define DECLARE_SPECIFIER_TYPE(type) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 extern struct specifier_methods * type##_specifier_methods; \
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
289 DECLARE_INLINE_HEADER ( \
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
290 struct type##_specifier * \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
291 error_check_##type##_specifier_data (Lisp_Specifier *sp) \
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
292 ) \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 if (SPECIFIERP (sp->magic_parent)) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 assert (SPECIFIER_TYPE_P (sp, type)); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 sp = XSPECIFIER (sp->magic_parent); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 else \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 assert (NILP (sp->magic_parent) || EQ (sp->magic_parent, Qt)); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 assert (SPECIFIER_TYPE_P (sp, type)); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 return (struct type##_specifier *) sp->data; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 } \
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
304 DECLARE_INLINE_HEADER ( \
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
305 Lisp_Specifier * \
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
306 error_check_##type##_specifier_type (Lisp_Object obj) \
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
307 ) \
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
308 { \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
309 Lisp_Specifier *sp = XSPECIFIER (obj); \
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
310 assert (SPECIFIER_TYPE_P (sp, type)); \
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
311 return sp; \
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
312 } \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 DECLARE_NOTHING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 #else
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
315 #define DECLARE_SPECIFIER_TYPE(type) \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 extern struct specifier_methods * type##_specifier_methods
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
317 #endif /* ERROR_CHECK_TYPES */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
319 #define DEFINE_SPECIFIER_TYPE(type) \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 struct specifier_methods * type##_specifier_methods
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
322 #define DEFINE_SPECIFIER_TYPE_WITH_DATA(type) \
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
323 struct specifier_methods * type##_specifier_methods; \
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
324 static const struct sized_memory_description type##_specifier_description_0 \
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
325 = { \
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
326 sizeof (struct type##_specifier), \
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
327 type##_specifier_description \
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
328 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
329
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
330 #define INITIALIZE_SPECIFIER_TYPE(type, obj_name, pred_sym) do { \
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
331 type##_specifier_methods = xnew_and_zero (struct specifier_methods); \
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
332 type##_specifier_methods->name = obj_name; \
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
333 type##_specifier_methods->extra_description = \
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
334 &specifier_empty_extra_description; \
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
335 defsymbol_nodump (&type##_specifier_methods->predicate_symbol, pred_sym); \
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
336 add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 1204
diff changeset
337 dump_add_root_block_ptr (&type##_specifier_methods, \
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 617
diff changeset
338 &specifier_methods_description); \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
341 #define REINITIALIZE_SPECIFIER_TYPE(type) do { \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 staticpro_nodump (&type##_specifier_methods->predicate_symbol); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 #define INITIALIZE_SPECIFIER_TYPE_WITH_DATA(type, obj_name, pred_sym) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 type##_specifier_methods->extra_data_size = \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 sizeof (struct type##_specifier); \
4430
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
350 type##_specifier_methods->extra_description = \
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 826
diff changeset
351 &type##_specifier_description_0; \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 /* Declare that specifier-type TYPE has method METH; used in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 initialization routines */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 #define SPECIFIER_HAS_METHOD(type, meth) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 (type##_specifier_methods->meth##_method = type##_##meth)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 /***** Macros for accessing specifier types *****/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 #define SPECIFIER_TYPE_P(sp, type) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 ((sp)->methods == type##_specifier_methods)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 /* Any of the two of the magic spec */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 #define MAGIC_SPECIFIER_P(sp) (!NILP((sp)->magic_parent))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 /* Normal part of the magic specifier */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 #define BODILY_SPECIFIER_P(sp) EQ ((sp)->magic_parent, Qt)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 /* Ghost part of the magic specifier */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 #define GHOST_SPECIFIER_P(sp) SPECIFIERP((sp)->magic_parent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 #define GHOST_SPECIFIER(sp) XSPECIFIER ((sp)->fallback)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
373 #ifdef ERROR_CHECK_TYPES
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 # define SPECIFIER_TYPE_DATA(sp, type) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 error_check_##type##_specifier_data (sp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 # define SPECIFIER_TYPE_DATA(sp, type) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 ((struct type##_specifier *) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 (GHOST_SPECIFIER_P(sp) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 ? XSPECIFIER((sp)->magic_parent)->data \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 : (sp)->data))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
384 #ifdef ERROR_CHECK_TYPES
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
385 # define XSPECIFIER_TYPE(x, type) \
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
386 error_check_##type##_specifier_type (x)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
387 #else
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
388 # define XSPECIFIER_TYPE(x, type) XSPECIFIER (x)
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
389 #endif /* ERROR_CHECK_TYPES */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
391 #define SPECIFIER_TYPEP(x, type) \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 (SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), type))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 #define CHECK_SPECIFIER_TYPE(x, type) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 CHECK_SPECIFIER (x); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 if (!SPECIFIER_TYPE_P (XSPECIFIER (x), type)) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 dead_wrong_type_argument \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 (type##_specifier_methods->predicate_symbol, x); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 #define CONCHECK_SPECIFIER_TYPE(x, type) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 CONCHECK_SPECIFIER (x); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 if (!(SPECIFIER_TYPEP (x, type))) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 x = wrong_type_argument \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 (type##_specifier_methods->predicate_symbol, x); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 /***** Miscellaneous structures *****/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 enum spec_locale_type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 LOCALE_GLOBAL,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 LOCALE_DEVICE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 LOCALE_FRAME,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 LOCALE_WINDOW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 LOCALE_BUFFER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 enum spec_add_meth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 SPEC_PREPEND,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 SPEC_APPEND,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 SPEC_REMOVE_TAG_SET_PREPEND,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 SPEC_REMOVE_TAG_SET_APPEND,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 SPEC_REMOVE_LOCALE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 SPEC_REMOVE_LOCALE_TYPE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 SPEC_REMOVE_ALL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 struct specifier_caching
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 {
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
430 #ifdef NEW_GC
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
431 struct lrecord_header header;
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
432 #endif /* NEW_GC */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 int offset_into_struct_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 void (*value_changed_in_window) (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 Lisp_Object oldval);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 int offset_into_struct_frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 void (*value_changed_in_frame) (Lisp_Object specifier, struct frame *f,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 Lisp_Object oldval);
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
439 int always_recompute;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
442 #ifdef NEW_GC
5118
e0db3c197671 merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents: 4430
diff changeset
443 DECLARE_LISP_OBJECT (specifier_caching, struct specifier_caching);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
444 #define XSPECIFIER_CACHING(x) \
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
445 XRECORD (x, specifier_caching, struct specifier_caching)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
446 #define wrap_specifier_caching(p) \
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
447 wrap_record (p, specifier_caching)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
448 #define SPECIFIER_CACHINGP(x) RECORDP (x, specifier_caching)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
449 #define CHECK_SPECIFIER_CACHING(x) \
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
450 CHECK_RECORD (x, specifier_caching)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
451 #define CONCHECK_SPECIFIER_CACHING(x) \
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
452 CONCHECK_RECORD (x, specifier_caching)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
453 #endif /* NEW_GC */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3017
diff changeset
454
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
455 /* #### get image instances out of domains! */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
456
2500
3d8143fc88e1 [xemacs-hg @ 2005-01-24 23:33:30 by ben]
ben
parents: 2367
diff changeset
457 /* #### I think the following should ABORT() rather than return nil
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
458 when an invalid domain is given; much more likely we'll catch design
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
459 errors early. --ben */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
460
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
461 /* This turns out to be used heavily so we make it a macro to make it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
462 inline. Also, the majority of the time the object will turn out to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
463 be a window so we move it from being checked last to being checked
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
464 first. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
465 #define DOMAIN_DEVICE(obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
466 (WINDOWP (obj) ? WINDOW_DEVICE (XWINDOW (obj)) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
467 : (FRAMEP (obj) ? FRAME_DEVICE (XFRAME (obj)) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
468 : (DEVICEP (obj) ? obj \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
469 : (IMAGE_INSTANCEP (obj) ? image_instance_device (obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
470 : Qnil))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
471
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
472 #define DOMAIN_FRAME(obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
473 (WINDOWP (obj) ? WINDOW_FRAME (XWINDOW (obj)) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
474 : (FRAMEP (obj) ? obj \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
475 : (IMAGE_INSTANCEP (obj) ? image_instance_frame (obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
476 : Qnil)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
477
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
478 #define DOMAIN_WINDOW(obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
479 (WINDOWP (obj) ? obj \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
480 : (IMAGE_INSTANCEP (obj) ? image_instance_window (obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
481 : Qnil))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
482
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
483 #define DOMAIN_LIVE_P(obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
484 (WINDOWP (obj) ? WINDOW_LIVE_P (XWINDOW (obj)) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
485 : (FRAMEP (obj) ? FRAME_LIVE_P (XFRAME (obj)) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
486 : (DEVICEP (obj) ? DEVICE_LIVE_P (XDEVICE (obj)) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
487 : (IMAGE_INSTANCEP (obj) ? image_instance_live_p (obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
488 : 0))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
489
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
490 #define DOMAIN_XDEVICE(obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
491 (XDEVICE (DOMAIN_DEVICE (obj)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
492 #define DOMAIN_XFRAME(obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
493 (XFRAME (DOMAIN_FRAME (obj)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
494 #define DOMAIN_XWINDOW(obj) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
495 (XWINDOW (DOMAIN_WINDOW (obj)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
496
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 EXFUN (Fcopy_specifier, 6);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 EXFUN (Fmake_specifier, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 EXFUN (Fset_specifier_dirty_flag, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 EXFUN (Fspecifier_instance, 4);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 EXFUN (Fvalid_specifier_locale_p, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 extern Lisp_Object Qfallback, Qnatnum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 Lisp_Object make_magic_specifier (Lisp_Object type);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 Lisp_Object decode_locale_list (Lisp_Object locale);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 extern enum spec_add_meth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 decode_how_to_add_specification (Lisp_Object how_to_add);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 Lisp_Object decode_specifier_tag_set (Lisp_Object tag_set);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
510 Lisp_Object decode_domain (Lisp_Object domain);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 void add_entry_to_specifier_type_list (Lisp_Object symbol,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 struct specifier_methods *meths);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 void set_specifier_caching (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 int struct_window_offset,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 void (*value_changed_in_window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 Lisp_Object oldval),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 int struct_frame_offset,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 void (*value_changed_in_frame)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 (Lisp_Object specifier, struct frame *f,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
522 Lisp_Object oldval),
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
523 int always_recompute);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 void set_specifier_fallback (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 Lisp_Object fallback);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 void recompute_all_cached_specifiers_in_window (struct window *w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 void recompute_all_cached_specifiers_in_frame (struct frame *f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 /* Counterparts of Fadd_spec_to_specifier and Fremove_specifier, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 operate directly on ghost objects given a magic specifier. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 void add_spec_to_ghost_specifier (Lisp_Object specifier, Lisp_Object instantiator,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 Lisp_Object locale, Lisp_Object tag_set,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 Lisp_Object how_to_add);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 void remove_ghost_specifier (Lisp_Object specifier, Lisp_Object locale,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 Lisp_Object tag_set, Lisp_Object exact_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 int unlock_ghost_specifiers_protected (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 void cleanup_specifiers (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 void prune_specifiers (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 void setup_device_initial_specifier_tags (struct device *d);
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
542 void setup_charset_initial_specifier_tags (Lisp_Object charset);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 void kill_specifier_buffer_locals (Lisp_Object buffer);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 DECLARE_SPECIFIER_TYPE (generic);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 #define XGENERIC_SPECIFIER(x) XSPECIFIER_TYPE (x, generic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 #define GENERIC_SPECIFIERP(x) SPECIFIER_TYPEP (x, generic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 #define CHECK_GENERIC_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, generic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 #define CONCHECK_GENERIC_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, generic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 DECLARE_SPECIFIER_TYPE (integer);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 #define XINTEGER_SPECIFIER(x) XSPECIFIER_TYPE (x, integer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 #define INTEGER_SPECIFIERP(x) SPECIFIER_TYPEP (x, integer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 #define CHECK_INTEGER_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, integer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 #define CONCHECK_INTEGER_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, integer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 DECLARE_SPECIFIER_TYPE (natnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 #define XNATNUM_SPECIFIER(x) XSPECIFIER_TYPE (x, natnum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 #define NATNUM_SPECIFIERP(x) SPECIFIER_TYPEP (x, natnum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 #define CHECK_NATNUM_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, natnum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 #define CONCHECK_NATNUM_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, natnum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 DECLARE_SPECIFIER_TYPE (boolean);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 #define XBOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, boolean)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 #define BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, boolean)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 #define CHECK_BOOLEAN_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, boolean)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 #define CONCHECK_BOOLEAN_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, boolean)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 DECLARE_SPECIFIER_TYPE (display_table);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 #define XDISPLAYTABLE_SPECIFIER(x) XSPECIFIER_TYPE (x, display_table)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 #define DISPLAYTABLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, display_table)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 #define CHECK_DISPLAYTABLE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, display_table)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 #define CONCHECK_DISPLAYTABLE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, display_table)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
575 /* The various stages of font instantiation; initial means "find a font for
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
576 CHARSET that matches the charset's registries" and final means "find a
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
577 font for CHARSET that matches iso10646-1, since we haven't found a font
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
578 that matches its registry." */
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
579 enum font_specifier_matchspec_stages {
4430
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
580 initial,
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
581 final,
4430
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
582 impossible,
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
583 };
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
584
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
585 Lisp_Object define_specifier_tag(Lisp_Object tag,
4430
d00347ec8289 Fix instantiate_method prototype
Didier Verna <didier@xemacs.org>
parents: 3659
diff changeset
586 Lisp_Object device_predicate,
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
587 Lisp_Object charset_predicate);
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3092
diff changeset
588
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
589 #endif /* INCLUDED_specifier_h_ */