comparison src/lisp.h @ 6416:6f57787905d9

(MAKE_GLYPH, GLYPH_CHAR, GLYPH_FACE): Handle termcap frames as well as X. (FAST_MAKE_GLYPH, FAST_GLYPH_CHAR, FAST_GLYPH_FACE): New macros.
author Karl Heuer <kwzh@gnu.org>
date Sat, 19 Mar 1994 02:54:00 +0000
parents 444351051761
children 13b9d23a243a
comparison
equal deleted inserted replaced
6415:35917d3d0952 6416:6f57787905d9
666 good bunch of face ID's; given that we have no mechanism for 666 good bunch of face ID's; given that we have no mechanism for
667 tossing unused frame face ID's yet, we'll probably run out of 255 667 tossing unused frame face ID's yet, we'll probably run out of 255
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
682 696
683 /* Data type checking */ 697 /* Data type checking */