aboutsummaryrefslogtreecommitdiffstats
path: root/src/dispextern.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dispextern.h')
-rw-r--r--src/dispextern.h125
1 files changed, 89 insertions, 36 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index c0a67690a5c..2d4aee0cb94 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1,6 +1,6 @@
1/* Interface definitions for display code. 1/* Interface definitions for display code.
2 2
3Copyright (C) 1985, 1993-1994, 1997-2011 Free Software Foundation, Inc. 3Copyright (C) 1985, 1993-1994, 1997-2012 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -405,7 +405,7 @@ struct glyph
405 { 405 {
406 /* Metrics of a partial glyph of an image (type == IMAGE_GLYPH). */ 406 /* Metrics of a partial glyph of an image (type == IMAGE_GLYPH). */
407 struct glyph_slice img; 407 struct glyph_slice img;
408 /* Start and end indices of glyphs of a graphme cluster of a 408 /* Start and end indices of glyphs of a grapheme cluster of a
409 composition (type == COMPOSITE_GLYPH). */ 409 composition (type == COMPOSITE_GLYPH). */
410 struct { int from, to; } cmp; 410 struct { int from, to; } cmp;
411 /* Pixel offsets for upper and lower part of the acronym. */ 411 /* Pixel offsets for upper and lower part of the acronym. */
@@ -575,7 +575,7 @@ struct glyph_pool
575 struct glyph *glyphs; 575 struct glyph *glyphs;
576 576
577 /* Allocated size of `glyphs'. */ 577 /* Allocated size of `glyphs'. */
578 int nglyphs; 578 ptrdiff_t nglyphs;
579 579
580 /* Number of rows and columns in a matrix. */ 580 /* Number of rows and columns in a matrix. */
581 int nrows, ncolumns; 581 int nrows, ncolumns;
@@ -625,7 +625,7 @@ struct glyph_matrix
625 struct glyph_row *rows; 625 struct glyph_row *rows;
626 626
627 /* Number of elements allocated for the vector rows above. */ 627 /* Number of elements allocated for the vector rows above. */
628 int rows_allocated; 628 ptrdiff_t rows_allocated;
629 629
630 /* The number of rows used by the window if all lines were displayed 630 /* The number of rows used by the window if all lines were displayed
631 with the smallest possible character height. */ 631 with the smallest possible character height. */
@@ -1240,7 +1240,7 @@ struct glyph_string
1240 struct composition *cmp; 1240 struct composition *cmp;
1241 1241
1242 /* If not negative, this string describes a compos. */ 1242 /* If not negative, this string describes a compos. */
1243 int cmp_id; 1243 ptrdiff_t cmp_id;
1244 1244
1245 /* Start and end glyph indices in a glyph-string. */ 1245 /* Start and end glyph indices in a glyph-string. */
1246 int cmp_from, cmp_to; 1246 int cmp_from, cmp_to;
@@ -1283,10 +1283,10 @@ struct glyph_string
1283 unsigned padding_p : 1; 1283 unsigned padding_p : 1;
1284 1284
1285 /* The GC to use for drawing this glyph string. */ 1285 /* The GC to use for drawing this glyph string. */
1286#if defined(HAVE_X_WINDOWS) 1286#if defined (HAVE_X_WINDOWS)
1287 GC gc; 1287 GC gc;
1288#endif 1288#endif
1289#if defined(HAVE_NTGUI) 1289#if defined (HAVE_NTGUI)
1290 XGCValues *gc; 1290 XGCValues *gc;
1291 HDC hdc; 1291 HDC hdc;
1292#endif 1292#endif
@@ -1708,7 +1708,8 @@ struct face_cache
1708 struct face **faces_by_id; 1708 struct face **faces_by_id;
1709 1709
1710 /* The allocated size, and number of used slots of faces_by_id. */ 1710 /* The allocated size, and number of used slots of faces_by_id. */
1711 int size, used; 1711 ptrdiff_t size;
1712 int used;
1712 1713
1713 /* Flag indicating that attributes of the `menu' face have been 1714 /* Flag indicating that attributes of the `menu' face have been
1714 changed. */ 1715 changed. */
@@ -1776,7 +1777,7 @@ extern int face_change_count;
1776 3 bits for it, so we cannot use there values larger than 7. 1777 3 bits for it, so we cannot use there values larger than 7.
1777 1778
1778 The order of members must be in sync with the 8th element of the 1779 The order of members must be in sync with the 8th element of the
1779 member of unidata-prop-alist (in admin/unidata/unidata-getn.el) for 1780 member of unidata-prop-alist (in admin/unidata/unidata-gen.el) for
1780 Unicode character property `bidi-class'. */ 1781 Unicode character property `bidi-class'. */
1781typedef enum { 1782typedef enum {
1782 UNKNOWN_BT = 0, 1783 UNKNOWN_BT = 0,
@@ -1820,9 +1821,21 @@ struct bidi_stack {
1820 bidi_dir_t override; 1821 bidi_dir_t override;
1821}; 1822};
1822 1823
1824/* Data type for storing information about a string being iterated on. */
1825struct bidi_string_data {
1826 Lisp_Object lstring; /* Lisp string to reorder, or nil */
1827 const unsigned char *s; /* string data, or NULL if reordering buffer */
1828 EMACS_INT schars; /* the number of characters in the string,
1829 excluding the terminating null */
1830 EMACS_INT bufpos; /* buffer position of lstring, or 0 if N/A */
1831 unsigned from_disp_str : 1; /* 1 means the string comes from a
1832 display property */
1833 unsigned unibyte : 1; /* 1 means the string is unibyte */
1834};
1835
1823/* Data type for reordering bidirectional text. */ 1836/* Data type for reordering bidirectional text. */
1824struct bidi_it { 1837struct bidi_it {
1825 EMACS_INT bytepos; /* iterator's position in buffer */ 1838 EMACS_INT bytepos; /* iterator's position in buffer/string */
1826 EMACS_INT charpos; 1839 EMACS_INT charpos;
1827 int ch; /* character at that position, or u+FFFC 1840 int ch; /* character at that position, or u+FFFC
1828 ("object replacement character") for a run 1841 ("object replacement character") for a run
@@ -1843,21 +1856,26 @@ struct bidi_it {
1843 struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ 1856 struct bidi_saved_info next_for_neutral; /* surrounding characters for... */
1844 struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */ 1857 struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */
1845 struct bidi_saved_info next_for_ws; /* character after sequence of ws */ 1858 struct bidi_saved_info next_for_ws; /* character after sequence of ws */
1846 EMACS_INT next_en_pos; /* position of next EN char for ET */ 1859 EMACS_INT next_en_pos; /* pos. of next char for determining ET type */
1860 bidi_type_t next_en_type; /* type of char at next_en_pos */
1847 EMACS_INT ignore_bn_limit; /* position until which to ignore BNs */ 1861 EMACS_INT ignore_bn_limit; /* position until which to ignore BNs */
1848 bidi_dir_t sor; /* direction of start-of-run in effect */ 1862 bidi_dir_t sor; /* direction of start-of-run in effect */
1849 int scan_dir; /* direction of text scan, 1: forw, -1: back */ 1863 int scan_dir; /* direction of text scan, 1: forw, -1: back */
1864 EMACS_INT disp_pos; /* position of display string after ch */
1865 int disp_prop; /* if non-zero, there really is a
1866 `display' property/string at disp_pos;
1867 if 2, the property is a `space' spec */
1850 int stack_idx; /* index of current data on the stack */ 1868 int stack_idx; /* index of current data on the stack */
1851 /* Note: Everything from here on is not copied/saved when the bidi 1869 /* Note: Everything from here on is not copied/saved when the bidi
1852 iterator state is saved, pushed, or popped. So only put here 1870 iterator state is saved, pushed, or popped. So only put here
1853 stuff that is not part of the bidi iterator's state! */ 1871 stuff that is not part of the bidi iterator's state! */
1854 struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */ 1872 struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */
1855 int first_elt; /* if non-zero, examine current char first */ 1873 struct bidi_string_data string; /* string to reorder */
1856 bidi_dir_t paragraph_dir; /* current paragraph direction */ 1874 bidi_dir_t paragraph_dir; /* current paragraph direction */
1857 int new_paragraph; /* if non-zero, we expect a new paragraph */
1858 int frame_window_p; /* non-zero if displaying on a GUI frame */
1859 EMACS_INT separator_limit; /* where paragraph separator should end */ 1875 EMACS_INT separator_limit; /* where paragraph separator should end */
1860 EMACS_INT disp_pos; /* position of display string after ch */ 1876 unsigned first_elt : 1; /* if non-zero, examine current char first */
1877 unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */
1878 unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */
1861}; 1879};
1862 1880
1863/* Value is non-zero when the bidi iterator is at base paragraph 1881/* Value is non-zero when the bidi iterator is at base paragraph
@@ -2043,7 +2061,7 @@ struct composition_it
2043 EMACS_INT stop_pos; 2061 EMACS_INT stop_pos;
2044 /* ID number of the composition or glyph-string. If negative, we 2062 /* ID number of the composition or glyph-string. If negative, we
2045 are not iterating over a composition now. */ 2063 are not iterating over a composition now. */
2046 int id; 2064 ptrdiff_t id;
2047 /* If non-negative, character that triggers the automatic 2065 /* If non-negative, character that triggers the automatic
2048 composition at `stop_pos', and this is an automatic composition. 2066 composition at `stop_pos', and this is an automatic composition.
2049 If negative, this is a static composition. This is set to -2 2067 If negative, this is a static composition. This is set to -2
@@ -2134,6 +2152,14 @@ struct it
2134 Don't handle some `display' properties in these strings. */ 2152 Don't handle some `display' properties in these strings. */
2135 unsigned string_from_display_prop_p : 1; 2153 unsigned string_from_display_prop_p : 1;
2136 2154
2155 /* 1 means `string' comes from a `line-prefix' or `wrap-prefix'
2156 property. */
2157 unsigned string_from_prefix_prop_p : 1;
2158
2159 /* 1 means we are iterating an object that came from a value of a
2160 `display' property. */
2161 unsigned from_disp_prop_p : 1;
2162
2137 /* When METHOD == next_element_from_display_vector, 2163 /* When METHOD == next_element_from_display_vector,
2138 this is 1 if we're doing an ellipsis. Otherwise meaningless. */ 2164 this is 1 if we're doing an ellipsis. Otherwise meaningless. */
2139 unsigned ellipsis_p : 1; 2165 unsigned ellipsis_p : 1;
@@ -2153,7 +2179,9 @@ struct it
2153 Lisp_Object *dpvec, *dpend; 2179 Lisp_Object *dpvec, *dpend;
2154 2180
2155 /* Length in bytes of the char that filled dpvec. A value of zero 2181 /* Length in bytes of the char that filled dpvec. A value of zero
2156 means that no such character is involved. */ 2182 means that no such character is involved. A negative value means
2183 the rest of the line from the current iterator position onwards
2184 is hidden by selective display or ellipsis. */
2157 int dpvec_char_len; 2185 int dpvec_char_len;
2158 2186
2159 /* Face id to use for all characters in display vector. -1 if unused. */ 2187 /* Face id to use for all characters in display vector. -1 if unused. */
@@ -2227,7 +2255,7 @@ struct it
2227 struct { 2255 struct {
2228 Lisp_Object object; 2256 Lisp_Object object;
2229 struct it_slice slice; 2257 struct it_slice slice;
2230 int image_id; 2258 ptrdiff_t image_id;
2231 } image; 2259 } image;
2232 /* method == GET_FROM_COMPOSITION */ 2260 /* method == GET_FROM_COMPOSITION */
2233 struct { 2261 struct {
@@ -2245,10 +2273,14 @@ struct it
2245 Lisp_Object from_overlay; 2273 Lisp_Object from_overlay;
2246 enum glyph_row_area area; 2274 enum glyph_row_area area;
2247 enum it_method method; 2275 enum it_method method;
2276 bidi_dir_t paragraph_embedding;
2248 unsigned multibyte_p : 1; 2277 unsigned multibyte_p : 1;
2249 unsigned string_from_display_prop_p : 1; 2278 unsigned string_from_display_prop_p : 1;
2279 unsigned string_from_prefix_prop_p : 1;
2250 unsigned display_ellipsis_p : 1; 2280 unsigned display_ellipsis_p : 1;
2251 unsigned avoid_cursor_p : 1; 2281 unsigned avoid_cursor_p : 1;
2282 unsigned bidi_p:1;
2283 unsigned from_disp_prop_p : 1;
2252 enum line_wrap_method line_wrap; 2284 enum line_wrap_method line_wrap;
2253 2285
2254 /* properties from display property that are reset by another display property. */ 2286 /* properties from display property that are reset by another display property. */
@@ -2354,7 +2386,7 @@ struct it
2354 enum glyphless_display_method glyphless_method; 2386 enum glyphless_display_method glyphless_method;
2355 2387
2356 /* If what == IT_IMAGE, the id of the image to display. */ 2388 /* If what == IT_IMAGE, the id of the image to display. */
2357 int image_id; 2389 ptrdiff_t image_id;
2358 2390
2359 /* Values from `slice' property. */ 2391 /* Values from `slice' property. */
2360 struct it_slice slice; 2392 struct it_slice slice;
@@ -2372,9 +2404,19 @@ struct it
2372 Lisp_Object font_height; 2404 Lisp_Object font_height;
2373 2405
2374 /* Object and position where the current display element came from. 2406 /* Object and position where the current display element came from.
2375 Object can be a Lisp string in case the current display element 2407 Object is normally the buffer which is being rendered, but it can
2376 comes from an overlay string, or it is buffer. It may also be nil 2408 also be a Lisp string in case the current display element comes
2377 during mode-line update. Position is a position in object. */ 2409 from an overlay string or from a display string (before- or
2410 after-string). It may also be nil when a C string is being
2411 rendered, e.g., during mode-line or header-line update. It can
2412 also be a cons cell of the form `(space ...)', when we produce a
2413 stretch glyph from a `display' specification. Finally, it can be
2414 a zero-valued Lisp integer, but only temporarily, when we are
2415 producing special glyphs for display purposes, like truncation
2416 and continuation glyphs, or blanks that extend each line to the
2417 edge of the window on a TTY.
2418
2419 Position is the current iterator position in object. */
2378 Lisp_Object object; 2420 Lisp_Object object;
2379 struct text_pos position; 2421 struct text_pos position;
2380 2422
@@ -2469,7 +2511,7 @@ struct it
2469 2511
2470 /* Non-zero means we need to reorder bidirectional text for display 2512 /* Non-zero means we need to reorder bidirectional text for display
2471 in the visual order. */ 2513 in the visual order. */
2472 int bidi_p; 2514 unsigned bidi_p : 1;
2473 2515
2474 /* For iterating over bidirectional text. */ 2516 /* For iterating over bidirectional text. */
2475 struct bidi_it bidi_it; 2517 struct bidi_it bidi_it;
@@ -2612,11 +2654,11 @@ struct redisplay_interface
2612 void (*flush_display) (struct frame *f); 2654 void (*flush_display) (struct frame *f);
2613 2655
2614 /* Flush the display of frame F if non-NULL. This is called 2656 /* Flush the display of frame F if non-NULL. This is called
2615 during redisplay, and should be NULL on systems which flushes 2657 during redisplay, and should be NULL on systems which flush
2616 automatically before reading input. */ 2658 automatically before reading input. */
2617 void (*flush_display_optional) (struct frame *f); 2659 void (*flush_display_optional) (struct frame *f);
2618 2660
2619 /* Clear the mouse hightlight in window W, if there is any. */ 2661 /* Clear the mouse highlight in window W, if there is any. */
2620 void (*clear_window_mouse_face) (struct window *w); 2662 void (*clear_window_mouse_face) (struct window *w);
2621 2663
2622 /* Set *LEFT and *RIGHT to the left and right overhang of GLYPH on 2664 /* Set *LEFT and *RIGHT to the left and right overhang of GLYPH on
@@ -2804,7 +2846,7 @@ struct image
2804 EMACS_UINT hash; 2846 EMACS_UINT hash;
2805 2847
2806 /* Image id of this image. */ 2848 /* Image id of this image. */
2807 int id; 2849 ptrdiff_t id;
2808 2850
2809 /* Hash collision chain. */ 2851 /* Hash collision chain. */
2810 struct image *next, *prev; 2852 struct image *next, *prev;
@@ -2823,13 +2865,13 @@ struct image_cache
2823 struct image **images; 2865 struct image **images;
2824 2866
2825 /* Allocated size of `images'. */ 2867 /* Allocated size of `images'. */
2826 unsigned size; 2868 ptrdiff_t size;
2827 2869
2828 /* Number of images in the cache. */ 2870 /* Number of images in the cache. */
2829 unsigned used; 2871 ptrdiff_t used;
2830 2872
2831 /* Reference count (number of frames sharing this cache). */ 2873 /* Reference count (number of frames sharing this cache). */
2832 int refcount; 2874 ptrdiff_t refcount;
2833}; 2875};
2834 2876
2835 2877
@@ -2951,6 +2993,10 @@ extern void bidi_init_it (EMACS_INT, EMACS_INT, int, struct bidi_it *);
2951extern void bidi_move_to_visually_next (struct bidi_it *); 2993extern void bidi_move_to_visually_next (struct bidi_it *);
2952extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int); 2994extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int);
2953extern int bidi_mirror_char (int); 2995extern int bidi_mirror_char (int);
2996extern void bidi_push_it (struct bidi_it *);
2997extern void bidi_pop_it (struct bidi_it *);
2998extern void *bidi_shelve_cache (void);
2999extern void bidi_unshelve_cache (void *, int);
2954 3000
2955/* Defined in xdisp.c */ 3001/* Defined in xdisp.c */
2956 3002
@@ -3006,10 +3052,13 @@ extern struct frame *last_mouse_frame;
3006extern int last_tool_bar_item; 3052extern int last_tool_bar_item;
3007extern void reseat_at_previous_visible_line_start (struct it *); 3053extern void reseat_at_previous_visible_line_start (struct it *);
3008extern Lisp_Object lookup_glyphless_char_display (int, struct it *); 3054extern Lisp_Object lookup_glyphless_char_display (int, struct it *);
3009extern int calc_pixel_width_or_height (double *, struct it *, Lisp_Object, 3055extern EMACS_INT compute_display_string_pos (struct text_pos *,
3010 struct font *, int, int *); 3056 struct bidi_string_data *,
3011extern EMACS_INT compute_display_string_pos (EMACS_INT, int); 3057 int, int *);
3012extern EMACS_INT compute_display_string_end (EMACS_INT); 3058extern EMACS_INT compute_display_string_end (EMACS_INT,
3059 struct bidi_string_data *);
3060extern void produce_stretch_glyph (struct it *);
3061
3013 3062
3014#ifdef HAVE_WINDOW_SYSTEM 3063#ifdef HAVE_WINDOW_SYSTEM
3015 3064
@@ -3082,6 +3131,9 @@ void compute_fringe_widths (struct frame *, int);
3082void w32_init_fringe (struct redisplay_interface *); 3131void w32_init_fringe (struct redisplay_interface *);
3083void w32_reset_fringes (void); 3132void w32_reset_fringes (void);
3084#endif 3133#endif
3134
3135extern unsigned row_hash (struct glyph_row *);
3136
3085/* Defined in image.c */ 3137/* Defined in image.c */
3086 3138
3087#ifdef HAVE_WINDOW_SYSTEM 3139#ifdef HAVE_WINDOW_SYSTEM
@@ -3089,7 +3141,7 @@ void w32_reset_fringes (void);
3089extern int x_bitmap_height (struct frame *, ptrdiff_t); 3141extern int x_bitmap_height (struct frame *, ptrdiff_t);
3090extern int x_bitmap_width (struct frame *, ptrdiff_t); 3142extern int x_bitmap_width (struct frame *, ptrdiff_t);
3091extern int x_bitmap_pixmap (struct frame *, ptrdiff_t); 3143extern int x_bitmap_pixmap (struct frame *, ptrdiff_t);
3092extern void x_reference_bitmap (struct frame *, int); 3144extern void x_reference_bitmap (struct frame *, ptrdiff_t);
3093extern ptrdiff_t x_create_bitmap_from_data (struct frame *, char *, 3145extern ptrdiff_t x_create_bitmap_from_data (struct frame *, char *,
3094 unsigned int, unsigned int); 3146 unsigned int, unsigned int);
3095extern ptrdiff_t x_create_bitmap_from_file (struct frame *, Lisp_Object); 3147extern ptrdiff_t x_create_bitmap_from_file (struct frame *, Lisp_Object);
@@ -3110,7 +3162,7 @@ void clear_image_caches (Lisp_Object);
3110void mark_image_cache (struct image_cache *); 3162void mark_image_cache (struct image_cache *);
3111int valid_image_p (Lisp_Object); 3163int valid_image_p (Lisp_Object);
3112void prepare_image_for_display (struct frame *, struct image *); 3164void prepare_image_for_display (struct frame *, struct image *);
3113int lookup_image (struct frame *, Lisp_Object); 3165ptrdiff_t lookup_image (struct frame *, Lisp_Object);
3114 3166
3115unsigned long image_background (struct image *, struct frame *, 3167unsigned long image_background (struct image *, struct frame *,
3116 XImagePtr_or_DC ximg); 3168 XImagePtr_or_DC ximg);
@@ -3171,7 +3223,6 @@ int merge_faces (struct frame *, Lisp_Object, EMACS_INT, int);
3171int compute_char_face (struct frame *, int, Lisp_Object); 3223int compute_char_face (struct frame *, int, Lisp_Object);
3172void free_all_realized_faces (Lisp_Object); 3224void free_all_realized_faces (Lisp_Object);
3173extern Lisp_Object Qforeground_color, Qbackground_color; 3225extern Lisp_Object Qforeground_color, Qbackground_color;
3174extern Lisp_Object Qframe_set_background_mode;
3175extern char unspecified_fg[], unspecified_bg[]; 3226extern char unspecified_fg[], unspecified_bg[];
3176 3227
3177/* Defined in xfns.c */ 3228/* Defined in xfns.c */
@@ -3303,8 +3354,10 @@ extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, un
3303extern void set_tty_color_mode (struct tty_display_info *, struct frame *); 3354extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
3304extern struct terminal *get_named_tty (const char *); 3355extern struct terminal *get_named_tty (const char *);
3305EXFUN (Ftty_type, 1); 3356EXFUN (Ftty_type, 1);
3357EXFUN (Fcontrolling_tty_p, 1);
3306extern void create_tty_output (struct frame *); 3358extern void create_tty_output (struct frame *);
3307extern struct terminal *init_tty (const char *, const char *, int); 3359extern struct terminal *init_tty (const char *, const char *, int);
3360extern void tty_append_glyph (struct it *);
3308 3361
3309 3362
3310/* Defined in scroll.c */ 3363/* Defined in scroll.c */