X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/045dee35ff74932bbaa0d603bd6f0b4e51a6fbd0..42088c126a5be232d2eacd23a1f5121e12fcae5f:/src/dispextern.h diff --git a/src/dispextern.h b/src/dispextern.h index 009ac503f2..54b58b77f6 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -26,7 +26,10 @@ Boston, MA 02111-1307, USA. */ #ifdef HAVE_X_WINDOWS #include -#endif +#ifdef USE_X_TOOLKIT +#include +#endif /* USE_X_TOOLKIT */ +#endif /* HAVE_X_WINDOWS */ #ifdef MSDOS #include "msdos.h" @@ -69,7 +72,7 @@ struct window; #if GLYPH_DEBUG #define IF_DEBUG(X) X -#define xassert(X) if (!(X)) abort (); else (void) 0 +#define xassert(X) do {if (!(X)) abort ();} while (0) #else #define IF_DEBUG(X) (void) 0 #define xassert(X) (void) 0 @@ -204,6 +207,9 @@ enum glyph_type /* Glyph describes a character. */ CHAR_GLYPH, + /* Glyph describes a composition sequence. */ + COMPOSITE_GLYPH, + /* Glyph describes an image. */ IMAGE_GLYPH, @@ -254,51 +260,38 @@ struct glyph 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. */ + unsigned padding_p : 1; + + /* Face of the glyph. */ + unsigned face_id : 23; + /* A union of sub-structures for different glyph types. */ union { - /* Sub-structure for character glyphs (type == CHAR_GLYPH). */ - struct - { - /* Character code. */ - unsigned code : 19; - - /* Character's face. */ - unsigned face_id : 11; - - /* 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. */ - unsigned padding_p : 1; - } - ch; + /* Character code for character glyphs (type == CHAR_GLYPH). */ + unsigned ch; - /* Sub-structure for image glyphs (type == IMAGE_GLYPH). */ - struct - { - /* Image id. */ - unsigned id : 20; + /* Composition ID for composition glyphs (type == COMPOSITION_GLYPH) */ + unsigned cmp_id; - /* Face under the image. */ - unsigned face_id : 12; - } - img; + /* Image ID for image glyphs (type == IMAGE_GLYPH). */ + unsigned img_id; /* Sub-structure for type == STRETCH_GLYPH. */ struct { /* The height of the glyph. */ - unsigned height : 11; + unsigned height : 16; /* The ascent of the glyph. */ - unsigned ascent : 10; - - /* The face of the stretch glyph. */ - unsigned face_id : 11; + unsigned ascent : 16; } stretch; @@ -318,19 +311,28 @@ struct glyph #define GLYPH_EQUAL_P(X, Y) \ ((X)->type == (Y)->type \ && (X)->u.val == (Y)->u.val \ + && (X)->face_id == (Y)->face_id \ + && (X)->padding_p == (Y)->padding_p \ && (X)->left_box_line_p == (Y)->left_box_line_p \ && (X)->right_box_line_p == (Y)->right_box_line_p \ && (X)->voffset == (Y)->voffset) +/* Are character codes, faces, padding_ps of glyphs *X and *Y equal? */ + +#define GLYPH_CHAR_AND_FACE_EQUAL_P(X, Y) \ + ((X)->u.ch == (Y)->u.ch \ + && (X)->face_id == (Y)->face_id \ + && (X)->padding_p == (Y)->padding_p) + /* Fill a character glyph GLYPH. CODE, FACE_ID, PADDING_P correspond to the bits defined for the typedef `GLYPH' in lisp.h. */ #define SET_CHAR_GLYPH(GLYPH, CODE, FACE_ID, PADDING_P) \ do \ { \ - (GLYPH).u.ch.code = (CODE); \ - (GLYPH).u.ch.face_id = (FACE_ID); \ - (GLYPH).u.ch.padding_p = (PADDING_P); \ + (GLYPH).u.ch = (CODE); \ + (GLYPH).face_id = (FACE_ID); \ + (GLYPH).padding_p = (PADDING_P); \ } \ while (0) @@ -341,18 +343,20 @@ struct glyph SET_CHAR_GLYPH ((GLYPH), \ FAST_GLYPH_CHAR ((FROM)), \ FAST_GLYPH_FACE ((FROM)), \ - ((FROM) & GLYPH_MASK_PADDING) != 0) + 0) -/* Construct a typedef'd GLYPH value from a character glyph GLYPH. */ +/* 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.code \ - | ((GLYPH).u.ch.face_id << CHARACTERBITS) \ - | ((GLYPH).u.ch.padding_p ? GLYPH_MASK_PADDING : 0)) +#define GLYPH_FROM_CHAR_GLYPH(GLYPH) \ + ((GLYPH).u.ch < 256 \ + ? ((GLYPH).u.ch | ((GLYPH).face_id << 8)) \ + : -1) /* Is GLYPH a padding glyph? */ -#define CHAR_GLYPH_PADDING_P(GLYPH) (GLYPH).u.ch.padding_p +#define CHAR_GLYPH_PADDING_P(GLYPH) (GLYPH).padding_p @@ -1172,8 +1176,8 @@ struct face int font_info_id; /* Fontset ID if this face uses a fontset, or -1. This is only >= 0 - if the face was realized for CHARSET_COMPOSITION. For all other - charsets, a specific font is loaded from the set of fonts + if the face was realized for a composition sequence. + Otherwise, a specific font is loaded from the set of fonts specified by the fontset given by the family attribute of the face. */ int fontset; @@ -1203,10 +1207,10 @@ struct face unsigned hash; /* The charset for which this face was realized if it was realized - for use in multibyte text. If fontset >= 0, this is - CHARSET_COMPOSITION. A value of charset < 0 means the face was - realized for use in unibyte text where the idea of Emacs - charsets isn't applicable. */ + for use in multibyte text. If fontset >= 0, this is the charset + of the first character of the composition sequence. A value of + charset < 0 means the face was realized for use in unibyte text + where the idea of Emacs charsets isn't applicable. */ int charset; /* Non-zero if text in this face should be underlined, overlined, @@ -1252,6 +1256,14 @@ struct face #define FACE_TTY_DEFAULT_COLOR ((unsigned long) -1) +/* Color index indicating that face uses an unknown foreground color. */ + +#define FACE_TTY_DEFAULT_FG_COLOR ((unsigned long) -2) + +/* Color index indicating that face uses an unsigned background color. */ + +#define FACE_TTY_DEFAULT_BG_COLOR ((unsigned long) -3) + /* Non-zero if FACE was realized for unibyte use. */ #define FACE_UNIBYTE_P(FACE) ((FACE)->charset < 0) @@ -1267,6 +1279,11 @@ enum face_id TOOL_BAR_FACE_ID, BITMAP_AREA_FACE_ID, HEADER_LINE_FACE_ID, + SCROLL_BAR_FACE_ID, + BORDER_FACE_ID, + CURSOR_FACE_ID, + MOUSE_FACE_ID, + MENU_FACE_ID, BASIC_FACE_ID_SENTINEL }; @@ -1303,7 +1320,7 @@ struct face_cache face doesn't exist. */ #define FACE_FROM_ID(F, ID) \ - (((ID) >= 0 && (ID) < FRAME_FACE_CACHE (F)->used) \ + (((unsigned) (ID) < FRAME_FACE_CACHE (F)->used) \ ? FRAME_FACE_CACHE (F)->faces_by_id[ID] \ : NULL) @@ -1395,6 +1412,9 @@ enum display_element_type /* A normal character. */ IT_CHARACTER, + /* A composition sequence. */ + IT_COMPOSITION, + /* An image. */ IT_IMAGE, @@ -1423,6 +1443,7 @@ enum prop_idx FACE_PROP_IDX, INVISIBLE_PROP_IDX, DISPLAY_PROP_IDX, + COMPOSITION_PROP_IDX, /* Not a property. Used to indicate changes in overlays. */ OVERLAY_PROP_IDX, @@ -1588,9 +1609,16 @@ struct it /* If what == IT_CHARACTER, character and length in bytes. This is a character from a buffer or string. It may be different from the character displayed in case that - unibyte_display_via_language_environment is set. */ + unibyte_display_via_language_environment is set. + + If what == IT_COMPOSITION, the first component of a composition + and length in bytes of the composition. */ int c, len; + /* If what == IT_COMPOSITION, identification number and length in + chars of a composition. */ + int cmp_id, cmp_len; + /* The character to display, possibly translated to multibyte if unibyte_display_via_language_environment is set. This is set after x_produce_glyphs has been called. */ @@ -1823,7 +1851,7 @@ extern int (* estimate_mode_line_height_hook) P_ ((struct frame *, Images ***********************************************************************/ -#ifdef HAVE_X_WINDOWS +#ifdef HAVE_WINDOW_SYSTEM /* Structure forward declarations. */ @@ -1895,6 +1923,9 @@ struct image /* Reference to the type of the image. */ struct image_type *type; + /* 1 means that loading the image failed. Don't try again. */ + unsigned load_failed_p; + /* A place for image types to store additional data. The member data.lisp_val is marked during GC, so it's safe to store Lisp data there. Image types should free this data when their `free' @@ -1956,7 +1987,7 @@ struct image_cache #define IMAGE_CACHE_BUCKETS_SIZE 1001 -#endif /* HAVE_X_WINDOWS */ +#endif /* HAVE_WINDOW_SYSTEM */ @@ -2033,7 +2064,8 @@ extern int tool_bar_button_relief; /* Defined in xdisp.c */ -int resize_mini_window P_ ((struct window *)); +void resize_echo_area_axactly P_ ((void)); +int resize_mini_window P_ ((struct window *, int)); int try_window P_ ((Lisp_Object, struct text_pos)); void window_box P_ ((struct window *, int, int *, int *, int *, int *)); int window_box_height P_ ((struct window *)); @@ -2064,6 +2096,7 @@ int tool_bar_item_info P_ ((struct frame *, struct glyph *, int *)); extern Lisp_Object Qtool_bar; extern Lisp_Object Vshow_trailing_whitespace; extern int redisplaying_p; +extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object)); /* Defined in sysdep.c */ @@ -2074,9 +2107,16 @@ int tabs_safe_p P_ ((void)); void init_baud_rate P_ ((void)); void init_sigio P_ ((int)); -/* Defined in xface.c */ +/* Defined in xfaces.c */ +#ifdef USE_X_TOOLKIT +void x_set_menu_resources_from_menu_face P_ ((struct frame *, Widget)); +#endif + +void update_face_from_frame_parameter P_ ((struct frame *, Lisp_Object, + Lisp_Object)); char *x_charset_registry P_ ((int)); +Lisp_Object tty_color_name P_ ((struct frame *, int)); void clear_face_cache P_ ((int)); unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object, enum lface_attribute_index)); @@ -2105,8 +2145,16 @@ extern Lisp_Object Qforeground_color, Qbackground_color; /* Defined in xfns.c */ -#ifdef HAVE_X_WINDOWS +#ifdef HAVE_X_WINDOWS +void gamma_correct P_ ((struct frame *, XColor *)); +#endif +#ifdef WINDOWSNT +void gamma_correct P_ ((struct frame *, COLORREF *)); +#endif + +#ifdef HAVE_WINDOW_SYSTEM +void x_kill_gs_process P_ ((Pixmap, struct frame *)); int x_screen_planes P_ ((struct frame *)); void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); struct image_cache *make_image_cache P_ ((void)); @@ -2126,7 +2174,7 @@ EXFUN (Fx_hide_busy_cursor, 1); extern int inhibit_busy_cursor; extern int display_busy_cursor_p; -#endif /* HAVE_X_WINDOWS */ +#endif /* HAVE_WINDOW_SYSTEM */ /* Defined in xmenu.c */