1 /* Generic glyph data structures + display tables
2 Copyright (C) 1994 Board of Trustees, University of Illinois.
3 Copyright (C) 1995, 1996 Ben Wing
5 This file is part of XEmacs.
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
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
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. */
22 /* Synched up with: Not in FSF. */
24 #ifndef INCLUDED_glyphs_h_
25 #define INCLUDED_glyphs_h_
27 #include "specifier.h"
30 /************************************************************************/
31 /* Image Instantiators */
32 /************************************************************************/
34 struct image_instantiator_methods;
36 /* Remember the distinction between image instantiator formats and
37 image instance types. Here's an approximate mapping:
39 image instantiator format image instance type
40 ------------------------- -------------------
44 xbm mono-pixmap, color-pixmap, pointer
45 xpm color-pixmap, mono-pixmap, pointer
46 xface mono-pixmap, color-pixmap, pointer
53 mswindows-resource pointer, color-pixmap
57 autodetect mono-pixmap, color-pixmap, pointer, text
70 /* These are methods specific to a particular format of image instantiator
71 (e.g. xpm, string, etc.). */
73 typedef struct ii_keyword_entry ii_keyword_entry;
74 struct ii_keyword_entry
77 void (*validate) (Lisp_Object data);
84 Dynarr_declare (ii_keyword_entry);
85 } ii_keyword_entry_dynarr;
87 extern const struct struct_description iim_description;
89 enum image_instance_geometry
92 IMAGE_DESIRED_GEOMETRY,
95 IMAGE_UNSPECIFIED_GEOMETRY = ~0
98 #define WIDGET_BORDER_HEIGHT 4
99 #define WIDGET_BORDER_WIDTH 4
101 enum governing_domain
103 GOVERNING_DOMAIN_WINDOW,
104 GOVERNING_DOMAIN_FRAME,
105 GOVERNING_DOMAIN_DEVICE
108 struct image_instantiator_methods
112 Lisp_Object device; /* sometimes used */
114 ii_keyword_entry_dynarr *keywords;
115 /* consoles this ii is supported on */
116 console_type_entry_dynarr *consoles;
117 /* Implementation specific methods: */
119 /* Validate method: Given an instantiator vector, signal an error if
120 it's invalid for this image-instantiator format. Note that this
121 validation only occurs after all the keyword-specific validation
122 has already been performed. This is chiefly useful for making
123 sure that certain required keywords are present. */
124 void (*validate_method) (Lisp_Object instantiator);
126 /* Normalize method: Given an instantiator, convert it to the form
127 that should be used in a glyph, for devices of type CONSOLE_TYPE.
128 Signal an error if conversion fails. */
129 Lisp_Object (*normalize_method) (Lisp_Object instantiator,
130 Lisp_Object console_type);
132 /* Governing domain method: Return an int indicating what type of
133 domain an instance in this format is governed by. */
134 int (*governing_domain_method) (void);
136 /* Possible-dest-types method: Return a mask indicating what dest types
137 are compatible with this format. */
138 int (*possible_dest_types_method) (void);
140 /* Instantiate method: Given an instantiator and a partially
141 filled-in image instance, complete the filling-in. Return
142 non-zero if the instantiation succeeds, 0 if it fails.
143 This must be present. */
144 void (*instantiate_method) (Lisp_Object image_instance,
145 Lisp_Object instantiator,
146 Lisp_Object pointer_fg,
147 Lisp_Object pointer_bg,
150 /* Post instantiate method: finish instantiation of the image
152 void (*post_instantiate_method) (Lisp_Object image_instance,
153 Lisp_Object instantiator,
155 /* Property method: Given an image instance, return device specific
157 Lisp_Object (*property_method) (Lisp_Object image_instance,
158 Lisp_Object property);
159 /* Set-property method: Given an image instance, set device specific
161 Lisp_Object (*set_property_method) (Lisp_Object image_instance,
162 Lisp_Object property,
164 /* Asynchronously update properties. */
165 void (*update_method) (Lisp_Object image_instance);
167 /* Find out the desired geometry, as given by disp, of this image
168 instance. Actual geometry is stored in the appropriate slots in the
170 void (*query_geometry_method) (Lisp_Object image_instance,
171 unsigned int* width, unsigned int* height,
172 enum image_instance_geometry disp,
175 /* Layout the instance and its children bounded by the provided
176 dimensions. Returns success or failure. */
177 int (*layout_method) (Lisp_Object image_instance,
178 unsigned int width, unsigned int height,
182 /***** Calling an image-instantiator method *****/
184 #define HAS_IIFORMAT_METH_P(mstruc, m) (((mstruc)->m##_method) != 0)
185 #define IIFORMAT_METH(mstruc, m, args) (((mstruc)->m##_method) args)
187 /* Call a void-returning specifier method, if it exists */
188 #define MAYBE_IIFORMAT_METH(mstruc, m, args) \
190 struct image_instantiator_methods *MIM_mstruc = (mstruc); \
191 if (MIM_mstruc && HAS_IIFORMAT_METH_P (MIM_mstruc, m)) \
192 IIFORMAT_METH (MIM_mstruc, m, args); \
195 #define MAYBE_IIFORMAT_DEVMETH(device, mstruc, m, args) \
197 struct image_instantiator_methods *MID_mstruc = \
198 decode_ii_device (device, mstruc); \
200 MAYBE_IIFORMAT_METH(MID_mstruc, m, args); \
204 /* Call a specifier method, if it exists; otherwise return
205 the specified value */
207 #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \
208 ((mstruc && HAS_IIFORMAT_METH_P (mstruc, m)) ? \
209 IIFORMAT_METH (mstruc, m, args) : (given))
211 /***** Defining new image-instantiator types *****/
213 #define DECLARE_IMAGE_INSTANTIATOR_FORMAT(format) \
214 extern struct image_instantiator_methods *format##_image_instantiator_methods
216 #define DEFINE_IMAGE_INSTANTIATOR_FORMAT(format) \
217 struct image_instantiator_methods *format##_image_instantiator_methods
219 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name) \
221 format##_image_instantiator_methods = \
222 xnew_and_zero (struct image_instantiator_methods); \
223 format##_image_instantiator_methods->symbol = Q##format; \
224 format##_image_instantiator_methods->device = Qnil; \
225 format##_image_instantiator_methods->keywords = \
226 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 \
230 (Q##format, format##_image_instantiator_methods); \
231 dumpstruct (&format##_image_instantiator_methods, \
235 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \
237 defsymbol (&Q##format, obj_name); \
238 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name);\
241 /* Declare that image-instantiator format FORMAT has method M; used in
242 initialization routines */
243 #define IIFORMAT_HAS_METHOD(format, m) \
244 (format##_image_instantiator_methods->m##_method = format##_##m)
246 #define IIFORMAT_HAS_SHARED_METHOD(format, m, type) \
247 (format##_image_instantiator_methods->m##_method = type##_##m)
249 /* Declare that KEYW is a valid keyword for image-instantiator format
250 FORMAT. VALIDATE_FUN if a function that returns whether the data
251 is valid. The keyword may not appear more than once. */
252 #define IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, copy, multi) \
254 struct ii_keyword_entry entry; \
256 entry.keyword = keyw; \
257 entry.validate = validate_fun; \
258 entry.multiple_p = multi; \
259 entry.copy_p = copy; \
260 Dynarr_add (format##_image_instantiator_methods->keywords, \
264 #define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \
265 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 0)
267 /* Same as IIFORMAT_VALID_KEYWORD except that the keyword may
268 appear multiple times. */
269 #define IIFORMAT_VALID_MULTI_KEYWORD(format, keyw, validate_fun) \
270 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 1)
272 /* Same as IIFORMAT_VALID_KEYWORD execpt that the argument is not
273 copied by the specifier functions. This is necessary for things
274 like callbacks etc. */
275 #define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun) \
276 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 0, 0)
278 /* Declare that image-instantiator format FORMAT is supported on
280 #define IIFORMAT_VALID_CONSOLE(console, format) \
282 struct console_type_entry entry; \
284 entry.symbol = Q##console; \
285 entry.meths = console##_console_methods; \
286 Dynarr_add (format##_image_instantiator_methods->consoles, \
290 #define IIFORMAT_VALID_CONSOLE2(con1, con2, format) \
291 IIFORMAT_VALID_CONSOLE (con1, format); \
292 IIFORMAT_VALID_CONSOLE (con2, format);
294 #define DEFINE_DEVICE_IIFORMAT(type, format) \
295 DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \
296 struct image_instantiator_methods *type##_##format##_image_instantiator_methods
298 #define INITIALIZE_DEVICE_IIFORMAT(type, format) \
300 type##_##format##_image_instantiator_methods = \
301 xnew_and_zero (struct image_instantiator_methods); \
302 type##_##format##_image_instantiator_methods->symbol = Q##format; \
303 type##_##format##_image_instantiator_methods->device = Q##type; \
304 type##_##format##_image_instantiator_methods->keywords = \
305 Dynarr_new (ii_keyword_entry); \
306 add_entry_to_device_ii_format_list \
307 (Q##type, Q##format, type##_##format##_image_instantiator_methods); \
308 IIFORMAT_VALID_CONSOLE(type,format); \
309 dumpstruct (&type##_##format##_image_instantiator_methods, \
313 /* Declare that image-instantiator format FORMAT has method M; used in
314 initialization routines */
315 #define IIFORMAT_HAS_DEVMETHOD(type, format, m) \
316 (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)
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)
325 struct image_instantiator_methods *
326 decode_device_ii_format (Lisp_Object device, Lisp_Object format,
327 Error_behavior errb);
328 struct image_instantiator_methods *
329 decode_image_instantiator_format (Lisp_Object format, Error_behavior errb);
331 void add_entry_to_image_instantiator_format_list (Lisp_Object symbol,
332 struct image_instantiator_methods *meths);
333 void add_entry_to_device_ii_format_list (Lisp_Object device, Lisp_Object symbol,
334 struct image_instantiator_methods *meths);
335 Lisp_Object find_keyword_in_vector (Lisp_Object vector,
336 Lisp_Object keyword);
337 Lisp_Object find_keyword_in_vector_or_given (Lisp_Object vector,
339 Lisp_Object default_);
340 Lisp_Object simple_image_type_normalize (Lisp_Object inst,
341 Lisp_Object console_type,
342 Lisp_Object image_type_tag);
343 Lisp_Object potential_pixmap_file_instantiator (Lisp_Object instantiator,
344 Lisp_Object file_keyword,
345 Lisp_Object data_keyword,
346 Lisp_Object console_type);
347 void check_valid_string (Lisp_Object data);
348 void check_valid_int (Lisp_Object data);
349 void check_valid_face (Lisp_Object data);
350 void check_valid_vector (Lisp_Object data);
351 void check_valid_item_list_1 (Lisp_Object items);
353 void initialize_subwindow_image_instance (Lisp_Image_Instance*);
354 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
355 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
356 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 unsigned int* width, unsigned int* height,
363 enum image_instance_geometry disp,
365 void image_instance_layout (Lisp_Object image_instance,
366 unsigned int width, unsigned int height,
368 int layout_layout (Lisp_Object image_instance,
369 unsigned int width, unsigned int height,
371 int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w);
373 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
375 int desired_dest_mask));
376 DECLARE_DOESNT_RETURN (signal_image_error (const char *, Lisp_Object));
377 DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object, Lisp_Object));
379 /************************************************************************/
380 /* Image Specifier Object */
381 /************************************************************************/
383 DECLARE_SPECIFIER_TYPE (image);
384 #define XIMAGE_SPECIFIER(x) XSPECIFIER_TYPE (x, image)
385 #define XSETIMAGE_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, image)
386 #define IMAGE_SPECIFIERP(x) SPECIFIER_TYPEP (x, image)
387 #define CHECK_IMAGE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, image)
388 #define CONCHECK_IMAGE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, image)
390 void set_image_attached_to (Lisp_Object obj, Lisp_Object face_or_glyph,
391 Lisp_Object property);
393 struct image_specifier
396 Lisp_Object attachee; /* face or glyph this is attached to, or nil */
397 Lisp_Object attachee_property;/* property of that face or glyph */
400 #define IMAGE_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, image))
401 #define IMAGE_SPECIFIER_ALLOWED(g) (IMAGE_SPECIFIER_DATA (g)->allowed)
402 #define IMAGE_SPECIFIER_ATTACHEE(g) (IMAGE_SPECIFIER_DATA (g)->attachee)
403 #define IMAGE_SPECIFIER_ATTACHEE_PROPERTY(g) \
404 (IMAGE_SPECIFIER_DATA (g)->attachee_property)
406 #define XIMAGE_SPECIFIER_ALLOWED(g) \
407 IMAGE_SPECIFIER_ALLOWED (XIMAGE_SPECIFIER (g))
409 /************************************************************************/
410 /* Image Instance Object */
411 /************************************************************************/
413 DECLARE_LRECORD (image_instance, Lisp_Image_Instance);
414 #define XIMAGE_INSTANCE(x) XRECORD (x, image_instance, Lisp_Image_Instance)
415 #define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance)
416 #define IMAGE_INSTANCEP(x) RECORDP (x, image_instance)
417 #define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance)
418 #define CONCHECK_IMAGE_INSTANCE(x) CONCHECK_RECORD (x, image_instance)
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)
428 #define ERROR_CHECK_IMAGE_INSTANCE(ii)
429 #define ERROR_CHECK_SUBWINDOW_CACHE(w)
432 enum image_instance_type
444 #define IMAGE_NOTHING_MASK (1 << 0)
445 #define IMAGE_TEXT_MASK (1 << 1)
446 #define IMAGE_MONO_PIXMAP_MASK (1 << 2)
447 #define IMAGE_COLOR_PIXMAP_MASK (1 << 3)
448 #define IMAGE_POINTER_MASK (1 << 4)
449 #define IMAGE_SUBWINDOW_MASK (1 << 5)
450 #define IMAGE_WIDGET_MASK (1 << 6)
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)))
459 #define IMAGE_INSTANCE_TYPE_P(ii, type) \
460 (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type)
462 #define NOTHING_IMAGE_INSTANCEP(ii) \
463 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_NOTHING)
464 #define TEXT_IMAGE_INSTANCEP(ii) \
465 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_TEXT)
466 #define MONO_PIXMAP_IMAGE_INSTANCEP(ii) \
467 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_MONO_PIXMAP)
468 #define COLOR_PIXMAP_IMAGE_INSTANCEP(ii) \
469 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_COLOR_PIXMAP)
470 #define POINTER_IMAGE_INSTANCEP(ii) \
471 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_POINTER)
472 #define SUBWINDOW_IMAGE_INSTANCEP(ii) \
473 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_SUBWINDOW)
474 #define WIDGET_IMAGE_INSTANCEP(ii) \
475 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_WIDGET)
477 #define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \
478 CHECK_IMAGE_INSTANCE (x); \
479 if (!NOTHING_IMAGE_INSTANCEP (x)) \
480 x = wrong_type_argument (Qnothing_image_instance_p, (x)); \
483 #define CHECK_TEXT_IMAGE_INSTANCE(x) do { \
484 CHECK_IMAGE_INSTANCE (x); \
485 if (!TEXT_IMAGE_INSTANCEP (x)) \
486 x = wrong_type_argument (Qtext_image_instance_p, (x)); \
489 #define CHECK_MONO_PIXMAP_IMAGE_INSTANCE(x) do { \
490 CHECK_IMAGE_INSTANCE (x); \
491 if (!MONO_PIXMAP_IMAGE_INSTANCEP (x)) \
492 x = wrong_type_argument (Qmono_pixmap_image_instance_p, (x)); \
495 #define CHECK_COLOR_PIXMAP_IMAGE_INSTANCE(x) do { \
496 CHECK_IMAGE_INSTANCE (x); \
497 if (!COLOR_PIXMAP_IMAGE_INSTANCEP (x)) \
498 x = wrong_type_argument (Qcolor_pixmap_image_instance_p, (x)); \
501 #define CHECK_POINTER_IMAGE_INSTANCE(x) do { \
502 CHECK_IMAGE_INSTANCE (x); \
503 if (!POINTER_IMAGE_INSTANCEP (x)) \
504 x = wrong_type_argument (Qpointer_image_instance_p, (x)); \
507 #define CHECK_SUBWINDOW_IMAGE_INSTANCE(x) do { \
508 CHECK_IMAGE_INSTANCE (x); \
509 if (!SUBWINDOW_IMAGE_INSTANCEP (x) \
510 && !WIDGET_IMAGE_INSTANCEP (x)) \
511 x = wrong_type_argument (Qsubwindow_image_instance_p, (x)); \
514 #define CHECK_WIDGET_IMAGE_INSTANCE(x) do { \
515 CHECK_IMAGE_INSTANCE (x); \
516 if (!WIDGET_IMAGE_INSTANCEP (x)) \
517 x = wrong_type_argument (Qwidget_image_instance_p, (x)); \
520 struct Lisp_Image_Instance
522 struct lcrecord_header header;
523 Lisp_Object domain; /* The domain in which we were cached. */
524 Lisp_Object device; /* The device of the domain. Recorded
525 since the domain may get deleted
528 /* The glyph from which we were instantiated. This is a weak
531 enum image_instance_type type;
532 unsigned int x_offset, y_offset; /* for layout purposes */
533 unsigned int width, height, margin_width;
534 unsigned long display_hash; /* Hash value representing the structure
535 of the image_instance when it was
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. */
548 unsigned int descent;
554 unsigned int slice, maxslice, timeout;
555 Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */
556 Lisp_Object filename; /* string or Qnil */
557 Lisp_Object mask_filename; /* string or Qnil */
558 Lisp_Object fg, bg; /* foreground and background colors,
559 if this is a colorized mono-pixmap
561 Lisp_Object auxdata; /* list or Qnil: any additional data
562 to be seen from lisp */
563 void* mask; /* mask that can be seen from all windowing systems */
564 } pixmap; /* used for pointers as well */
567 void* subwindow; /* specific devices can use this as necessary */
569 { /* We need these so we can do without
572 unsigned int width, height;
574 unsigned int being_displayed : 1; /* used to detect when needs
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
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;
598 /* console-type- and image-type-specific data */
602 /* Layout bit-fields. */
603 #define LAYOUT_HORIZONTAL 0
604 #define LAYOUT_VERTICAL 1
606 #define LAYOUT_JUSTIFY_LEFT 0
607 #define LAYOUT_JUSTIFY_RIGHT 1
608 #define LAYOUT_JUSTIFY_CENTER 2
610 #define IMAGE_INSTANCE_HASH_DEPTH 0
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)
616 #define IMAGE_INSTANCE_FRAME(i) (DOMAIN_FRAME ((i)->domain))
617 #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)
621 #define IMAGE_INSTANCE_XOFFSET(i) ((i)->x_offset)
622 #define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset)
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))
631 #define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty)
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)
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)
650 /* Text properties */
651 #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string)
652 #define IMAGE_INSTANCE_TEXT_WIDTH(i) \
653 IMAGE_INSTANCE_WIDTH(i)
654 #define IMAGE_INSTANCE_TEXT_HEIGHT(i) \
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))
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)
666 #define IMAGE_INSTANCE_PIXMAP_FILENAME(i) ((i)->u.pixmap.filename)
667 #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)
669 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y)
670 #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg)
671 #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg)
672 #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata)
673 #define IMAGE_INSTANCE_PIXMAP_MASK(i) ((i)->u.pixmap.mask)
674 #define IMAGE_INSTANCE_PIXMAP_SLICE(i) ((i)->u.pixmap.slice)
675 #define IMAGE_INSTANCE_PIXMAP_MAXSLICE(i) ((i)->u.pixmap.maxslice)
676 #define IMAGE_INSTANCE_PIXMAP_TIMEOUT(i) ((i)->u.pixmap.timeout)
678 /* Subwindow properties */
679 #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow)
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) \
688 ((i)->u.subwindow.being_displayed)
689 #define IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP(i) \
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)
698 /* Widget properties */
699 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \
700 IMAGE_INSTANCE_WIDTH(i)
701 #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \
702 IMAGE_INSTANCE_HEIGHT(i)
703 #define IMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) ((i)->u.subwindow.width)
704 #define IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) ((i)->u.subwindow.height)
705 #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type)
706 #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props)
707 #define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \
708 ((i)->u.subwindow.face = f)
709 #define IMAGE_INSTANCE_WIDGET_FACE(i) \
710 (!NILP ((i)->u.subwindow.face) ? (i)->u.subwindow.face : \
711 !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \
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
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)
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) \
731 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) \
735 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) \
741 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))
763 #define XIMAGE_INSTANCE_TEXT_STRING(i) \
764 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))
774 #define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \
775 IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i))
776 #define XIMAGE_INSTANCE_PIXMAP_HEIGHT(i) \
777 IMAGE_INSTANCE_PIXMAP_HEIGHT (XIMAGE_INSTANCE (i))
778 #define XIMAGE_INSTANCE_PIXMAP_DEPTH(i) \
779 IMAGE_INSTANCE_PIXMAP_DEPTH (XIMAGE_INSTANCE (i))
780 #define XIMAGE_INSTANCE_PIXMAP_FILENAME(i) \
781 IMAGE_INSTANCE_PIXMAP_FILENAME (XIMAGE_INSTANCE (i))
782 #define XIMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) \
783 IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (XIMAGE_INSTANCE (i))
784 #define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) \
785 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (XIMAGE_INSTANCE (i))
786 #define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) \
787 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (XIMAGE_INSTANCE (i))
788 #define XIMAGE_INSTANCE_PIXMAP_FG(i) \
789 IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i))
790 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \
791 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))
801 #define XIMAGE_INSTANCE_WIDGET_WIDTH(i) \
802 IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i))
803 #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \
804 IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i))
805 #define XIMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) \
806 IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (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) \
810 IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i))
811 #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \
812 IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i))
813 #define XIMAGE_INSTANCE_WIDGET_FACE(i) \
814 IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i))
815 #define XSET_IMAGE_INSTANCE_WIDGET_FACE(i) \
816 SET_IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i))
817 #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \
818 IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i))
819 #define XIMAGE_INSTANCE_WIDGET_ITEMS(i) \
820 IMAGE_INSTANCE_WIDGET_ITEMS (XIMAGE_INSTANCE (i))
821 #define XIMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \
822 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (XIMAGE_INSTANCE (i))
823 #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \
824 IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i))
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))
831 #define XIMAGE_INSTANCE_SUBWINDOW_ID(i) \
832 IMAGE_INSTANCE_SUBWINDOW_ID (XIMAGE_INSTANCE (i))
833 #define XIMAGE_INSTANCE_DISPLAY_X(i) \
834 IMAGE_INSTANCE_DISPLAY_X (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) \
842 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))
848 #define MARK_IMAGE_INSTANCE_CHANGED(i) \
849 (IMAGE_INSTANCE_DIRTYP (i) = 1);
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);
857 Lisp_Object evaluate_xpm_color_symbols (void);
858 Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid);
859 #endif /* HAVE_XPM */
860 #ifdef HAVE_WINDOW_SYSTEM
861 Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot,
862 int ok_if_data_invalid);
863 int read_bitmap_data_from_file (const char *filename, unsigned int *width,
864 unsigned int *height, unsigned char **datap,
865 int *x_hot, int *y_hot);
866 Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file,
867 Lisp_Object mask_file,
868 Lisp_Object console_type);
871 /************************************************************************/
873 /************************************************************************/
885 struct lcrecord_header header;
887 enum glyph_type type;
890 Lisp_Object image; /* the actual image */
891 Lisp_Object contrib_p; /* whether to figure into line height */
892 Lisp_Object baseline; /* percent above baseline */
894 Lisp_Object face; /* if non-nil, face to use when displaying */
897 void (*after_change) (Lisp_Object glyph, Lisp_Object property,
900 unsigned int dirty : 1; /* So that we can selectively
901 redisplay changed glyphs. */
903 typedef struct Lisp_Glyph Lisp_Glyph;
905 DECLARE_LRECORD (glyph, Lisp_Glyph);
906 #define XGLYPH(x) XRECORD (x, glyph, Lisp_Glyph)
907 #define XSETGLYPH(x, p) XSETRECORD (x, p, glyph)
908 #define GLYPHP(x) RECORDP (x, glyph)
909 #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph)
910 #define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph)
912 #define CHECK_BUFFER_GLYPH(x) do { \
914 if (XGLYPH (x)->type != GLYPH_BUFFER) \
915 x = wrong_type_argument (Qbuffer_glyph_p, (x)); \
918 #define CHECK_POINTER_GLYPH(x) do { \
920 if (XGLYPH (x)->type != GLYPH_POINTER) \
921 x = wrong_type_argument (Qpointer_glyph_p, (x)); \
924 #define CHECK_ICON_GLYPH(x) do { \
926 if (XGLYPH (x)->type != GLYPH_ICON) \
927 x = wrong_type_argument (Qicon_glyph_p, (x)); \
930 #define GLYPH_TYPE(g) ((g)->type)
931 #define GLYPH_IMAGE(g) ((g)->image)
932 #define GLYPH_CONTRIB_P(g) ((g)->contrib_p)
933 #define GLYPH_BASELINE(g) ((g)->baseline)
934 #define GLYPH_FACE(g) ((g)->face)
935 #define GLYPH_DIRTYP(g) ((g)->dirty)
937 #define XGLYPH_TYPE(g) GLYPH_TYPE (XGLYPH (g))
938 #define XGLYPH_IMAGE(g) GLYPH_IMAGE (XGLYPH (g))
939 #define XGLYPH_CONTRIB_P(g) GLYPH_CONTRIB_P (XGLYPH (g))
940 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g))
941 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g))
942 #define XGLYPH_DIRTYP(g) GLYPH_DIRTYP (XGLYPH (g))
944 #define MARK_GLYPH_CHANGED(g) (GLYPH_DIRTYP (g) = 1);
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;
948 extern Lisp_Object Qxbm, Qedit_field, Qgroup, Qlabel, Qcombo_box, Qscrollbar;
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;
951 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;
953 extern Lisp_Object Q_items, Q_properties, Q_image, Qimage_conversion_error;
954 extern Lisp_Object Q_orientation, Q_margin_width;
955 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph;
956 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph;
957 extern Lisp_Object Vxemacs_logo;
960 unsigned short glyph_width (Lisp_Object glyph, Lisp_Object domain);
961 unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object domain);
962 unsigned short glyph_descent (Lisp_Object glyph, Lisp_Object domain);
963 unsigned short glyph_height (Lisp_Object glyph, Lisp_Object domain);
964 Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain);
965 Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain);
966 int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain);
967 Lisp_Object glyph_image_instance (Lisp_Object glyph,
969 Error_behavior errb, int no_quit);
970 void file_or_data_must_be_present (Lisp_Object instantiator);
971 void data_must_be_present (Lisp_Object instantiator);
972 Lisp_Object make_string_from_file (Lisp_Object file);
973 Lisp_Object tagged_vector_to_alist (Lisp_Object vector);
974 Lisp_Object alist_to_tagged_vector (Lisp_Object tag, Lisp_Object alist);
975 void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
976 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
977 int dest_mask, Lisp_Object domain);
978 Lisp_Object allocate_glyph (enum glyph_type type,
979 void (*after_change) (Lisp_Object glyph,
980 Lisp_Object property,
981 Lisp_Object locale));
982 void query_string_geometry ( Lisp_Object string, Lisp_Object face,
983 unsigned int* width, unsigned int* height,
984 unsigned int* descent, Lisp_Object domain);
985 Lisp_Object query_string_font (Lisp_Object string,
986 Lisp_Object face, Lisp_Object domain);
987 Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object device);
988 void disable_glyph_animated_timeout (int i);
990 /************************************************************************/
992 /************************************************************************/
994 typedef struct glyph_cachel glyph_cachel;
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;
1007 unsigned short width;
1008 unsigned short ascent;
1009 unsigned short descent;
1012 #define CONT_GLYPH_INDEX (glyph_index) 0
1013 #define TRUN_GLYPH_INDEX (glyph_index) 1
1014 #define HSCROLL_GLYPH_INDEX (glyph_index) 2
1015 #define CONTROL_GLYPH_INDEX (glyph_index) 3
1016 #define OCT_ESC_GLYPH_INDEX (glyph_index) 4
1017 #define INVIS_GLYPH_INDEX (glyph_index) 5
1019 #ifdef ERROR_CHECK_GLYPHS
1024 GLYPH_CACHEL_WIDTH (struct window *window, int ind);
1026 GLYPH_CACHEL_WIDTH (struct window *window, int ind)
1028 int wid = Dynarr_atp (window->glyph_cachels, ind)->width;
1029 assert (wid >= 0 && wid < 10000);
1033 GLYPH_CACHEL_ASCENT (struct window *window, int ind);
1035 GLYPH_CACHEL_ASCENT (struct window *window, int ind)
1037 int wid = Dynarr_atp (window->glyph_cachels, ind)->ascent;
1038 assert (wid >= 0 && wid < 10000);
1042 GLYPH_CACHEL_DESCENT (struct window *window, int ind);
1044 GLYPH_CACHEL_DESCENT (struct window *window, int ind)
1046 int wid = Dynarr_atp (window->glyph_cachels, ind)->descent;
1047 assert (wid >= 0 && wid < 10000);
1051 #else /* not ERROR_CHECK_GLYPHS */
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
1060 #endif /* not ERROR_CHECK_GLYPHS */
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
1069 void mark_glyph_cachels (glyph_cachel_dynarr *elements);
1070 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);
1073 glyph_index get_glyph_cachel_index (struct window *w, Lisp_Object glyph);
1075 #ifdef MEMORY_USAGE_STATS
1076 int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels,
1077 struct overhead_stats *ovstats);
1078 #endif /* MEMORY_USAGE_STATS */
1080 /************************************************************************/
1081 /* Display Tables */
1082 /************************************************************************/
1084 Lisp_Object display_table_entry (Emchar, Lisp_Object, Lisp_Object);
1085 void get_display_tables (struct window *, face_index,
1086 Lisp_Object *, Lisp_Object *);
1088 /****************************************************************************
1089 * Subwindow Object *
1090 ****************************************************************************/
1092 void unmap_subwindow (Lisp_Object subwindow);
1093 void map_subwindow (Lisp_Object subwindow, int x, int y,
1094 struct display_glyph_area *dga);
1095 int find_matching_subwindow (struct frame* f, int x, int y, int width, int height);
1096 void update_widget (Lisp_Object widget);
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);
1104 struct expose_ignore
1107 unsigned int width, height;
1108 struct expose_ignore *next;
1111 int check_for_ignored_expose (struct frame* f, int x, int y, int width, int height);
1112 extern int hold_ignored_expose_registration;
1114 #endif /* INCLUDED_glyphs_h_ */