summaryrefslogtreecommitdiff
path: root/src/dispextern.h
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2008-08-29 07:54:09 +0000
committerKenichi Handa <handa@m17n.org>2008-08-29 07:54:09 +0000
commit494e84540b185f287a7a01c1431cd41b2fda98a8 (patch)
treec529086c144a2cefc93df7c305eb1548861c177c /src/dispextern.h
parent4207f0c22c1374317718643b005c0826f389eaa0 (diff)
downloademacs-494e84540b185f287a7a01c1431cd41b2fda98a8.tar.gz
* dispextern.h (struct glyph): New union u.cmp. Delete the member
cmp_id. (struct glyph_string): Delete the member gidx. New members cmp_id, cmp_from, and cmp_to. (enum it_method): Delete GET_FROM_COMPOSITION. (struct composition_it): New struct. (struct it): New member cmp_it, and iterator_stack_entry.cmp_it. Delete c, len, cmp_id, cmp_len in u.comp.
Diffstat (limited to 'src/dispextern.h')
-rw-r--r--src/dispextern.h64
1 files changed, 48 insertions, 16 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 2d6e0d026f1..8aeaa82cc5a 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -274,7 +274,7 @@ enum glyph_type
/* Glyph describes a character. */
CHAR_GLYPH,
- /* Glyph describes a composition sequence. */
+ /* Glyph describes a static composition. */
COMPOSITE_GLYPH,
/* Glyph describes an image. */
@@ -390,8 +390,17 @@ struct glyph
/* 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;
@@ -1165,14 +1174,15 @@ struct glyph_string
/* 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. */
@@ -1774,7 +1784,7 @@ enum display_element_type
/* A normal character. */
IT_CHARACTER,
- /* A composition sequence. */
+ /* A composition (static and automatic). */
IT_COMPOSITION,
/* An image. */
@@ -1838,7 +1848,6 @@ struct it_slice
enum it_method {
GET_FROM_BUFFER = 0,
GET_FROM_DISPLAY_VECTOR,
- GET_FROM_COMPOSITION,
GET_FROM_STRING,
GET_FROM_C_STRING,
GET_FROM_IMAGE,
@@ -1848,6 +1857,30 @@ enum it_method {
#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). */
@@ -1970,6 +2003,7 @@ struct it
int string_nchars;
int end_charpos;
int stop_charpos;
+ struct composition_it cmp_it;
int face_id;
/* Save values specific to a given method. */
@@ -1983,8 +2017,6 @@ struct it
/* method == GET_FROM_COMPOSITION */
struct {
Lisp_Object object;
- int c, len;
- int cmp_id, cmp_len;
} comp;
/* method == GET_FROM_STRETCH */
struct {
@@ -2081,9 +2113,9 @@ struct it
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