/* Glyph describes a character. */
CHAR_GLYPH,
- /* Glyph describes a composition sequence. */
+ /* Glyph describes a static composition. */
COMPOSITE_GLYPH,
/* Glyph describes an image. */
/* Character code for character glyphs (type == CHAR_GLYPH). */
unsigned ch;
- /* Composition ID for composition glyphs (type == COMPOSITION_GLYPH) */
- unsigned cmp_id;
+ /* Sub-structures for type == COMPOSITION_GLYPH. */
+ struct
+ {
+ /* Flag to tell if the composition is automatic or not. */
+ unsigned automatic : 1;
+ /* ID of the composition. */
+ unsigned id : 23;
+ /* Start and end indices of glyhs of the composition. */
+ unsigned from : 4;
+ unsigned to : 4;
+ } cmp;
/* Image ID for image glyphs (type == IMAGE_GLYPH). */
unsigned img_id;
/* Font in which this string is to be drawn. */
struct font *font;
- /* Non-null means this string describes (part of) a composition.
- All characters from char2b are drawn composed. */
+ /* Non-null means this string describes (part of) a static
+ composition. */
struct composition *cmp;
- /* Index of this glyph string's first character in the glyph
- definition of CMP. If this is zero, this glyph string describes
- the first character of a composition. */
- int gidx;
+ /* If not negative, this string describes a compos. */
+ int cmp_id;
+
+ /* Start and end glyph indices in a glyph-string. */
+ int cmp_from, cmp_to;
/* 1 means this glyph strings face has to be drawn to the right end
of the window's drawing area. */
/* A normal character. */
IT_CHARACTER,
- /* A composition sequence. */
+ /* A composition (static and automatic). */
IT_COMPOSITION,
/* An image. */
enum it_method {
GET_FROM_BUFFER = 0,
GET_FROM_DISPLAY_VECTOR,
- GET_FROM_COMPOSITION,
GET_FROM_STRING,
GET_FROM_C_STRING,
GET_FROM_IMAGE,
#define IT_STACK_SIZE 4
+/* Iterator for composition (both for static and automatic). */
+struct composition_it
+{
+ /* Next position at which to check the composition. */
+ EMACS_INT stop_pos;
+ /* ID number of the composition or glyph-string. If negative, we
+ are not iterating over a composition now. */
+ int id;
+ /* If non-negative, character that triggers the automatic
+ composition at `stop_pos', and this is an automatic compositoin.
+ If negative, this is a static composition.. */
+ int ch;
+ /* If non-negative, number of glyphs of the glyph-string. */
+ int nglyphs;
+ /* Number of characters and bytes of the current grapheme cluster. */
+ int nchars, nbytes;
+ /* Indices of the glyphs for the current grapheme cluster. */
+ int from, to;
+ /* Width of the current grapheme cluster in units of pixels on a
+ graphic display and in units of canonical characters on a
+ terminal display. */
+ int width;
+};
+
struct it
{
/* The window in which we iterate over current_buffer (or a string). */
int string_nchars;
int end_charpos;
int stop_charpos;
+ struct composition_it cmp_it;
int face_id;
/* Save values specific to a given method. */
/* method == GET_FROM_COMPOSITION */
struct {
Lisp_Object object;
- int c, len;
- int cmp_id, cmp_len;
} comp;
/* method == GET_FROM_STRETCH */
struct {
and length in bytes of the composition. */
int c, len;
- /* If what == IT_COMPOSITION, identification number and length in
- chars of a composition. */
- int cmp_id, cmp_len;
+ /* If what == IT_COMPOSITION, iterator substructure for the
+ composition. */
+ struct composition_it cmp_it;
/* The character to display, possibly translated to multibyte
if unibyte_display_via_language_environment is set. This