X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/945c3bbb15ab1af18e94ab6f81e9c72c8ce1402f..a338b7a70881174039ad488d7950041175dad9d0:/src/dispextern.h diff --git a/src/dispextern.h b/src/dispextern.h index 7056519e7b..8a56e1dcc2 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -274,6 +274,17 @@ enum glyph_type }; +/* Structure describing how to use partial glyphs (images slicing) */ + +struct glyph_slice +{ + unsigned x : 16; + unsigned y : 16; + unsigned width : 16; + unsigned height : 16; +}; + + /* Glyphs. Be extra careful when changing this structure! Esp. make sure that @@ -352,6 +363,8 @@ struct glyph w32_char_font_type. Otherwise it equals FONT_TYPE_UNKNOWN. */ unsigned font_type : 3; + struct glyph_slice slice; + /* A union of sub-structures for different glyph types. */ union { @@ -390,11 +403,20 @@ struct glyph #define CHAR_GLYPH_SPACE_P(GLYPH) \ (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH) +/* Are glyph slices of glyphs *X and *Y equal */ + +#define GLYPH_SLICE_EQUAL_P(X, Y) \ + ((X)->slice.x == (Y)->slice.x \ + && (X)->slice.y == (Y)->slice.y \ + && (X)->slice.width == (Y)->slice.width \ + && (X)->slice.height == (Y)->slice.height) + /* Are glyphs *X and *Y displayed equal? */ #define GLYPH_EQUAL_P(X, Y) \ ((X)->type == (Y)->type \ && (X)->u.val == (Y)->u.val \ + && GLYPH_SLICE_EQUAL_P (X, Y) \ && (X)->face_id == (Y)->face_id \ && (X)->padding_p == (Y)->padding_p \ && (X)->left_box_line_p == (Y)->left_box_line_p \ @@ -968,10 +990,6 @@ extern int fonts_changed_p; extern struct glyph space_glyph; -/* Frame being updated by update_window/update_frame. */ - -extern struct frame *updating_frame; - /* Window being updated by update_window. This is non-null as long as update_window has not finished, and null otherwise. It's role is analogous to updating_frame. */ @@ -1143,6 +1161,9 @@ struct glyph_string /* Image, if any. */ struct image *img; + /* Slice */ + struct glyph_slice slice; + struct glyph_string *next, *prev; }; @@ -1611,7 +1632,7 @@ extern int face_change_count; width and height of the bitmap, DH is the height adjustment (if bitmap is periodic). X and Y are frame coordinates of the area to display the bitmap, DY is relative offset of the bitmap into that - area. BX, NX, BY, NY specifies the area to clear if the bitmap + area. BX, NX, BY, NY specifies the area to clear if the bitmap does not fill the entire area. FACE is the fringe face. */ struct draw_fringe_bitmap_params @@ -1722,6 +1743,15 @@ enum prop_idx }; +struct it_slice +{ + Lisp_Object x; + Lisp_Object y; + Lisp_Object width; + Lisp_Object height; +}; + + struct it { /* The window in which we iterate over current_buffer (or a string). */ @@ -1834,6 +1864,7 @@ struct it unsigned multibyte_p : 1; unsigned string_from_display_prop_p : 1; unsigned display_ellipsis_p : 1; + struct it_slice slice; Lisp_Object space_width; short voffset; Lisp_Object font_height; @@ -1888,6 +1919,10 @@ struct it skipped due to selective display. */ unsigned face_before_selective_p : 1; + /* If 1, adjust current glyph so it does not increase current row + descent/ascent (line-height property). Reset after this glyph. */ + unsigned constrain_row_ascent_descent_p : 1; + /* The ID of the default face to use. One of DEFAULT_FACE_ID, MODE_LINE_FACE_ID, etc, depending on what we are displaying. */ int base_face_id; @@ -1913,6 +1948,9 @@ struct it /* If what == IT_IMAGE, the id of the image to display. */ int image_id; + /* Values from `slice' property. */ + struct it_slice slice; + /* Value of the `space-width' property, if any; nil if none. */ Lisp_Object space_width; @@ -1951,6 +1989,10 @@ struct it only.) */ int extra_line_spacing; + /* Override font height information for this glyph. + Used if override_ascent >= 0. Cleared after this glyph. */ + int override_ascent, override_descent, override_boff; + /* If non-null, glyphs are produced in glyph_row with each call to produce_glyphs. */ struct glyph_row *glyph_row; @@ -2180,7 +2222,7 @@ struct redisplay_interface int (*encode_char) P_ ((int c, XChar2b *char2b, struct font_info *font_into, int *two_byte_p)); -/* Compute left and right overhang of glyph string S. +/* Compute left and right overhang of glyph string S. A NULL pointer if platform does not support this. */ void (*compute_glyph_string_overhangs) P_ ((struct glyph_string *s)); @@ -2208,7 +2250,7 @@ struct redisplay_interface void (*draw_vertical_window_border) P_ ((struct window *w, int x, int y0, int y1)); -/* Shift display of frame F to make room for inserted glyphs. +/* Shift display of frame F to make room for inserted glyphs. The area at pixel (X,Y) of width WIDTH and height HEIGHT is shifted right by SHIFT_BY pixels. */ void (*shift_glyphs_for_insert) P_ ((struct frame *f, @@ -2523,7 +2565,7 @@ extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object)); extern int help_echo_showing_p; extern int current_mode_line_height, current_header_line_height; extern Lisp_Object help_echo_string, help_echo_window; -extern Lisp_Object help_echo_object, previous_help_echo_string; +extern Lisp_Object help_echo_object, previous_help_echo_string; extern int help_echo_pos; extern struct frame *last_mouse_frame; extern int last_tool_bar_item; @@ -2633,6 +2675,8 @@ unsigned long image_background P_ ((struct image *, struct frame *, int image_background_transparent P_ ((struct image *, struct frame *, XImagePtr_or_DC mask)); +int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *)); + #endif /* Defined in sysdep.c */ @@ -2737,7 +2781,7 @@ extern int required_matrix_height P_ ((struct window *)); extern Lisp_Object buffer_posn_from_coords P_ ((struct window *, int *, int *, struct display_pos *, - Lisp_Object *, + Lisp_Object *, int *, int *, int *, int *)); extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part, int *, int *, int *, @@ -2777,8 +2821,8 @@ void clear_glyph_row P_ ((struct glyph_row *)); void prepare_desired_row P_ ((struct glyph_row *)); int line_hash_code P_ ((struct glyph_row *)); void set_window_update_flags P_ ((struct window *, int)); -void write_glyphs P_ ((struct glyph *, int)); -void insert_glyphs P_ ((struct glyph *, int)); +void write_glyphs P_ ((struct frame *, struct glyph *, int)); +void insert_glyphs P_ ((struct frame *, struct glyph *, int)); void redraw_frame P_ ((struct frame *)); void redraw_garbaged_frames P_ ((void)); int scroll_cost P_ ((struct frame *, int, int, int)); @@ -2797,20 +2841,20 @@ extern Lisp_Object Qredisplay_dont_pause; /* Defined in term.c */ -extern void ring_bell P_ ((void)); +extern void ring_bell P_ ((struct frame *)); extern void update_begin P_ ((struct frame *)); extern void update_end P_ ((struct frame *)); -extern void set_terminal_window P_ ((int)); -extern void set_scroll_region P_ ((int, int)); +extern void set_terminal_window P_ ((struct frame *, int)); +extern void set_scroll_region P_ ((struct frame *, int, int)); extern void turn_off_insert P_ ((struct tty_display_info *)); extern void turn_off_highlight P_ ((struct tty_display_info *)); extern void background_highlight P_ ((struct tty_display_info *)); -extern void clear_frame P_ ((void)); -extern void clear_end_of_line P_ ((int)); -extern void clear_end_of_line_raw P_ ((int)); -extern void tty_clear_end_of_line P_ ((int)); -extern void delete_glyphs P_ ((int)); -extern void ins_del_lines P_ ((int, int)); +extern void clear_frame P_ ((struct frame *)); +extern void clear_end_of_line P_ ((struct frame *, int)); +extern void clear_end_of_line_raw P_ ((struct frame *, int)); +extern void tty_clear_end_of_line P_ ((struct frame *, int)); +extern void delete_glyphs P_ ((struct frame *, int)); +extern void ins_del_lines P_ ((struct frame *, int, int)); extern int string_cost P_ ((char *)); extern int per_line_cost P_ ((char *)); extern void calculate_costs P_ ((struct frame *)); @@ -2822,7 +2866,7 @@ extern struct display *init_initial_display P_ ((void)); extern struct display *term_init P_ ((char *, char *, int)); extern void delete_tty P_ ((struct display *)); extern void fatal P_ ((/* char *, ... */)); -extern void cursor_to P_ ((int, int)); +extern void cursor_to P_ ((struct frame *, int, int)); extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long)); extern void tty_set_terminal_modes P_ ((struct display *)); extern void tty_reset_terminal_modes P_ ((struct display *));