glyphs above or below it. */
unsigned overlaps_vertically_p : 1;
- /* 1 means glyph is a padding glyph. Padding glyphs are used for
- characters whose visual shape consists of more than one glyph
- (e.g. Asian characters). All but the first glyph of such a glyph
- sequence have the padding_p flag set. Only used for terminal
- frames, and there only to minimize code changes. A better way
- would probably be to use the width field of glyphs to express
- padding. */
+ /* For terminal frames, 1 means glyph is a padding glyph. Padding
+ glyphs are used for characters whose visual shape consists of
+ more than one glyph (e.g. Asian characters). All but the first
+ glyph of such a glyph sequence have the padding_p flag set. This
+ flag is used only to minimize code changes. A better way would
+ probably be to use the width field of glyphs to express padding.
+
+ For graphic frames, 1 means the pixel width of the glyph in a
+ font is 0, but 1-pixel is padded on displaying for correct cursor
+ displaying. The member `pixel_width' above is set to 1. */
unsigned padding_p : 1;
/* 1 means the actual glyph is not available, draw a box instead.
/* Is GLYPH a space? */
#define CHAR_GLYPH_SPACE_P(GLYPH) \
- (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH)
+ ((GLYPH).u.ch == SPACEGLYPH && (GLYPH).face_id == DEFAULT_FACE_ID)
/* Are glyph slices of glyphs *X and *Y equal */
#define SET_CHAR_GLYPH_FROM_GLYPH(GLYPH, FROM) \
SET_CHAR_GLYPH ((GLYPH), \
- FAST_GLYPH_CHAR ((FROM)), \
- FAST_GLYPH_FACE ((FROM)), \
+ GLYPH_CHAR ((FROM)), \
+ GLYPH_FACE ((FROM)), \
0)
/* Construct a glyph code from a character glyph GLYPH. If the
character is multibyte, return -1 as we can't use glyph table for a
multibyte character. */
-#define GLYPH_FROM_CHAR_GLYPH(GLYPH) \
- ((GLYPH).u.ch < 256 \
- ? ((GLYPH).u.ch | ((GLYPH).face_id << CHARACTERBITS)) \
- : -1)
+#define SET_GLYPH_FROM_CHAR_GLYPH(G, GLYPH) \
+ do \
+ { \
+ if ((GLYPH).u.ch < 256) \
+ SET_GLYPH ((G), (GLYPH).u.ch, ((GLYPH).face_id)); \
+ else \
+ SET_GLYPH ((G), -1, 0); \
+ } \
+ while (0)
+
+#define GLYPH_INVALID_P(GLYPH) (GLYPH_CHAR (GLYPH) < 0)
/* Is GLYPH a padding glyph? */
respectively. */
unsigned for_overlaps : 3;
+ /* 1 means that all glyphs in this glyph string has the flag
+ padding_p set, and thus must be drawn one by one to have 1-pixel
+ width even though the logical width in the font is zero. */
+ unsigned padding_p : 1;
+
/* The GC to use for drawing this glyph string. */
#if defined(HAVE_X_WINDOWS) || defined(MAC_OS)
GC gc;
/* Lisp specification of this image. */
Lisp_Object spec;
+ /* List of "references" followed to build the image.
+ Typically will just contain the name of the image file.
+ Used to allow fine-grained cache flushing. */
+ Lisp_Object dependencies;
+
/* Relief to draw around the image. */
int relief;
no image with that id exists. */
#define IMAGE_FROM_ID(F, ID) \
- (((ID) >= 0 && (ID) < (FRAME_X_IMAGE_CACHE (F)->used)) \
- ? FRAME_X_IMAGE_CACHE (F)->images[ID] \
+ (((ID) >= 0 && (ID) < (FRAME_IMAGE_CACHE (F)->used)) \
+ ? FRAME_IMAGE_CACHE (F)->images[ID] \
: NULL)
/* Size of bucket vector of image caches. Should be prime. */
void x_kill_gs_process P_ ((Pixmap, struct frame *));
struct image_cache *make_image_cache P_ ((void));
void free_image_cache P_ ((struct frame *));
-void clear_image_cache P_ ((struct frame *, int));
-void forall_images_in_image_cache P_ ((struct frame *,
- void (*) P_ ((struct image *))));
+void clear_image_caches P_ ((Lisp_Object));
+void mark_image_cache P_ ((struct image_cache *));
int valid_image_p P_ ((Lisp_Object));
void prepare_image_for_display P_ ((struct frame *, struct image *));
int lookup_image P_ ((struct frame *, Lisp_Object));
void init_frame_faces P_ ((struct frame *));
void free_frame_faces P_ ((struct frame *));
void recompute_basic_faces P_ ((struct frame *));
-int face_at_buffer_position P_ ((struct window *, int, int, int, int *,
- int, int));
-int face_for_overlay_string P_ ((struct window *, int, int,
- int, int *,
- int, int, Lisp_Object));
-int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int,
- int, int *, enum face_id, int));
+int face_at_buffer_position P_ ((struct window *w, EMACS_INT pos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, EMACS_INT limit,
+ int mouse));
+int face_for_overlay_string P_ ((struct window *w, EMACS_INT pos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, EMACS_INT limit,
+ int mouse, Lisp_Object overlay));
+int face_at_string_position P_ ((struct window *w, Lisp_Object string,
+ EMACS_INT pos, EMACS_INT bufpos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, enum face_id, int mouse));
int merge_faces P_ ((struct frame *, Lisp_Object, int, int));
int compute_char_face P_ ((struct frame *, int, Lisp_Object));
void free_all_realized_faces P_ ((Lisp_Object));
void init_display P_ ((void));
void syms_of_display P_ ((void));
extern Lisp_Object Qredisplay_dont_pause;
-GLYPH spec_glyph_lookup_face P_ ((struct window *, GLYPH));
+void spec_glyph_lookup_face P_ ((struct window *, GLYPH *));
/* Defined in terminal.c */
extern void produce_glyphs P_ ((struct it *));
extern void produce_special_glyphs P_ ((struct it *, enum display_element_type));
extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
-extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
+extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int));
extern struct terminal *get_named_tty P_ ((char *));
EXFUN (Ftty_type, 1);