#ifdef HAVE_X_WINDOWS
#include <X11/Xlib.h>
-#endif
+#ifdef USE_X_TOOLKIT
+#include <X11/Intrinsic.h>
+#endif /* USE_X_TOOLKIT */
+#endif /* HAVE_X_WINDOWS */
#ifdef MSDOS
#include "msdos.h"
#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
/* Glyph describes a character. */
CHAR_GLYPH,
+ /* Glyph describes a composition sequence. */
+ COMPOSITE_GLYPH,
+
/* Glyph describes an image. */
IMAGE_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;
#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)
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
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;
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,
#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)
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
};
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)
/* A normal character. */
IT_CHARACTER,
+ /* A composition sequence. */
+ IT_COMPOSITION,
+
/* An image. */
IT_IMAGE,
FACE_PROP_IDX,
INVISIBLE_PROP_IDX,
DISPLAY_PROP_IDX,
+ COMPOSITION_PROP_IDX,
/* Not a property. Used to indicate changes in overlays. */
OVERLAY_PROP_IDX,
/* 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. */
Images
***********************************************************************/
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Structure forward declarations. */
/* 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'
#define IMAGE_CACHE_BUCKETS_SIZE 1001
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
\f
/* 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 *));
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 */
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));
/* 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));
extern int inhibit_busy_cursor;
extern int display_busy_cursor_p;
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
/* Defined in xmenu.c */