diff options
| author | Karl Heuer | 1994-03-19 02:54:00 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-03-19 02:54:00 +0000 |
| commit | 49b0dd75955ed595dcd2b0f16756fe1251e0639e (patch) | |
| tree | 5aa2111b985eefbc5f414e97163b6269840176fd | |
| parent | 4cdc65eb4ae4052201205f1197704fa9190e5da5 (diff) | |
| download | emacs-49b0dd75955ed595dcd2b0f16756fe1251e0639e.tar.gz emacs-49b0dd75955ed595dcd2b0f16756fe1251e0639e.zip | |
(MAKE_GLYPH, GLYPH_CHAR, GLYPH_FACE): Handle termcap frames as well as X.
(FAST_MAKE_GLYPH, FAST_GLYPH_CHAR, FAST_GLYPH_FACE): New macros.
| -rw-r--r-- | src/lisp.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/lisp.h b/src/lisp.h index 11337645e54..fbf6ab6e025 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -668,14 +668,28 @@ typedef unsigned char UCHAR; | |||
| 668 | pretty quickly. */ | 668 | pretty quickly. */ |
| 669 | #define GLYPH unsigned int | 669 | #define GLYPH unsigned int |
| 670 | 670 | ||
| 671 | #ifdef HAVE_X_WINDOWS | ||
| 672 | /* The FAST macros assume that we already know we're in an X window. */ | ||
| 673 | |||
| 671 | /* Given a character code and a face ID, return the appropriate glyph. */ | 674 | /* Given a character code and a face ID, return the appropriate glyph. */ |
| 672 | #define MAKE_GLYPH(char, face) ((char) | ((face) << 8)) | 675 | #define FAST_MAKE_GLYPH(char, face) ((char) | ((face) << 8)) |
| 673 | 676 | ||
| 674 | /* Return a glyph's character code. */ | 677 | /* Return a glyph's character code. */ |
| 675 | #define GLYPH_CHAR(glyph) ((glyph) & 0xff) | 678 | #define FAST_GLYPH_CHAR(glyph) ((glyph) & 0xff) |
| 676 | 679 | ||
| 677 | /* Return a glyph's face ID. */ | 680 | /* Return a glyph's face ID. */ |
| 678 | #define GLYPH_FACE(glyph) (((glyph) >> 8) & ((1 << 24) - 1)) | 681 | #define FAST_GLYPH_FACE(glyph) (((glyph) >> 8) & ((1 << 24) - 1)) |
| 682 | |||
| 683 | /* Slower versions that test the frame type first. */ | ||
| 684 | #define MAKE_GLYPH(f, char, face) (FRAME_TERMCAP_P (f) ? (char) \ | ||
| 685 | : FAST_MAKE_GLYPH (char, face)) | ||
| 686 | #define GLYPH_CHAR(f, g) (FRAME_TERMCAP_P (f) ? (g) : FAST_GLYPH_CHAR (g)) | ||
| 687 | #define GLYPH_FACE(f, g) (FRAME_TERMCAP_P (f) ? (0) : FAST_GLYPH_FACE (g)) | ||
| 688 | #else | ||
| 689 | #define MAKE_GLYPH(f, char, face) (char) | ||
| 690 | #define GLYPH_CHAR(f, g) (g) | ||
| 691 | #define GLYPH_FACE(f, g) (g) | ||
| 692 | #endif | ||
| 679 | 693 | ||
| 680 | /* The ID of the mode line highlighting face. */ | 694 | /* The ID of the mode line highlighting face. */ |
| 681 | #define GLYPH_MODE_LINE_FACE 1 | 695 | #define GLYPH_MODE_LINE_FACE 1 |