aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-04-20 22:16:07 +0000
committerKim F. Storm2004-04-20 22:16:07 +0000
commit0633d52c3e2c278a293a30da354e43ed92e5816d (patch)
treeb07f9beea0baa8392f617db458ac563d3ad544d5 /src
parentae7ab2d30faef50582f4510dc6b75620dab771e2 (diff)
downloademacs-0633d52c3e2c278a293a30da354e43ed92e5816d.tar.gz
emacs-0633d52c3e2c278a293a30da354e43ed92e5816d.zip
(struct glyph_slice): New struct.
(struct glyph): New member slice. (GLYPH_SLICE_EQUAL_P): New macro. (GLYPH_EQUAL_P): Use it. (struct glyph_string): New member slice. (struct it_slice): New struct. (struct it): New member slice, add member to stack too. New member constrain_row_ascent_descent_p. (image_ascent): Add prototype.
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h54
1 files changed, 49 insertions, 5 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 5285e0174ae..746a5b2906f 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -274,6 +274,17 @@ enum glyph_type
274}; 274};
275 275
276 276
277/* Structure describing how to use partial glyphs (images slicing) */
278
279struct glyph_slice
280{
281 unsigned x : 16;
282 unsigned y : 16;
283 unsigned width : 16;
284 unsigned height : 16;
285};
286
287
277/* Glyphs. 288/* Glyphs.
278 289
279 Be extra careful when changing this structure! Esp. make sure that 290 Be extra careful when changing this structure! Esp. make sure that
@@ -352,6 +363,8 @@ struct glyph
352 w32_char_font_type. Otherwise it equals FONT_TYPE_UNKNOWN. */ 363 w32_char_font_type. Otherwise it equals FONT_TYPE_UNKNOWN. */
353 unsigned font_type : 3; 364 unsigned font_type : 3;
354 365
366 struct glyph_slice slice;
367
355 /* A union of sub-structures for different glyph types. */ 368 /* A union of sub-structures for different glyph types. */
356 union 369 union
357 { 370 {
@@ -390,11 +403,20 @@ struct glyph
390#define CHAR_GLYPH_SPACE_P(GLYPH) \ 403#define CHAR_GLYPH_SPACE_P(GLYPH) \
391 (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH) 404 (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH)
392 405
406/* Are glyph slices of glyphs *X and *Y equal */
407
408#define GLYPH_SLICE_EQUAL_P(X, Y) \
409 ((X)->slice.x == (Y)->slice.x \
410 && (X)->slice.y == (Y)->slice.y \
411 && (X)->slice.width == (Y)->slice.width \
412 && (X)->slice.height == (Y)->slice.height)
413
393/* Are glyphs *X and *Y displayed equal? */ 414/* Are glyphs *X and *Y displayed equal? */
394 415
395#define GLYPH_EQUAL_P(X, Y) \ 416#define GLYPH_EQUAL_P(X, Y) \
396 ((X)->type == (Y)->type \ 417 ((X)->type == (Y)->type \
397 && (X)->u.val == (Y)->u.val \ 418 && (X)->u.val == (Y)->u.val \
419 && GLYPH_SLICE_EQUAL_P (X, Y) \
398 && (X)->face_id == (Y)->face_id \ 420 && (X)->face_id == (Y)->face_id \
399 && (X)->padding_p == (Y)->padding_p \ 421 && (X)->padding_p == (Y)->padding_p \
400 && (X)->left_box_line_p == (Y)->left_box_line_p \ 422 && (X)->left_box_line_p == (Y)->left_box_line_p \
@@ -1143,6 +1165,9 @@ struct glyph_string
1143 /* Image, if any. */ 1165 /* Image, if any. */
1144 struct image *img; 1166 struct image *img;
1145 1167
1168 /* Slice */
1169 struct glyph_slice slice;
1170
1146 struct glyph_string *next, *prev; 1171 struct glyph_string *next, *prev;
1147}; 1172};
1148 1173
@@ -1611,7 +1636,7 @@ extern int face_change_count;
1611 width and height of the bitmap, DH is the height adjustment (if 1636 width and height of the bitmap, DH is the height adjustment (if
1612 bitmap is periodic). X and Y are frame coordinates of the area to 1637 bitmap is periodic). X and Y are frame coordinates of the area to
1613 display the bitmap, DY is relative offset of the bitmap into that 1638 display the bitmap, DY is relative offset of the bitmap into that
1614 area. BX, NX, BY, NY specifies the area to clear if the bitmap 1639 area. BX, NX, BY, NY specifies the area to clear if the bitmap
1615 does not fill the entire area. FACE is the fringe face. */ 1640 does not fill the entire area. FACE is the fringe face. */
1616 1641
1617struct draw_fringe_bitmap_params 1642struct draw_fringe_bitmap_params
@@ -1722,6 +1747,15 @@ enum prop_idx
1722}; 1747};
1723 1748
1724 1749
1750struct it_slice
1751{
1752 Lisp_Object x;
1753 Lisp_Object y;
1754 Lisp_Object width;
1755 Lisp_Object height;
1756};
1757
1758
1725struct it 1759struct it
1726{ 1760{
1727 /* The window in which we iterate over current_buffer (or a string). */ 1761 /* The window in which we iterate over current_buffer (or a string). */
@@ -1834,6 +1868,7 @@ struct it
1834 unsigned multibyte_p : 1; 1868 unsigned multibyte_p : 1;
1835 unsigned string_from_display_prop_p : 1; 1869 unsigned string_from_display_prop_p : 1;
1836 unsigned display_ellipsis_p : 1; 1870 unsigned display_ellipsis_p : 1;
1871 struct it_slice slice;
1837 Lisp_Object space_width; 1872 Lisp_Object space_width;
1838 short voffset; 1873 short voffset;
1839 Lisp_Object font_height; 1874 Lisp_Object font_height;
@@ -1888,6 +1923,10 @@ struct it
1888 skipped due to selective display. */ 1923 skipped due to selective display. */
1889 unsigned face_before_selective_p : 1; 1924 unsigned face_before_selective_p : 1;
1890 1925
1926 /* If 1, adjust current glyph so it does not increase current row
1927 descent/ascent. */
1928 unsigned constrain_row_ascent_descent_p : 1;
1929
1891 /* The ID of the default face to use. One of DEFAULT_FACE_ID, 1930 /* The ID of the default face to use. One of DEFAULT_FACE_ID,
1892 MODE_LINE_FACE_ID, etc, depending on what we are displaying. */ 1931 MODE_LINE_FACE_ID, etc, depending on what we are displaying. */
1893 int base_face_id; 1932 int base_face_id;
@@ -1913,6 +1952,9 @@ struct it
1913 /* If what == IT_IMAGE, the id of the image to display. */ 1952 /* If what == IT_IMAGE, the id of the image to display. */
1914 int image_id; 1953 int image_id;
1915 1954
1955 /* Values from `slice' property. */
1956 struct it_slice slice;
1957
1916 /* Value of the `space-width' property, if any; nil if none. */ 1958 /* Value of the `space-width' property, if any; nil if none. */
1917 Lisp_Object space_width; 1959 Lisp_Object space_width;
1918 1960
@@ -2180,7 +2222,7 @@ struct redisplay_interface
2180 int (*encode_char) P_ ((int c, XChar2b *char2b, 2222 int (*encode_char) P_ ((int c, XChar2b *char2b,
2181 struct font_info *font_into, int *two_byte_p)); 2223 struct font_info *font_into, int *two_byte_p));
2182 2224
2183/* Compute left and right overhang of glyph string S. 2225/* Compute left and right overhang of glyph string S.
2184 A NULL pointer if platform does not support this. */ 2226 A NULL pointer if platform does not support this. */
2185 void (*compute_glyph_string_overhangs) P_ ((struct glyph_string *s)); 2227 void (*compute_glyph_string_overhangs) P_ ((struct glyph_string *s));
2186 2228
@@ -2208,7 +2250,7 @@ struct redisplay_interface
2208 void (*draw_vertical_window_border) P_ ((struct window *w, 2250 void (*draw_vertical_window_border) P_ ((struct window *w,
2209 int x, int y0, int y1)); 2251 int x, int y0, int y1));
2210 2252
2211/* Shift display of frame F to make room for inserted glyphs. 2253/* Shift display of frame F to make room for inserted glyphs.
2212 The area at pixel (X,Y) of width WIDTH and height HEIGHT is 2254 The area at pixel (X,Y) of width WIDTH and height HEIGHT is
2213 shifted right by SHIFT_BY pixels. */ 2255 shifted right by SHIFT_BY pixels. */
2214 void (*shift_glyphs_for_insert) P_ ((struct frame *f, 2256 void (*shift_glyphs_for_insert) P_ ((struct frame *f,
@@ -2527,7 +2569,7 @@ extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
2527extern int help_echo_showing_p; 2569extern int help_echo_showing_p;
2528extern int current_mode_line_height, current_header_line_height; 2570extern int current_mode_line_height, current_header_line_height;
2529extern Lisp_Object help_echo_string, help_echo_window; 2571extern Lisp_Object help_echo_string, help_echo_window;
2530extern Lisp_Object help_echo_object, previous_help_echo_string; 2572extern Lisp_Object help_echo_object, previous_help_echo_string;
2531extern int help_echo_pos; 2573extern int help_echo_pos;
2532extern struct frame *last_mouse_frame; 2574extern struct frame *last_mouse_frame;
2533extern int last_tool_bar_item; 2575extern int last_tool_bar_item;
@@ -2637,6 +2679,8 @@ unsigned long image_background P_ ((struct image *, struct frame *,
2637int image_background_transparent P_ ((struct image *, struct frame *, 2679int image_background_transparent P_ ((struct image *, struct frame *,
2638 XImagePtr_or_DC mask)); 2680 XImagePtr_or_DC mask));
2639 2681
2682int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *));
2683
2640#endif 2684#endif
2641 2685
2642/* Defined in sysdep.c */ 2686/* Defined in sysdep.c */
@@ -2741,7 +2785,7 @@ extern int required_matrix_height P_ ((struct window *));
2741extern Lisp_Object buffer_posn_from_coords P_ ((struct window *, 2785extern Lisp_Object buffer_posn_from_coords P_ ((struct window *,
2742 int *, int *, 2786 int *, int *,
2743 struct display_pos *, 2787 struct display_pos *,
2744 Lisp_Object *, 2788 Lisp_Object *,
2745 int *, int *, int *, int *)); 2789 int *, int *, int *, int *));
2746extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part, 2790extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part,
2747 int *, int *, int *, 2791 int *, int *, int *,