annotate src/specifier.h @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents c5d627a313b1
children 7df0dd720c89
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 /* Generic specifier list implementation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995 Ben Wing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 later version.
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 distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #ifndef _XEMACS_SPECIFIER_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #define _XEMACS_SPECIFIER_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
27 /*
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
28 MAGIC SPECIFIERS
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
29 ================
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
30
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
31 Magic specifiers are used to provide fallback values for window
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
32 system provided specifications, reflecting user preferences on the
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
33 window system, such as default fonts, colors, scrollbar thickness
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
34 etc.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
35
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
36 A magic specifier consists of two specifier objects. The first one
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
37 behaves like a normal specifier in all sences. The second one, a
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
38 ghost specifier, is a fallback value for the first one.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
39
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
40 Ghost specifiers have the following properties:
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
41 - Have back pointers to their parent specifiers.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
42 - Do not have instance data. Instead, they share parent's instance
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
43 data.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
44 - Have the same methods structure pointer.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
45 - Share parent's caching scheme.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
46 - Store fallback value instead of their parent.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
47
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
48 Ghost specifiers normally are not modifiable at the lisp level, and
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
49 only used to supply fallback instance values. Although, under
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
50 certain rare conditions, all functions that modify specifiers
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
51 operate on ghost objects. This behavior is controlled by the global
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
52 variable Vreveal_ghoste_specifiers. It is not exposed to lisp, and
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
53 is set during calls to lisp functions which initialize global,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
54 device and frame defaults, such as
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
55 init-{global,frame,device}-{faces,toolbars,etc}.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
56
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
57 Thus, values supplied by resources or other means of a window system
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
58 stored in externally unmodifiable ghost objects. Regular lisp code
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
59 may thus freely modify the normal part of a magic specifier, and
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
60 removing a specification for a particular domain causes the
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
61 specification to consider ghost-provided fallback values, or its own
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
62 fallback value.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
63
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
64 Rules of conduct for magic specifiers
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
65 -------------------------------------
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
66 1. All functions exposed to lisp operate on a ghost specifier when
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
67 Vreveal_ghoste_specifiers is non-nil. This includes both
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
68 modifying and non-modifying functions, such as
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
69 Fspecifier_instance, for symmetry and consistency.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
70 2. These functions deal with the above condition internally, passing
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
71 mangled specifier pointer to internal functions. The internal
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
72 functions always work on a specifier passed, and do not regard
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
73 the value of Vreveal_ghoste_specifiers.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
74 3. recompute_*() functions always operate on the whole specifier
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
75 when passed only a ghost object, by substituting it with their
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
76 parent bodily object.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
77 4. All specifier methods, except for instantiate method, are passed
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
78 the bodily object of the magic specifier. Instantiate method is
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
79 passed the specifier being instantiated.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
80 5. Only bodily objects are passed to set_specifier_caching function,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
81 and only these may be cached.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
82 6. All specifiers are added to Vall_specifiers list, both bodily and
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
83 ghost. The pair of objects is always removed from the list at the
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
84 same time.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
85 */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
86
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 struct specifier_methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 CONST char *name;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 Lisp_Object predicate_symbol;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 /* Implementation specific methods: */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
94 /* Create method: Initialize specifier data. Optional. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 void (*create_method) (Lisp_Object specifier);
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
96
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
97 /* Mark method: Mark any lisp object within specifier data
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
98 structure. Not required if no specifier data are Lisp_Objects. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 void (*mark_method) (Lisp_Object specifier, void (*markobj) (Lisp_Object));
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
100
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
101 /* Equal method: Compare two specifiers. This is called after
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
102 ensuring that the two specifiers are of the same type, and habe
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
103 the same specs. Quit is inhibited during the call so it is safe
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
104 to call internal_equal().
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
105
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
106 If this function is not present, specifiers considered equal when
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
107 the above conditions are met, i.e. as if the method returned
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
108 non-zero. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 int (*equal_method) (Lisp_Object sp1, Lisp_Object sp2, int depth);
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
110
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
111 /* Hash method: Hash specifier instance data. This has to hash only
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
112 data structure of the specifier, as specs are hashed by the core
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
113 code.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
114
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
115 If this function is not present, hashing behaves as if it
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
116 returned zero. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 unsigned long (*hash_method) (Lisp_Object specifier, int depth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 /* Validate method: Given an instantiator, verify that it's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 valid for this specifier type. If not, signal an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
122 If this function is not present, all instantiators are considered
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
123 valid. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 void (*validate_method) (Lisp_Object instantiator);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 /* Validate-matchspec method: Given a matchspec, verify that it's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 valid for this specifier type. If not, signal an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
129 If this function is not present, *no* matchspecs are considered
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 valid. Note that this differs from validate_method(). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 void (*validate_matchspec_method) (Lisp_Object matchspec);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
133 /* Instantiate method: Return SPECIFIER instance in DOMAIN,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
134 specified by INSTANTIATOR. MATCHSPEC specifies an additional
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
135 constraints on the instance value (see the docstring for
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
136 Fspecifier_matching_instance function). MATCHSPEC is passed
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
137 Qunbound when no matching constraints are imposed. The method is
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
138 called via call_with_suspended_errors(), so allowed to eval
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
139 safely.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
140
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
141 DEPTH is a lisp integer denoting current depth of instantiation
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
142 calls. #### WTF a method can do with this?
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
143
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
144 This method must presume that both INSTANTIATOR and MATCSPEC are
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
145 already validated by the corresponding validate_* methods, and
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
146 may abort if they are invalid.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
147
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
148 Return value is an instance, which is returned immediately to the
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
149 caller, or Qunbound to continue instantiation lookup chain.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
150
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
151 If this function is not present, INSTANTIATOR is used as the
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
152 specifier instance. This is the usual case for "simple"
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
153 specifiers, like integer and boolean. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 Lisp_Object (*instantiate_method) (Lisp_Object specifier,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 Lisp_Object matchspec,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 Lisp_Object domain,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 Lisp_Object instantiator,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 Lisp_Object depth);
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
159
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 /* Going-to-add method: Called when an instantiator is about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 to be added to a specifier. This function can specify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 that different instantiators should be used instead by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 returning an inst-list (possibly containing zero elements).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 If the instantiator is fine as-is, return Qt. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 instantiator has been copied with copy-tree, so feel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 free to reuse parts of it to create a new instantiator.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 The tag-set, however, is not copied and is not canonicalized
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
168 (that will be done on the result of this function). */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 Lisp_Object (*going_to_add_method) (Lisp_Object specifier,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 Lisp_Object locale,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 Lisp_Object tag_set,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 Lisp_Object instantiator);
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
173
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
174 /* After-change method: Called when the SPECIFIER has just been
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
175 changed in LOCALE. The method is called upon:
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
176 * Removing and adding specs to/from the specifier;
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
177 * Changing the specifier fallback.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
178
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
179 #### The method may have called more than once per each specifier
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
180 change.
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
181
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
182 #### Do not still know if this can safely eval. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 void (*after_change_method) (Lisp_Object specifier,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 Lisp_Object locale);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 int extra_data_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 struct Lisp_Specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 struct lcrecord_header header;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 struct specifier_methods *methods;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 /* we keep a chained list of all current specifiers, for GC cleanup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 purposes. Do NOT mark through this, or specifiers will never
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 be GC'd. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 Lisp_Object next_specifier;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 /* This is a straight list of instantiators. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 Lisp_Object global_specs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
202 /* These are all assoc lists where the key is the type of object the
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 list represents (buffer, window, etc.) and the associated list is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 the actual list of instantiators. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 Lisp_Object device_specs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 Lisp_Object frame_specs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 /* window_specs is actually a key-assoc weak list. See specifier.c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 for an explanation of why (it boils down to the fact that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 dead windows can become live again through window configurations).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 Lisp_Object window_specs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 Lisp_Object buffer_specs;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 struct specifier_caching *caching;
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
215
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
216 /* This can be either nil, for a plain, non-magic specifier object,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
217 t for the normal part of the magic specifier, or #<specifier> for
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
218 the ghost part of the magic specifier, a pointer to its parent
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
219 object */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
220 Lisp_Object magic_parent;
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
221
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
222 /* Fallback value. For magic specifiers, it is a pointer to the ghost. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 Lisp_Object fallback;
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
224
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 /* type-specific extra data attached to a specifier */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 char data[1];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 DECLARE_LRECORD (specifier, struct Lisp_Specifier);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 #define XSPECIFIER(x) XRECORD (x, specifier, struct Lisp_Specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 #define XSETSPECIFIER(x, p) XSETRECORD (x, p, specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 #define SPECIFIERP(x) RECORDP (x, specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 #define GC_SPECIFIERP(x) GC_RECORDP (x, specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 #define CHECK_SPECIFIER(x) CHECK_RECORD (x, specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 #define CONCHECK_SPECIFIER(x) CONCHECK_RECORD (x, specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 /***** Calling a specifier method *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 #define RAW_SPECMETH(sp, m) ((sp)->methods->m##_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 #define HAS_SPECMETH_P(sp, m) (!!RAW_SPECMETH (sp, m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 #define SPECMETH(sp, m, args) (((sp)->methods->m##_method) args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
243 /* Call a void-returning specifier method, if it exists. */
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
244 #define MAYBE_SPECMETH(sp, m, args) do { \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
245 struct Lisp_Specifier *_maybe_specmeth_sp = (sp); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
246 if (HAS_SPECMETH_P (_maybe_specmeth_sp, m)) \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
247 SPECMETH (_maybe_specmeth_sp, m, args); \
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 /***** Defining new specifier types *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
252 #ifdef ERROR_CHECK_TYPECHECK
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
253 #define DECLARE_SPECIFIER_TYPE(type) \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
254 extern struct specifier_methods * type##_specifier_methods; \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
255 INLINE struct type##_specifier * \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
256 error_check_##type##_specifier_data (struct Lisp_Specifier *sp); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
257 INLINE struct type##_specifier * \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
258 error_check_##type##_specifier_data (struct Lisp_Specifier *sp) \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
259 { \
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
260 if (SPECIFIERP (sp->magic_parent)) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
261 { \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
262 assert (SPECIFIER_TYPE_P (sp, type)); \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
263 sp = XSPECIFIER (sp->magic_parent); \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
264 } \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
265 else \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
266 assert (NILP (sp->magic_parent) || EQ (sp->magic_parent, Qt)); \
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
267 assert (SPECIFIER_TYPE_P (sp, type)); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
268 return (struct type##_specifier *) sp->data; \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
269 } \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
270 DECLARE_NOTHING
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
271 #else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
272 #define DECLARE_SPECIFIER_TYPE(type) \
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 extern struct specifier_methods * type##_specifier_methods
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
274 #endif /* ERROR_CHECK_TYPECHECK */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
276 #define DEFINE_SPECIFIER_TYPE(type) \
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 struct specifier_methods * type##_specifier_methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
279 #define INITIALIZE_SPECIFIER_TYPE(type, obj_name, pred_sym) do { \
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
280 type##_specifier_methods = xnew_and_zero (struct specifier_methods); \
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
281 type##_specifier_methods->name = obj_name; \
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
282 defsymbol (&type##_specifier_methods->predicate_symbol, pred_sym); \
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
283 add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
284 } while (0)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 #define INITIALIZE_SPECIFIER_TYPE_WITH_DATA(type, obj_name, pred_sym) \
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
287 do { \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
288 INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
289 type##_specifier_methods->extra_data_size = \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
290 sizeof (struct type##_specifier); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
291 } while (0)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
293 /* Declare that specifier-type TYPE has method METH; used in
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 initialization routines */
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
295 #define SPECIFIER_HAS_METHOD(type, meth) \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
296 (type##_specifier_methods->meth##_method = type##_##meth)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 /***** Macros for accessing specifier types *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
300 #define SPECIFIER_TYPE_P(sp, type) \
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ((sp)->methods == type##_specifier_methods)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
303 /* Any of the two of the magic spec */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
304 #define MAGIC_SPECIFIER_P(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
305 (!NILP((sp)->magic_parent))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
306 /* Normal part of the magic specifier */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
307 #define BODILY_SPECIFIER_P(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
308 (EQ ((sp)->magic_parent, Qt))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
309 /* Ghost part of the magic specifier */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
310 #define GHOST_SPECIFIER_P(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
311 (SPECIFIERP((sp)->magic_parent))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
312 /* The same three, when used in GC */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
313 #define GC_MAGIC_SPECIFIER_P(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
314 (!GC_NILP((sp)->magic_parent))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
315 #define GC_BODILY_SPECIFIER_P(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
316 (GC_EQ ((sp)->magic_parent, Qt))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
317 #define GC_GHOST_SPECIFIER_P(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
318 (GC_SPECIFIERP((sp)->magic_parent))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
319
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
320 #define GHOST_SPECIFIER(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
321 (XSPECIFIER ((sp)->fallback))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
322
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 #ifdef ERROR_CHECK_TYPECHECK
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
324 # define SPECIFIER_TYPE_DATA(sp, type) \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
325 error_check_##type##_specifier_data (sp)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 #else
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
327 # define SPECIFIER_TYPE_DATA(sp, type) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
328 ((struct type##_specifier *) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
329 (GHOST_SPECIFIER_P(sp) \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
330 ? XSPECIFIER((sp)->magic_parent)->data \
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
331 : (sp)->data))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 /* #### Need to create ERROR_CHECKING versions of these. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 #define XSPECIFIER_TYPE(x, type) XSPECIFIER (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 #define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 #define SPECIFIER_TYPEP(x, type) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), type))
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
340 #define CHECK_SPECIFIER_TYPE(x, type) do { \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
341 CHECK_SPECIFIER (x); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
342 if (!SPECIFIER_TYPE_P (XSPECIFIER (x), type)) \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
343 dead_wrong_type_argument \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
344 (type##_specifier_methods->predicate_symbol, x); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
345 } while (0)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
346 #define CONCHECK_SPECIFIER_TYPE(x, type) do { \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
347 CONCHECK_SPECIFIER (x); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
348 if (!(SPECIFIER_TYPEP (x, type))) \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
349 x = wrong_type_argument \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
350 (type##_specifier_methods->predicate_symbol, x); \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
351 } while (0)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 /***** Miscellaneous structures *****/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 enum spec_locale_type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 LOCALE_GLOBAL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 LOCALE_DEVICE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 LOCALE_FRAME,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 LOCALE_WINDOW,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 LOCALE_BUFFER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 enum spec_add_meth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 SPEC_PREPEND,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 SPEC_APPEND,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 SPEC_REMOVE_TAG_SET_PREPEND,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 SPEC_REMOVE_TAG_SET_APPEND,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 SPEC_REMOVE_LOCALE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 SPEC_REMOVE_LOCALE_TYPE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 SPEC_REMOVE_ALL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 struct specifier_caching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 int offset_into_struct_window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 void (*value_changed_in_window) (Lisp_Object specifier, struct window *w,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 Lisp_Object oldval);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 int offset_into_struct_frame;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 void (*value_changed_in_frame) (Lisp_Object specifier, struct frame *f,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 Lisp_Object oldval);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
385 EXFUN (Fcopy_specifier, 6);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
386 EXFUN (Fmake_specifier, 1);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
387 EXFUN (Fset_specifier_dirty_flag, 1);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
388 EXFUN (Fspecifier_instance, 4);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
389 EXFUN (Fvalid_specifier_locale_p, 1);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
390
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
391 extern Lisp_Object Qfallback, Qnatnum;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
392
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
393 Lisp_Object make_magic_specifier (Lisp_Object type);
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
394 Lisp_Object decode_locale_list (Lisp_Object locale);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 extern enum spec_add_meth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 decode_how_to_add_specification (Lisp_Object how_to_add);
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
397 Lisp_Object decode_specifier_tag_set (Lisp_Object tag_set);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
399 void add_entry_to_specifier_type_list (Lisp_Object symbol,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
400 struct specifier_methods *meths);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
401 void set_specifier_caching (Lisp_Object specifier,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
402 int struct_window_offset,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
403 void (*value_changed_in_window)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
404 (Lisp_Object specifier, struct window *w,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
405 Lisp_Object oldval),
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
406 int struct_frame_offset,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
407 void (*value_changed_in_frame)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
408 (Lisp_Object specifier, struct frame *f,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
409 Lisp_Object oldval));
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
410 void set_specifier_fallback (Lisp_Object specifier,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
411 Lisp_Object fallback);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
412 void recompute_all_cached_specifiers_in_window (struct window *w);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
413 void recompute_all_cached_specifiers_in_frame (struct frame *f);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
415 /* Counterparts of Fadd_spec_to_specifier and Fremove_specifier,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
416 which operate directly on ghost objects */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
417 void add_spec_to_ghost_specifier (Lisp_Object specifier, Lisp_Object instantiator,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
418 Lisp_Object locale, Lisp_Object tag_set,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
419 Lisp_Object how_to_add);
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
420 void remove_ghost_specifier (Lisp_Object specifier, Lisp_Object locale,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
421 Lisp_Object tag_set, Lisp_Object exact_p);
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
422
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
423 int reveal_ghost_specifiers_protected (void);
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
424
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
425 void cleanup_specifiers (void);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
426 void prune_specifiers (int (*obj_marked_p) (Lisp_Object));
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 185
diff changeset
427 void setup_device_initial_specifier_tags (struct device *d);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 void kill_specifier_buffer_locals (Lisp_Object buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 DECLARE_SPECIFIER_TYPE (generic);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 #define XGENERIC_SPECIFIER(x) XSPECIFIER_TYPE (x, generic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 #define XSETGENERIC_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, generic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 #define GENERIC_SPECIFIERP(x) SPECIFIER_TYPEP (x, generic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 #define CHECK_GENERIC_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, generic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 #define CONCHECK_GENERIC_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, generic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 DECLARE_SPECIFIER_TYPE (integer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 #define XINTEGER_SPECIFIER(x) XSPECIFIER_TYPE (x, integer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 #define XSETINTEGER_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, integer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 #define INTEGER_SPECIFIERP(x) SPECIFIER_TYPEP (x, integer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 #define CHECK_INTEGER_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, integer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 #define CONCHECK_INTEGER_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, integer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 DECLARE_SPECIFIER_TYPE (natnum);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 #define XNATNUM_SPECIFIER(x) XSPECIFIER_TYPE (x, natnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 #define XSETNATNUM_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, natnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 #define NATNUM_SPECIFIERP(x) SPECIFIER_TYPEP (x, natnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 #define CHECK_NATNUM_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, natnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 #define CONCHECK_NATNUM_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, natnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 DECLARE_SPECIFIER_TYPE (boolean);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 #define XBOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, boolean)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 #define XSETBOOLEAN_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, boolean)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 #define BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, boolean)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 #define CHECK_BOOLEAN_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, boolean)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 #define CONCHECK_BOOLEAN_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, boolean)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 0
diff changeset
458 DECLARE_SPECIFIER_TYPE (display_table);
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 0
diff changeset
459 #define XDISPLAYTABLE_SPECIFIER(x) XSPECIFIER_TYPE (x, display_table)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 0
diff changeset
460 #define XSETDISPLAYTABLE_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, display_table)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 0
diff changeset
461 #define DISPLAYTABLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, display_table)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 0
diff changeset
462 #define CHECK_DISPLAYTABLE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, display_table)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 0
diff changeset
463 #define CONCHECK_DISPLAYTABLE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, display_table)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 0
diff changeset
464
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 #endif /* _XEMACS_SPECIFIER_H_ */