112 |
|
|
113 |
#endif /* GLYPH_DEBUG == 0 */ |
#endif /* GLYPH_DEBUG == 0 */ |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
/*********************************************************************** |
/*********************************************************************** |
118 |
Text positions |
Text positions |
121 |
/* Starting with Emacs 20.3, characters from strings and buffers have |
/* Starting with Emacs 20.3, characters from strings and buffers have |
122 |
both a character and a byte position associated with them. The |
both a character and a byte position associated with them. The |
123 |
following structure holds such a pair of positions. */ |
following structure holds such a pair of positions. */ |
124 |
|
|
125 |
struct text_pos |
struct text_pos |
126 |
{ |
{ |
127 |
/* Character position. */ |
/* Character position. */ |
177 |
|
|
178 |
#define SET_MARKER_FROM_TEXT_POS(MARKER, POS) \ |
#define SET_MARKER_FROM_TEXT_POS(MARKER, POS) \ |
179 |
set_marker_both ((MARKER), Qnil, CHARPOS ((POS)), BYTEPOS ((POS))) |
set_marker_both ((MARKER), Qnil, CHARPOS ((POS)), BYTEPOS ((POS))) |
180 |
|
|
181 |
/* Value is non-zero if character and byte positions of POS1 and POS2 |
/* Value is non-zero if character and byte positions of POS1 and POS2 |
182 |
are equal. */ |
are equal. */ |
183 |
|
|
224 |
enum glyph_type |
enum glyph_type |
225 |
{ |
{ |
226 |
/* Glyph describes a character. */ |
/* Glyph describes a character. */ |
227 |
CHAR_GLYPH, |
CHAR_GLYPH, |
228 |
|
|
229 |
/* Glyph describes a composition sequence. */ |
/* Glyph describes a composition sequence. */ |
230 |
COMPOSITE_GLYPH, |
COMPOSITE_GLYPH, |
255 |
int charpos; |
int charpos; |
256 |
|
|
257 |
/* Lisp object source of this glyph. Currently either a buffer or |
/* Lisp object source of this glyph. Currently either a buffer or |
258 |
a string, if the glyph was produced from characters which came from |
a string, if the glyph was produced from characters which came from |
259 |
a buffer or a string; or 0 if the glyph was inserted by redisplay |
a buffer or a string; or 0 if the glyph was inserted by redisplay |
260 |
for its own purposes such as padding. */ |
for its own purposes such as padding. */ |
261 |
Lisp_Object object; |
Lisp_Object object; |
334 |
unsigned ascent : 16; |
unsigned ascent : 16; |
335 |
} |
} |
336 |
stretch; |
stretch; |
337 |
|
|
338 |
/* Used to compare all bit-fields above in one step. */ |
/* Used to compare all bit-fields above in one step. */ |
339 |
unsigned val; |
unsigned val; |
340 |
} u; |
} u; |
347 |
(GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH) |
(GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH) |
348 |
|
|
349 |
/* Are glyphs *X and *Y displayed equal? */ |
/* Are glyphs *X and *Y displayed equal? */ |
350 |
|
|
351 |
#define GLYPH_EQUAL_P(X, Y) \ |
#define GLYPH_EQUAL_P(X, Y) \ |
352 |
((X)->type == (Y)->type \ |
((X)->type == (Y)->type \ |
353 |
&& (X)->u.val == (Y)->u.val \ |
&& (X)->u.val == (Y)->u.val \ |
367 |
|
|
368 |
/* Fill a character glyph GLYPH. CODE, FACE_ID, PADDING_P correspond |
/* Fill a character glyph GLYPH. CODE, FACE_ID, PADDING_P correspond |
369 |
to the bits defined for the typedef `GLYPH' in lisp.h. */ |
to the bits defined for the typedef `GLYPH' in lisp.h. */ |
370 |
|
|
371 |
#define SET_CHAR_GLYPH(GLYPH, CODE, FACE_ID, PADDING_P) \ |
#define SET_CHAR_GLYPH(GLYPH, CODE, FACE_ID, PADDING_P) \ |
372 |
do \ |
do \ |
373 |
{ \ |
{ \ |
379 |
|
|
380 |
/* Fill a character type glyph GLYPH from a glyph typedef FROM as |
/* Fill a character type glyph GLYPH from a glyph typedef FROM as |
381 |
defined in lisp.h. */ |
defined in lisp.h. */ |
382 |
|
|
383 |
#define SET_CHAR_GLYPH_FROM_GLYPH(GLYPH, FROM) \ |
#define SET_CHAR_GLYPH_FROM_GLYPH(GLYPH, FROM) \ |
384 |
SET_CHAR_GLYPH ((GLYPH), \ |
SET_CHAR_GLYPH ((GLYPH), \ |
385 |
FAST_GLYPH_CHAR ((FROM)), \ |
FAST_GLYPH_CHAR ((FROM)), \ |
389 |
/* Construct a glyph code from a character glyph GLYPH. If the |
/* Construct a glyph code from a character glyph GLYPH. If the |
390 |
character is multibyte, return -1 as we can't use glyph table for a |
character is multibyte, return -1 as we can't use glyph table for a |
391 |
multibyte character. */ |
multibyte character. */ |
392 |
|
|
393 |
#define GLYPH_FROM_CHAR_GLYPH(GLYPH) \ |
#define GLYPH_FROM_CHAR_GLYPH(GLYPH) \ |
394 |
((GLYPH).u.ch < 256 \ |
((GLYPH).u.ch < 256 \ |
395 |
? ((GLYPH).u.ch | ((GLYPH).face_id << CHARACTERBITS)) \ |
? ((GLYPH).u.ch | ((GLYPH).face_id << CHARACTERBITS)) \ |
396 |
: -1) |
: -1) |
397 |
|
|
398 |
/* Is GLYPH a padding glyph? */ |
/* Is GLYPH a padding glyph? */ |
399 |
|
|
400 |
#define CHAR_GLYPH_PADDING_P(GLYPH) (GLYPH).padding_p |
#define CHAR_GLYPH_PADDING_P(GLYPH) (GLYPH).padding_p |
401 |
|
|
402 |
|
|
557 |
|
|
558 |
Each row is partitioned into three areas. The start and end of |
Each row is partitioned into three areas. The start and end of |
559 |
each area is recorded in a pointer as shown below. |
each area is recorded in a pointer as shown below. |
560 |
|
|
561 |
+--------------------+-------------+---------------------+ |
+--------------------+-------------+---------------------+ |
562 |
| left margin area | text area | right margin area | |
| left margin area | text area | right margin area | |
563 |
+--------------------+-------------+---------------------+ |
+--------------------+-------------+---------------------+ |
565 |
glyphs[LEFT_MARGIN_AREA] glyphs[RIGHT_MARGIN_AREA] |
glyphs[LEFT_MARGIN_AREA] glyphs[RIGHT_MARGIN_AREA] |
566 |
| | |
| | |
567 |
glyphs[TEXT_AREA] | |
glyphs[TEXT_AREA] | |
568 |
glyphs[LAST_AREA] |
glyphs[LAST_AREA] |
569 |
|
|
570 |
Rows in frame matrices reference glyph memory allocated in a frame |
Rows in frame matrices reference glyph memory allocated in a frame |
571 |
glyph pool (see the description of struct glyph_pool). Rows in |
glyph pool (see the description of struct glyph_pool). Rows in |
572 |
window matrices on frames having frame matrices reference slices of |
window matrices on frames having frame matrices reference slices of |
573 |
the glyphs of corresponding rows in the frame matrix. |
the glyphs of corresponding rows in the frame matrix. |
574 |
|
|
575 |
Rows in window matrices on frames having no frame matrices point to |
Rows in window matrices on frames having no frame matrices point to |
576 |
glyphs allocated from the heap via xmalloc; |
glyphs allocated from the heap via xmalloc; |
577 |
glyphs[LEFT_MARGIN_AREA] is the start address of the allocated |
glyphs[LEFT_MARGIN_AREA] is the start address of the allocated |
655 |
|
|
656 |
/* 1 means the overlay arrow is on this line. */ |
/* 1 means the overlay arrow is on this line. */ |
657 |
unsigned overlay_arrow_p : 1; |
unsigned overlay_arrow_p : 1; |
658 |
|
|
659 |
/* 1 means that this row displays a continued line, i.e. it has a |
/* 1 means that this row displays a continued line, i.e. it has a |
660 |
continuation mark at the right side. */ |
continuation mark at the right side. */ |
661 |
unsigned continued_p : 1; |
unsigned continued_p : 1; |
695 |
of more than one glyph. Some glyphs have been put in this row, |
of more than one glyph. Some glyphs have been put in this row, |
696 |
the rest are put in rows below this one. */ |
the rest are put in rows below this one. */ |
697 |
unsigned ends_in_middle_of_char_p : 1; |
unsigned ends_in_middle_of_char_p : 1; |
698 |
|
|
699 |
/* 1 means this line starts in the middle of a character consisting |
/* 1 means this line starts in the middle of a character consisting |
700 |
of more than one glyph. Some glyphs have been put in the |
of more than one glyph. Some glyphs have been put in the |
701 |
previous row, the rest are put in this row. */ |
previous row, the rest are put in this row. */ |
726 |
#define MATRIX_ROW(MATRIX, ROW) ((MATRIX)->rows + (ROW)) |
#define MATRIX_ROW(MATRIX, ROW) ((MATRIX)->rows + (ROW)) |
727 |
#endif |
#endif |
728 |
|
|
729 |
/* Return a pointer to the row reserved for the mode line in MATRIX. |
/* Return a pointer to the row reserved for the mode line in MATRIX. |
730 |
Row MATRIX->nrows - 1 is always reserved for the mode line. */ |
Row MATRIX->nrows - 1 is always reserved for the mode line. */ |
731 |
|
|
732 |
#define MATRIX_MODE_LINE_ROW(MATRIX) \ |
#define MATRIX_MODE_LINE_ROW(MATRIX) \ |
751 |
(MATRIX_ROW ((MATRIX), (ROW))->glyphs[TEXT_AREA]) |
(MATRIX_ROW ((MATRIX), (ROW))->glyphs[TEXT_AREA]) |
752 |
|
|
753 |
/* Return the number of used glyphs in the text area of a row. */ |
/* Return the number of used glyphs in the text area of a row. */ |
754 |
|
|
755 |
#define MATRIX_ROW_USED(MATRIX, ROW) \ |
#define MATRIX_ROW_USED(MATRIX, ROW) \ |
756 |
(MATRIX_ROW ((MATRIX), (ROW))->used[TEXT_AREA]) |
(MATRIX_ROW ((MATRIX), (ROW))->used[TEXT_AREA]) |
757 |
|
|
758 |
/* Return the character/ byte position at which the display of ROW |
/* Return the character/ byte position at which the display of ROW |
759 |
starts. */ |
starts. */ |
760 |
|
|
761 |
#define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos) |
#define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos) |
762 |
#define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos) |
#define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos) |
763 |
|
|
764 |
/* Return the character/ byte position at which ROW ends. */ |
/* Return the character/ byte position at which ROW ends. */ |
765 |
|
|
766 |
#define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos) |
#define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos) |
767 |
#define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos) |
#define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos) |
768 |
|
|
769 |
/* Return the vertical position of ROW in MATRIX. */ |
/* Return the vertical position of ROW in MATRIX. */ |
770 |
|
|
771 |
#define MATRIX_ROW_VPOS(ROW, MATRIX) ((ROW) - (MATRIX)->rows) |
#define MATRIX_ROW_VPOS(ROW, MATRIX) ((ROW) - (MATRIX)->rows) |
772 |
|
|
773 |
/* Return the last glyph row + 1 in MATRIX on window W reserved for |
/* Return the last glyph row + 1 in MATRIX on window W reserved for |
774 |
text. If W has a mode line, the last row in the matrix is reserved |
text. If W has a mode line, the last row in the matrix is reserved |
775 |
for it. */ |
for it. */ |
776 |
|
|
777 |
#define MATRIX_BOTTOM_TEXT_ROW(MATRIX, W) \ |
#define MATRIX_BOTTOM_TEXT_ROW(MATRIX, W) \ |
778 |
((MATRIX)->rows \ |
((MATRIX)->rows \ |
779 |
+ (MATRIX)->nrows \ |
+ (MATRIX)->nrows \ |
781 |
|
|
782 |
/* Non-zero if the face of the last glyph in ROW's text area has |
/* Non-zero if the face of the last glyph in ROW's text area has |
783 |
to be drawn to the end of the text area. */ |
to be drawn to the end of the text area. */ |
784 |
|
|
785 |
#define MATRIX_ROW_EXTENDS_FACE_P(ROW) ((ROW)->fill_line_p) |
#define MATRIX_ROW_EXTENDS_FACE_P(ROW) ((ROW)->fill_line_p) |
786 |
|
|
787 |
/* Set and query the enabled_p flag of glyph row ROW in MATRIX. */ |
/* Set and query the enabled_p flag of glyph row ROW in MATRIX. */ |
788 |
|
|
789 |
#define SET_MATRIX_ROW_ENABLED_P(MATRIX, ROW, VALUE) \ |
#define SET_MATRIX_ROW_ENABLED_P(MATRIX, ROW, VALUE) \ |
790 |
(MATRIX_ROW ((MATRIX), (ROW))->enabled_p = (VALUE) != 0) |
(MATRIX_ROW ((MATRIX), (ROW))->enabled_p = (VALUE) != 0) |
791 |
|
|
792 |
#define MATRIX_ROW_ENABLED_P(MATRIX, ROW) \ |
#define MATRIX_ROW_ENABLED_P(MATRIX, ROW) \ |
793 |
(MATRIX_ROW ((MATRIX), (ROW))->enabled_p) |
(MATRIX_ROW ((MATRIX), (ROW))->enabled_p) |
794 |
|
|
795 |
/* Non-zero if ROW displays text. Value is non-zero if the row is |
/* Non-zero if ROW displays text. Value is non-zero if the row is |
796 |
blank but displays a line end. */ |
blank but displays a line end. */ |
797 |
|
|
798 |
#define MATRIX_ROW_DISPLAYS_TEXT_P(ROW) ((ROW)->displays_text_p) |
#define MATRIX_ROW_DISPLAYS_TEXT_P(ROW) ((ROW)->displays_text_p) |
799 |
|
|
800 |
/* Non-zero if ROW is not completely visible in window W. */ |
/* Non-zero if ROW is not completely visible in window W. */ |
801 |
|
|
802 |
#define MATRIX_ROW_PARTIALLY_VISIBLE_P(ROW) \ |
#define MATRIX_ROW_PARTIALLY_VISIBLE_P(ROW) \ |
803 |
((ROW)->height != (ROW)->visible_height) |
((ROW)->height != (ROW)->visible_height) |
804 |
|
|
805 |
/* Non-zero if ROW is partially visible at the top of window W. */ |
/* Non-zero if ROW is partially visible at the top of window W. */ |
806 |
|
|
807 |
#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \ |
#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \ |
808 |
(MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ |
(MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ |
809 |
&& (ROW)->y < WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W))) |
&& (ROW)->y < WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W))) |
810 |
|
|
811 |
/* Non-zero if ROW is partially visible at the bottom of window W. */ |
/* Non-zero if ROW is partially visible at the bottom of window W. */ |
812 |
|
|
813 |
#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ |
#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ |
814 |
(MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ |
(MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ |
815 |
&& (ROW)->y + (ROW)->height > WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE ((W))) |
&& (ROW)->y + (ROW)->height > WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE ((W))) |
816 |
|
|
817 |
/* Return the bottom Y + 1 of ROW. */ |
/* Return the bottom Y + 1 of ROW. */ |
818 |
|
|
819 |
#define MATRIX_ROW_BOTTOM_Y(ROW) ((ROW)->y + (ROW)->height) |
#define MATRIX_ROW_BOTTOM_Y(ROW) ((ROW)->y + (ROW)->height) |
820 |
|
|
821 |
/* Is ROW the last visible one in the display described by the |
/* Is ROW the last visible one in the display described by the |
822 |
iterator structure pointed to by IT?. */ |
iterator structure pointed to by IT?. */ |
823 |
|
|
824 |
#define MATRIX_ROW_LAST_VISIBLE_P(ROW, IT) \ |
#define MATRIX_ROW_LAST_VISIBLE_P(ROW, IT) \ |
825 |
(MATRIX_ROW_BOTTOM_Y ((ROW)) >= (IT)->last_visible_y) |
(MATRIX_ROW_BOTTOM_Y ((ROW)) >= (IT)->last_visible_y) |
826 |
|
|
844 |
((ROW)->end.overlay_string_index >= 0) |
((ROW)->end.overlay_string_index >= 0) |
845 |
|
|
846 |
/* Non-zero if ROW starts in the middle of a character. See above. */ |
/* Non-zero if ROW starts in the middle of a character. See above. */ |
847 |
|
|
848 |
#define MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P(ROW) \ |
#define MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P(ROW) \ |
849 |
((ROW)->start.dpvec_index >= 0 \ |
((ROW)->start.dpvec_index >= 0 \ |
850 |
|| (ROW)->starts_in_middle_of_char_p \ |
|| (ROW)->starts_in_middle_of_char_p \ |
1016 |
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
1017 |
|
|
1018 |
/* Height of the display region of W, including a mode line, if any. */ |
/* Height of the display region of W, including a mode line, if any. */ |
1019 |
|
|
1020 |
#define WINDOW_DISPLAY_PIXEL_HEIGHT(W) \ |
#define WINDOW_DISPLAY_PIXEL_HEIGHT(W) \ |
1021 |
(XFASTINT ((W)->height) \ |
(XFASTINT ((W)->height) \ |
1022 |
* CANON_Y_UNIT (XFRAME (WINDOW_FRAME ((W))))) |
* CANON_Y_UNIT (XFRAME (WINDOW_FRAME ((W))))) |
1023 |
|
|
1024 |
/* Height in pixels of the mode line. May be zero if W doesn't have a |
/* Height in pixels of the mode line. May be zero if W doesn't have a |
1025 |
mode line. */ |
mode line. */ |
1026 |
|
|
1027 |
#define WINDOW_DISPLAY_MODE_LINE_HEIGHT(W) \ |
#define WINDOW_DISPLAY_MODE_LINE_HEIGHT(W) \ |
1028 |
(WINDOW_WANTS_MODELINE_P ((W)) \ |
(WINDOW_WANTS_MODELINE_P ((W)) \ |
1029 |
? CURRENT_MODE_LINE_HEIGHT (W) \ |
? CURRENT_MODE_LINE_HEIGHT (W) \ |
1031 |
|
|
1032 |
/* Height in pixels of the header line. Zero if W doesn't have a header |
/* Height in pixels of the header line. Zero if W doesn't have a header |
1033 |
line. */ |
line. */ |
1034 |
|
|
1035 |
#define WINDOW_DISPLAY_HEADER_LINE_HEIGHT(W) \ |
#define WINDOW_DISPLAY_HEADER_LINE_HEIGHT(W) \ |
1036 |
(WINDOW_WANTS_HEADER_LINE_P ((W)) \ |
(WINDOW_WANTS_HEADER_LINE_P ((W)) \ |
1037 |
? CURRENT_HEADER_LINE_HEIGHT (W) \ |
? CURRENT_HEADER_LINE_HEIGHT (W) \ |
1038 |
: 0) |
: 0) |
1039 |
|
|
1040 |
/* Pixel height of window W without mode line. */ |
/* Pixel height of window W without mode line. */ |
1041 |
|
|
1042 |
#define WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE(W) \ |
#define WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE(W) \ |
1043 |
(WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \ |
(WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \ |
1044 |
- WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W))) |
- WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W))) |
1045 |
|
|
1046 |
/* Pixel height of window W without mode and header line. */ |
/* Pixel height of window W without mode and header line. */ |
1047 |
|
|
1048 |
#define WINDOW_DISPLAY_TEXT_HEIGHT(W) \ |
#define WINDOW_DISPLAY_TEXT_HEIGHT(W) \ |
1049 |
(WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \ |
(WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \ |
1050 |
- WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W)) \ |
- WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W)) \ |
1051 |
- WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W))) |
- WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W))) |
1052 |
|
|
1053 |
/* Left edge of W in pixels relative to its frame. */ |
/* Left edge of W in pixels relative to its frame. */ |
1054 |
|
|
1055 |
#define WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X(W) \ |
#define WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X(W) \ |
1056 |
(FRAME_INTERNAL_BORDER_WIDTH_SAFE (XFRAME (WINDOW_FRAME ((W)))) \ |
(FRAME_INTERNAL_BORDER_WIDTH_SAFE (XFRAME (WINDOW_FRAME ((W)))) \ |
1057 |
+ (WINDOW_LEFT_MARGIN ((W)) \ |
+ (WINDOW_LEFT_MARGIN ((W)) \ |
1059 |
+ FRAME_LEFT_FRINGE_WIDTH (XFRAME (WINDOW_FRAME ((W))))) |
+ FRAME_LEFT_FRINGE_WIDTH (XFRAME (WINDOW_FRAME ((W))))) |
1060 |
|
|
1061 |
/* Right edge of window W in pixels, relative to its frame. */ |
/* Right edge of window W in pixels, relative to its frame. */ |
1062 |
|
|
1063 |
#define WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X(W) \ |
#define WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X(W) \ |
1064 |
(WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W)) \ |
(WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W)) \ |
1065 |
+ WINDOW_DISPLAY_PIXEL_WIDTH ((W))) |
+ WINDOW_DISPLAY_PIXEL_WIDTH ((W))) |
1066 |
|
|
1067 |
/* Top edge of W in pixels relative to its frame. */ |
/* Top edge of W in pixels relative to its frame. */ |
1068 |
|
|
1069 |
#define WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y(W) \ |
#define WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y(W) \ |
1070 |
(FRAME_INTERNAL_BORDER_WIDTH_SAFE (XFRAME (WINDOW_FRAME ((W)))) \ |
(FRAME_INTERNAL_BORDER_WIDTH_SAFE (XFRAME (WINDOW_FRAME ((W)))) \ |
1071 |
+ (XFASTINT ((W)->top) \ |
+ (XFASTINT ((W)->top) \ |
1072 |
* CANON_Y_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
* CANON_Y_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
1073 |
|
|
1074 |
/* Bottom edge of window W relative to its frame. */ |
/* Bottom edge of window W relative to its frame. */ |
1075 |
|
|
1076 |
#define WINDOW_DISPLAY_BOTTOM_EDGE_PIXEL_Y(W) \ |
#define WINDOW_DISPLAY_BOTTOM_EDGE_PIXEL_Y(W) \ |
1077 |
(WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W)) \ |
(WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W)) \ |
1078 |
+ WINDOW_DISPLAY_PIXEL_HEIGHT ((W))) |
+ WINDOW_DISPLAY_PIXEL_HEIGHT ((W))) |
1079 |
|
|
1080 |
/* Convert window W relative pixel X to frame pixel coordinates. */ |
/* Convert window W relative pixel X to frame pixel coordinates. */ |
1081 |
|
|
1082 |
#define WINDOW_TO_FRAME_PIXEL_X(W, X) \ |
#define WINDOW_TO_FRAME_PIXEL_X(W, X) \ |
1083 |
((X) + WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W))) |
((X) + WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W))) |
1084 |
|
|
1085 |
/* Convert window W relative pixel Y to frame pixel coordinates. */ |
/* Convert window W relative pixel Y to frame pixel coordinates. */ |
1086 |
|
|
1087 |
#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ |
#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ |
1088 |
((Y) + WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W))) |
((Y) + WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W))) |
1089 |
|
|
1090 |
/* Convert frame relative pixel X to window relative pixel X. */ |
/* Convert frame relative pixel X to window relative pixel X. */ |
1091 |
|
|
1092 |
#define FRAME_TO_WINDOW_PIXEL_X(W, X) \ |
#define FRAME_TO_WINDOW_PIXEL_X(W, X) \ |
1093 |
((X) - WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W))) |
((X) - WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W))) |
1094 |
|
|
1095 |
/* Convert frame relative pixel Y to window relative pixel Y. */ |
/* Convert frame relative pixel Y to window relative pixel Y. */ |
1096 |
|
|
1097 |
#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ |
#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ |
1098 |
((Y) - WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W))) |
((Y) - WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W))) |
1099 |
|
|
1100 |
/* Width of left margin area in pixels. */ |
/* Width of left margin area in pixels. */ |
1101 |
|
|
1102 |
#define WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH(W) \ |
#define WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH(W) \ |
1103 |
(NILP ((W)->left_margin_width) \ |
(NILP ((W)->left_margin_width) \ |
1104 |
? 0 \ |
? 0 \ |
1105 |
: (XINT ((W)->left_margin_width) \ |
: (XINT ((W)->left_margin_width) \ |
1106 |
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
1107 |
|
|
1108 |
/* Width of right marginal area in pixels. */ |
/* Width of right marginal area in pixels. */ |
1109 |
|
|
1110 |
#define WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH(W) \ |
#define WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH(W) \ |
1111 |
(NILP ((W)->right_margin_width) \ |
(NILP ((W)->right_margin_width) \ |
1112 |
? 0 \ |
? 0 \ |
1114 |
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) |
1115 |
|
|
1116 |
/* Width of text area in pixels. */ |
/* Width of text area in pixels. */ |
1117 |
|
|
1118 |
#define WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH(W) \ |
#define WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH(W) \ |
1119 |
(WINDOW_DISPLAY_PIXEL_WIDTH ((W)) \ |
(WINDOW_DISPLAY_PIXEL_WIDTH ((W)) \ |
1120 |
- WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \ |
- WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \ |
1147 |
: (((AREA) == LEFT_MARGIN_AREA) \ |
: (((AREA) == LEFT_MARGIN_AREA) \ |
1148 |
? WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \ |
? WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \ |
1149 |
: WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH ((W)))) |
: WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH ((W)))) |
1150 |
|
|
1151 |
/* Value is non-zero if window W wants a mode line. */ |
/* Value is non-zero if window W wants a mode line. */ |
1152 |
|
|
1153 |
#define WINDOW_WANTS_MODELINE_P(W) \ |
#define WINDOW_WANTS_MODELINE_P(W) \ |
1168 |
&& !NILP (XBUFFER ((W)->buffer)->header_line_format) \ |
&& !NILP (XBUFFER ((W)->buffer)->header_line_format) \ |
1169 |
&& XFASTINT ((W)->height) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) |
&& XFASTINT ((W)->height) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) |
1170 |
|
|
1171 |
|
|
1172 |
/*********************************************************************** |
/*********************************************************************** |
1173 |
Faces |
Faces |
1174 |
***********************************************************************/ |
***********************************************************************/ |
1175 |
|
|
1176 |
/* Indices of face attributes in Lisp face vectors. Slot zero is the |
/* Indices of face attributes in Lisp face vectors. Slot zero is the |
1177 |
symbol `face'. */ |
symbol `face'. */ |
1178 |
|
|
1230 |
int id; |
int id; |
1231 |
|
|
1232 |
#ifdef HAVE_WINDOW_SYSTEM |
#ifdef HAVE_WINDOW_SYSTEM |
1233 |
|
|
1234 |
/* If non-zero, this is a GC that we can use without modification for |
/* If non-zero, this is a GC that we can use without modification for |
1235 |
drawing the characters in this face. */ |
drawing the characters in this face. */ |
1236 |
GC gc; |
GC gc; |
1237 |
|
|
1238 |
/* Font used for this face, or null if the font could not be loaded |
/* Font used for this face, or null if the font could not be loaded |
1239 |
for some reason. This points to a `font' slot of a struct |
for some reason. This points to a `font' slot of a struct |
1240 |
font_info, and we should not call XFreeFont on it because the |
font_info, and we should not call XFreeFont on it because the |
1255 |
/* Pixel value of foreground color for X frames. Color index |
/* Pixel value of foreground color for X frames. Color index |
1256 |
for tty frames. */ |
for tty frames. */ |
1257 |
unsigned long foreground; |
unsigned long foreground; |
1258 |
|
|
1259 |
/* Pixel value or color index of background color. */ |
/* Pixel value or color index of background color. */ |
1260 |
unsigned long background; |
unsigned long background; |
1261 |
|
|
1283 |
Otherwise, a specific font is loaded from the set of fonts |
Otherwise, a specific font is loaded from the set of fonts |
1284 |
specified by the fontset given by the family attribute of the face. */ |
specified by the fontset given by the family attribute of the face. */ |
1285 |
int fontset; |
int fontset; |
1286 |
|
|
1287 |
/* Pixmap width and height. */ |
/* Pixmap width and height. */ |
1288 |
unsigned int pixmap_w, pixmap_h; |
unsigned int pixmap_w, pixmap_h; |
1289 |
|
|
1290 |
/* Non-zero means characters in this face have a box that thickness |
/* Non-zero means characters in this face have a box that thickness |
1291 |
around them. If it is negative, the absolute value indicates the |
around them. If it is negative, the absolute value indicates the |
1292 |
thickness, and the horizontal lines of box (top and bottom) are |
thickness, and the horizontal lines of box (top and bottom) are |
1335 |
/* 1 means that either no color is specified for underlining or that |
/* 1 means that either no color is specified for underlining or that |
1336 |
the specified color couldn't be loaded. Use the foreground |
the specified color couldn't be loaded. Use the foreground |
1337 |
color when drawing in that case. */ |
color when drawing in that case. */ |
1338 |
unsigned underline_defaulted_p : 1; |
unsigned underline_defaulted_p : 1; |
1339 |
|
|
1340 |
/* 1 means that either no color is specified for the corresponding |
/* 1 means that either no color is specified for the corresponding |
1341 |
attribute or that the specified color couldn't be loaded. |
attribute or that the specified color couldn't be loaded. |
1415 |
{ |
{ |
1416 |
/* Hash table of cached realized faces. */ |
/* Hash table of cached realized faces. */ |
1417 |
struct face **buckets; |
struct face **buckets; |
1418 |
|
|
1419 |
/* Back-pointer to the frame this cache belongs to. */ |
/* Back-pointer to the frame this cache belongs to. */ |
1420 |
struct frame *f; |
struct frame *f; |
1421 |
|
|
1460 |
/* Return the id of the realized face on frame F that is like the face |
/* Return the id of the realized face on frame F that is like the face |
1461 |
with id ID but is suitable for displaying character CHAR. |
with id ID but is suitable for displaying character CHAR. |
1462 |
This macro is only meaningful for multibyte character CHAR. */ |
This macro is only meaningful for multibyte character CHAR. */ |
1463 |
|
|
1464 |
#define FACE_FOR_CHAR(F, FACE, CHAR) \ |
#define FACE_FOR_CHAR(F, FACE, CHAR) \ |
1465 |
(SINGLE_BYTE_CHAR_P (CHAR) \ |
(SINGLE_BYTE_CHAR_P (CHAR) \ |
1466 |
? (FACE)->ascii_face->id \ |
? (FACE)->ascii_face->id \ |
1690 |
|
|
1691 |
/* Stack pointer. */ |
/* Stack pointer. */ |
1692 |
int sp; |
int sp; |
1693 |
|
|
1694 |
/* Setting of buffer-local variable selective-display-ellipsis. */ |
/* Setting of buffer-local variable selective-display-ellipsis. */ |
1695 |
unsigned selective_display_ellipsis_p : 1; |
unsigned selective_display_ellipsis_p : 1; |
1696 |
|
|
1715 |
/* Non-null means that the current character is the first in a run |
/* Non-null means that the current character is the first in a run |
1716 |
of characters with box face. */ |
of characters with box face. */ |
1717 |
unsigned start_of_box_run_p : 1; |
unsigned start_of_box_run_p : 1; |
1718 |
|
|
1719 |
/* Non-zero means that the current character is the last in a run |
/* Non-zero means that the current character is the last in a run |
1720 |
of characters with box face. */ |
of characters with box face. */ |
1721 |
unsigned end_of_box_run_p : 1; |
unsigned end_of_box_run_p : 1; |
1809 |
/* Number of glyphs needed for the last character requested via |
/* Number of glyphs needed for the last character requested via |
1810 |
produce_glyphs. This is 1 except for tabs. */ |
produce_glyphs. This is 1 except for tabs. */ |
1811 |
int nglyphs; |
int nglyphs; |
1812 |
|
|
1813 |
/* Width of the display element in pixels. Result of |
/* Width of the display element in pixels. Result of |
1814 |
produce_glyphs. */ |
produce_glyphs. */ |
1815 |
int pixel_width; |
int pixel_width; |
1925 |
/* Produce glyphs/get display metrics for the display element IT is |
/* Produce glyphs/get display metrics for the display element IT is |
1926 |
loaded with. */ |
loaded with. */ |
1927 |
void (*produce_glyphs) P_ ((struct it *it)); |
void (*produce_glyphs) P_ ((struct it *it)); |
1928 |
|
|
1929 |
/* Write or insert LEN glyphs from STRING at the nominal output |
/* Write or insert LEN glyphs from STRING at the nominal output |
1930 |
position. */ |
position. */ |
1931 |
void (*write_glyphs) P_ ((struct glyph *string, int len)); |
void (*write_glyphs) P_ ((struct glyph *string, int len)); |
1934 |
/* Clear from nominal output position to X. X < 0 means clear |
/* Clear from nominal output position to X. X < 0 means clear |
1935 |
to right end of display. */ |
to right end of display. */ |
1936 |
void (*clear_end_of_line) P_ ((int x)); |
void (*clear_end_of_line) P_ ((int x)); |
1937 |
|
|
1938 |
/* Function to call to scroll the display as described by RUN on |
/* Function to call to scroll the display as described by RUN on |
1939 |
window W. */ |
window W. */ |
1940 |
void (*scroll_run_hook) P_ ((struct window *w, struct run *run)); |
void (*scroll_run_hook) P_ ((struct window *w, struct run *run)); |
1955 |
have to update the mouse highlight. */ |
have to update the mouse highlight. */ |
1956 |
void (*update_window_end_hook) P_ ((struct window *w, int cursor_on_p, |
void (*update_window_end_hook) P_ ((struct window *w, int cursor_on_p, |
1957 |
int mouse_face_overwritten_p)); |
int mouse_face_overwritten_p)); |
1958 |
|
|
1959 |
/* Move cursor to row/column position VPOS/HPOS, pixel coordinates |
/* Move cursor to row/column position VPOS/HPOS, pixel coordinates |
1960 |
Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y |
Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y |
1961 |
are window-relative pixel positions. */ |
are window-relative pixel positions. */ |