diff options
| author | Kenichi Handa | 1999-12-27 05:03:46 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-12-27 05:03:46 +0000 |
| commit | 3b0fee460ebf3ea8515d143ce4bc49ef78e58a77 (patch) | |
| tree | 98505d7f79e8ecfaa67f5d34327c089591c6f3ee /src/lisp.h | |
| parent | 89ba5b5f009618ae2a7d5feca6f661fa45780e60 (diff) | |
| download | emacs-3b0fee460ebf3ea8515d143ce4bc49ef78e58a77.tar.gz emacs-3b0fee460ebf3ea8515d143ce4bc49ef78e58a77.zip | |
(GLYPH): Defined as `int', not `unsigned int'. Now the
lowest 8 bits are single byte character code, the bits above are
face ID.
(GLYPH_MASK_FACE) (GLYPH_MASK_CHAR): Adjusted for the change
above.
(FAST_MAKE_GLYPH) (FSST_GLYPH_FACE): Likewise.
(GLYPH_MASK_REV_DIR) (GLYPH_MASK_PADDING): Macros deleted.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/lisp.h b/src/lisp.h index f4ee67f9530..8fe1f1a5f6a 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1122,36 +1122,33 @@ typedef unsigned char UCHAR; | |||
| 1122 | 1122 | ||
| 1123 | /* The glyph datatype, used to represent characters on the display. */ | 1123 | /* The glyph datatype, used to represent characters on the display. */ |
| 1124 | 1124 | ||
| 1125 | /* The low 19 bits (CHARACTERBITS) are the character code, and the | 1125 | /* Glyph code to use as an index to the glyph table. If it is out of |
| 1126 | bits above them except for the topmost two bits are the numeric | 1126 | range for the glyph table, or the corresonding element in the table |
| 1127 | face ID. If FID is the face ID of a glyph on a frame F, then | 1127 | is nil, the low 8 bits are the single byte character code, and the |
| 1128 | F->display.x->faces[FID] contains the description of that face. | 1128 | bits above are the numeric face ID. If FID is the face ID of a |
| 1129 | This is an int instead of a short, so we can support a good bunch | 1129 | glyph on a frame F, then F->display.x->faces[FID] contains the |
| 1130 | of face ID's (i.e. 2^(32 - 19 - 2) = 2048 ID's) ; given that we | 1130 | description of that face. This is an int instead of a short, so we |
| 1131 | can support a good bunch of face ID's (2^(31 - 8)); given that we | ||
| 1131 | have no mechanism for tossing unused frame face ID's yet, we'll | 1132 | have no mechanism for tossing unused frame face ID's yet, we'll |
| 1132 | probably run out of 255 pretty quickly. */ | 1133 | probably run out of 255 pretty quickly. |
| 1133 | #define GLYPH unsigned int | 1134 | This is always -1 for a multibyte character. */ |
| 1134 | 1135 | #define GLYPH int | |
| 1135 | /* Mask bit for a glyph of a character which should be written from | 1136 | |
| 1136 | right to left. */ | ||
| 1137 | #define GLYPH_MASK_REV_DIR 0x80000000 | ||
| 1138 | /* Mask bit for a padding glyph of a multi-column character. */ | ||
| 1139 | #define GLYPH_MASK_PADDING 0x40000000 | ||
| 1140 | /* Mask bits for face. */ | 1137 | /* Mask bits for face. */ |
| 1141 | #define GLYPH_MASK_FACE 0x3FF80000 | 1138 | #define GLYPH_MASK_FACE 0x7FFFFF00 |
| 1142 | /* Mask bits for character code. */ | 1139 | /* Mask bits for character code. */ |
| 1143 | #define GLYPH_MASK_CHAR 0x0007FFFF /* The lowest 19 bits */ | 1140 | #define GLYPH_MASK_CHAR 0x000000FF /* The lowest 8 bits */ |
| 1144 | 1141 | ||
| 1145 | /* The FAST macros assume that we already know we're in an X window. */ | 1142 | /* The FAST macros assume that we already know we're in an X window. */ |
| 1146 | 1143 | ||
| 1147 | /* Given a character code and a face ID, return the appropriate glyph. */ | 1144 | /* Set a character code and a face ID in a glyph G. */ |
| 1148 | #define FAST_MAKE_GLYPH(char, face) ((char) | ((face) << CHARACTERBITS)) | 1145 | #define FAST_MAKE_GLYPH(char, face) ((char) | ((face) << 8)) |
| 1149 | 1146 | ||
| 1150 | /* Return a glyph's character code. */ | 1147 | /* Return a glyph's character code. */ |
| 1151 | #define FAST_GLYPH_CHAR(glyph) ((glyph) & GLYPH_MASK_CHAR) | 1148 | #define FAST_GLYPH_CHAR(glyph) ((glyph) & GLYPH_MASK_CHAR) |
| 1152 | 1149 | ||
| 1153 | /* Return a glyph's face ID. */ | 1150 | /* Return a glyph's face ID. */ |
| 1154 | #define FAST_GLYPH_FACE(glyph) (((glyph) & GLYPH_MASK_FACE) >> CHARACTERBITS) | 1151 | #define FAST_GLYPH_FACE(glyph) (((glyph) & GLYPH_MASK_FACE) >> 8) |
| 1155 | 1152 | ||
| 1156 | /* Slower versions that test the frame type first. */ | 1153 | /* Slower versions that test the frame type first. */ |
| 1157 | #define MAKE_GLYPH(f, char, face) (FAST_MAKE_GLYPH (char, face)) | 1154 | #define MAKE_GLYPH(f, char, face) (FAST_MAKE_GLYPH (char, face)) |