Mercurial > hg > xemacs-beta
annotate src/glyphs.h @ 5887:6eca500211f4
Prototype for X509_check_host() has changed, detect this in configure.ac
ChangeLog addition:
2015-04-09 Aidan Kehoe <kehoea@parhasard.net>
* configure.ac:
If X509_check_host() is available, check the number of arguments
it takes. Don't use it if it takes any number of arguments other
than five. Also don't use it if <openssl/x509v3.h> does not
declare it, since if that is so there is no portable way to tell
how many arguments it should take, and so we would end up smashing
the stack.
* configure: Regenerate.
src/ChangeLog addition:
2015-04-09 Aidan Kehoe <kehoea@parhasard.net>
* tls.c:
#include <openssl/x509v3.h> for its prototype for
X509_check_host().
* tls.c (tls_open):
Pass the new fifth argument to X509_check_host().
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 09 Apr 2015 14:27:02 +0100 |
parents | 308d34e9f07d |
children |
rev | line source |
---|---|
800 | 1 /* Generic glyph data structures + display tables |
428 | 2 Copyright (C) 1994 Board of Trustees, University of Illinois. |
826 | 3 Copyright (C) 1995, 1996, 2002 Ben Wing |
428 | 4 |
5 This file is part of XEmacs. | |
6 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5222
diff
changeset
|
7 XEmacs is free software: you can redistribute it and/or modify it |
428 | 8 under the terms of the GNU General Public License as published by the |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5222
diff
changeset
|
9 Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5222
diff
changeset
|
10 option) any later version. |
428 | 11 |
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5222
diff
changeset
|
18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
428 | 19 |
20 /* Synched up with: Not in FSF. */ | |
21 | |
440 | 22 #ifndef INCLUDED_glyphs_h_ |
23 #define INCLUDED_glyphs_h_ | |
428 | 24 |
25 #include "specifier.h" | |
872 | 26 #include "window-impl.h" /* need for GLYPH_CACHEL_WIDTH */ |
428 | 27 |
28 /************************************************************************/ | |
29 /* Image Instantiators */ | |
30 /************************************************************************/ | |
31 | |
32 struct image_instantiator_methods; | |
33 | |
34 /* Remember the distinction between image instantiator formats and | |
35 image instance types. Here's an approximate mapping: | |
36 | |
37 image instantiator format image instance type | |
38 ------------------------- ------------------- | |
39 nothing nothing | |
40 string text | |
41 formatted-string text | |
42 xbm mono-pixmap, color-pixmap, pointer | |
43 xpm color-pixmap, mono-pixmap, pointer | |
44 xface mono-pixmap, color-pixmap, pointer | |
45 gif color-pixmap | |
46 jpeg color-pixmap | |
47 png color-pixmap | |
48 tiff color-pixmap | |
49 bmp color-pixmap | |
50 cursor-font pointer | |
442 | 51 mswindows-resource pointer, color-pixmap |
428 | 52 font pointer |
53 subwindow subwindow | |
54 inherit mono-pixmap | |
55 autodetect mono-pixmap, color-pixmap, pointer, text | |
440 | 56 button widget |
428 | 57 edit-field widget |
442 | 58 combo-box widget |
428 | 59 progress-gauge widget |
60 tab-control widget | |
61 tree-view widget | |
62 scrollbar widget | |
442 | 63 label widget |
64 layout widget | |
65 native-layout widget | |
428 | 66 */ |
67 | |
68 /* These are methods specific to a particular format of image instantiator | |
69 (e.g. xpm, string, etc.). */ | |
70 | |
71 typedef struct ii_keyword_entry ii_keyword_entry; | |
72 struct ii_keyword_entry | |
73 { | |
74 Lisp_Object keyword; | |
75 void (*validate) (Lisp_Object data); | |
76 int multiple_p; | |
434 | 77 int copy_p; |
428 | 78 }; |
79 | |
80 typedef struct | |
81 { | |
82 Dynarr_declare (ii_keyword_entry); | |
83 } ii_keyword_entry_dynarr; | |
84 | |
1204 | 85 extern const struct sized_memory_description iim_description; |
428 | 86 |
438 | 87 enum image_instance_geometry |
88 { | |
89 IMAGE_GEOMETRY, | |
90 IMAGE_DESIRED_GEOMETRY, | |
91 IMAGE_MIN_GEOMETRY, | |
442 | 92 IMAGE_MAX_GEOMETRY |
438 | 93 }; |
94 | |
442 | 95 #define IMAGE_UNSPECIFIED_GEOMETRY -1 |
96 #define IMAGE_UNCHANGED_GEOMETRY -2 | |
97 | |
863 | 98 #define DEFAULT_WIDGET_BORDER_WIDTH 2 |
99 #define DEFAULT_WIDGET_SPACING 3 | |
100 #define DEFAULT_WIDGET_SHADOW_WIDTH 2 | |
438 | 101 |
442 | 102 enum governing_domain |
103 { | |
104 GOVERNING_DOMAIN_WINDOW, | |
105 GOVERNING_DOMAIN_FRAME, | |
106 GOVERNING_DOMAIN_DEVICE | |
107 }; | |
108 | |
428 | 109 struct image_instantiator_methods |
110 { | |
111 Lisp_Object symbol; | |
112 | |
113 Lisp_Object device; /* sometimes used */ | |
114 | |
115 ii_keyword_entry_dynarr *keywords; | |
116 /* consoles this ii is supported on */ | |
117 console_type_entry_dynarr *consoles; | |
118 /* Implementation specific methods: */ | |
119 | |
120 /* Validate method: Given an instantiator vector, signal an error if | |
121 it's invalid for this image-instantiator format. Note that this | |
122 validation only occurs after all the keyword-specific validation | |
123 has already been performed. This is chiefly useful for making | |
124 sure that certain required keywords are present. */ | |
125 void (*validate_method) (Lisp_Object instantiator); | |
126 | |
127 /* Normalize method: Given an instantiator, convert it to the form | |
128 that should be used in a glyph, for devices of type CONSOLE_TYPE. | |
129 Signal an error if conversion fails. */ | |
130 Lisp_Object (*normalize_method) (Lisp_Object instantiator, | |
442 | 131 Lisp_Object console_type, |
132 Lisp_Object dest_mask); | |
133 | |
134 /* Governing domain method: Return an int indicating what type of | |
135 domain an instance in this format is governed by. */ | |
136 int (*governing_domain_method) (void); | |
428 | 137 |
138 /* Possible-dest-types method: Return a mask indicating what dest types | |
139 are compatible with this format. */ | |
140 int (*possible_dest_types_method) (void); | |
141 | |
142 /* Instantiate method: Given an instantiator and a partially | |
143 filled-in image instance, complete the filling-in. Return | |
144 non-zero if the instantiation succeeds, 0 if it fails. | |
145 This must be present. */ | |
146 void (*instantiate_method) (Lisp_Object image_instance, | |
147 Lisp_Object instantiator, | |
148 Lisp_Object pointer_fg, | |
149 Lisp_Object pointer_bg, | |
150 int dest_mask, | |
151 Lisp_Object domain); | |
442 | 152 /* Post instantiate method: finish instantiation of the image |
153 instance. */ | |
154 void (*post_instantiate_method) (Lisp_Object image_instance, | |
155 Lisp_Object instantiator, | |
156 Lisp_Object domain); | |
428 | 157 /* Property method: Given an image instance, return device specific |
158 properties. */ | |
159 Lisp_Object (*property_method) (Lisp_Object image_instance, | |
160 Lisp_Object property); | |
161 /* Set-property method: Given an image instance, set device specific | |
162 properties. */ | |
163 Lisp_Object (*set_property_method) (Lisp_Object image_instance, | |
164 Lisp_Object property, | |
165 Lisp_Object val); | |
442 | 166 /* Asynchronously update properties. */ |
167 void (*update_method) (Lisp_Object image_instance, | |
168 Lisp_Object instantiator); | |
169 void (*redisplay_method) (Lisp_Object image_instance); | |
434 | 170 |
438 | 171 /* Find out the desired geometry, as given by disp, of this image |
172 instance. Actual geometry is stored in the appropriate slots in the | |
173 image instance. */ | |
434 | 174 void (*query_geometry_method) (Lisp_Object image_instance, |
442 | 175 int* width, int* height, |
440 | 176 enum image_instance_geometry disp, |
438 | 177 Lisp_Object domain); |
440 | 178 |
438 | 179 /* Layout the instance and its children bounded by the provided |
442 | 180 dimensions. Returns success or failure. */ |
181 int (*layout_method) (Lisp_Object image_instance, | |
182 int width, int height, int xoffset, int yoffset, | |
183 Lisp_Object domain); | |
428 | 184 }; |
185 | |
186 /***** Calling an image-instantiator method *****/ | |
187 | |
188 #define HAS_IIFORMAT_METH_P(mstruc, m) (((mstruc)->m##_method) != 0) | |
189 #define IIFORMAT_METH(mstruc, m, args) (((mstruc)->m##_method) args) | |
190 | |
191 /* Call a void-returning specifier method, if it exists */ | |
192 #define MAYBE_IIFORMAT_METH(mstruc, m, args) \ | |
193 do { \ | |
194 struct image_instantiator_methods *MIM_mstruc = (mstruc); \ | |
195 if (MIM_mstruc && HAS_IIFORMAT_METH_P (MIM_mstruc, m)) \ | |
196 IIFORMAT_METH (MIM_mstruc, m, args); \ | |
197 } while (0) | |
198 | |
199 #define MAYBE_IIFORMAT_DEVMETH(device, mstruc, m, args) \ | |
200 do { \ | |
201 struct image_instantiator_methods *MID_mstruc = \ | |
202 decode_ii_device (device, mstruc); \ | |
203 if (MID_mstruc) \ | |
204 MAYBE_IIFORMAT_METH(MID_mstruc, m, args); \ | |
205 } while (0) | |
206 | |
207 | |
208 /* Call a specifier method, if it exists; otherwise return | |
209 the specified value */ | |
210 | |
211 #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ | |
442 | 212 ((mstruc && HAS_IIFORMAT_METH_P (mstruc, m)) ? \ |
428 | 213 IIFORMAT_METH (mstruc, m, args) : (given)) |
214 | |
215 /***** Defining new image-instantiator types *****/ | |
216 | |
217 #define DECLARE_IMAGE_INSTANTIATOR_FORMAT(format) \ | |
218 extern struct image_instantiator_methods *format##_image_instantiator_methods | |
219 | |
220 #define DEFINE_IMAGE_INSTANTIATOR_FORMAT(format) \ | |
221 struct image_instantiator_methods *format##_image_instantiator_methods | |
222 | |
223 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name) \ | |
452 | 224 do { \ |
225 format##_image_instantiator_methods = \ | |
226 xnew_and_zero (struct image_instantiator_methods); \ | |
227 format##_image_instantiator_methods->symbol = Q##format; \ | |
228 format##_image_instantiator_methods->device = Qnil; \ | |
229 format##_image_instantiator_methods->keywords = \ | |
230 Dynarr_new (ii_keyword_entry); \ | |
231 format##_image_instantiator_methods->consoles = \ | |
232 Dynarr_new (console_type_entry); \ | |
233 add_entry_to_image_instantiator_format_list \ | |
234 (Q##format, format##_image_instantiator_methods); \ | |
2367 | 235 dump_add_root_block_ptr (&format##_image_instantiator_methods, \ |
452 | 236 &iim_description); \ |
428 | 237 } while (0) |
238 | |
239 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \ | |
240 do { \ | |
241 defsymbol (&Q##format, obj_name); \ | |
242 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name);\ | |
243 } while (0) | |
244 | |
245 /* Declare that image-instantiator format FORMAT has method M; used in | |
246 initialization routines */ | |
247 #define IIFORMAT_HAS_METHOD(format, m) \ | |
248 (format##_image_instantiator_methods->m##_method = format##_##m) | |
249 | |
250 #define IIFORMAT_HAS_SHARED_METHOD(format, m, type) \ | |
251 (format##_image_instantiator_methods->m##_method = type##_##m) | |
252 | |
253 /* Declare that KEYW is a valid keyword for image-instantiator format | |
254 FORMAT. VALIDATE_FUN if a function that returns whether the data | |
255 is valid. The keyword may not appear more than once. */ | |
434 | 256 #define IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, copy, multi) \ |
440 | 257 do { \ |
428 | 258 struct ii_keyword_entry entry; \ |
440 | 259 \ |
260 entry.keyword = keyw; \ | |
428 | 261 entry.validate = validate_fun; \ |
440 | 262 entry.multiple_p = multi; \ |
434 | 263 entry.copy_p = copy; \ |
428 | 264 Dynarr_add (format##_image_instantiator_methods->keywords, \ |
265 entry); \ | |
266 } while (0) | |
267 | |
434 | 268 #define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \ |
269 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 0) | |
270 | |
428 | 271 /* Same as IIFORMAT_VALID_KEYWORD except that the keyword may |
272 appear multiple times. */ | |
434 | 273 #define IIFORMAT_VALID_MULTI_KEYWORD(format, keyw, validate_fun) \ |
274 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 1) | |
275 | |
442 | 276 /* Same as IIFORMAT_VALID_KEYWORD except that the argument is not |
434 | 277 copied by the specifier functions. This is necessary for things |
278 like callbacks etc. */ | |
279 #define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun) \ | |
280 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 0, 0) | |
428 | 281 |
440 | 282 /* Declare that image-instantiator format FORMAT is supported on |
428 | 283 CONSOLE type. */ |
440 | 284 #define IIFORMAT_VALID_CONSOLE(console, format) \ |
428 | 285 do { \ |
286 struct console_type_entry entry; \ | |
287 \ | |
288 entry.symbol = Q##console; \ | |
289 entry.meths = console##_console_methods; \ | |
290 Dynarr_add (format##_image_instantiator_methods->consoles, \ | |
291 entry); \ | |
292 } while (0) | |
293 | |
442 | 294 #define IIFORMAT_VALID_CONSOLE2(con1, con2, format) \ |
295 IIFORMAT_VALID_CONSOLE (con1, format); \ | |
296 IIFORMAT_VALID_CONSOLE (con2, format); | |
297 | |
440 | 298 #define DEFINE_DEVICE_IIFORMAT(type, format) \ |
299 DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \ | |
428 | 300 struct image_instantiator_methods *type##_##format##_image_instantiator_methods |
301 | |
647 | 302 #define INITIALIZE_DEVICE_IIFORMAT(type, format) \ |
303 do { \ | |
304 type##_##format##_image_instantiator_methods = \ | |
305 xnew_and_zero (struct image_instantiator_methods); \ | |
306 type##_##format##_image_instantiator_methods->symbol = Q##format; \ | |
307 type##_##format##_image_instantiator_methods->device = Q##type; \ | |
308 type##_##format##_image_instantiator_methods->keywords = \ | |
309 Dynarr_new (ii_keyword_entry); \ | |
310 add_entry_to_device_ii_format_list \ | |
311 (Q##type, Q##format, type##_##format##_image_instantiator_methods); \ | |
312 IIFORMAT_VALID_CONSOLE(type,format); \ | |
2367 | 313 dump_add_root_block_ptr (&type##_##format##_image_instantiator_methods, \ |
647 | 314 &iim_description); \ |
428 | 315 } while (0) |
316 | |
317 /* Declare that image-instantiator format FORMAT has method M; used in | |
318 initialization routines */ | |
319 #define IIFORMAT_HAS_DEVMETHOD(type, format, m) \ | |
320 (type##_##format##_image_instantiator_methods->m##_method = type##_##format##_##m) | |
321 #define IIFORMAT_HAS_SHARED_DEVMETHOD(type, format, m, fromformat) \ | |
322 (type##_##format##_image_instantiator_methods->m##_method = type##_##fromformat##_##m) | |
323 | |
442 | 324 #define IIFORMAT_INHERITS_DEVMETHOD(type, from, format, m) \ |
325 (type##_##format##_image_instantiator_methods->m##_method = from##_##format##_##m) | |
326 #define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \ | |
327 (type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m) | |
328 | |
450 | 329 #define INSTANTIATOR_TYPE(inst) (XVECTOR_DATA ((inst))[0]) |
330 | |
826 | 331 struct image_instantiator_methods *decode_device_ii_format (Lisp_Object device, |
332 Lisp_Object format, | |
333 Error_Behavior | |
334 errb); | |
335 struct image_instantiator_methods *decode_image_instantiator_format | |
336 (Lisp_Object format, Error_Behavior errb); | |
428 | 337 |
338 void add_entry_to_image_instantiator_format_list (Lisp_Object symbol, | |
826 | 339 struct |
340 image_instantiator_methods * | |
341 meths); | |
342 void add_entry_to_device_ii_format_list (Lisp_Object device, | |
343 Lisp_Object symbol, | |
344 struct image_instantiator_methods * | |
345 meths); | |
428 | 346 Lisp_Object find_keyword_in_vector (Lisp_Object vector, |
347 Lisp_Object keyword); | |
348 Lisp_Object find_keyword_in_vector_or_given (Lisp_Object vector, | |
349 Lisp_Object keyword, | |
350 Lisp_Object default_); | |
351 Lisp_Object simple_image_type_normalize (Lisp_Object inst, | |
352 Lisp_Object console_type, | |
353 Lisp_Object image_type_tag); | |
354 Lisp_Object potential_pixmap_file_instantiator (Lisp_Object instantiator, | |
355 Lisp_Object file_keyword, | |
356 Lisp_Object data_keyword, | |
357 Lisp_Object console_type); | |
358 void check_valid_string (Lisp_Object data); | |
359 void check_valid_int (Lisp_Object data); | |
360 void check_valid_face (Lisp_Object data); | |
361 void check_valid_vector (Lisp_Object data); | |
362 | |
440 | 363 void initialize_subwindow_image_instance (Lisp_Image_Instance*); |
428 | 364 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
365 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | |
366 int dest_mask, Lisp_Object domain); | |
442 | 367 int subwindow_governing_domain (void); |
438 | 368 void widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
369 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | |
370 int dest_mask, Lisp_Object domain); | |
440 | 371 void image_instance_query_geometry (Lisp_Object image_instance, |
442 | 372 int* width, int* height, |
438 | 373 enum image_instance_geometry disp, |
374 Lisp_Object domain); | |
440 | 375 void image_instance_layout (Lisp_Object image_instance, |
442 | 376 int width, int height, int xoffset, int yoffset, |
438 | 377 Lisp_Object domain); |
442 | 378 int layout_layout (Lisp_Object image_instance, |
379 int width, int height, int xoffset, int yoffset, | |
380 Lisp_Object domain); | |
440 | 381 int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w); |
450 | 382 Lisp_Object make_image_instance_cache_hash_table (void); |
428 | 383 |
384 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, | |
385 int given_dest_mask, | |
386 int desired_dest_mask)); | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
387 DECLARE_DOESNT_RETURN (signal_image_error (const Ascbyte *reason, |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
388 Lisp_Object frob)); |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
389 DECLARE_DOESNT_RETURN (signal_image_error_2 (const Ascbyte *reason, |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
390 Lisp_Object frob0, |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
391 Lisp_Object frob1)); |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
392 DECLARE_DOESNT_RETURN (signal_double_image_error (const Ascbyte *reason1, |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
393 const Ascbyte *reason2, |
563 | 394 Lisp_Object data)); |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
395 DECLARE_DOESNT_RETURN (signal_double_image_error_2 (const Ascbyte *reason1, |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
396 const Ascbyte *reason2, |
563 | 397 Lisp_Object data1, |
398 Lisp_Object data2)); | |
428 | 399 |
400 /************************************************************************/ | |
401 /* Image Specifier Object */ | |
402 /************************************************************************/ | |
403 | |
404 DECLARE_SPECIFIER_TYPE (image); | |
405 #define XIMAGE_SPECIFIER(x) XSPECIFIER_TYPE (x, image) | |
406 #define IMAGE_SPECIFIERP(x) SPECIFIER_TYPEP (x, image) | |
407 #define CHECK_IMAGE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, image) | |
408 #define CONCHECK_IMAGE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, image) | |
409 | |
410 void set_image_attached_to (Lisp_Object obj, Lisp_Object face_or_glyph, | |
411 Lisp_Object property); | |
412 | |
413 struct image_specifier | |
414 { | |
415 int allowed; | |
416 Lisp_Object attachee; /* face or glyph this is attached to, or nil */ | |
417 Lisp_Object attachee_property;/* property of that face or glyph */ | |
418 }; | |
419 | |
456 | 420 #define IMAGE_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, image) |
428 | 421 #define IMAGE_SPECIFIER_ALLOWED(g) (IMAGE_SPECIFIER_DATA (g)->allowed) |
422 #define IMAGE_SPECIFIER_ATTACHEE(g) (IMAGE_SPECIFIER_DATA (g)->attachee) | |
423 #define IMAGE_SPECIFIER_ATTACHEE_PROPERTY(g) \ | |
424 (IMAGE_SPECIFIER_DATA (g)->attachee_property) | |
425 | |
426 #define XIMAGE_SPECIFIER_ALLOWED(g) \ | |
427 IMAGE_SPECIFIER_ALLOWED (XIMAGE_SPECIFIER (g)) | |
428 | |
429 /************************************************************************/ | |
430 /* Image Instance Object */ | |
431 /************************************************************************/ | |
432 | |
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
433 DECLARE_LISP_OBJECT (image_instance, Lisp_Image_Instance); |
440 | 434 #define XIMAGE_INSTANCE(x) XRECORD (x, image_instance, Lisp_Image_Instance) |
617 | 435 #define wrap_image_instance(p) wrap_record (p, image_instance) |
428 | 436 #define IMAGE_INSTANCEP(x) RECORDP (x, image_instance) |
437 #define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance) | |
438 #define CONCHECK_IMAGE_INSTANCE(x) CONCHECK_RECORD (x, image_instance) | |
439 | |
442 | 440 #ifdef ERROR_CHECK_GLYPHS |
441 void check_image_instance_structure (Lisp_Object instance); | |
442 void check_window_subwindow_cache (struct window* w); | |
443 #define ERROR_CHECK_IMAGE_INSTANCE(ii) \ | |
444 check_image_instance_structure (ii) | |
445 #define ERROR_CHECK_SUBWINDOW_CACHE(w) \ | |
446 check_window_subwindow_cache (w) | |
447 #else | |
448 #define ERROR_CHECK_IMAGE_INSTANCE(ii) | |
449 #define ERROR_CHECK_SUBWINDOW_CACHE(w) | |
450 #endif | |
451 | |
428 | 452 enum image_instance_type |
453 { | |
454 IMAGE_UNKNOWN, | |
455 IMAGE_NOTHING, | |
456 IMAGE_TEXT, | |
457 IMAGE_MONO_PIXMAP, | |
458 IMAGE_COLOR_PIXMAP, | |
459 IMAGE_POINTER, | |
460 IMAGE_SUBWINDOW, | |
442 | 461 IMAGE_WIDGET |
428 | 462 }; |
463 | |
464 #define IMAGE_NOTHING_MASK (1 << 0) | |
465 #define IMAGE_TEXT_MASK (1 << 1) | |
466 #define IMAGE_MONO_PIXMAP_MASK (1 << 2) | |
467 #define IMAGE_COLOR_PIXMAP_MASK (1 << 3) | |
468 #define IMAGE_POINTER_MASK (1 << 4) | |
469 #define IMAGE_SUBWINDOW_MASK (1 << 5) | |
470 #define IMAGE_WIDGET_MASK (1 << 6) | |
442 | 471 |
472 /* This depends on the fact that enums are assigned consecutive | |
473 integers starting at 0. (Remember that IMAGE_UNKNOWN is the | |
474 first enum.) I'm fairly sure this behavior is ANSI-mandated, | |
475 so there should be no portability problems here. */ | |
476 #define image_instance_type_to_mask(type) \ | |
477 ((int) (1 << ((int) (type) - 1))) | |
428 | 478 |
479 #define IMAGE_INSTANCE_TYPE_P(ii, type) \ | |
480 (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type) | |
481 | |
482 #define NOTHING_IMAGE_INSTANCEP(ii) \ | |
483 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_NOTHING) | |
484 #define TEXT_IMAGE_INSTANCEP(ii) \ | |
485 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_TEXT) | |
486 #define MONO_PIXMAP_IMAGE_INSTANCEP(ii) \ | |
487 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_MONO_PIXMAP) | |
488 #define COLOR_PIXMAP_IMAGE_INSTANCEP(ii) \ | |
489 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_COLOR_PIXMAP) | |
490 #define POINTER_IMAGE_INSTANCEP(ii) \ | |
491 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_POINTER) | |
492 #define SUBWINDOW_IMAGE_INSTANCEP(ii) \ | |
493 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_SUBWINDOW) | |
494 #define WIDGET_IMAGE_INSTANCEP(ii) \ | |
495 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_WIDGET) | |
496 | |
440 | 497 #define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \ |
498 CHECK_IMAGE_INSTANCE (x); \ | |
428 | 499 if (!NOTHING_IMAGE_INSTANCEP (x)) \ |
500 x = wrong_type_argument (Qnothing_image_instance_p, (x)); \ | |
501 } while (0) | |
502 | |
440 | 503 #define CHECK_TEXT_IMAGE_INSTANCE(x) do { \ |
504 CHECK_IMAGE_INSTANCE (x); \ | |
428 | 505 if (!TEXT_IMAGE_INSTANCEP (x)) \ |
506 x = wrong_type_argument (Qtext_image_instance_p, (x)); \ | |
507 } while (0) | |
508 | |
509 #define CHECK_MONO_PIXMAP_IMAGE_INSTANCE(x) do { \ | |
510 CHECK_IMAGE_INSTANCE (x); \ | |
511 if (!MONO_PIXMAP_IMAGE_INSTANCEP (x)) \ | |
512 x = wrong_type_argument (Qmono_pixmap_image_instance_p, (x)); \ | |
513 } while (0) | |
514 | |
440 | 515 #define CHECK_COLOR_PIXMAP_IMAGE_INSTANCE(x) do { \ |
516 CHECK_IMAGE_INSTANCE (x); \ | |
428 | 517 if (!COLOR_PIXMAP_IMAGE_INSTANCEP (x)) \ |
518 x = wrong_type_argument (Qcolor_pixmap_image_instance_p, (x)); \ | |
519 } while (0) | |
520 | |
440 | 521 #define CHECK_POINTER_IMAGE_INSTANCE(x) do { \ |
522 CHECK_IMAGE_INSTANCE (x); \ | |
428 | 523 if (!POINTER_IMAGE_INSTANCEP (x)) \ |
524 x = wrong_type_argument (Qpointer_image_instance_p, (x)); \ | |
525 } while (0) | |
526 | |
440 | 527 #define CHECK_SUBWINDOW_IMAGE_INSTANCE(x) do { \ |
428 | 528 CHECK_IMAGE_INSTANCE (x); \ |
529 if (!SUBWINDOW_IMAGE_INSTANCEP (x) \ | |
530 && !WIDGET_IMAGE_INSTANCEP (x)) \ | |
531 x = wrong_type_argument (Qsubwindow_image_instance_p, (x)); \ | |
532 } while (0) | |
533 | |
440 | 534 #define CHECK_WIDGET_IMAGE_INSTANCE(x) do { \ |
535 CHECK_IMAGE_INSTANCE (x); \ | |
428 | 536 if (!WIDGET_IMAGE_INSTANCEP (x)) \ |
537 x = wrong_type_argument (Qwidget_image_instance_p, (x)); \ | |
538 } while (0) | |
539 | |
1204 | 540 struct text_image_instance |
541 { | |
542 int descent; | |
543 Lisp_Object string; | |
544 }; | |
545 | |
546 struct pixmap_image_instance | |
547 { /* used for pointers as well */ | |
548 int depth; | |
549 int slice, maxslice, timeout; | |
550 Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */ | |
551 Lisp_Object filename; /* string or Qnil */ | |
552 Lisp_Object mask_filename; /* string or Qnil */ | |
553 Lisp_Object fg, bg; /* foreground and background colors, | |
554 if this is a colorized mono-pixmap | |
555 or a pointer */ | |
556 Lisp_Object auxdata; /* list or Qnil: any additional data | |
557 to be seen from lisp */ | |
558 void* mask; /* mask that can be seen from all windowing systems */ | |
559 }; | |
560 | |
561 struct subwindow_image_instance | |
562 { | |
563 void* subwindow; /* specific devices can use this as necessary */ | |
564 struct | |
565 { /* We need these so we can do without | |
566 subwindow_cachel */ | |
567 int x, y; | |
568 int width, height; | |
569 } display_data; | |
570 unsigned int being_displayed : 1; /* used to detect when needs | |
571 to be unmapped */ | |
572 unsigned int v_resize : 1; /* Whether the vsize is allowed to change. */ | |
573 unsigned int h_resize : 1; /* Whether the hsize is allowed to change. */ | |
574 unsigned int orientation : 1; /* Vertical or horizontal. */ | |
575 unsigned int h_justification : 2; /* left, right or center. */ | |
576 unsigned int v_justification : 2; /* top, bottom or center. */ | |
577 /* Face for colors and font. We specify this here because we | |
578 want people to be able to put :face in the instantiator | |
579 spec. Using glyph-face is more inconvenient, although more | |
580 general. */ | |
581 Lisp_Object face; | |
582 Lisp_Object type; | |
583 Lisp_Object props; /* properties or border*/ | |
584 Lisp_Object items; /* a list of displayed gui_items */ | |
585 Lisp_Object pending_items; /* gui_items that should be displayed */ | |
586 Lisp_Object children; /* a list of children */ | |
587 Lisp_Object width; /* dynamic width spec. */ | |
588 Lisp_Object height; /* dynamic height spec. */ | |
589 /* Change flags to augment dirty. */ | |
590 unsigned int face_changed : 1; | |
591 unsigned int items_changed : 1; | |
592 unsigned int action_occurred : 1; | |
593 }; | |
594 | |
428 | 595 struct Lisp_Image_Instance |
596 { | |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
597 NORMAL_LISP_OBJECT_HEADER header; |
442 | 598 Lisp_Object domain; /* The domain in which we were cached. */ |
599 Lisp_Object device; /* The device of the domain. Recorded | |
600 since the domain may get deleted | |
601 before us. */ | |
428 | 602 Lisp_Object name; |
438 | 603 /* The glyph from which we were instantiated. This is a weak |
604 reference. */ | |
442 | 605 Lisp_Object parent; |
606 /* The instantiator from which we were instantiated. */ | |
607 Lisp_Object instantiator; | |
428 | 608 enum image_instance_type type; |
647 | 609 int x_offset, y_offset; /* for layout purposes */ |
442 | 610 int width, height, margin_width; |
665 | 611 Hashcode display_hash; /* Hash value representing the structure |
647 | 612 of the image_instance when it was |
613 last displayed. */ | |
428 | 614 unsigned int dirty : 1; |
442 | 615 unsigned int size_changed : 1; |
616 unsigned int text_changed : 1; | |
617 unsigned int layout_changed : 1; | |
618 unsigned int optimize_output : 1; /* For outputting layouts. */ | |
619 unsigned int initialized : 1; /* When we're fully done. */ | |
620 unsigned int wants_initial_focus : 1; | |
621 | |
428 | 622 union |
623 { | |
1204 | 624 struct text_image_instance text; |
625 struct pixmap_image_instance pixmap; /* used for pointers as well */ | |
626 struct subwindow_image_instance subwindow; | |
428 | 627 } u; |
628 | |
629 /* console-type- and image-type-specific data */ | |
630 void *data; | |
631 }; | |
632 | |
438 | 633 /* Layout bit-fields. */ |
634 #define LAYOUT_HORIZONTAL 0 | |
635 #define LAYOUT_VERTICAL 1 | |
636 | |
637 #define LAYOUT_JUSTIFY_LEFT 0 | |
863 | 638 #define LAYOUT_JUSTIFY_TOP 0 |
438 | 639 #define LAYOUT_JUSTIFY_RIGHT 1 |
863 | 640 #define LAYOUT_JUSTIFY_BOTTOM 1 |
438 | 641 #define LAYOUT_JUSTIFY_CENTER 2 |
642 | |
442 | 643 #define IMAGE_INSTANCE_HASH_DEPTH 0 |
644 | |
438 | 645 /* Accessor macros. */ |
442 | 646 #define IMAGE_INSTANCE_DOMAIN(i) ((i)->domain) |
647 #define IMAGE_INSTANCE_DOMAIN_LIVE_P(i) (DOMAIN_LIVE_P ((i)->domain)) | |
428 | 648 #define IMAGE_INSTANCE_DEVICE(i) ((i)->device) |
442 | 649 #define IMAGE_INSTANCE_FRAME(i) (DOMAIN_FRAME ((i)->domain)) |
428 | 650 #define IMAGE_INSTANCE_NAME(i) ((i)->name) |
442 | 651 #define IMAGE_INSTANCE_PARENT(i) ((i)->parent) |
652 #define IMAGE_INSTANCE_INSTANTIATOR(i) ((i)->instantiator) | |
653 #define IMAGE_INSTANCE_GLYPH(i) (image_instance_parent_glyph(i)) | |
428 | 654 #define IMAGE_INSTANCE_TYPE(i) ((i)->type) |
655 #define IMAGE_INSTANCE_XOFFSET(i) ((i)->x_offset) | |
656 #define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset) | |
434 | 657 #define IMAGE_INSTANCE_WIDTH(i) ((i)->width) |
442 | 658 #define IMAGE_INSTANCE_MARGIN_WIDTH(i) ((i)->margin_width) |
434 | 659 #define IMAGE_INSTANCE_HEIGHT(i) ((i)->height) |
442 | 660 #define IMAGE_INSTANCE_INITIALIZED(i) ((i)->initialized) |
661 #define IMAGE_INSTANCE_DISPLAY_HASH(i) ((i)->display_hash) | |
440 | 662 #define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \ |
663 ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \ | |
428 | 664 || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP)) |
665 #define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty) | |
442 | 666 #define IMAGE_INSTANCE_NEEDS_LAYOUT(i) \ |
667 ((IMAGE_INSTANCE_DIRTYP (i) && IMAGE_INSTANCE_LAYOUT_CHANGED (i)) \ | |
668 || (FRAMEP (IMAGE_INSTANCE_FRAME (i)) \ | |
669 && XFRAME (IMAGE_INSTANCE_FRAME (i))->size_changed)) | |
438 | 670 #define IMAGE_INSTANCE_FACE(i) \ |
442 | 671 (GLYPHP (IMAGE_INSTANCE_GLYPH (i)) ? \ |
672 XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) : Qnil) | |
673 #define IMAGE_INSTANCE_WANTS_INITIAL_FOCUS(i) ((i)->wants_initial_focus) | |
428 | 674 |
442 | 675 /* Changed flags */ |
676 #define IMAGE_INSTANCE_TEXT_CHANGED(i) ((i)->text_changed) | |
677 #define IMAGE_INSTANCE_SIZE_CHANGED(i) ((i)->size_changed) | |
678 #define IMAGE_INSTANCE_WIDGET_FACE_CHANGED(i) \ | |
679 ((i)->u.subwindow.face_changed) | |
680 #define IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED(i) \ | |
681 ((i)->u.subwindow.items_changed) | |
682 #define IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED(i) \ | |
683 ((i)->u.subwindow.action_occurred) | |
684 #define IMAGE_INSTANCE_LAYOUT_CHANGED(i) ((i)->layout_changed) | |
685 #define IMAGE_INSTANCE_OPTIMIZE_OUTPUT(i) ((i)->optimize_output) | |
686 | |
687 /* Text properties */ | |
428 | 688 #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string) |
434 | 689 #define IMAGE_INSTANCE_TEXT_WIDTH(i) \ |
690 IMAGE_INSTANCE_WIDTH(i) | |
691 #define IMAGE_INSTANCE_TEXT_HEIGHT(i) \ | |
692 IMAGE_INSTANCE_HEIGHT(i) | |
693 #define IMAGE_INSTANCE_TEXT_DESCENT(i) ((i)->u.text.descent) | |
438 | 694 #define IMAGE_INSTANCE_TEXT_ASCENT(i) \ |
695 (IMAGE_INSTANCE_TEXT_HEIGHT(i) - IMAGE_INSTANCE_TEXT_DESCENT(i)) | |
428 | 696 |
442 | 697 /* Pixmap properties */ |
434 | 698 #define IMAGE_INSTANCE_PIXMAP_WIDTH(i) \ |
699 IMAGE_INSTANCE_WIDTH(i) | |
700 #define IMAGE_INSTANCE_PIXMAP_HEIGHT(i) \ | |
701 IMAGE_INSTANCE_HEIGHT(i) | |
428 | 702 #define IMAGE_INSTANCE_PIXMAP_DEPTH(i) ((i)->u.pixmap.depth) |
703 #define IMAGE_INSTANCE_PIXMAP_FILENAME(i) ((i)->u.pixmap.filename) | |
704 #define IMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) ((i)->u.pixmap.mask_filename) | |
705 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) ((i)->u.pixmap.hotspot_x) | |
706 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y) | |
707 #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg) | |
708 #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg) | |
709 #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata) | |
710 #define IMAGE_INSTANCE_PIXMAP_MASK(i) ((i)->u.pixmap.mask) | |
711 #define IMAGE_INSTANCE_PIXMAP_SLICE(i) ((i)->u.pixmap.slice) | |
712 #define IMAGE_INSTANCE_PIXMAP_MAXSLICE(i) ((i)->u.pixmap.maxslice) | |
713 #define IMAGE_INSTANCE_PIXMAP_TIMEOUT(i) ((i)->u.pixmap.timeout) | |
714 | |
442 | 715 /* Subwindow properties */ |
428 | 716 #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow) |
442 | 717 /* Display data. */ |
718 #define IMAGE_INSTANCE_DISPLAY_X(i) ((i)->u.subwindow.display_data.x) | |
719 #define IMAGE_INSTANCE_DISPLAY_Y(i) ((i)->u.subwindow.display_data.y) | |
720 #define IMAGE_INSTANCE_DISPLAY_WIDTH(i) \ | |
721 ((i)->u.subwindow.display_data.width) | |
722 #define IMAGE_INSTANCE_DISPLAY_HEIGHT(i) \ | |
723 ((i)->u.subwindow.display_data.height) | |
428 | 724 #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ |
725 ((i)->u.subwindow.being_displayed) | |
438 | 726 #define IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP(i) \ |
727 ((i)->u.subwindow.v_resize) | |
728 #define IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP(i) \ | |
729 ((i)->u.subwindow.h_resize) | |
730 #define IMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \ | |
731 ((i)->u.subwindow.orientation) | |
863 | 732 #define IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) \ |
733 ((i)->u.subwindow.h_justification) | |
734 #define IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) \ | |
735 ((i)->u.subwindow.v_justification) | |
736 #define IMAGE_INSTANCE_SUBWINDOW_RIGHT_JUSTIFIED(i) \ | |
737 (IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) == LAYOUT_JUSTIFY_RIGHT) | |
738 #define IMAGE_INSTANCE_SUBWINDOW_LEFT_JUSTIFIED(i) \ | |
739 (IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) == LAYOUT_JUSTIFY_LEFT) | |
740 #define IMAGE_INSTANCE_SUBWINDOW_TOP_JUSTIFIED(i) \ | |
741 (IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) == LAYOUT_JUSTIFY_TOP) | |
742 #define IMAGE_INSTANCE_SUBWINDOW_BOTTOM_JUSTIFIED(i) \ | |
743 (IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) == LAYOUT_JUSTIFY_BOTTOM) | |
744 #define IMAGE_INSTANCE_SUBWINDOW_H_CENTERED(i) \ | |
745 (IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) == LAYOUT_JUSTIFY_CENTER) | |
746 #define IMAGE_INSTANCE_SUBWINDOW_V_CENTERED(i) \ | |
747 (IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) == LAYOUT_JUSTIFY_CENTER) | |
748 #define IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT(i) \ | |
749 (IMAGE_INSTANCE_SUBWINDOW_ORIENT (i) \ | |
750 == LAYOUT_VERTICAL && !IMAGE_INSTANCE_SUBWINDOW_V_CENTERED (i)) | |
751 | |
442 | 752 #define IMAGE_INSTANCE_SUBWINDOW_FACE(i) \ |
753 ((i)->u.subwindow.face) | |
428 | 754 |
442 | 755 /* Widget properties */ |
428 | 756 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \ |
434 | 757 IMAGE_INSTANCE_WIDTH(i) |
428 | 758 #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \ |
434 | 759 IMAGE_INSTANCE_HEIGHT(i) |
442 | 760 #define IMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) ((i)->u.subwindow.width) |
761 #define IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) ((i)->u.subwindow.height) | |
440 | 762 #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type) |
763 #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props) | |
438 | 764 #define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \ |
440 | 765 ((i)->u.subwindow.face = f) |
766 #define IMAGE_INSTANCE_WIDGET_FACE(i) \ | |
767 (!NILP ((i)->u.subwindow.face) ? (i)->u.subwindow.face : \ | |
768 !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \ | |
438 | 769 Vwidget_face) |
440 | 770 #define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.items) |
442 | 771 #define IMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ |
772 ((i)->u.subwindow.pending_items) | |
440 | 773 #define IMAGE_INSTANCE_WIDGET_ITEM(i) \ |
444 | 774 (CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \ |
775 XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \ | |
776 IMAGE_INSTANCE_WIDGET_ITEMS (i)) | |
777 #define IMAGE_INSTANCE_WIDGET_TEXT(i) \ | |
778 XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (i))->name | |
428 | 779 |
442 | 780 /* Layout properties */ |
781 #define IMAGE_INSTANCE_LAYOUT_CHILDREN(i) ((i)->u.subwindow.children) | |
440 | 782 #define IMAGE_INSTANCE_LAYOUT_BORDER(i) ((i)->u.subwindow.props) |
428 | 783 |
442 | 784 #define XIMAGE_INSTANCE_DOMAIN(i) \ |
785 IMAGE_INSTANCE_DOMAIN (XIMAGE_INSTANCE (i)) | |
786 #define XIMAGE_INSTANCE_DOMAIN_LIVE_P(i) \ | |
787 IMAGE_INSTANCE_DOMAIN_LIVE_P (XIMAGE_INSTANCE (i)) | |
428 | 788 #define XIMAGE_INSTANCE_DEVICE(i) \ |
789 IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i)) | |
442 | 790 #define XIMAGE_INSTANCE_FRAME(i) \ |
791 IMAGE_INSTANCE_FRAME (XIMAGE_INSTANCE (i)) | |
428 | 792 #define XIMAGE_INSTANCE_NAME(i) \ |
793 IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i)) | |
438 | 794 #define XIMAGE_INSTANCE_GLYPH(i) \ |
795 IMAGE_INSTANCE_GLYPH (XIMAGE_INSTANCE (i)) | |
442 | 796 #define XIMAGE_INSTANCE_PARENT(i) \ |
797 IMAGE_INSTANCE_PARENT (XIMAGE_INSTANCE (i)) | |
798 #define XIMAGE_INSTANCE_INSTANTIATOR(i) \ | |
799 IMAGE_INSTANCE_INSTANTIATOR (XIMAGE_INSTANCE (i)) | |
428 | 800 #define XIMAGE_INSTANCE_TYPE(i) \ |
801 IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i)) | |
442 | 802 #define XIMAGE_INSTANCE_DISPLAY_HASH(i) \ |
803 IMAGE_INSTANCE_DISPLAY_HASH (XIMAGE_INSTANCE (i)) | |
428 | 804 #define XIMAGE_INSTANCE_XOFFSET(i) \ |
805 IMAGE_INSTANCE_XOFFSET (XIMAGE_INSTANCE (i)) | |
806 #define XIMAGE_INSTANCE_YOFFSET(i) \ | |
807 IMAGE_INSTANCE_YOFFSET (XIMAGE_INSTANCE (i)) | |
808 #define XIMAGE_INSTANCE_DIRTYP(i) \ | |
809 IMAGE_INSTANCE_DIRTYP (XIMAGE_INSTANCE (i)) | |
442 | 810 #define XIMAGE_INSTANCE_NEEDS_LAYOUT(i) \ |
811 IMAGE_INSTANCE_NEEDS_LAYOUT (XIMAGE_INSTANCE (i)) | |
438 | 812 #define XIMAGE_INSTANCE_WIDTH(i) \ |
813 IMAGE_INSTANCE_WIDTH (XIMAGE_INSTANCE (i)) | |
442 | 814 #define XIMAGE_INSTANCE_MARGIN_WIDTH(i) \ |
815 IMAGE_INSTANCE_MARGIN_WIDTH (XIMAGE_INSTANCE (i)) | |
438 | 816 #define XIMAGE_INSTANCE_HEIGHT(i) \ |
817 IMAGE_INSTANCE_HEIGHT (XIMAGE_INSTANCE (i)) | |
442 | 818 #define XIMAGE_INSTANCE_INITIALIZED(i) \ |
819 IMAGE_INSTANCE_INITIALIZED (XIMAGE_INSTANCE (i)) | |
438 | 820 #define XIMAGE_INSTANCE_FACE(i) \ |
821 IMAGE_INSTANCE_FACE (XIMAGE_INSTANCE (i)) | |
428 | 822 |
823 #define XIMAGE_INSTANCE_TEXT_STRING(i) \ | |
824 IMAGE_INSTANCE_TEXT_STRING (XIMAGE_INSTANCE (i)) | |
438 | 825 #define XIMAGE_INSTANCE_TEXT_WIDTH(i) \ |
826 IMAGE_INSTANCE_TEXT_WIDTH (XIMAGE_INSTANCE (i)) | |
827 #define XIMAGE_INSTANCE_TEXT_HEIGHT(i) \ | |
828 IMAGE_INSTANCE_TEXT_HEIGHT (XIMAGE_INSTANCE (i)) | |
829 #define XIMAGE_INSTANCE_TEXT_ASCENT(i) \ | |
830 IMAGE_INSTANCE_TEXT_ASCENT (XIMAGE_INSTANCE (i)) | |
831 #define XIMAGE_INSTANCE_TEXT_DESCENT(i) \ | |
832 IMAGE_INSTANCE_TEXT_DESCENT (XIMAGE_INSTANCE (i)) | |
428 | 833 |
834 #define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \ | |
835 IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i)) | |
836 #define XIMAGE_INSTANCE_PIXMAP_HEIGHT(i) \ | |
837 IMAGE_INSTANCE_PIXMAP_HEIGHT (XIMAGE_INSTANCE (i)) | |
838 #define XIMAGE_INSTANCE_PIXMAP_DEPTH(i) \ | |
839 IMAGE_INSTANCE_PIXMAP_DEPTH (XIMAGE_INSTANCE (i)) | |
840 #define XIMAGE_INSTANCE_PIXMAP_FILENAME(i) \ | |
841 IMAGE_INSTANCE_PIXMAP_FILENAME (XIMAGE_INSTANCE (i)) | |
842 #define XIMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) \ | |
843 IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (XIMAGE_INSTANCE (i)) | |
844 #define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) \ | |
845 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (XIMAGE_INSTANCE (i)) | |
846 #define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) \ | |
847 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (XIMAGE_INSTANCE (i)) | |
848 #define XIMAGE_INSTANCE_PIXMAP_FG(i) \ | |
849 IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i)) | |
850 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \ | |
851 IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i)) | |
852 #define XIMAGE_INSTANCE_PIXMAP_MASK(i) \ | |
853 IMAGE_INSTANCE_PIXMAP_MASK (XIMAGE_INSTANCE (i)) | |
854 #define XIMAGE_INSTANCE_PIXMAP_SLICE(i) \ | |
855 IMAGE_INSTANCE_PIXMAP_SLICE (XIMAGE_INSTANCE (i)) | |
856 #define XIMAGE_INSTANCE_PIXMAP_MAXSLICE(i) \ | |
857 IMAGE_INSTANCE_PIXMAP_MAXSLICE (XIMAGE_INSTANCE (i)) | |
858 #define XIMAGE_INSTANCE_PIXMAP_TIMEOUT(i) \ | |
859 IMAGE_INSTANCE_PIXMAP_TIMEOUT (XIMAGE_INSTANCE (i)) | |
860 | |
861 #define XIMAGE_INSTANCE_WIDGET_WIDTH(i) \ | |
862 IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i)) | |
863 #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \ | |
864 IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i)) | |
442 | 865 #define XIMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) \ |
866 IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (XIMAGE_INSTANCE (i)) | |
867 #define XIMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) \ | |
868 IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (XIMAGE_INSTANCE (i)) | |
428 | 869 #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ |
870 IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) | |
871 #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ | |
872 IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i)) | |
873 #define XIMAGE_INSTANCE_WIDGET_FACE(i) \ | |
874 IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) | |
438 | 875 #define XSET_IMAGE_INSTANCE_WIDGET_FACE(i) \ |
876 SET_IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) | |
428 | 877 #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \ |
878 IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i)) | |
879 #define XIMAGE_INSTANCE_WIDGET_ITEMS(i) \ | |
880 IMAGE_INSTANCE_WIDGET_ITEMS (XIMAGE_INSTANCE (i)) | |
442 | 881 #define XIMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ |
882 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (XIMAGE_INSTANCE (i)) | |
428 | 883 #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \ |
884 IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i)) | |
442 | 885 #define XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED(i) \ |
886 IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (XIMAGE_INSTANCE (i)) | |
428 | 887 |
888 #define XIMAGE_INSTANCE_LAYOUT_CHILDREN(i) \ | |
889 IMAGE_INSTANCE_LAYOUT_CHILDREN (XIMAGE_INSTANCE (i)) | |
890 #define XIMAGE_INSTANCE_LAYOUT_BORDER(i) \ | |
891 IMAGE_INSTANCE_LAYOUT_BORDER (XIMAGE_INSTANCE (i)) | |
892 | |
893 #define XIMAGE_INSTANCE_SUBWINDOW_ID(i) \ | |
894 IMAGE_INSTANCE_SUBWINDOW_ID (XIMAGE_INSTANCE (i)) | |
442 | 895 #define XIMAGE_INSTANCE_DISPLAY_X(i) \ |
896 IMAGE_INSTANCE_DISPLAY_X (XIMAGE_INSTANCE (i)) | |
897 #define XIMAGE_INSTANCE_DISPLAY_Y(i) \ | |
898 IMAGE_INSTANCE_DISPLAY_Y (XIMAGE_INSTANCE (i)) | |
899 #define XIMAGE_INSTANCE_DISPLAY_WIDTH(i) \ | |
900 IMAGE_INSTANCE_DISPLAY_WIDTH (XIMAGE_INSTANCE (i)) | |
901 #define XIMAGE_INSTANCE_DISPLAY_HEIGHT(i) \ | |
902 IMAGE_INSTANCE_DISPLAY_HEIGHT (XIMAGE_INSTANCE (i)) | |
428 | 903 #define XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ |
904 IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (XIMAGE_INSTANCE (i)) | |
438 | 905 #define XIMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \ |
906 IMAGE_INSTANCE_SUBWINDOW_ORIENT (XIMAGE_INSTANCE (i)) | |
907 #define XIMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \ | |
908 IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (XIMAGE_INSTANCE (i)) | |
442 | 909 #define XIMAGE_INSTANCE_SUBWINDOW_FACE(i) \ |
910 IMAGE_INSTANCE_SUBWINDOW_FACE (XIMAGE_INSTANCE (i)) | |
428 | 911 |
912 #define MARK_IMAGE_INSTANCE_CHANGED(i) \ | |
913 (IMAGE_INSTANCE_DIRTYP (i) = 1); | |
914 | |
442 | 915 Lisp_Object image_instance_device (Lisp_Object instance); |
916 Lisp_Object image_instance_frame (Lisp_Object instance); | |
917 Lisp_Object image_instance_window (Lisp_Object instance); | |
918 int image_instance_live_p (Lisp_Object instance); | |
919 | |
428 | 920 #ifdef HAVE_XPM |
921 Lisp_Object evaluate_xpm_color_symbols (void); | |
922 Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid); | |
923 #endif /* HAVE_XPM */ | |
924 #ifdef HAVE_WINDOW_SYSTEM | |
925 Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot, | |
926 int ok_if_data_invalid); | |
771 | 927 int read_bitmap_data_from_file (Lisp_Object filename, int *width, |
2367 | 928 int *height, Binbyte **datap, |
428 | 929 int *x_hot, int *y_hot); |
930 Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file, | |
931 Lisp_Object mask_file, | |
932 Lisp_Object console_type); | |
933 #endif | |
934 | |
935 /************************************************************************/ | |
936 /* Glyph Object */ | |
937 /************************************************************************/ | |
938 | |
939 enum glyph_type | |
940 { | |
941 GLYPH_UNKNOWN, | |
942 GLYPH_BUFFER, | |
943 GLYPH_POINTER, | |
944 GLYPH_ICON | |
945 }; | |
946 | |
947 struct Lisp_Glyph | |
948 { | |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
949 NORMAL_LISP_OBJECT_HEADER header; |
428 | 950 |
951 enum glyph_type type; | |
952 | |
953 /* specifiers: */ | |
954 Lisp_Object image; /* the actual image */ | |
955 Lisp_Object contrib_p; /* whether to figure into line height */ | |
956 Lisp_Object baseline; /* percent above baseline */ | |
957 | |
958 Lisp_Object face; /* if non-nil, face to use when displaying */ | |
440 | 959 |
428 | 960 Lisp_Object plist; |
961 void (*after_change) (Lisp_Object glyph, Lisp_Object property, | |
962 Lisp_Object locale); | |
963 | |
964 unsigned int dirty : 1; /* So that we can selectively | |
965 redisplay changed glyphs. */ | |
966 }; | |
440 | 967 typedef struct Lisp_Glyph Lisp_Glyph; |
428 | 968 |
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
969 DECLARE_LISP_OBJECT (glyph, Lisp_Glyph); |
440 | 970 #define XGLYPH(x) XRECORD (x, glyph, Lisp_Glyph) |
617 | 971 #define wrap_glyph(p) wrap_record (p, glyph) |
428 | 972 #define GLYPHP(x) RECORDP (x, glyph) |
973 #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph) | |
974 #define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph) | |
975 | |
976 #define CHECK_BUFFER_GLYPH(x) do { \ | |
977 CHECK_GLYPH (x); \ | |
978 if (XGLYPH (x)->type != GLYPH_BUFFER) \ | |
979 x = wrong_type_argument (Qbuffer_glyph_p, (x)); \ | |
980 } while (0) | |
981 | |
982 #define CHECK_POINTER_GLYPH(x) do { \ | |
983 CHECK_GLYPH (x); \ | |
984 if (XGLYPH (x)->type != GLYPH_POINTER) \ | |
985 x = wrong_type_argument (Qpointer_glyph_p, (x)); \ | |
986 } while (0) | |
987 | |
988 #define CHECK_ICON_GLYPH(x) do { \ | |
989 CHECK_GLYPH (x); \ | |
990 if (XGLYPH (x)->type != GLYPH_ICON) \ | |
991 x = wrong_type_argument (Qicon_glyph_p, (x)); \ | |
992 } while (0) | |
993 | |
994 #define GLYPH_TYPE(g) ((g)->type) | |
995 #define GLYPH_IMAGE(g) ((g)->image) | |
996 #define GLYPH_CONTRIB_P(g) ((g)->contrib_p) | |
997 #define GLYPH_BASELINE(g) ((g)->baseline) | |
998 #define GLYPH_FACE(g) ((g)->face) | |
999 #define GLYPH_DIRTYP(g) ((g)->dirty) | |
1000 | |
1001 #define XGLYPH_TYPE(g) GLYPH_TYPE (XGLYPH (g)) | |
1002 #define XGLYPH_IMAGE(g) GLYPH_IMAGE (XGLYPH (g)) | |
1003 #define XGLYPH_CONTRIB_P(g) GLYPH_CONTRIB_P (XGLYPH (g)) | |
1004 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g)) | |
1005 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g)) | |
1006 #define XGLYPH_DIRTYP(g) GLYPH_DIRTYP (XGLYPH (g)) | |
1007 | |
1008 #define MARK_GLYPH_CHANGED(g) (GLYPH_DIRTYP (g) = 1); | |
1009 | |
1010 extern Lisp_Object Qxpm, Qxface, Qetched_in, Qetched_out, Qbevel_in, Qbevel_out; | |
5222
18c0b5909d16
Use keywords in structure syntax; new #define, NEED_TO_HANDLE_21_4_CODE 1
Aidan Kehoe <kehoea@parhasard.net>
parents:
5157
diff
changeset
|
1011 extern Lisp_Object Q_file, Q_color_symbols, Qconst_glyph_variable; |
428 | 1012 extern Lisp_Object Qxbm, Qedit_field, Qgroup, Qlabel, Qcombo_box, Qscrollbar; |
1111 | 1013 extern Lisp_Object Qtree_view, Qtab_control, Qprogress_gauge; |
428 | 1014 extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y; |
1111 | 1015 extern Lisp_Object Q_foreground, Q_background, Q_face, Q_group; |
1016 extern Lisp_Object Q_pixel_width, Q_pixel_height; | |
1017 extern Lisp_Object Qimage_conversion_error; | |
428 | 1018 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; |
1019 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; | |
1020 extern Lisp_Object Vxemacs_logo; | |
1021 | |
442 | 1022 |
438 | 1023 unsigned short glyph_width (Lisp_Object glyph, Lisp_Object domain); |
1024 unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object domain); | |
1025 unsigned short glyph_descent (Lisp_Object glyph, Lisp_Object domain); | |
1026 unsigned short glyph_height (Lisp_Object glyph, Lisp_Object domain); | |
428 | 1027 Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain); |
1028 Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain); | |
1029 int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain); | |
1030 Lisp_Object glyph_image_instance (Lisp_Object glyph, | |
1031 Lisp_Object domain, | |
578 | 1032 Error_Behavior errb, int no_quit); |
428 | 1033 void file_or_data_must_be_present (Lisp_Object instantiator); |
1034 void data_must_be_present (Lisp_Object instantiator); | |
1035 Lisp_Object make_string_from_file (Lisp_Object file); | |
1036 Lisp_Object tagged_vector_to_alist (Lisp_Object vector); | |
1037 Lisp_Object alist_to_tagged_vector (Lisp_Object tag, Lisp_Object alist); | |
1038 void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | |
1039 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | |
1040 int dest_mask, Lisp_Object domain); | |
442 | 1041 int tab_control_order_only_changed (Lisp_Object image_instance); |
428 | 1042 Lisp_Object allocate_glyph (enum glyph_type type, |
1043 void (*after_change) (Lisp_Object glyph, | |
1044 Lisp_Object property, | |
1045 Lisp_Object locale)); | |
442 | 1046 Lisp_Object normalize_image_instantiator (Lisp_Object instantiator, |
1047 Lisp_Object contype, | |
1048 Lisp_Object dest_mask); | |
1049 void glyph_query_geometry (Lisp_Object glyph_or_image, int* width, int* height, | |
1050 enum image_instance_geometry disp, | |
1051 Lisp_Object domain); | |
1052 void glyph_do_layout (Lisp_Object glyph_or_image, int width, int height, | |
1053 int xoffset, int yoffset, | |
1054 Lisp_Object domain); | |
438 | 1055 void query_string_geometry ( Lisp_Object string, Lisp_Object face, |
442 | 1056 int* width, int* height, int* descent, |
1057 Lisp_Object domain); | |
440 | 1058 Lisp_Object query_string_font (Lisp_Object string, |
438 | 1059 Lisp_Object face, Lisp_Object domain); |
428 | 1060 Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object device); |
1061 void disable_glyph_animated_timeout (int i); | |
1062 | |
1063 /************************************************************************/ | |
1064 /* Glyph Cachels */ | |
1065 /************************************************************************/ | |
1066 | |
1067 typedef struct glyph_cachel glyph_cachel; | |
1068 struct glyph_cachel | |
1069 { | |
3092 | 1070 #ifdef NEW_GC |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
1071 NORMAL_LISP_OBJECT_HEADER header; |
3263 | 1072 #endif /* NEW_GC */ |
428 | 1073 Lisp_Object glyph; |
1074 | |
1075 unsigned int dirty :1; /* I'm copying faces here. I'm not | |
1076 sure why we need two dirty | |
1077 flags. Maybe because an image | |
1078 instance can be dirty and so we | |
1079 need to frob this in the same way | |
1080 as other image instance properties. */ | |
1081 unsigned int updated :1; | |
1082 | |
1083 unsigned short width; | |
1084 unsigned short ascent; | |
1085 unsigned short descent; | |
1086 }; | |
1087 | |
3092 | 1088 #ifdef NEW_GC |
1089 typedef struct glyph_cachel Lisp_Glyph_Cachel; | |
1090 | |
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
1091 DECLARE_LISP_OBJECT (glyph_cachel, Lisp_Glyph_Cachel); |
3092 | 1092 |
1093 #define XGLYPH_CACHEL(x) \ | |
1094 XRECORD (x, glyph_cachel, Lisp_Glyph_Cachel) | |
1095 #define wrap_glyph_cachel(p) wrap_record (p, glyph_cachel) | |
1096 #define GLYPH_CACHEL_P(x) RECORDP (x, glyph_cachel) | |
1097 #define CHECK_GLYPH_CACHEL(x) CHECK_RECORD (x, glyph_cachel) | |
1098 #define CONCHECK_GLYPH_CACHEL(x) CONCHECK_RECORD (x, glyph_cachel) | |
1099 #endif /* NEW_GC */ | |
1100 | |
428 | 1101 #define CONT_GLYPH_INDEX (glyph_index) 0 |
1102 #define TRUN_GLYPH_INDEX (glyph_index) 1 | |
1103 #define HSCROLL_GLYPH_INDEX (glyph_index) 2 | |
1104 #define CONTROL_GLYPH_INDEX (glyph_index) 3 | |
1105 #define OCT_ESC_GLYPH_INDEX (glyph_index) 4 | |
1106 #define INVIS_GLYPH_INDEX (glyph_index) 5 | |
1107 | |
442 | 1108 #ifdef ERROR_CHECK_GLYPHS |
1109 | |
826 | 1110 DECLARE_INLINE_HEADER ( |
1111 int | |
442 | 1112 GLYPH_CACHEL_WIDTH (struct window *window, int ind) |
826 | 1113 ) |
442 | 1114 { |
1115 int wid = Dynarr_atp (window->glyph_cachels, ind)->width; | |
1116 assert (wid >= 0 && wid < 10000); | |
1117 return wid; | |
1118 } | |
826 | 1119 |
1120 DECLARE_INLINE_HEADER ( | |
1121 int | |
442 | 1122 GLYPH_CACHEL_ASCENT (struct window *window, int ind) |
826 | 1123 ) |
442 | 1124 { |
1125 int wid = Dynarr_atp (window->glyph_cachels, ind)->ascent; | |
1126 assert (wid >= 0 && wid < 10000); | |
1127 return wid; | |
1128 } | |
826 | 1129 |
1130 DECLARE_INLINE_HEADER ( | |
1131 int | |
442 | 1132 GLYPH_CACHEL_DESCENT (struct window *window, int ind) |
826 | 1133 ) |
442 | 1134 { |
1135 int wid = Dynarr_atp (window->glyph_cachels, ind)->descent; | |
1136 assert (wid >= 0 && wid < 10000); | |
1137 return wid; | |
1138 } | |
1139 | |
1140 #else /* not ERROR_CHECK_GLYPHS */ | |
1141 | |
800 | 1142 #define GLYPH_CACHEL_WIDTH(window, ind) \ |
442 | 1143 Dynarr_atp (window->glyph_cachels, ind)->width |
1144 #define GLYPH_CACHEL_ASCENT(window, ind) \ | |
1145 Dynarr_atp (window->glyph_cachels, ind)->ascent | |
1146 #define GLYPH_CACHEL_DESCENT(window, ind) \ | |
1147 Dynarr_atp (window->glyph_cachels, ind)->descent | |
1148 | |
1149 #endif /* not ERROR_CHECK_GLYPHS */ | |
1150 | |
1151 #define GLYPH_CACHEL(window, ind) \ | |
1152 Dynarr_atp (window->glyph_cachels, ind) | |
800 | 1153 #define GLYPH_CACHEL_GLYPH(window, ind) \ |
442 | 1154 Dynarr_atp (window->glyph_cachels, ind)->glyph |
1155 #define GLYPH_CACHEL_DIRTYP(window, ind) \ | |
1156 Dynarr_atp (window->glyph_cachels, ind)->dirty | |
428 | 1157 |
1158 void mark_glyph_cachels (glyph_cachel_dynarr *elements); | |
1159 void mark_glyph_cachels_as_not_updated (struct window *w); | |
1160 void mark_glyph_cachels_as_clean (struct window *w); | |
1161 void reset_glyph_cachels (struct window *w); | |
1162 glyph_index get_glyph_cachel_index (struct window *w, Lisp_Object glyph); | |
1163 | |
1164 #ifdef MEMORY_USAGE_STATS | |
1165 int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels, | |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5127
diff
changeset
|
1166 struct usage_stats *ustats); |
428 | 1167 #endif /* MEMORY_USAGE_STATS */ |
1168 | |
1169 /************************************************************************/ | |
1170 /* Display Tables */ | |
1171 /************************************************************************/ | |
1172 | |
867 | 1173 Lisp_Object display_table_entry (Ichar, Lisp_Object, Lisp_Object); |
428 | 1174 void get_display_tables (struct window *, face_index, |
1175 Lisp_Object *, Lisp_Object *); | |
1176 | |
1177 /**************************************************************************** | |
1178 * Subwindow Object * | |
1179 ****************************************************************************/ | |
1180 | |
1181 void unmap_subwindow (Lisp_Object subwindow); | |
1182 void map_subwindow (Lisp_Object subwindow, int x, int y, | |
1183 struct display_glyph_area *dga); | |
647 | 1184 int find_matching_subwindow (struct frame* f, int x, int y, int width, |
1185 int height); | |
442 | 1186 void redisplay_widget (Lisp_Object widget); |
1187 void update_widget_instances (Lisp_Object frame); | |
1188 void redisplay_subwindow (Lisp_Object subwindow); | |
1189 Lisp_Object image_instance_parent_glyph (struct Lisp_Image_Instance*); | |
1190 int image_instance_changed (Lisp_Object image); | |
1191 void free_frame_subwindow_instances (struct frame* f); | |
1192 void reset_frame_subwindow_instance_cache (struct frame* f); | |
1193 int unmap_subwindow_instance_cache_mapper (Lisp_Object key, | |
1194 Lisp_Object value, void* finalize); | |
428 | 1195 |
1196 struct expose_ignore | |
1197 { | |
3092 | 1198 #ifdef NEW_GC |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
1199 NORMAL_LISP_OBJECT_HEADER header; |
3092 | 1200 #endif /* NEW_GC */ |
647 | 1201 int x, y; |
1202 int width, height; | |
428 | 1203 struct expose_ignore *next; |
1204 }; | |
1205 | |
3092 | 1206 #ifdef NEW_GC |
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
1207 DECLARE_LISP_OBJECT (expose_ignore, struct expose_ignore); |
3092 | 1208 #define XEXPOSE_IGNORE(x) XRECORD (x, expose_ignore, struct expose_ignore) |
1209 #define wrap_expose_ignore(p) wrap_record (p, expose_ignore) | |
1210 #define EXPOSE_IGNOREP(x) RECORDP (x, expose_ignore) | |
1211 #define CHECK_EXPOSE_IGNORE(x) CHECK_RECORD (x, expose_ignore) | |
1212 #define CONCHECK_EXPOSE_IGNORE(x) CONCHECK_RECORD (x, expose_ignore) | |
1213 #endif /* NEW_GC */ | |
1214 | |
647 | 1215 int check_for_ignored_expose (struct frame* f, int x, int y, int width, |
1216 int height); | |
428 | 1217 extern int hold_ignored_expose_registration; |
1218 | |
863 | 1219 #define ROUND_UP(arg, unit) (((int)((arg) + (unit) - 1) / (int)(unit)) * (int)(unit)) |
1220 | |
440 | 1221 #endif /* INCLUDED_glyphs_h_ */ |