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