aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-08-29 07:54:09 +0000
committerKenichi Handa2008-08-29 07:54:09 +0000
commita88c7fcdd3a25d78472d87794b3d690776624d94 (patch)
treeda949d20a3a5b180d92d8f0609288a44d1ead058 /src
parent6e8b8329c26cd73167289f86acbdab3530cf4e6c (diff)
downloademacs-a88c7fcdd3a25d78472d87794b3d690776624d94.tar.gz
emacs-a88c7fcdd3a25d78472d87794b3d690776624d94.zip
* 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')
-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
274 /* Glyph describes a character. */ 274 /* Glyph describes a character. */
275 CHAR_GLYPH, 275 CHAR_GLYPH,
276 276
277 /* Glyph describes a composition sequence. */ 277 /* Glyph describes a static composition. */
278 COMPOSITE_GLYPH, 278 COMPOSITE_GLYPH,
279 279
280 /* Glyph describes an image. */ 280 /* Glyph describes an image. */
@@ -390,8 +390,17 @@ struct glyph
390 /* Character code for character glyphs (type == CHAR_GLYPH). */ 390 /* Character code for character glyphs (type == CHAR_GLYPH). */
391 unsigned ch; 391 unsigned ch;
392 392
393 /* Composition ID for composition glyphs (type == COMPOSITION_GLYPH) */ 393 /* Sub-structures for type == COMPOSITION_GLYPH. */
394 unsigned cmp_id; 394 struct
395 {
396 /* Flag to tell if the composition is automatic or not. */
397 unsigned automatic : 1;
398 /* ID of the composition. */
399 unsigned id : 23;
400 /* Start and end indices of glyhs of the composition. */
401 unsigned from : 4;
402 unsigned to : 4;
403 } cmp;
395 404
396 /* Image ID for image glyphs (type == IMAGE_GLYPH). */ 405 /* Image ID for image glyphs (type == IMAGE_GLYPH). */
397 unsigned img_id; 406 unsigned img_id;
@@ -1165,14 +1174,15 @@ struct glyph_string
1165 /* Font in which this string is to be drawn. */ 1174 /* Font in which this string is to be drawn. */
1166 struct font *font; 1175 struct font *font;
1167 1176
1168 /* Non-null means this string describes (part of) a composition. 1177 /* Non-null means this string describes (part of) a static
1169 All characters from char2b are drawn composed. */ 1178 composition. */
1170 struct composition *cmp; 1179 struct composition *cmp;
1171 1180
1172 /* Index of this glyph string's first character in the glyph 1181 /* If not negative, this string describes a compos. */
1173 definition of CMP. If this is zero, this glyph string describes 1182 int cmp_id;
1174 the first character of a composition. */ 1183
1175 int gidx; 1184 /* Start and end glyph indices in a glyph-string. */
1185 int cmp_from, cmp_to;
1176 1186
1177 /* 1 means this glyph strings face has to be drawn to the right end 1187 /* 1 means this glyph strings face has to be drawn to the right end
1178 of the window's drawing area. */ 1188 of the window's drawing area. */
@@ -1774,7 +1784,7 @@ enum display_element_type
1774 /* A normal character. */ 1784 /* A normal character. */
1775 IT_CHARACTER, 1785 IT_CHARACTER,
1776 1786
1777 /* A composition sequence. */ 1787 /* A composition (static and automatic). */
1778 IT_COMPOSITION, 1788 IT_COMPOSITION,
1779 1789
1780 /* An image. */ 1790 /* An image. */
@@ -1838,7 +1848,6 @@ struct it_slice
1838enum it_method { 1848enum it_method {
1839 GET_FROM_BUFFER = 0, 1849 GET_FROM_BUFFER = 0,
1840 GET_FROM_DISPLAY_VECTOR, 1850 GET_FROM_DISPLAY_VECTOR,
1841 GET_FROM_COMPOSITION,
1842 GET_FROM_STRING, 1851 GET_FROM_STRING,
1843 GET_FROM_C_STRING, 1852 GET_FROM_C_STRING,
1844 GET_FROM_IMAGE, 1853 GET_FROM_IMAGE,
@@ -1848,6 +1857,30 @@ enum it_method {
1848 1857
1849#define IT_STACK_SIZE 4 1858#define IT_STACK_SIZE 4
1850 1859
1860/* Iterator for composition (both for static and automatic). */
1861struct composition_it
1862{
1863 /* Next position at which to check the composition. */
1864 EMACS_INT stop_pos;
1865 /* ID number of the composition or glyph-string. If negative, we
1866 are not iterating over a composition now. */
1867 int id;
1868 /* If non-negative, character that triggers the automatic
1869 composition at `stop_pos', and this is an automatic compositoin.
1870 If negative, this is a static composition.. */
1871 int ch;
1872 /* If non-negative, number of glyphs of the glyph-string. */
1873 int nglyphs;
1874 /* Number of characters and bytes of the current grapheme cluster. */
1875 int nchars, nbytes;
1876 /* Indices of the glyphs for the current grapheme cluster. */
1877 int from, to;
1878 /* Width of the current grapheme cluster in units of pixels on a
1879 graphic display and in units of canonical characters on a
1880 terminal display. */
1881 int width;
1882};
1883
1851struct it 1884struct it
1852{ 1885{
1853 /* The window in which we iterate over current_buffer (or a string). */ 1886 /* The window in which we iterate over current_buffer (or a string). */
@@ -1970,6 +2003,7 @@ struct it
1970 int string_nchars; 2003 int string_nchars;
1971 int end_charpos; 2004 int end_charpos;
1972 int stop_charpos; 2005 int stop_charpos;
2006 struct composition_it cmp_it;
1973 int face_id; 2007 int face_id;
1974 2008
1975 /* Save values specific to a given method. */ 2009 /* Save values specific to a given method. */
@@ -1983,8 +2017,6 @@ struct it
1983 /* method == GET_FROM_COMPOSITION */ 2017 /* method == GET_FROM_COMPOSITION */
1984 struct { 2018 struct {
1985 Lisp_Object object; 2019 Lisp_Object object;
1986 int c, len;
1987 int cmp_id, cmp_len;
1988 } comp; 2020 } comp;
1989 /* method == GET_FROM_STRETCH */ 2021 /* method == GET_FROM_STRETCH */
1990 struct { 2022 struct {
@@ -2081,9 +2113,9 @@ struct it
2081 and length in bytes of the composition. */ 2113 and length in bytes of the composition. */
2082 int c, len; 2114 int c, len;
2083 2115
2084 /* If what == IT_COMPOSITION, identification number and length in 2116 /* If what == IT_COMPOSITION, iterator substructure for the
2085 chars of a composition. */ 2117 composition. */
2086 int cmp_id, cmp_len; 2118 struct composition_it cmp_it;
2087 2119
2088 /* The character to display, possibly translated to multibyte 2120 /* The character to display, possibly translated to multibyte
2089 if unibyte_display_via_language_environment is set. This 2121 if unibyte_display_via_language_environment is set. This