# HG changeset patch # User Karl Heuer # Date 764045640 0 # Node ID 6f57787905d9f49387d43c2a29bc04a7937efeb6 # Parent 35917d3d09528d6c24fdda6967b77b72fbd96532 (MAKE_GLYPH, GLYPH_CHAR, GLYPH_FACE): Handle termcap frames as well as X. (FAST_MAKE_GLYPH, FAST_GLYPH_CHAR, FAST_GLYPH_FACE): New macros. diff -r 35917d3d0952 -r 6f57787905d9 src/lisp.h --- a/src/lisp.h Sat Mar 19 02:53:33 1994 +0000 +++ b/src/lisp.h Sat Mar 19 02:54:00 1994 +0000 @@ -668,14 +668,28 @@ pretty quickly. */ #define GLYPH unsigned int +#ifdef HAVE_X_WINDOWS +/* The FAST macros assume that we already know we're in an X window. */ + /* Given a character code and a face ID, return the appropriate glyph. */ -#define MAKE_GLYPH(char, face) ((char) | ((face) << 8)) +#define FAST_MAKE_GLYPH(char, face) ((char) | ((face) << 8)) /* Return a glyph's character code. */ -#define GLYPH_CHAR(glyph) ((glyph) & 0xff) +#define FAST_GLYPH_CHAR(glyph) ((glyph) & 0xff) /* Return a glyph's face ID. */ -#define GLYPH_FACE(glyph) (((glyph) >> 8) & ((1 << 24) - 1)) +#define FAST_GLYPH_FACE(glyph) (((glyph) >> 8) & ((1 << 24) - 1)) + +/* Slower versions that test the frame type first. */ +#define MAKE_GLYPH(f, char, face) (FRAME_TERMCAP_P (f) ? (char) \ + : FAST_MAKE_GLYPH (char, face)) +#define GLYPH_CHAR(f, g) (FRAME_TERMCAP_P (f) ? (g) : FAST_GLYPH_CHAR (g)) +#define GLYPH_FACE(f, g) (FRAME_TERMCAP_P (f) ? (0) : FAST_GLYPH_FACE (g)) +#else +#define MAKE_GLYPH(f, char, face) (char) +#define GLYPH_CHAR(f, g) (g) +#define GLYPH_FACE(f, g) (g) +#endif /* The ID of the mode line highlighting face. */ #define GLYPH_MODE_LINE_FACE 1