diff options
| author | Eli Zaretskii | 2009-12-31 14:44:59 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2009-12-31 14:44:59 -0500 |
| commit | b7b65b15091c57cf5b5c28caeac83aded8f5e9aa (patch) | |
| tree | 006b5079ad568f05eacd10d61703865be4697ccb /src/dispextern.h | |
| parent | 829f35a5bb1a68526a3175542bad177420df1e1d (diff) | |
| download | emacs-b7b65b15091c57cf5b5c28caeac83aded8f5e9aa.tar.gz emacs-b7b65b15091c57cf5b5c28caeac83aded8f5e9aa.zip | |
Retrospective commit.
These are the original changes made by Kenichi Handa on the old
pre Emacs 22 emacs-bidi branch.
Diffstat (limited to 'src/dispextern.h')
| -rw-r--r-- | src/dispextern.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index f28cae6d8b3..0b3310c8f69 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -1702,6 +1702,79 @@ struct face_cache | |||
| 1702 | 1702 | ||
| 1703 | extern int face_change_count; | 1703 | extern int face_change_count; |
| 1704 | 1704 | ||
| 1705 | /* For BIDI */ | ||
| 1706 | #define BIDI_MAXLEVEL 64 | ||
| 1707 | |||
| 1708 | /* Data type for describing the bidirectional character types. */ | ||
| 1709 | typedef enum { | ||
| 1710 | UNKNOWN_BT, | ||
| 1711 | STRONG_L, /* strong left-to-right */ | ||
| 1712 | STRONG_R, /* strong right-to-left */ | ||
| 1713 | STRONG_AL, /* arabic right-to-left letter */ | ||
| 1714 | LRE, /* left-to-right embedding */ | ||
| 1715 | LRO, /* left-to-right override */ | ||
| 1716 | RLE, /* right-to-left embedding */ | ||
| 1717 | RLO, /* right-to-left override */ | ||
| 1718 | PDF, /* pop directional format */ | ||
| 1719 | WEAK_EN, /* european number */ | ||
| 1720 | WEAK_ES, /* european number separator */ | ||
| 1721 | WEAK_ET, /* european number terminator */ | ||
| 1722 | WEAK_AN, /* arabic number */ | ||
| 1723 | WEAK_CS, /* common separator */ | ||
| 1724 | WEAK_NSM, /* non-spacing mark */ | ||
| 1725 | WEAK_BN, /* boundary neutral */ | ||
| 1726 | NEUTRAL_B, /* paragraph separator */ | ||
| 1727 | NEUTRAL_S, /* segment separator */ | ||
| 1728 | NEUTRAL_WS, /* whitespace */ | ||
| 1729 | NEUTRAL_ON /* other neutrals */ | ||
| 1730 | } bidi_type_t; | ||
| 1731 | |||
| 1732 | /* The basic directionality data type. */ | ||
| 1733 | typedef enum { NEUTRAL_DIR, L2R, R2L } bidi_dir_t; | ||
| 1734 | |||
| 1735 | /* Data type for storing information about characters we need to | ||
| 1736 | remember. */ | ||
| 1737 | struct bidi_saved_info { | ||
| 1738 | int bytepos, charpos; /* character's buffer position */ | ||
| 1739 | bidi_type_t type; /* character bidi type */ | ||
| 1740 | bidi_type_t orig_type; /* original type of the character, after W1 */ | ||
| 1741 | bidi_type_t pristine_type; /* type as we found it in the buffer */ | ||
| 1742 | }; | ||
| 1743 | |||
| 1744 | /* Data type for keeping track of saved embedding levels and override | ||
| 1745 | status information. */ | ||
| 1746 | struct bidi_stack { | ||
| 1747 | int level; | ||
| 1748 | bidi_dir_t override; | ||
| 1749 | }; | ||
| 1750 | |||
| 1751 | /* Data type for iterating over bidi text. */ | ||
| 1752 | struct bidi_it { | ||
| 1753 | int bytepos; /* iterator's position in buffer */ | ||
| 1754 | int charpos; | ||
| 1755 | int ch; /* the character itself */ | ||
| 1756 | int ch_len; /* the length of its multibyte sequence */ | ||
| 1757 | bidi_type_t type; /* type of this character */ | ||
| 1758 | bidi_type_t orig_type; /* original type, after overrides and W1 */ | ||
| 1759 | bidi_type_t pristine_type; /* original type, as found in the buffer */ | ||
| 1760 | int resolved_level; /* final resolved level of this character */ | ||
| 1761 | int invalid_levels; /* how many PDFs should we ignore */ | ||
| 1762 | int invalid_rl_levels; /* how many PDFs from RLE/RLO should ignore */ | ||
| 1763 | int new_paragraph; /* if non-zero, a new paragraph begins here */ | ||
| 1764 | int prev_was_pdf; /* if non-zero, prev char was PDF */ | ||
| 1765 | struct bidi_saved_info prev; /* info about the previous character */ | ||
| 1766 | struct bidi_saved_info last_strong; /* last-seen strong directional char */ | ||
| 1767 | struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ | ||
| 1768 | struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */ | ||
| 1769 | struct bidi_saved_info next_for_ws; /* character after sequence of ws */ | ||
| 1770 | int next_en_pos; /* position of next EN char for ET */ | ||
| 1771 | int ignore_bn_limit; /* position until which we should ignore BNs */ | ||
| 1772 | bidi_dir_t sor; /* direction of start-of-run in effect */ | ||
| 1773 | int scan_dir; /* direction of text scan */ | ||
| 1774 | int stack_idx; /* index of current data on the stack */ | ||
| 1775 | struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */ | ||
| 1776 | }; | ||
| 1777 | |||
| 1705 | 1778 | ||
| 1706 | 1779 | ||
| 1707 | 1780 | ||
| @@ -2233,6 +2306,12 @@ struct it | |||
| 2233 | 2306 | ||
| 2234 | /* Face of the right fringe glyph. */ | 2307 | /* Face of the right fringe glyph. */ |
| 2235 | unsigned right_user_fringe_face_id : FACE_ID_BITS; | 2308 | unsigned right_user_fringe_face_id : FACE_ID_BITS; |
| 2309 | |||
| 2310 | /* 1 means we need bidi processing. */ | ||
| 2311 | int bidi_p; | ||
| 2312 | |||
| 2313 | /* For iterating over bidi text. */ | ||
| 2314 | struct bidi_it bidi_it; | ||
| 2236 | }; | 2315 | }; |
| 2237 | 2316 | ||
| 2238 | 2317 | ||
| @@ -2704,6 +2783,12 @@ extern EMACS_INT tool_bar_button_relief; | |||
| 2704 | Function Prototypes | 2783 | Function Prototypes |
| 2705 | ***********************************************************************/ | 2784 | ***********************************************************************/ |
| 2706 | 2785 | ||
| 2786 | /* Defined in bidi.c */ | ||
| 2787 | |||
| 2788 | extern void bidi_init_it P_ ((int pos, bidi_dir_t dir, | ||
| 2789 | struct bidi_it *bidi_it)); | ||
| 2790 | extern void bidi_get_next_char_visually P_ ((struct bidi_it *bidi_it)); | ||
| 2791 | |||
| 2707 | /* Defined in xdisp.c */ | 2792 | /* Defined in xdisp.c */ |
| 2708 | 2793 | ||
| 2709 | struct glyph_row *row_containing_pos P_ ((struct window *, int, | 2794 | struct glyph_row *row_containing_pos P_ ((struct window *, int, |