aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-02-08 23:18:36 +0000
committerKim F. Storm2004-02-08 23:18:36 +0000
commit2251a6f2b7e145d7e143f79437c2d673b4f96c4b (patch)
tree02415e60f094fa4697c226007fbcdc3ad0f93aed /src
parent2d05deefc7e02da3281b7955ae235894d513c9cb (diff)
downloademacs-2251a6f2b7e145d7e143f79437c2d673b4f96c4b.tar.gz
emacs-2251a6f2b7e145d7e143f79437c2d673b4f96c4b.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h97
1 files changed, 59 insertions, 38 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index eed56e55706..ec6750086ea 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -126,6 +126,9 @@ enum window_part
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/***********************************************************************
@@ -710,10 +713,28 @@ struct glyph_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;
720
721 /* Right fringe bitmap number (enum fringe_bitmap_type). */
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;
714 732
715 /* Right fringe bitmap number (enum fringe_bitmap_type). */ 733 /* Right fringe bitmap number (enum fringe_bitmap_type). */
716 unsigned right_fringe_bitmap : 4; 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;
@@ -1609,35 +1630,6 @@ extern int face_change_count;
1609 Fringes 1630 Fringes
1610 ***********************************************************************/ 1631 ***********************************************************************/
1611 1632
1612enum 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
1633struct 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
@@ -1648,14 +1640,17 @@ struct fringe_bitmap
1648 1640
1649struct draw_fringe_bitmap_params 1641struct 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
1658extern struct fringe_bitmap fringe_bitmaps[MAX_FRINGE_BITMAPS]; 1653#define MAX_FRINGE_BITMAPS (1<<FRINGE_ID_BITS)
1659 1654
1660 1655
1661/*********************************************************************** 1656/***********************************************************************
@@ -2025,6 +2020,18 @@ struct it
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
@@ -2181,6 +2188,11 @@ struct redisplay_interface
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));
2183 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));
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,
@@ -2530,11 +2542,6 @@ void move_it_past_eol P_ ((struct it *));
2530int in_display_vector_p P_ ((struct it *)); 2542int in_display_vector_p P_ ((struct it *));
2531int frame_mode_line_height P_ ((struct frame *)); 2543int frame_mode_line_height P_ ((struct frame *));
2532void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *)); 2544void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *));
2533void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int));
2534void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));
2535void draw_window_fringes P_ ((struct window *));
2536int update_window_fringes P_ ((struct window *, int));
2537void compute_fringe_widths P_ ((struct frame *, int));
2538extern Lisp_Object Qtool_bar; 2545extern Lisp_Object Qtool_bar;
2539extern Lisp_Object Vshow_trailing_whitespace; 2546extern Lisp_Object Vshow_trailing_whitespace;
2540extern int mode_line_in_non_selected_windows; 2547extern int mode_line_in_non_selected_windows;
@@ -2604,6 +2611,20 @@ extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *,
2604 XRectangle *)); 2611 XRectangle *));
2605#endif 2612#endif
2606 2613
2614/* Defined in fringe.c */
2615
2616int valid_fringe_bitmap_id_p (int);
2617void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int));
2618void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));
2619void draw_window_fringes P_ ((struct window *));
2620int update_window_fringes P_ ((struct window *, int));
2621void compute_fringe_widths P_ ((struct frame *, int));
2622
2623#ifdef WINDOWS_NT
2624void w32_init_fringe P_ ((void));
2625void w32_reset_fringes P_ ((void));
2626#endif
2627
2607/* Defined in sysdep.c */ 2628/* Defined in sysdep.c */
2608 2629
2609void get_frame_size P_ ((int *, int *)); 2630void get_frame_size P_ ((int *, int *));