changeset 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 35917d3d0952
children 81e96cd91613
files src/lisp.h
diffstat 1 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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