annotate src/specifier.h @ 298:70ad99077275 r21-0b47

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