Mercurial > hg > xemacs-beta
comparison src/glyphs.h @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | de805c49cfc1 |
children | e804706bfb8c |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02111-1307, USA. */ |
21 | 21 |
22 /* Synched up with: Not in FSF. */ | 22 /* Synched up with: Not in FSF. */ |
23 | 23 |
24 #ifndef INCLUDED_glyphs_h_ | 24 #ifndef _XEMACS_GLYPHS_H_ |
25 #define INCLUDED_glyphs_h_ | 25 #define _XEMACS_GLYPHS_H_ |
26 | 26 |
27 #include "specifier.h" | 27 #include "specifier.h" |
28 #include "gui.h" | 28 #include "gui.h" |
29 | 29 |
30 /************************************************************************/ | 30 /************************************************************************/ |
48 jpeg color-pixmap | 48 jpeg color-pixmap |
49 png color-pixmap | 49 png color-pixmap |
50 tiff color-pixmap | 50 tiff color-pixmap |
51 bmp color-pixmap | 51 bmp color-pixmap |
52 cursor-font pointer | 52 cursor-font pointer |
53 mswindows-resource pointer, color-pixmap | 53 mswindows-resource pointer |
54 font pointer | 54 font pointer |
55 subwindow subwindow | 55 subwindow subwindow |
56 inherit mono-pixmap | 56 inherit mono-pixmap |
57 autodetect mono-pixmap, color-pixmap, pointer, text | 57 autodetect mono-pixmap, color-pixmap, pointer, text |
58 button widget | 58 button widget |
59 edit-field widget | 59 edit widget |
60 combo-box widget | 60 combo widget |
61 progress-gauge widget | |
62 tab-control widget | |
63 tree-view widget | |
64 scrollbar widget | 61 scrollbar widget |
65 label widget | 62 static widget |
66 layout widget | |
67 native-layout widget | |
68 */ | 63 */ |
69 | 64 |
70 /* These are methods specific to a particular format of image instantiator | 65 /* These are methods specific to a particular format of image instantiator |
71 (e.g. xpm, string, etc.). */ | 66 (e.g. xpm, string, etc.). */ |
72 | 67 |
74 struct ii_keyword_entry | 69 struct ii_keyword_entry |
75 { | 70 { |
76 Lisp_Object keyword; | 71 Lisp_Object keyword; |
77 void (*validate) (Lisp_Object data); | 72 void (*validate) (Lisp_Object data); |
78 int multiple_p; | 73 int multiple_p; |
79 int copy_p; | |
80 }; | 74 }; |
81 | 75 |
82 typedef struct | 76 typedef struct |
83 { | 77 { |
84 Dynarr_declare (ii_keyword_entry); | 78 Dynarr_declare (ii_keyword_entry); |
85 } ii_keyword_entry_dynarr; | 79 } ii_keyword_entry_dynarr; |
86 | 80 |
87 extern const struct struct_description iim_description; | |
88 | |
89 enum image_instance_geometry | |
90 { | |
91 IMAGE_GEOMETRY, | |
92 IMAGE_DESIRED_GEOMETRY, | |
93 IMAGE_MIN_GEOMETRY, | |
94 IMAGE_MAX_GEOMETRY | |
95 }; | |
96 | |
97 #define IMAGE_UNSPECIFIED_GEOMETRY -1 | |
98 | |
99 #define WIDGET_BORDER_HEIGHT 4 | |
100 #define WIDGET_BORDER_WIDTH 4 | |
101 | |
102 enum governing_domain | |
103 { | |
104 GOVERNING_DOMAIN_WINDOW, | |
105 GOVERNING_DOMAIN_FRAME, | |
106 GOVERNING_DOMAIN_DEVICE | |
107 }; | |
108 | |
109 struct image_instantiator_methods | 81 struct image_instantiator_methods |
110 { | 82 { |
111 Lisp_Object symbol; | 83 Lisp_Object symbol; |
112 | 84 |
113 Lisp_Object device; /* sometimes used */ | 85 Lisp_Object device; /* sometimes used */ |
114 | 86 |
115 ii_keyword_entry_dynarr *keywords; | 87 ii_keyword_entry_dynarr *keywords; |
116 /* consoles this ii is supported on */ | |
117 console_type_entry_dynarr *consoles; | |
118 /* Implementation specific methods: */ | 88 /* Implementation specific methods: */ |
119 | 89 |
120 /* Validate method: Given an instantiator vector, signal an error if | 90 /* Validate method: Given an instantiator vector, signal an error if |
121 it's invalid for this image-instantiator format. Note that this | 91 it's invalid for this image-instantiator format. Note that this |
122 validation only occurs after all the keyword-specific validation | 92 validation only occurs after all the keyword-specific validation |
127 /* Normalize method: Given an instantiator, convert it to the form | 97 /* Normalize method: Given an instantiator, convert it to the form |
128 that should be used in a glyph, for devices of type CONSOLE_TYPE. | 98 that should be used in a glyph, for devices of type CONSOLE_TYPE. |
129 Signal an error if conversion fails. */ | 99 Signal an error if conversion fails. */ |
130 Lisp_Object (*normalize_method) (Lisp_Object instantiator, | 100 Lisp_Object (*normalize_method) (Lisp_Object instantiator, |
131 Lisp_Object console_type); | 101 Lisp_Object console_type); |
132 | |
133 /* Governing domain method: Return an int indicating what type of | |
134 domain an instance in this format is governed by. */ | |
135 int (*governing_domain_method) (void); | |
136 | 102 |
137 /* Possible-dest-types method: Return a mask indicating what dest types | 103 /* Possible-dest-types method: Return a mask indicating what dest types |
138 are compatible with this format. */ | 104 are compatible with this format. */ |
139 int (*possible_dest_types_method) (void); | 105 int (*possible_dest_types_method) (void); |
140 | 106 |
146 Lisp_Object instantiator, | 112 Lisp_Object instantiator, |
147 Lisp_Object pointer_fg, | 113 Lisp_Object pointer_fg, |
148 Lisp_Object pointer_bg, | 114 Lisp_Object pointer_bg, |
149 int dest_mask, | 115 int dest_mask, |
150 Lisp_Object domain); | 116 Lisp_Object domain); |
151 /* Post instantiate method: finish instantiation of the image | |
152 instance. */ | |
153 void (*post_instantiate_method) (Lisp_Object image_instance, | |
154 Lisp_Object instantiator, | |
155 Lisp_Object domain); | |
156 /* Property method: Given an image instance, return device specific | 117 /* Property method: Given an image instance, return device specific |
157 properties. */ | 118 properties. */ |
158 Lisp_Object (*property_method) (Lisp_Object image_instance, | 119 Lisp_Object (*property_method) (Lisp_Object image_instance, |
159 Lisp_Object property); | 120 Lisp_Object property); |
160 /* Set-property method: Given an image instance, set device specific | 121 /* Set-property method: Given an image instance, set device specific |
161 properties. */ | 122 properties. */ |
162 Lisp_Object (*set_property_method) (Lisp_Object image_instance, | 123 Lisp_Object (*set_property_method) (Lisp_Object image_instance, |
163 Lisp_Object property, | 124 Lisp_Object property, |
164 Lisp_Object val); | 125 Lisp_Object val); |
165 /* Asynchronously update properties. */ | |
166 void (*update_method) (Lisp_Object image_instance); | |
167 | |
168 /* Find out the desired geometry, as given by disp, of this image | |
169 instance. Actual geometry is stored in the appropriate slots in the | |
170 image instance. */ | |
171 void (*query_geometry_method) (Lisp_Object image_instance, | |
172 int* width, int* height, | |
173 enum image_instance_geometry disp, | |
174 Lisp_Object domain); | |
175 | |
176 /* Layout the instance and its children bounded by the provided | |
177 dimensions. Returns success or failure. */ | |
178 int (*layout_method) (Lisp_Object image_instance, | |
179 int width, int height, Lisp_Object domain); | |
180 }; | 126 }; |
181 | 127 |
182 /***** Calling an image-instantiator method *****/ | 128 /***** Calling an image-instantiator method *****/ |
183 | 129 |
184 #define HAS_IIFORMAT_METH_P(mstruc, m) (((mstruc)->m##_method) != 0) | 130 #define HAS_IIFORMAT_METH_P(mstruc, m) (((mstruc)->m##_method) != 0) |
203 | 149 |
204 /* Call a specifier method, if it exists; otherwise return | 150 /* Call a specifier method, if it exists; otherwise return |
205 the specified value */ | 151 the specified value */ |
206 | 152 |
207 #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ | 153 #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ |
208 ((mstruc && HAS_IIFORMAT_METH_P (mstruc, m)) ? \ | 154 (HAS_IIFORMAT_METH_P (mstruc, m) ? \ |
209 IIFORMAT_METH (mstruc, m, args) : (given)) | 155 IIFORMAT_METH (mstruc, m, args) : (given)) |
210 | 156 |
211 /***** Defining new image-instantiator types *****/ | 157 /***** Defining new image-instantiator types *****/ |
212 | 158 |
213 #define DECLARE_IMAGE_INSTANTIATOR_FORMAT(format) \ | 159 #define DECLARE_IMAGE_INSTANTIATOR_FORMAT(format) \ |
222 xnew_and_zero (struct image_instantiator_methods); \ | 168 xnew_and_zero (struct image_instantiator_methods); \ |
223 format##_image_instantiator_methods->symbol = Q##format; \ | 169 format##_image_instantiator_methods->symbol = Q##format; \ |
224 format##_image_instantiator_methods->device = Qnil; \ | 170 format##_image_instantiator_methods->device = Qnil; \ |
225 format##_image_instantiator_methods->keywords = \ | 171 format##_image_instantiator_methods->keywords = \ |
226 Dynarr_new (ii_keyword_entry); \ | 172 Dynarr_new (ii_keyword_entry); \ |
227 format##_image_instantiator_methods->consoles = \ | |
228 Dynarr_new (console_type_entry); \ | |
229 add_entry_to_image_instantiator_format_list \ | 173 add_entry_to_image_instantiator_format_list \ |
230 (Q##format, format##_image_instantiator_methods); \ | 174 (Q##format, format##_image_instantiator_methods); \ |
231 dumpstruct (&format##_image_instantiator_methods, \ | |
232 &iim_description); \ | |
233 } while (0) | 175 } while (0) |
234 | 176 |
235 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \ | 177 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \ |
236 do { \ | 178 do { \ |
237 defsymbol (&Q##format, obj_name); \ | 179 defsymbol (&Q##format, obj_name); \ |
238 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name);\ | 180 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name); \ |
239 } while (0) | 181 } while (0) |
240 | 182 |
241 /* Declare that image-instantiator format FORMAT has method M; used in | 183 /* Declare that image-instantiator format FORMAT has method M; used in |
242 initialization routines */ | 184 initialization routines */ |
243 #define IIFORMAT_HAS_METHOD(format, m) \ | 185 #define IIFORMAT_HAS_METHOD(format, m) \ |
247 (format##_image_instantiator_methods->m##_method = type##_##m) | 189 (format##_image_instantiator_methods->m##_method = type##_##m) |
248 | 190 |
249 /* Declare that KEYW is a valid keyword for image-instantiator format | 191 /* Declare that KEYW is a valid keyword for image-instantiator format |
250 FORMAT. VALIDATE_FUN if a function that returns whether the data | 192 FORMAT. VALIDATE_FUN if a function that returns whether the data |
251 is valid. The keyword may not appear more than once. */ | 193 is valid. The keyword may not appear more than once. */ |
252 #define IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, copy, multi) \ | 194 #define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \ |
253 do { \ | 195 do { \ |
254 struct ii_keyword_entry entry; \ | 196 struct ii_keyword_entry entry; \ |
255 \ | 197 \ |
256 entry.keyword = keyw; \ | 198 entry.keyword = keyw; \ |
257 entry.validate = validate_fun; \ | 199 entry.validate = validate_fun; \ |
258 entry.multiple_p = multi; \ | 200 entry.multiple_p = 0; \ |
259 entry.copy_p = copy; \ | |
260 Dynarr_add (format##_image_instantiator_methods->keywords, \ | 201 Dynarr_add (format##_image_instantiator_methods->keywords, \ |
261 entry); \ | 202 entry); \ |
262 } while (0) | 203 } while (0) |
263 | 204 |
264 #define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \ | |
265 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 0) | |
266 | |
267 /* Same as IIFORMAT_VALID_KEYWORD except that the keyword may | 205 /* Same as IIFORMAT_VALID_KEYWORD except that the keyword may |
268 appear multiple times. */ | 206 appear multiple times. */ |
269 #define IIFORMAT_VALID_MULTI_KEYWORD(format, keyw, validate_fun) \ | 207 #define IIFORMAT_VALID_MULTI_KEYWORD(format, keyword, validate_fun) \ |
270 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 1) | 208 do { \ |
271 | 209 struct ii_keyword_entry entry; \ |
272 /* Same as IIFORMAT_VALID_KEYWORD execpt that the argument is not | 210 \ |
273 copied by the specifier functions. This is necessary for things | 211 entry.keyword = keyword; \ |
274 like callbacks etc. */ | 212 entry.validate = validate_fun; \ |
275 #define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun) \ | 213 entry.multiple_p = 1; \ |
276 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 0, 0) | 214 Dynarr_add (format##_image_instantiator_methods->keywords, \ |
277 | 215 entry); \ |
278 /* Declare that image-instantiator format FORMAT is supported on | |
279 CONSOLE type. */ | |
280 #define IIFORMAT_VALID_CONSOLE(console, format) \ | |
281 do { \ | |
282 struct console_type_entry entry; \ | |
283 \ | |
284 entry.symbol = Q##console; \ | |
285 entry.meths = console##_console_methods; \ | |
286 Dynarr_add (format##_image_instantiator_methods->consoles, \ | |
287 entry); \ | |
288 } while (0) | 216 } while (0) |
289 | 217 |
290 #define IIFORMAT_VALID_CONSOLE2(con1, con2, format) \ | 218 #define DEFINE_DEVICE_IIFORMAT(type, format)\ |
291 IIFORMAT_VALID_CONSOLE (con1, format); \ | |
292 IIFORMAT_VALID_CONSOLE (con2, format); | |
293 | |
294 #define DEFINE_DEVICE_IIFORMAT(type, format) \ | |
295 DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \ | |
296 struct image_instantiator_methods *type##_##format##_image_instantiator_methods | 219 struct image_instantiator_methods *type##_##format##_image_instantiator_methods |
297 | 220 |
298 #define INITIALIZE_DEVICE_IIFORMAT(type, format) \ | 221 #define INITIALIZE_DEVICE_IIFORMAT(type, format) \ |
299 do { \ | 222 do { \ |
300 type##_##format##_image_instantiator_methods = \ | 223 type##_##format##_image_instantiator_methods = \ |
301 xnew_and_zero (struct image_instantiator_methods); \ | 224 xnew_and_zero (struct image_instantiator_methods); \ |
302 type##_##format##_image_instantiator_methods->symbol = Q##format; \ | 225 type##_##format##_image_instantiator_methods->symbol = Q##format; \ |
303 type##_##format##_image_instantiator_methods->device = Q##type; \ | 226 type##_##format##_image_instantiator_methods->device = Q##type; \ |
304 type##_##format##_image_instantiator_methods->keywords = \ | 227 type##_##format##_image_instantiator_methods->keywords = \ |
305 Dynarr_new (ii_keyword_entry); \ | 228 Dynarr_new (ii_keyword_entry); \ |
306 add_entry_to_device_ii_format_list \ | 229 add_entry_to_device_ii_format_list \ |
307 (Q##type, Q##format, type##_##format##_image_instantiator_methods); \ | 230 (Q##type, Q##format, type##_##format##_image_instantiator_methods); \ |
308 IIFORMAT_VALID_CONSOLE(type,format); \ | |
309 dumpstruct (&type##_##format##_image_instantiator_methods, \ | |
310 &iim_description); \ | |
311 } while (0) | 231 } while (0) |
312 | 232 |
313 /* Declare that image-instantiator format FORMAT has method M; used in | 233 /* Declare that image-instantiator format FORMAT has method M; used in |
314 initialization routines */ | 234 initialization routines */ |
315 #define IIFORMAT_HAS_DEVMETHOD(type, format, m) \ | 235 #define IIFORMAT_HAS_DEVMETHOD(type, format, m) \ |
316 (type##_##format##_image_instantiator_methods->m##_method = type##_##format##_##m) | 236 (type##_##format##_image_instantiator_methods->m##_method = type##_##format##_##m) |
317 #define IIFORMAT_HAS_SHARED_DEVMETHOD(type, format, m, fromformat) \ | |
318 (type##_##format##_image_instantiator_methods->m##_method = type##_##fromformat##_##m) | |
319 | |
320 #define IIFORMAT_INHERITS_DEVMETHOD(type, from, format, m) \ | |
321 (type##_##format##_image_instantiator_methods->m##_method = from##_##format##_##m) | |
322 #define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \ | |
323 (type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m) | |
324 | 237 |
325 struct image_instantiator_methods * | 238 struct image_instantiator_methods * |
326 decode_device_ii_format (Lisp_Object device, Lisp_Object format, | 239 decode_device_ii_format (Lisp_Object device, Lisp_Object format, |
327 Error_behavior errb); | 240 Error_behavior errb); |
328 struct image_instantiator_methods * | 241 struct image_instantiator_methods * |
346 Lisp_Object console_type); | 259 Lisp_Object console_type); |
347 void check_valid_string (Lisp_Object data); | 260 void check_valid_string (Lisp_Object data); |
348 void check_valid_int (Lisp_Object data); | 261 void check_valid_int (Lisp_Object data); |
349 void check_valid_face (Lisp_Object data); | 262 void check_valid_face (Lisp_Object data); |
350 void check_valid_vector (Lisp_Object data); | 263 void check_valid_vector (Lisp_Object data); |
351 void check_valid_item_list_1 (Lisp_Object items); | 264 |
352 | 265 void initialize_subwindow_image_instance (struct Lisp_Image_Instance*); |
353 void initialize_subwindow_image_instance (Lisp_Image_Instance*); | |
354 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | 266 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
355 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | 267 Lisp_Object pointer_fg, Lisp_Object pointer_bg, |
356 int dest_mask, Lisp_Object domain); | 268 int dest_mask, Lisp_Object domain); |
357 int subwindow_governing_domain (void); | |
358 void widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | |
359 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | |
360 int dest_mask, Lisp_Object domain); | |
361 void image_instance_query_geometry (Lisp_Object image_instance, | |
362 int* width, int* height, | |
363 enum image_instance_geometry disp, | |
364 Lisp_Object domain); | |
365 void image_instance_layout (Lisp_Object image_instance, | |
366 int width, int height, | |
367 Lisp_Object domain); | |
368 int layout_layout (Lisp_Object image_instance, | |
369 int width, int height, | |
370 Lisp_Object domain); | |
371 int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w); | |
372 | 269 |
373 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, | 270 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, |
374 int given_dest_mask, | 271 int given_dest_mask, |
375 int desired_dest_mask)); | 272 int desired_dest_mask)); |
376 DECLARE_DOESNT_RETURN (signal_image_error (const char *, Lisp_Object)); | 273 DECLARE_DOESNT_RETURN (signal_image_error (CONST char *, Lisp_Object)); |
377 DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object, Lisp_Object)); | 274 DECLARE_DOESNT_RETURN (signal_image_error_2 (CONST char *, Lisp_Object, Lisp_Object)); |
378 | 275 |
379 /************************************************************************/ | 276 /************************************************************************/ |
380 /* Image Specifier Object */ | 277 /* Image Specifier Object */ |
381 /************************************************************************/ | 278 /************************************************************************/ |
382 | 279 |
408 | 305 |
409 /************************************************************************/ | 306 /************************************************************************/ |
410 /* Image Instance Object */ | 307 /* Image Instance Object */ |
411 /************************************************************************/ | 308 /************************************************************************/ |
412 | 309 |
413 DECLARE_LRECORD (image_instance, Lisp_Image_Instance); | 310 DECLARE_LRECORD (image_instance, struct Lisp_Image_Instance); |
414 #define XIMAGE_INSTANCE(x) XRECORD (x, image_instance, Lisp_Image_Instance) | 311 #define XIMAGE_INSTANCE(x) \ |
312 XRECORD (x, image_instance, struct Lisp_Image_Instance) | |
415 #define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance) | 313 #define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance) |
416 #define IMAGE_INSTANCEP(x) RECORDP (x, image_instance) | 314 #define IMAGE_INSTANCEP(x) RECORDP (x, image_instance) |
315 #define GC_IMAGE_INSTANCEP(x) GC_RECORDP (x, image_instance) | |
417 #define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance) | 316 #define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance) |
418 #define CONCHECK_IMAGE_INSTANCE(x) CONCHECK_RECORD (x, image_instance) | 317 #define CONCHECK_IMAGE_INSTANCE(x) CONCHECK_RECORD (x, image_instance) |
419 | |
420 #ifdef ERROR_CHECK_GLYPHS | |
421 void check_image_instance_structure (Lisp_Object instance); | |
422 void check_window_subwindow_cache (struct window* w); | |
423 #define ERROR_CHECK_IMAGE_INSTANCE(ii) \ | |
424 check_image_instance_structure (ii) | |
425 #define ERROR_CHECK_SUBWINDOW_CACHE(w) \ | |
426 check_window_subwindow_cache (w) | |
427 #else | |
428 #define ERROR_CHECK_IMAGE_INSTANCE(ii) | |
429 #define ERROR_CHECK_SUBWINDOW_CACHE(w) | |
430 #endif | |
431 | 318 |
432 enum image_instance_type | 319 enum image_instance_type |
433 { | 320 { |
434 IMAGE_UNKNOWN, | 321 IMAGE_UNKNOWN, |
435 IMAGE_NOTHING, | 322 IMAGE_NOTHING, |
446 #define IMAGE_MONO_PIXMAP_MASK (1 << 2) | 333 #define IMAGE_MONO_PIXMAP_MASK (1 << 2) |
447 #define IMAGE_COLOR_PIXMAP_MASK (1 << 3) | 334 #define IMAGE_COLOR_PIXMAP_MASK (1 << 3) |
448 #define IMAGE_POINTER_MASK (1 << 4) | 335 #define IMAGE_POINTER_MASK (1 << 4) |
449 #define IMAGE_SUBWINDOW_MASK (1 << 5) | 336 #define IMAGE_SUBWINDOW_MASK (1 << 5) |
450 #define IMAGE_WIDGET_MASK (1 << 6) | 337 #define IMAGE_WIDGET_MASK (1 << 6) |
451 | |
452 /* This depends on the fact that enums are assigned consecutive | |
453 integers starting at 0. (Remember that IMAGE_UNKNOWN is the | |
454 first enum.) I'm fairly sure this behavior is ANSI-mandated, | |
455 so there should be no portability problems here. */ | |
456 #define image_instance_type_to_mask(type) \ | |
457 ((int) (1 << ((int) (type) - 1))) | |
458 | 338 |
459 #define IMAGE_INSTANCE_TYPE_P(ii, type) \ | 339 #define IMAGE_INSTANCE_TYPE_P(ii, type) \ |
460 (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type) | 340 (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type) |
461 | 341 |
462 #define NOTHING_IMAGE_INSTANCEP(ii) \ | 342 #define NOTHING_IMAGE_INSTANCEP(ii) \ |
518 } while (0) | 398 } while (0) |
519 | 399 |
520 struct Lisp_Image_Instance | 400 struct Lisp_Image_Instance |
521 { | 401 { |
522 struct lcrecord_header header; | 402 struct lcrecord_header header; |
523 Lisp_Object domain; /* The domain in which we were cached. */ | 403 Lisp_Object device; |
524 Lisp_Object device; /* The device of the domain. Recorded | |
525 since the domain may get deleted | |
526 before us. */ | |
527 Lisp_Object name; | 404 Lisp_Object name; |
528 /* The glyph from which we were instantiated. This is a weak | |
529 reference. */ | |
530 Lisp_Object parent; | |
531 enum image_instance_type type; | 405 enum image_instance_type type; |
532 unsigned int x_offset, y_offset; /* for layout purposes */ | |
533 int width, height, margin_width; | |
534 unsigned long display_hash; /* Hash value representing the structure | |
535 of the image_instance when it was | |
536 last displayed. */ | |
537 unsigned int dirty : 1; | |
538 unsigned int size_changed : 1; | |
539 unsigned int text_changed : 1; | |
540 unsigned int layout_changed : 1; | |
541 unsigned int optimize_output : 1; /* For outputting layouts. */ | |
542 unsigned int initialized : 1; /* When we're fully done. */ | |
543 | |
544 union | 406 union |
545 { | 407 { |
546 struct | 408 struct |
547 { | 409 { |
548 unsigned int descent; | |
549 Lisp_Object string; | 410 Lisp_Object string; |
550 } text; | 411 } text; |
551 struct | 412 struct |
552 { | 413 { |
553 unsigned int depth; | 414 int width, height, depth; |
554 unsigned int slice, maxslice, timeout; | |
555 Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */ | 415 Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */ |
556 Lisp_Object filename; /* string or Qnil */ | 416 Lisp_Object filename; /* string or Qnil */ |
557 Lisp_Object mask_filename; /* string or Qnil */ | 417 Lisp_Object mask_filename; /* string or Qnil */ |
558 Lisp_Object fg, bg; /* foreground and background colors, | 418 Lisp_Object fg, bg; /* foreground and background colors, |
559 if this is a colorized mono-pixmap | 419 if this is a colorized mono-pixmap |
560 or a pointer */ | 420 or a pointer */ |
561 Lisp_Object auxdata; /* list or Qnil: any additional data | 421 Lisp_Object auxdata; /* list or Qnil: any additional data |
562 to be seen from lisp */ | 422 to be seen from lisp */ |
563 void* mask; /* mask that can be seen from all windowing systems */ | |
564 } pixmap; /* used for pointers as well */ | 423 } pixmap; /* used for pointers as well */ |
565 struct | 424 struct |
566 { | 425 { |
426 Lisp_Object frame; | |
427 unsigned int width, height; | |
567 void* subwindow; /* specific devices can use this as necessary */ | 428 void* subwindow; /* specific devices can use this as necessary */ |
568 struct | 429 int being_displayed; /* used to detect when needs to be unmapped */ |
569 { /* We need these so we can do without | 430 struct |
570 subwindow_cachel */ | 431 { |
571 unsigned int x, y; | 432 Lisp_Object face; /* foreground and background colors */ |
572 unsigned int width, height; | 433 Lisp_Object type; |
573 } display_data; | 434 Lisp_Object props; /* properties */ |
574 unsigned int being_displayed : 1; /* used to detect when needs | 435 struct gui_item gui_item; |
575 to be unmapped */ | 436 } widget; /* widgets are subwindows */ |
576 unsigned int v_resize : 1; /* Whether the vsize is allowed to change. */ | |
577 unsigned int h_resize : 1; /* Whether the hsize is allowed to change. */ | |
578 unsigned int orientation : 1; /* Vertical or horizontal. */ | |
579 unsigned int justification : 2; /* Left, right or center. */ | |
580 /* Face for colors and font. We specify this here because we | |
581 want people to be able to put :face in the instantiator | |
582 spec. Using gyph-face is more inconvenient, although more | |
583 general. */ | |
584 Lisp_Object face; | |
585 Lisp_Object type; | |
586 Lisp_Object props; /* properties or border*/ | |
587 Lisp_Object items; /* a list of displayed gui_items */ | |
588 Lisp_Object pending_items; /* gui_items that should be displayed */ | |
589 Lisp_Object children; /* a list of children */ | |
590 Lisp_Object width; /* dynamic width spec. */ | |
591 Lisp_Object height; /* dynamic height spec. */ | |
592 /* Change flags to augment dirty. */ | |
593 unsigned int face_changed : 1; | |
594 unsigned int items_changed : 1; | |
595 } subwindow; | 437 } subwindow; |
596 } u; | 438 } u; |
597 | 439 |
598 /* console-type- and image-type-specific data */ | 440 /* console-type- and image-type-specific data */ |
599 void *data; | 441 void *data; |
600 }; | 442 }; |
601 | 443 |
602 /* Layout bit-fields. */ | |
603 #define LAYOUT_HORIZONTAL 0 | |
604 #define LAYOUT_VERTICAL 1 | |
605 | |
606 #define LAYOUT_JUSTIFY_LEFT 0 | |
607 #define LAYOUT_JUSTIFY_RIGHT 1 | |
608 #define LAYOUT_JUSTIFY_CENTER 2 | |
609 | |
610 #define IMAGE_INSTANCE_HASH_DEPTH 0 | |
611 | |
612 /* Accessor macros. */ | |
613 #define IMAGE_INSTANCE_DOMAIN(i) ((i)->domain) | |
614 #define IMAGE_INSTANCE_DOMAIN_LIVE_P(i) (DOMAIN_LIVE_P ((i)->domain)) | |
615 #define IMAGE_INSTANCE_DEVICE(i) ((i)->device) | 444 #define IMAGE_INSTANCE_DEVICE(i) ((i)->device) |
616 #define IMAGE_INSTANCE_FRAME(i) (DOMAIN_FRAME ((i)->domain)) | |
617 #define IMAGE_INSTANCE_NAME(i) ((i)->name) | 445 #define IMAGE_INSTANCE_NAME(i) ((i)->name) |
618 #define IMAGE_INSTANCE_PARENT(i) ((i)->parent) | |
619 #define IMAGE_INSTANCE_GLYPH(i) (image_instance_parent_glyph(i)) | |
620 #define IMAGE_INSTANCE_TYPE(i) ((i)->type) | 446 #define IMAGE_INSTANCE_TYPE(i) ((i)->type) |
621 #define IMAGE_INSTANCE_XOFFSET(i) ((i)->x_offset) | 447 #define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \ |
622 #define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset) | 448 ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \ |
623 #define IMAGE_INSTANCE_WIDTH(i) ((i)->width) | |
624 #define IMAGE_INSTANCE_MARGIN_WIDTH(i) ((i)->margin_width) | |
625 #define IMAGE_INSTANCE_HEIGHT(i) ((i)->height) | |
626 #define IMAGE_INSTANCE_INITIALIZED(i) ((i)->initialized) | |
627 #define IMAGE_INSTANCE_DISPLAY_HASH(i) ((i)->display_hash) | |
628 #define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \ | |
629 ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \ | |
630 || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP)) | 449 || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP)) |
631 #define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty) | 450 |
632 #define IMAGE_INSTANCE_NEEDS_LAYOUT(i) \ | |
633 ((IMAGE_INSTANCE_DIRTYP (i) && IMAGE_INSTANCE_LAYOUT_CHANGED (i)) \ | |
634 || (FRAMEP (IMAGE_INSTANCE_FRAME (i)) \ | |
635 && XFRAME (IMAGE_INSTANCE_FRAME (i))->size_changed)) | |
636 #define IMAGE_INSTANCE_FACE(i) \ | |
637 (GLYPHP (IMAGE_INSTANCE_GLYPH (i)) ? \ | |
638 XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) : Qnil) | |
639 | |
640 /* Changed flags */ | |
641 #define IMAGE_INSTANCE_TEXT_CHANGED(i) ((i)->text_changed) | |
642 #define IMAGE_INSTANCE_SIZE_CHANGED(i) ((i)->size_changed) | |
643 #define IMAGE_INSTANCE_WIDGET_FACE_CHANGED(i) \ | |
644 ((i)->u.subwindow.face_changed) | |
645 #define IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED(i) \ | |
646 ((i)->u.subwindow.items_changed) | |
647 #define IMAGE_INSTANCE_LAYOUT_CHANGED(i) ((i)->layout_changed) | |
648 #define IMAGE_INSTANCE_OPTIMIZE_OUTPUT(i) ((i)->optimize_output) | |
649 | |
650 /* Text properties */ | |
651 #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string) | 451 #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string) |
652 #define IMAGE_INSTANCE_TEXT_WIDTH(i) \ | 452 |
653 IMAGE_INSTANCE_WIDTH(i) | 453 #define IMAGE_INSTANCE_PIXMAP_WIDTH(i) ((i)->u.pixmap.width) |
654 #define IMAGE_INSTANCE_TEXT_HEIGHT(i) \ | 454 #define IMAGE_INSTANCE_PIXMAP_HEIGHT(i) ((i)->u.pixmap.height) |
655 IMAGE_INSTANCE_HEIGHT(i) | |
656 #define IMAGE_INSTANCE_TEXT_DESCENT(i) ((i)->u.text.descent) | |
657 #define IMAGE_INSTANCE_TEXT_ASCENT(i) \ | |
658 (IMAGE_INSTANCE_TEXT_HEIGHT(i) - IMAGE_INSTANCE_TEXT_DESCENT(i)) | |
659 | |
660 /* Pixmap properties */ | |
661 #define IMAGE_INSTANCE_PIXMAP_WIDTH(i) \ | |
662 IMAGE_INSTANCE_WIDTH(i) | |
663 #define IMAGE_INSTANCE_PIXMAP_HEIGHT(i) \ | |
664 IMAGE_INSTANCE_HEIGHT(i) | |
665 #define IMAGE_INSTANCE_PIXMAP_DEPTH(i) ((i)->u.pixmap.depth) | 455 #define IMAGE_INSTANCE_PIXMAP_DEPTH(i) ((i)->u.pixmap.depth) |
666 #define IMAGE_INSTANCE_PIXMAP_FILENAME(i) ((i)->u.pixmap.filename) | 456 #define IMAGE_INSTANCE_PIXMAP_FILENAME(i) ((i)->u.pixmap.filename) |
667 #define IMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) ((i)->u.pixmap.mask_filename) | 457 #define IMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) ((i)->u.pixmap.mask_filename) |
668 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) ((i)->u.pixmap.hotspot_x) | 458 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) ((i)->u.pixmap.hotspot_x) |
669 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y) | 459 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y) |
670 #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg) | 460 #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg) |
671 #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg) | 461 #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg) |
672 #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata) | 462 #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata) |
673 #define IMAGE_INSTANCE_PIXMAP_MASK(i) ((i)->u.pixmap.mask) | 463 |
674 #define IMAGE_INSTANCE_PIXMAP_SLICE(i) ((i)->u.pixmap.slice) | 464 #define IMAGE_INSTANCE_SUBWINDOW_WIDTH(i) ((i)->u.subwindow.width) |
675 #define IMAGE_INSTANCE_PIXMAP_MAXSLICE(i) ((i)->u.pixmap.maxslice) | 465 #define IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) ((i)->u.subwindow.height) |
676 #define IMAGE_INSTANCE_PIXMAP_TIMEOUT(i) ((i)->u.pixmap.timeout) | |
677 | |
678 /* Subwindow properties */ | |
679 #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow) | 466 #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow) |
680 /* Display data. */ | 467 #define IMAGE_INSTANCE_SUBWINDOW_FRAME(i) ((i)->u.subwindow.frame) |
681 #define IMAGE_INSTANCE_DISPLAY_X(i) ((i)->u.subwindow.display_data.x) | |
682 #define IMAGE_INSTANCE_DISPLAY_Y(i) ((i)->u.subwindow.display_data.y) | |
683 #define IMAGE_INSTANCE_DISPLAY_WIDTH(i) \ | |
684 ((i)->u.subwindow.display_data.width) | |
685 #define IMAGE_INSTANCE_DISPLAY_HEIGHT(i) \ | |
686 ((i)->u.subwindow.display_data.height) | |
687 #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ | 468 #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ |
688 ((i)->u.subwindow.being_displayed) | 469 ((i)->u.subwindow.being_displayed) |
689 #define IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP(i) \ | 470 |
690 ((i)->u.subwindow.v_resize) | |
691 #define IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP(i) \ | |
692 ((i)->u.subwindow.h_resize) | |
693 #define IMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \ | |
694 ((i)->u.subwindow.orientation) | |
695 #define IMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \ | |
696 ((i)->u.subwindow.justification) | |
697 | |
698 /* Widget properties */ | |
699 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \ | 471 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \ |
700 IMAGE_INSTANCE_WIDTH(i) | 472 IMAGE_INSTANCE_SUBWINDOW_WIDTH(i) |
701 #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \ | 473 #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \ |
702 IMAGE_INSTANCE_HEIGHT(i) | 474 IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) |
703 #define IMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) ((i)->u.subwindow.width) | 475 #define IMAGE_INSTANCE_WIDGET_CALLBACK(i) \ |
704 #define IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) ((i)->u.subwindow.height) | 476 ((i)->u.subwindow.widget.gui_item.callback) |
705 #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type) | 477 #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.widget.type) |
706 #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props) | 478 #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.widget.props) |
707 #define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \ | 479 #define IMAGE_INSTANCE_WIDGET_FACE(i) ((i)->u.subwindow.widget.face) |
708 ((i)->u.subwindow.face = f) | 480 #define IMAGE_INSTANCE_WIDGET_TEXT(i) ((i)->u.subwindow.widget.gui_item.name) |
709 #define IMAGE_INSTANCE_WIDGET_FACE(i) \ | 481 #define IMAGE_INSTANCE_WIDGET_ITEM(i) ((i)->u.subwindow.widget.gui_item) |
710 (!NILP ((i)->u.subwindow.face) ? (i)->u.subwindow.face : \ | 482 |
711 !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \ | |
712 Vwidget_face) | |
713 #define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.items) | |
714 #define IMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ | |
715 ((i)->u.subwindow.pending_items) | |
716 #define IMAGE_INSTANCE_WIDGET_ITEM(i) \ | |
717 (CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \ | |
718 XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \ | |
719 IMAGE_INSTANCE_WIDGET_ITEMS (i)) | |
720 #define IMAGE_INSTANCE_WIDGET_TEXT(i) XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (i))->name | |
721 | |
722 /* Layout properties */ | |
723 #define IMAGE_INSTANCE_LAYOUT_CHILDREN(i) ((i)->u.subwindow.children) | |
724 #define IMAGE_INSTANCE_LAYOUT_BORDER(i) ((i)->u.subwindow.props) | |
725 | |
726 #define XIMAGE_INSTANCE_DOMAIN(i) \ | |
727 IMAGE_INSTANCE_DOMAIN (XIMAGE_INSTANCE (i)) | |
728 #define XIMAGE_INSTANCE_DOMAIN_LIVE_P(i) \ | |
729 IMAGE_INSTANCE_DOMAIN_LIVE_P (XIMAGE_INSTANCE (i)) | |
730 #define XIMAGE_INSTANCE_DEVICE(i) \ | 483 #define XIMAGE_INSTANCE_DEVICE(i) \ |
731 IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i)) | 484 IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i)) |
732 #define XIMAGE_INSTANCE_FRAME(i) \ | |
733 IMAGE_INSTANCE_FRAME (XIMAGE_INSTANCE (i)) | |
734 #define XIMAGE_INSTANCE_NAME(i) \ | 485 #define XIMAGE_INSTANCE_NAME(i) \ |
735 IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i)) | 486 IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i)) |
736 #define XIMAGE_INSTANCE_GLYPH(i) \ | |
737 IMAGE_INSTANCE_GLYPH (XIMAGE_INSTANCE (i)) | |
738 #define XIMAGE_INSTANCE_PARENT(i) \ | |
739 IMAGE_INSTANCE_PARENT (XIMAGE_INSTANCE (i)) | |
740 #define XIMAGE_INSTANCE_TYPE(i) \ | 487 #define XIMAGE_INSTANCE_TYPE(i) \ |
741 IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i)) | 488 IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i)) |
742 #define XIMAGE_INSTANCE_DISPLAY_HASH(i) \ | |
743 IMAGE_INSTANCE_DISPLAY_HASH (XIMAGE_INSTANCE (i)) | |
744 #define XIMAGE_INSTANCE_XOFFSET(i) \ | |
745 IMAGE_INSTANCE_XOFFSET (XIMAGE_INSTANCE (i)) | |
746 #define XIMAGE_INSTANCE_YOFFSET(i) \ | |
747 IMAGE_INSTANCE_YOFFSET (XIMAGE_INSTANCE (i)) | |
748 #define XIMAGE_INSTANCE_DIRTYP(i) \ | |
749 IMAGE_INSTANCE_DIRTYP (XIMAGE_INSTANCE (i)) | |
750 #define XIMAGE_INSTANCE_NEEDS_LAYOUT(i) \ | |
751 IMAGE_INSTANCE_NEEDS_LAYOUT (XIMAGE_INSTANCE (i)) | |
752 #define XIMAGE_INSTANCE_WIDTH(i) \ | |
753 IMAGE_INSTANCE_WIDTH (XIMAGE_INSTANCE (i)) | |
754 #define XIMAGE_INSTANCE_MARGIN_WIDTH(i) \ | |
755 IMAGE_INSTANCE_MARGIN_WIDTH (XIMAGE_INSTANCE (i)) | |
756 #define XIMAGE_INSTANCE_HEIGHT(i) \ | |
757 IMAGE_INSTANCE_HEIGHT (XIMAGE_INSTANCE (i)) | |
758 #define XIMAGE_INSTANCE_INITIALIZED(i) \ | |
759 IMAGE_INSTANCE_INITIALIZED (XIMAGE_INSTANCE (i)) | |
760 #define XIMAGE_INSTANCE_FACE(i) \ | |
761 IMAGE_INSTANCE_FACE (XIMAGE_INSTANCE (i)) | |
762 | 489 |
763 #define XIMAGE_INSTANCE_TEXT_STRING(i) \ | 490 #define XIMAGE_INSTANCE_TEXT_STRING(i) \ |
764 IMAGE_INSTANCE_TEXT_STRING (XIMAGE_INSTANCE (i)) | 491 IMAGE_INSTANCE_TEXT_STRING (XIMAGE_INSTANCE (i)) |
765 #define XIMAGE_INSTANCE_TEXT_WIDTH(i) \ | |
766 IMAGE_INSTANCE_TEXT_WIDTH (XIMAGE_INSTANCE (i)) | |
767 #define XIMAGE_INSTANCE_TEXT_HEIGHT(i) \ | |
768 IMAGE_INSTANCE_TEXT_HEIGHT (XIMAGE_INSTANCE (i)) | |
769 #define XIMAGE_INSTANCE_TEXT_ASCENT(i) \ | |
770 IMAGE_INSTANCE_TEXT_ASCENT (XIMAGE_INSTANCE (i)) | |
771 #define XIMAGE_INSTANCE_TEXT_DESCENT(i) \ | |
772 IMAGE_INSTANCE_TEXT_DESCENT (XIMAGE_INSTANCE (i)) | |
773 | 492 |
774 #define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \ | 493 #define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \ |
775 IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i)) | 494 IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i)) |
776 #define XIMAGE_INSTANCE_PIXMAP_HEIGHT(i) \ | 495 #define XIMAGE_INSTANCE_PIXMAP_HEIGHT(i) \ |
777 IMAGE_INSTANCE_PIXMAP_HEIGHT (XIMAGE_INSTANCE (i)) | 496 IMAGE_INSTANCE_PIXMAP_HEIGHT (XIMAGE_INSTANCE (i)) |
787 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (XIMAGE_INSTANCE (i)) | 506 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (XIMAGE_INSTANCE (i)) |
788 #define XIMAGE_INSTANCE_PIXMAP_FG(i) \ | 507 #define XIMAGE_INSTANCE_PIXMAP_FG(i) \ |
789 IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i)) | 508 IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i)) |
790 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \ | 509 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \ |
791 IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i)) | 510 IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i)) |
792 #define XIMAGE_INSTANCE_PIXMAP_MASK(i) \ | |
793 IMAGE_INSTANCE_PIXMAP_MASK (XIMAGE_INSTANCE (i)) | |
794 #define XIMAGE_INSTANCE_PIXMAP_SLICE(i) \ | |
795 IMAGE_INSTANCE_PIXMAP_SLICE (XIMAGE_INSTANCE (i)) | |
796 #define XIMAGE_INSTANCE_PIXMAP_MAXSLICE(i) \ | |
797 IMAGE_INSTANCE_PIXMAP_MAXSLICE (XIMAGE_INSTANCE (i)) | |
798 #define XIMAGE_INSTANCE_PIXMAP_TIMEOUT(i) \ | |
799 IMAGE_INSTANCE_PIXMAP_TIMEOUT (XIMAGE_INSTANCE (i)) | |
800 | 511 |
801 #define XIMAGE_INSTANCE_WIDGET_WIDTH(i) \ | 512 #define XIMAGE_INSTANCE_WIDGET_WIDTH(i) \ |
802 IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i)) | 513 IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i)) |
803 #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \ | 514 #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \ |
804 IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i)) | 515 IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i)) |
805 #define XIMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) \ | 516 #define XIMAGE_INSTANCE_WIDGET_CALLBACK(i) \ |
806 IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (XIMAGE_INSTANCE (i)) | 517 IMAGE_INSTANCE_WIDGET_CALLBACK (XIMAGE_INSTANCE (i)) |
807 #define XIMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) \ | |
808 IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (XIMAGE_INSTANCE (i)) | |
809 #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ | 518 #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ |
810 IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) | 519 IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) |
811 #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ | 520 #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ |
812 IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i)) | 521 IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i)) |
813 #define XIMAGE_INSTANCE_WIDGET_FACE(i) \ | 522 #define XIMAGE_INSTANCE_WIDGET_FACE(i) \ |
814 IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) | 523 IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) |
815 #define XSET_IMAGE_INSTANCE_WIDGET_FACE(i) \ | 524 #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \ |
816 SET_IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) | 525 IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i)) |
817 #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \ | 526 #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \ |
818 IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i)) | 527 IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i)) |
819 #define XIMAGE_INSTANCE_WIDGET_ITEMS(i) \ | 528 |
820 IMAGE_INSTANCE_WIDGET_ITEMS (XIMAGE_INSTANCE (i)) | 529 #define XIMAGE_INSTANCE_SUBWINDOW_WIDTH(i) \ |
821 #define XIMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ | 530 IMAGE_INSTANCE_SUBWINDOW_WIDTH (XIMAGE_INSTANCE (i)) |
822 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (XIMAGE_INSTANCE (i)) | 531 #define XIMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) \ |
823 #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \ | 532 IMAGE_INSTANCE_SUBWINDOW_HEIGHT (XIMAGE_INSTANCE (i)) |
824 IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i)) | |
825 | |
826 #define XIMAGE_INSTANCE_LAYOUT_CHILDREN(i) \ | |
827 IMAGE_INSTANCE_LAYOUT_CHILDREN (XIMAGE_INSTANCE (i)) | |
828 #define XIMAGE_INSTANCE_LAYOUT_BORDER(i) \ | |
829 IMAGE_INSTANCE_LAYOUT_BORDER (XIMAGE_INSTANCE (i)) | |
830 | |
831 #define XIMAGE_INSTANCE_SUBWINDOW_ID(i) \ | 533 #define XIMAGE_INSTANCE_SUBWINDOW_ID(i) \ |
832 IMAGE_INSTANCE_SUBWINDOW_ID (XIMAGE_INSTANCE (i)) | 534 IMAGE_INSTANCE_SUBWINDOW_ID (XIMAGE_INSTANCE (i)) |
833 #define XIMAGE_INSTANCE_DISPLAY_X(i) \ | 535 #define XIMAGE_INSTANCE_SUBWINDOW_FRAME(i) \ |
834 IMAGE_INSTANCE_DISPLAY_X (XIMAGE_INSTANCE (i)) | 536 IMAGE_INSTANCE_SUBWINDOW_FRAME (XIMAGE_INSTANCE (i)) |
835 #define XIMAGE_INSTANCE_DISPLAY_Y(i) \ | |
836 IMAGE_INSTANCE_DISPLAY_Y (XIMAGE_INSTANCE (i)) | |
837 #define XIMAGE_INSTANCE_DISPLAY_WIDTH(i) \ | |
838 IMAGE_INSTANCE_DISPLAY_WIDTH (XIMAGE_INSTANCE (i)) | |
839 #define XIMAGE_INSTANCE_DISPLAY_HEIGHT(i) \ | |
840 IMAGE_INSTANCE_DISPLAY_HEIGHT (XIMAGE_INSTANCE (i)) | |
841 #define XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ | 537 #define XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ |
842 IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (XIMAGE_INSTANCE (i)) | 538 IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (XIMAGE_INSTANCE (i)) |
843 #define XIMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \ | |
844 IMAGE_INSTANCE_SUBWINDOW_ORIENT (XIMAGE_INSTANCE (i)) | |
845 #define XIMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \ | |
846 IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (XIMAGE_INSTANCE (i)) | |
847 | |
848 #define MARK_IMAGE_INSTANCE_CHANGED(i) \ | |
849 (IMAGE_INSTANCE_DIRTYP (i) = 1); | |
850 | |
851 Lisp_Object image_instance_device (Lisp_Object instance); | |
852 Lisp_Object image_instance_frame (Lisp_Object instance); | |
853 Lisp_Object image_instance_window (Lisp_Object instance); | |
854 int image_instance_live_p (Lisp_Object instance); | |
855 | 539 |
856 #ifdef HAVE_XPM | 540 #ifdef HAVE_XPM |
857 Lisp_Object evaluate_xpm_color_symbols (void); | 541 Lisp_Object evaluate_xpm_color_symbols (void); |
858 Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid); | 542 Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid); |
859 #endif /* HAVE_XPM */ | 543 #endif /* HAVE_XPM */ |
860 #ifdef HAVE_WINDOW_SYSTEM | 544 #ifdef HAVE_WINDOW_SYSTEM |
861 Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot, | 545 Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot, |
862 int ok_if_data_invalid); | 546 int ok_if_data_invalid); |
863 int read_bitmap_data_from_file (const char *filename, unsigned int *width, | 547 int read_bitmap_data_from_file (CONST char *filename, unsigned int *width, |
864 unsigned int *height, unsigned char **datap, | 548 unsigned int *height, unsigned char **datap, |
865 int *x_hot, int *y_hot); | 549 int *x_hot, int *y_hot); |
866 Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file, | 550 Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file, |
867 Lisp_Object mask_file, | 551 Lisp_Object mask_file, |
868 Lisp_Object console_type); | 552 Lisp_Object console_type); |
894 Lisp_Object face; /* if non-nil, face to use when displaying */ | 578 Lisp_Object face; /* if non-nil, face to use when displaying */ |
895 | 579 |
896 Lisp_Object plist; | 580 Lisp_Object plist; |
897 void (*after_change) (Lisp_Object glyph, Lisp_Object property, | 581 void (*after_change) (Lisp_Object glyph, Lisp_Object property, |
898 Lisp_Object locale); | 582 Lisp_Object locale); |
899 | 583 }; |
900 unsigned int dirty : 1; /* So that we can selectively | 584 |
901 redisplay changed glyphs. */ | 585 DECLARE_LRECORD (glyph, struct Lisp_Glyph); |
902 }; | 586 #define XGLYPH(x) XRECORD (x, glyph, struct Lisp_Glyph) |
903 typedef struct Lisp_Glyph Lisp_Glyph; | |
904 | |
905 DECLARE_LRECORD (glyph, Lisp_Glyph); | |
906 #define XGLYPH(x) XRECORD (x, glyph, Lisp_Glyph) | |
907 #define XSETGLYPH(x, p) XSETRECORD (x, p, glyph) | 587 #define XSETGLYPH(x, p) XSETRECORD (x, p, glyph) |
908 #define GLYPHP(x) RECORDP (x, glyph) | 588 #define GLYPHP(x) RECORDP (x, glyph) |
589 #define GC_GLYPHP(x) GC_RECORDP (x, glyph) | |
909 #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph) | 590 #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph) |
910 #define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph) | 591 #define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph) |
911 | 592 |
912 #define CHECK_BUFFER_GLYPH(x) do { \ | 593 #define CHECK_BUFFER_GLYPH(x) do { \ |
913 CHECK_GLYPH (x); \ | 594 CHECK_GLYPH (x); \ |
930 #define GLYPH_TYPE(g) ((g)->type) | 611 #define GLYPH_TYPE(g) ((g)->type) |
931 #define GLYPH_IMAGE(g) ((g)->image) | 612 #define GLYPH_IMAGE(g) ((g)->image) |
932 #define GLYPH_CONTRIB_P(g) ((g)->contrib_p) | 613 #define GLYPH_CONTRIB_P(g) ((g)->contrib_p) |
933 #define GLYPH_BASELINE(g) ((g)->baseline) | 614 #define GLYPH_BASELINE(g) ((g)->baseline) |
934 #define GLYPH_FACE(g) ((g)->face) | 615 #define GLYPH_FACE(g) ((g)->face) |
935 #define GLYPH_DIRTYP(g) ((g)->dirty) | |
936 | 616 |
937 #define XGLYPH_TYPE(g) GLYPH_TYPE (XGLYPH (g)) | 617 #define XGLYPH_TYPE(g) GLYPH_TYPE (XGLYPH (g)) |
938 #define XGLYPH_IMAGE(g) GLYPH_IMAGE (XGLYPH (g)) | 618 #define XGLYPH_IMAGE(g) GLYPH_IMAGE (XGLYPH (g)) |
939 #define XGLYPH_CONTRIB_P(g) GLYPH_CONTRIB_P (XGLYPH (g)) | 619 #define XGLYPH_CONTRIB_P(g) GLYPH_CONTRIB_P (XGLYPH (g)) |
940 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g)) | 620 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g)) |
941 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g)) | 621 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g)) |
942 #define XGLYPH_DIRTYP(g) GLYPH_DIRTYP (XGLYPH (g)) | 622 |
943 | 623 extern Lisp_Object Qxpm, Qxface; |
944 #define MARK_GLYPH_CHANGED(g) (GLYPH_DIRTYP (g) = 1); | |
945 | |
946 extern Lisp_Object Qxpm, Qxface, Qetched_in, Qetched_out, Qbevel_in, Qbevel_out; | |
947 extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable; | 624 extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable; |
948 extern Lisp_Object Qxbm, Qedit_field, Qgroup, Qlabel, Qcombo_box, Qscrollbar; | 625 extern Lisp_Object Qxbm, Qedit, Qgroup, Qlabel, Qcombo, Qscrollbar, Qprogress; |
949 extern Lisp_Object Qtree_view, Qtab_control, Qprogress_gauge, Q_border; | |
950 extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y; | 626 extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y; |
951 extern Lisp_Object Q_foreground, Q_background, Q_face, Q_descriptor, Q_group; | 627 extern Lisp_Object Q_foreground, Q_background, Q_face, Q_descriptor, Q_group; |
952 extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height, Q_text; | 628 extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height, Q_text; |
953 extern Lisp_Object Q_items, Q_properties, Q_image, Qimage_conversion_error; | 629 extern Lisp_Object Q_items, Q_properties, Q_image, Q_percent, Qimage_conversion_error; |
954 extern Lisp_Object Q_orientation, Q_margin_width; | |
955 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; | 630 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; |
956 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; | 631 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; |
957 extern Lisp_Object Vxemacs_logo; | 632 extern Lisp_Object Vxemacs_logo; |
958 | 633 |
959 | 634 unsigned short glyph_width (Lisp_Object glyph, Lisp_Object frame_face, |
960 unsigned short glyph_width (Lisp_Object glyph, Lisp_Object domain); | 635 face_index window_findex, |
961 unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object domain); | 636 Lisp_Object window); |
962 unsigned short glyph_descent (Lisp_Object glyph, Lisp_Object domain); | 637 unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object frame_face, |
963 unsigned short glyph_height (Lisp_Object glyph, Lisp_Object domain); | 638 face_index window_findex, |
639 Lisp_Object window); | |
640 unsigned short glyph_descent (Lisp_Object glyph, | |
641 Lisp_Object frame_face, | |
642 face_index window_findex, | |
643 Lisp_Object window); | |
644 unsigned short glyph_height (Lisp_Object glyph, Lisp_Object frame_face, | |
645 face_index window_findex, | |
646 Lisp_Object window); | |
964 Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain); | 647 Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain); |
965 Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain); | 648 Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain); |
966 int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain); | 649 int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain); |
967 Lisp_Object glyph_image_instance (Lisp_Object glyph, | 650 Lisp_Object glyph_image_instance (Lisp_Object glyph, |
968 Lisp_Object domain, | 651 Lisp_Object domain, |
977 int dest_mask, Lisp_Object domain); | 660 int dest_mask, Lisp_Object domain); |
978 Lisp_Object allocate_glyph (enum glyph_type type, | 661 Lisp_Object allocate_glyph (enum glyph_type type, |
979 void (*after_change) (Lisp_Object glyph, | 662 void (*after_change) (Lisp_Object glyph, |
980 Lisp_Object property, | 663 Lisp_Object property, |
981 Lisp_Object locale)); | 664 Lisp_Object locale)); |
982 void query_string_geometry ( Lisp_Object string, Lisp_Object face, | 665 Lisp_Object widget_face_font_info (Lisp_Object domain, Lisp_Object face, |
983 int* width, int* height, int* descent, | 666 int *height, int *width); |
984 Lisp_Object domain); | 667 void widget_text_to_pixel_conversion (Lisp_Object domain, Lisp_Object face, |
985 Lisp_Object query_string_font (Lisp_Object string, | 668 int th, int tw, |
986 Lisp_Object face, Lisp_Object domain); | 669 int* height, int* width); |
987 Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object device); | |
988 void disable_glyph_animated_timeout (int i); | |
989 | 670 |
990 /************************************************************************/ | 671 /************************************************************************/ |
991 /* Glyph Cachels */ | 672 /* Glyph Cachels */ |
992 /************************************************************************/ | 673 /************************************************************************/ |
993 | 674 |
994 typedef struct glyph_cachel glyph_cachel; | 675 typedef struct glyph_cachel glyph_cachel; |
995 struct glyph_cachel | 676 struct glyph_cachel |
996 { | 677 { |
997 Lisp_Object glyph; | 678 Lisp_Object glyph; |
998 | 679 |
999 unsigned int dirty :1; /* I'm copying faces here. I'm not | |
1000 sure why we need two dirty | |
1001 flags. Maybe because an image | |
1002 instance can be dirty and so we | |
1003 need to frob this in the same way | |
1004 as other image instance properties. */ | |
1005 unsigned int updated :1; | 680 unsigned int updated :1; |
1006 | |
1007 unsigned short width; | 681 unsigned short width; |
1008 unsigned short ascent; | 682 unsigned short ascent; |
1009 unsigned short descent; | 683 unsigned short descent; |
1010 }; | 684 }; |
1011 | 685 |
1014 #define HSCROLL_GLYPH_INDEX (glyph_index) 2 | 688 #define HSCROLL_GLYPH_INDEX (glyph_index) 2 |
1015 #define CONTROL_GLYPH_INDEX (glyph_index) 3 | 689 #define CONTROL_GLYPH_INDEX (glyph_index) 3 |
1016 #define OCT_ESC_GLYPH_INDEX (glyph_index) 4 | 690 #define OCT_ESC_GLYPH_INDEX (glyph_index) 4 |
1017 #define INVIS_GLYPH_INDEX (glyph_index) 5 | 691 #define INVIS_GLYPH_INDEX (glyph_index) 5 |
1018 | 692 |
1019 #ifdef ERROR_CHECK_GLYPHS | 693 #define GLYPH_CACHEL(window, index) \ |
1020 | 694 Dynarr_atp (window->glyph_cachels, index) |
1021 #include "window.h" | 695 #define GLYPH_CACHEL_GLYPH(window, index) \ |
1022 | 696 Dynarr_atp (window->glyph_cachels, index)->glyph |
1023 INLINE_HEADER int | 697 #define GLYPH_CACHEL_WIDTH(window, index) \ |
1024 GLYPH_CACHEL_WIDTH (struct window *window, int ind); | 698 Dynarr_atp (window->glyph_cachels, index)->width |
1025 INLINE_HEADER int | 699 #define GLYPH_CACHEL_ASCENT(window, index) \ |
1026 GLYPH_CACHEL_WIDTH (struct window *window, int ind) | 700 Dynarr_atp (window->glyph_cachels, index)->ascent |
1027 { | 701 #define GLYPH_CACHEL_DESCENT(window, index) \ |
1028 int wid = Dynarr_atp (window->glyph_cachels, ind)->width; | 702 Dynarr_atp (window->glyph_cachels, index)->descent |
1029 assert (wid >= 0 && wid < 10000); | 703 |
1030 return wid; | 704 void mark_glyph_cachels (glyph_cachel_dynarr *elements, |
1031 } | 705 void (*markobj) (Lisp_Object)); |
1032 INLINE_HEADER int | |
1033 GLYPH_CACHEL_ASCENT (struct window *window, int ind); | |
1034 INLINE_HEADER int | |
1035 GLYPH_CACHEL_ASCENT (struct window *window, int ind) | |
1036 { | |
1037 int wid = Dynarr_atp (window->glyph_cachels, ind)->ascent; | |
1038 assert (wid >= 0 && wid < 10000); | |
1039 return wid; | |
1040 } | |
1041 INLINE_HEADER int | |
1042 GLYPH_CACHEL_DESCENT (struct window *window, int ind); | |
1043 INLINE_HEADER int | |
1044 GLYPH_CACHEL_DESCENT (struct window *window, int ind) | |
1045 { | |
1046 int wid = Dynarr_atp (window->glyph_cachels, ind)->descent; | |
1047 assert (wid >= 0 && wid < 10000); | |
1048 return wid; | |
1049 } | |
1050 | |
1051 #else /* not ERROR_CHECK_GLYPHS */ | |
1052 | |
1053 #define GLYPH_CACHEL_WIDTH(window, ind) \ | |
1054 Dynarr_atp (window->glyph_cachels, ind)->width | |
1055 #define GLYPH_CACHEL_ASCENT(window, ind) \ | |
1056 Dynarr_atp (window->glyph_cachels, ind)->ascent | |
1057 #define GLYPH_CACHEL_DESCENT(window, ind) \ | |
1058 Dynarr_atp (window->glyph_cachels, ind)->descent | |
1059 | |
1060 #endif /* not ERROR_CHECK_GLYPHS */ | |
1061 | |
1062 #define GLYPH_CACHEL(window, ind) \ | |
1063 Dynarr_atp (window->glyph_cachels, ind) | |
1064 #define GLYPH_CACHEL_GLYPH(window, ind) \ | |
1065 Dynarr_atp (window->glyph_cachels, ind)->glyph | |
1066 #define GLYPH_CACHEL_DIRTYP(window, ind) \ | |
1067 Dynarr_atp (window->glyph_cachels, ind)->dirty | |
1068 | |
1069 void mark_glyph_cachels (glyph_cachel_dynarr *elements); | |
1070 void mark_glyph_cachels_as_not_updated (struct window *w); | 706 void mark_glyph_cachels_as_not_updated (struct window *w); |
1071 void mark_glyph_cachels_as_clean (struct window *w); | |
1072 void reset_glyph_cachels (struct window *w); | 707 void reset_glyph_cachels (struct window *w); |
1073 glyph_index get_glyph_cachel_index (struct window *w, Lisp_Object glyph); | |
1074 | 708 |
1075 #ifdef MEMORY_USAGE_STATS | 709 #ifdef MEMORY_USAGE_STATS |
1076 int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels, | 710 int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels, |
1077 struct overhead_stats *ovstats); | 711 struct overhead_stats *ovstats); |
1078 #endif /* MEMORY_USAGE_STATS */ | 712 #endif /* MEMORY_USAGE_STATS */ |
1087 | 721 |
1088 /**************************************************************************** | 722 /**************************************************************************** |
1089 * Subwindow Object * | 723 * Subwindow Object * |
1090 ****************************************************************************/ | 724 ****************************************************************************/ |
1091 | 725 |
726 /* redisplay needs a per-frame cache of subwindows being displayed so | |
727 * that we known when to unmap them */ | |
728 typedef struct subwindow_cachel subwindow_cachel; | |
729 struct subwindow_cachel | |
730 { | |
731 Lisp_Object subwindow; | |
732 int x, y; | |
733 int width, height; | |
734 int being_displayed; | |
735 int updated; | |
736 }; | |
737 | |
738 typedef struct | |
739 { | |
740 Dynarr_declare (subwindow_cachel); | |
741 } subwindow_cachel_dynarr; | |
742 | |
743 void mark_subwindow_cachels (subwindow_cachel_dynarr *elements, | |
744 void (*markobj) (Lisp_Object)); | |
745 void mark_subwindow_cachels_as_not_updated (struct frame *f); | |
746 void reset_subwindow_cachels (struct frame *f); | |
1092 void unmap_subwindow (Lisp_Object subwindow); | 747 void unmap_subwindow (Lisp_Object subwindow); |
1093 void map_subwindow (Lisp_Object subwindow, int x, int y, | 748 void map_subwindow (Lisp_Object subwindow, int x, int y); |
1094 struct display_glyph_area *dga); | 749 void update_frame_subwindows (struct frame *f); |
1095 int find_matching_subwindow (struct frame* f, int x, int y, int width, int height); | 750 |
1096 void update_widget (Lisp_Object widget); | 751 #endif /* _XEMACS_GLYPHS_H_ */ |
1097 void update_widget_instances (Lisp_Object frame); | |
1098 void update_subwindow (Lisp_Object subwindow); | |
1099 Lisp_Object image_instance_parent_glyph (struct Lisp_Image_Instance*); | |
1100 int image_instance_changed (Lisp_Object image); | |
1101 void free_frame_subwindow_instance_cache (struct frame* f); | |
1102 void reset_frame_subwindow_instance_cache (struct frame* f); | |
1103 | |
1104 struct expose_ignore | |
1105 { | |
1106 unsigned int x, y; | |
1107 unsigned int width, height; | |
1108 struct expose_ignore *next; | |
1109 }; | |
1110 | |
1111 int check_for_ignored_expose (struct frame* f, int x, int y, int width, int height); | |
1112 extern int hold_ignored_expose_registration; | |
1113 | |
1114 #endif /* INCLUDED_glyphs_h_ */ |