Mercurial > emacs
comparison src/dispextern.h @ 53880:c3e8576e5ba2
(FRINGE_ID_BITS): New definition for number of
bits allocated to hold a fringe number. Increase number of bits
from 4 to 8 to allow user defined fringe bitmaps.
(struct glyph_row, struct it): New members left_user_fringe_bitmap,
left_user_fringe_face_id, right_user_fringe_bitmap,
right_user_fringe_face_id.
(enum fringe_bitmap_type, struct fringe_bitmap, fringe_bitmaps):
Move to new file fringe.c.
(MAX_FRINGE_BITMAPS): Define here.
(struct draw_fringe_bitmap_params): New members bits, cursor_p,
and overlay_p. Change member which to int.
(struct redisplay_interface): New members define_fringe_bitmap
and destroy_fringe_bitmap.
(valid_fringe_bitmap_id_p): Add prototype.
(w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: Add prototypes.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sun, 08 Feb 2004 23:18:36 +0000 |
parents | 59115f5809c3 |
children | 8970999f9bcc |
comparison
equal
deleted
inserted
replaced
53879:e3771c262410 | 53880:c3e8576e5ba2 |
---|---|
124 ON_RIGHT_FRINGE, | 124 ON_RIGHT_FRINGE, |
125 ON_LEFT_MARGIN, | 125 ON_LEFT_MARGIN, |
126 ON_RIGHT_MARGIN | 126 ON_RIGHT_MARGIN |
127 }; | 127 }; |
128 | 128 |
129 /* Number of bits allocated to store fringe bitmap numbers. */ | |
130 #define FRINGE_ID_BITS 8 | |
131 | |
129 | 132 |
130 | 133 |
131 /*********************************************************************** | 134 /*********************************************************************** |
132 Debugging | 135 Debugging |
133 ***********************************************************************/ | 136 ***********************************************************************/ |
708 up-to-date display, this should always be equal to the start | 711 up-to-date display, this should always be equal to the start |
709 position of the next row. */ | 712 position of the next row. */ |
710 struct display_pos end; | 713 struct display_pos end; |
711 | 714 |
712 /* Left fringe bitmap number (enum fringe_bitmap_type). */ | 715 /* Left fringe bitmap number (enum fringe_bitmap_type). */ |
713 unsigned left_fringe_bitmap : 4; | 716 unsigned left_user_fringe_bitmap : FRINGE_ID_BITS; |
717 | |
718 /* Face of the left fringe glyph. */ | |
719 unsigned left_user_fringe_face_id : FACE_ID_BITS; | |
714 | 720 |
715 /* Right fringe bitmap number (enum fringe_bitmap_type). */ | 721 /* Right fringe bitmap number (enum fringe_bitmap_type). */ |
716 unsigned right_fringe_bitmap : 4; | 722 unsigned right_user_fringe_bitmap : FRINGE_ID_BITS; |
723 | |
724 /* Face of the right fringe glyph. */ | |
725 unsigned right_user_fringe_face_id : FACE_ID_BITS; | |
726 | |
727 /* Left fringe bitmap number (enum fringe_bitmap_type). */ | |
728 unsigned left_fringe_bitmap : FRINGE_ID_BITS; | |
729 | |
730 /* Face of the left fringe glyph. */ | |
731 unsigned left_fringe_face_id : FACE_ID_BITS; | |
732 | |
733 /* Right fringe bitmap number (enum fringe_bitmap_type). */ | |
734 unsigned right_fringe_bitmap : FRINGE_ID_BITS; | |
735 | |
736 /* Face of the right fringe glyph. */ | |
737 unsigned right_fringe_face_id : FACE_ID_BITS; | |
717 | 738 |
718 /* 1 means that we must draw the bitmaps of this row. */ | 739 /* 1 means that we must draw the bitmaps of this row. */ |
719 unsigned redraw_fringe_bitmaps_p : 1; | 740 unsigned redraw_fringe_bitmaps_p : 1; |
720 | 741 |
721 /* In a desired matrix, 1 means that this row must be updated. In a | 742 /* In a desired matrix, 1 means that this row must be updated. In a |
1607 | 1628 |
1608 /*********************************************************************** | 1629 /*********************************************************************** |
1609 Fringes | 1630 Fringes |
1610 ***********************************************************************/ | 1631 ***********************************************************************/ |
1611 | 1632 |
1612 enum fringe_bitmap_type | |
1613 { | |
1614 NO_FRINGE_BITMAP = 0, | |
1615 LEFT_TRUNCATION_BITMAP, | |
1616 RIGHT_TRUNCATION_BITMAP, | |
1617 UP_ARROW_BITMAP, | |
1618 DOWN_ARROW_BITMAP, | |
1619 CONTINUED_LINE_BITMAP, | |
1620 CONTINUATION_LINE_BITMAP, | |
1621 OVERLAY_ARROW_BITMAP, | |
1622 FIRST_LINE_BITMAP, | |
1623 LAST_LINE_BITMAP, | |
1624 FILLED_BOX_CURSOR_BITMAP, | |
1625 HOLLOW_BOX_CURSOR_BITMAP, | |
1626 BAR_CURSOR_BITMAP, | |
1627 HBAR_CURSOR_BITMAP, | |
1628 ZV_LINE_BITMAP, | |
1629 HOLLOW_SQUARE_BITMAP, | |
1630 MAX_FRINGE_BITMAPS | |
1631 }; | |
1632 | |
1633 struct fringe_bitmap | |
1634 { | |
1635 int width; | |
1636 int height; | |
1637 int period; | |
1638 unsigned char *bits; | |
1639 }; | |
1640 | |
1641 /* Structure used to describe where and how to draw a fringe bitmap. | 1633 /* Structure used to describe where and how to draw a fringe bitmap. |
1642 WHICH is the fringe bitmap to draw. WD and H is the (adjusted) | 1634 WHICH is the fringe bitmap to draw. WD and H is the (adjusted) |
1643 width and height of the bitmap, DH is the height adjustment (if | 1635 width and height of the bitmap, DH is the height adjustment (if |
1644 bitmap is periodic). X and Y are frame coordinates of the area to | 1636 bitmap is periodic). X and Y are frame coordinates of the area to |
1645 display the bitmap, DY is relative offset of the bitmap into that | 1637 display the bitmap, DY is relative offset of the bitmap into that |
1646 area. BX, NX, BY, NY specifies the area to clear if the bitmap | 1638 area. BX, NX, BY, NY specifies the area to clear if the bitmap |
1647 does not fill the entire area. FACE is the fringe face. */ | 1639 does not fill the entire area. FACE is the fringe face. */ |
1648 | 1640 |
1649 struct draw_fringe_bitmap_params | 1641 struct draw_fringe_bitmap_params |
1650 { | 1642 { |
1651 enum fringe_bitmap_type which; | 1643 int which; /* enum fringe_bitmap_type */ |
1644 unsigned char *bits; | |
1652 int wd, h, dh; | 1645 int wd, h, dh; |
1653 int x, y; | 1646 int x, y; |
1654 int bx, nx, by, ny; | 1647 int bx, nx, by, ny; |
1648 unsigned cursor_p : 1; | |
1649 unsigned overlay_p : 1; | |
1655 struct face *face; | 1650 struct face *face; |
1656 }; | 1651 }; |
1657 | 1652 |
1658 extern struct fringe_bitmap fringe_bitmaps[MAX_FRINGE_BITMAPS]; | 1653 #define MAX_FRINGE_BITMAPS (1<<FRINGE_ID_BITS) |
1659 | 1654 |
1660 | 1655 |
1661 /*********************************************************************** | 1656 /*********************************************************************** |
1662 Display Iterator | 1657 Display Iterator |
1663 ***********************************************************************/ | 1658 ***********************************************************************/ |
2023 int vpos; | 2018 int vpos; |
2024 | 2019 |
2025 /* Horizontal matrix position reached in move_it_in_display_line. | 2020 /* Horizontal matrix position reached in move_it_in_display_line. |
2026 Only set there, not in display_line. */ | 2021 Only set there, not in display_line. */ |
2027 int hpos; | 2022 int hpos; |
2023 | |
2024 /* Left fringe bitmap number (enum fringe_bitmap_type). */ | |
2025 unsigned left_user_fringe_bitmap : FRINGE_ID_BITS; | |
2026 | |
2027 /* Face of the left fringe glyph. */ | |
2028 unsigned left_user_fringe_face_id : FACE_ID_BITS; | |
2029 | |
2030 /* Right fringe bitmap number (enum fringe_bitmap_type). */ | |
2031 unsigned right_user_fringe_bitmap : FRINGE_ID_BITS; | |
2032 | |
2033 /* Face of the right fringe glyph. */ | |
2034 unsigned right_user_fringe_face_id : FACE_ID_BITS; | |
2028 }; | 2035 }; |
2029 | 2036 |
2030 | 2037 |
2031 /* Access to positions of iterator IT. */ | 2038 /* Access to positions of iterator IT. */ |
2032 | 2039 |
2178 #ifdef HAVE_WINDOW_SYSTEM | 2185 #ifdef HAVE_WINDOW_SYSTEM |
2179 | 2186 |
2180 /* Draw a fringe bitmap in window W of row ROW using parameters P. */ | 2187 /* Draw a fringe bitmap in window W of row ROW using parameters P. */ |
2181 void (*draw_fringe_bitmap) P_ ((struct window *w, struct glyph_row *row, | 2188 void (*draw_fringe_bitmap) P_ ((struct window *w, struct glyph_row *row, |
2182 struct draw_fringe_bitmap_params *p)); | 2189 struct draw_fringe_bitmap_params *p)); |
2190 | |
2191 /* Define and destroy fringe bitmap no. WHICH. */ | |
2192 void (*define_fringe_bitmap) P_ ((int which, unsigned char *bits, | |
2193 int h, int wd)); | |
2194 void (*destroy_fringe_bitmap) P_ ((int which)); | |
2183 | 2195 |
2184 /* Get metrics of character CHAR2B in FONT of type FONT_TYPE. | 2196 /* Get metrics of character CHAR2B in FONT of type FONT_TYPE. |
2185 Value is null if CHAR2B is not contained in the font. */ | 2197 Value is null if CHAR2B is not contained in the font. */ |
2186 XCharStruct * (*per_char_metric) P_ ((XFontStruct *font, XChar2b *char2b, | 2198 XCharStruct * (*per_char_metric) P_ ((XFontStruct *font, XChar2b *char2b, |
2187 int font_type)); | 2199 int font_type)); |
2528 void move_it_by_lines P_ ((struct it *, int, int)); | 2540 void move_it_by_lines P_ ((struct it *, int, int)); |
2529 void move_it_past_eol P_ ((struct it *)); | 2541 void move_it_past_eol P_ ((struct it *)); |
2530 int in_display_vector_p P_ ((struct it *)); | 2542 int in_display_vector_p P_ ((struct it *)); |
2531 int frame_mode_line_height P_ ((struct frame *)); | 2543 int frame_mode_line_height P_ ((struct frame *)); |
2532 void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *)); | 2544 void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *)); |
2533 void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int)); | |
2534 void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); | |
2535 void draw_window_fringes P_ ((struct window *)); | |
2536 int update_window_fringes P_ ((struct window *, int)); | |
2537 void compute_fringe_widths P_ ((struct frame *, int)); | |
2538 extern Lisp_Object Qtool_bar; | 2545 extern Lisp_Object Qtool_bar; |
2539 extern Lisp_Object Vshow_trailing_whitespace; | 2546 extern Lisp_Object Vshow_trailing_whitespace; |
2540 extern int mode_line_in_non_selected_windows; | 2547 extern int mode_line_in_non_selected_windows; |
2541 extern int redisplaying_p; | 2548 extern int redisplaying_p; |
2542 extern Lisp_Object Vimage_types; | 2549 extern Lisp_Object Vimage_types; |
2600 extern int cursor_in_mouse_face_p P_ ((struct window *w)); | 2607 extern int cursor_in_mouse_face_p P_ ((struct window *w)); |
2601 | 2608 |
2602 extern void expose_frame P_ ((struct frame *, int, int, int, int)); | 2609 extern void expose_frame P_ ((struct frame *, int, int, int, int)); |
2603 extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, | 2610 extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, |
2604 XRectangle *)); | 2611 XRectangle *)); |
2612 #endif | |
2613 | |
2614 /* Defined in fringe.c */ | |
2615 | |
2616 int valid_fringe_bitmap_id_p (int); | |
2617 void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int)); | |
2618 void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); | |
2619 void draw_window_fringes P_ ((struct window *)); | |
2620 int update_window_fringes P_ ((struct window *, int)); | |
2621 void compute_fringe_widths P_ ((struct frame *, int)); | |
2622 | |
2623 #ifdef WINDOWS_NT | |
2624 void w32_init_fringe P_ ((void)); | |
2625 void w32_reset_fringes P_ ((void)); | |
2605 #endif | 2626 #endif |
2606 | 2627 |
2607 /* Defined in sysdep.c */ | 2628 /* Defined in sysdep.c */ |
2608 | 2629 |
2609 void get_frame_size P_ ((int *, int *)); | 2630 void get_frame_size P_ ((int *, int *)); |