diff options
| author | Eli Zaretskii | 2010-01-01 05:57:17 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-01-01 05:57:17 -0500 |
| commit | 9c82e14597e63ce0d4b036deedc18a8a4732d19b (patch) | |
| tree | f3d801a3d2d356667545630b7517e7a921685023 /src/dispextern.h | |
| parent | e7402cb24ccbf5776dbc5b086bc42bd40d5fb05e (diff) | |
| download | emacs-9c82e14597e63ce0d4b036deedc18a8a4732d19b.tar.gz emacs-9c82e14597e63ce0d4b036deedc18a8a4732d19b.zip | |
Retrospective commit from 2009-09-26.
Continued working on initialization.
Started working on paragraph direction initialization.
bidi.c (bidi_paragraph_init): Don't set bidi_it->ch_len. Abort
if called not at beginning of a new paragraph.
(bidi_get_next_char_visually): Prepare and use a sentinel iterator
state when first_elt flag is set.
dispextern.h (struct bidi_it): New struct member first_elt.
bidi.c (bidi_init_it): Initialize bidi_it->first_elt.
(bidi_copy_it): Don't copy the first_elt flag.
xdisp.c (reseat_1): Initialize bidi_it.first_elt. Move bidi
scan start code from here...
(next_element_from_buffer): ...to here. Use bidi_it.first_elt flag.
Diffstat (limited to 'src/dispextern.h')
| -rw-r--r-- | src/dispextern.h | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index d4f572227a3..389d0acc23c 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -739,14 +739,18 @@ struct glyph_row | |||
| 739 | /* First position in this row. This is the text position, including | 739 | /* First position in this row. This is the text position, including |
| 740 | overlay position information etc, where the display of this row | 740 | overlay position information etc, where the display of this row |
| 741 | started, and can thus be less the position of the first glyph | 741 | started, and can thus be less the position of the first glyph |
| 742 | (e.g. due to invisible text or horizontal scrolling). */ | 742 | (e.g. due to invisible text or horizontal scrolling). BIDI Note: |
| 743 | This is the smallest character position in the row, i.e. not | ||
| 744 | necessarily the character that is displayed the leftmost. */ | ||
| 743 | struct display_pos start; | 745 | struct display_pos start; |
| 744 | 746 | ||
| 745 | /* Text position at the end of this row. This is the position after | 747 | /* Text position at the end of this row. This is the position after |
| 746 | the last glyph on this row. It can be greater than the last | 748 | the last glyph on this row. It can be greater than the last |
| 747 | glyph position + 1, due to truncation, invisible text etc. In an | 749 | glyph position + 1, due to truncation, invisible text etc. In an |
| 748 | up-to-date display, this should always be equal to the start | 750 | up-to-date display, this should always be equal to the start |
| 749 | position of the next row. */ | 751 | position of the next row. BIDI Note: this is the character whose |
| 752 | buffer position is the largest, not necessarily the one displayed | ||
| 753 | the rightmost. */ | ||
| 750 | struct display_pos end; | 754 | struct display_pos end; |
| 751 | 755 | ||
| 752 | /* Non-zero means the overlay arrow bitmap is on this line. | 756 | /* Non-zero means the overlay arrow bitmap is on this line. |
| @@ -924,12 +928,18 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int)); | |||
| 924 | (MATRIX_ROW ((MATRIX), (ROW))->used[TEXT_AREA]) | 928 | (MATRIX_ROW ((MATRIX), (ROW))->used[TEXT_AREA]) |
| 925 | 929 | ||
| 926 | /* Return the character/ byte position at which the display of ROW | 930 | /* Return the character/ byte position at which the display of ROW |
| 927 | starts. */ | 931 | starts. BIDI Note: this is the smallest character/byte position |
| 932 | among characters in ROW, i.e. the first logical-order character | ||
| 933 | displayed by ROW, which is not necessarily the smallest horizontal | ||
| 934 | position. */ | ||
| 928 | 935 | ||
| 929 | #define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos) | 936 | #define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos) |
| 930 | #define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos) | 937 | #define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos) |
| 931 | 938 | ||
| 932 | /* Return the character/ byte position at which ROW ends. */ | 939 | /* Return the character/ byte position at which ROW ends. BIDI Note: |
| 940 | this is the largest character/byte position among characters in | ||
| 941 | ROW, i.e. the last logical-order character displayed by ROW, which | ||
| 942 | is not necessarily the largest horizontal position. */ | ||
| 933 | 943 | ||
| 934 | #define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos) | 944 | #define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos) |
| 935 | #define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos) | 945 | #define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos) |
| @@ -1750,26 +1760,27 @@ struct bidi_stack { | |||
| 1750 | 1760 | ||
| 1751 | /* Data type for iterating over bidi text. */ | 1761 | /* Data type for iterating over bidi text. */ |
| 1752 | struct bidi_it { | 1762 | struct bidi_it { |
| 1763 | int first_elt; /* if non-zero, examine current char first */ | ||
| 1753 | int bytepos; /* iterator's position in buffer */ | 1764 | int bytepos; /* iterator's position in buffer */ |
| 1754 | int charpos; | 1765 | int charpos; |
| 1755 | int ch; /* the character itself */ | 1766 | int ch; /* character itself */ |
| 1756 | int ch_len; /* the length of its multibyte sequence */ | 1767 | int ch_len; /* length of its multibyte sequence */ |
| 1757 | bidi_type_t type; /* bidi type of this character, after | 1768 | bidi_type_t type; /* bidi type of this character, after |
| 1758 | resolving weak and neutral types */ | 1769 | resolving weak and neutral types */ |
| 1759 | bidi_type_t type_after_w1; /* original type, after overrides and W1 */ | 1770 | bidi_type_t type_after_w1; /* original type, after overrides and W1 */ |
| 1760 | bidi_type_t orig_type; /* original type, as found in the buffer */ | 1771 | bidi_type_t orig_type; /* original type, as found in the buffer */ |
| 1761 | int resolved_level; /* final resolved level of this character */ | 1772 | int resolved_level; /* final resolved level of this character */ |
| 1762 | int invalid_levels; /* how many PDFs should we ignore */ | 1773 | int invalid_levels; /* how many PDFs to ignore */ |
| 1763 | int invalid_rl_levels; /* how many PDFs from RLE/RLO should ignore */ | 1774 | int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */ |
| 1764 | int new_paragraph; /* if non-zero, a new paragraph begins here */ | 1775 | int new_paragraph; /* if non-zero, a new paragraph begins here */ |
| 1765 | int prev_was_pdf; /* if non-zero, prev char was PDF */ | 1776 | int prev_was_pdf; /* if non-zero, previous char was PDF */ |
| 1766 | struct bidi_saved_info prev; /* info about the previous character */ | 1777 | struct bidi_saved_info prev; /* info about previous character */ |
| 1767 | struct bidi_saved_info last_strong; /* last-seen strong directional char */ | 1778 | struct bidi_saved_info last_strong; /* last-seen strong directional char */ |
| 1768 | struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ | 1779 | struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ |
| 1769 | struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */ | 1780 | struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */ |
| 1770 | struct bidi_saved_info next_for_ws; /* character after sequence of ws */ | 1781 | struct bidi_saved_info next_for_ws; /* character after sequence of ws */ |
| 1771 | int next_en_pos; /* position of next EN char for ET */ | 1782 | int next_en_pos; /* position of next EN char for ET */ |
| 1772 | int ignore_bn_limit; /* position until which we should ignore BNs */ | 1783 | int ignore_bn_limit; /* position until which to ignore BNs */ |
| 1773 | bidi_dir_t sor; /* direction of start-of-run in effect */ | 1784 | bidi_dir_t sor; /* direction of start-of-run in effect */ |
| 1774 | int scan_dir; /* direction of text scan */ | 1785 | int scan_dir; /* direction of text scan */ |
| 1775 | int stack_idx; /* index of current data on the stack */ | 1786 | int stack_idx; /* index of current data on the stack */ |