Mercurial > emacs
comparison src/xdisp.c @ 57558:97a5853254e0
(overlay_arrow_at_row): Return overlay string rather
than bitmap if there is not left fringe.
(get_overlay_arrow_glyph_row): Also used on windows system.
(display_line): Display overlay string if no left fringe.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sun, 17 Oct 2004 13:17:00 +0000 |
parents | ad0659a2d52e |
children | a928074615ea 0fc4928cc48e |
comparison
equal
deleted
inserted
replaced
57557:13225583da0d | 57558:97a5853254e0 |
---|---|
9521 } | 9521 } |
9522 } | 9522 } |
9523 } | 9523 } |
9524 | 9524 |
9525 | 9525 |
9526 /* Return overlay arrow string at row, or nil. */ | 9526 /* Return overlay arrow string to display at row. |
9527 Return t if display as bitmap in left fringe. | |
9528 Return nil if no overlay arrow. */ | |
9527 | 9529 |
9528 static Lisp_Object | 9530 static Lisp_Object |
9529 overlay_arrow_at_row (f, row, pbitmap) | 9531 overlay_arrow_at_row (it, row, pbitmap) |
9530 struct frame *f; | 9532 struct it *it; |
9531 struct glyph_row *row; | 9533 struct glyph_row *row; |
9532 int *pbitmap; | 9534 int *pbitmap; |
9533 { | 9535 { |
9534 Lisp_Object vlist; | 9536 Lisp_Object vlist; |
9535 | 9537 |
9548 if (MARKERP (val) | 9550 if (MARKERP (val) |
9549 && current_buffer == XMARKER (val)->buffer | 9551 && current_buffer == XMARKER (val)->buffer |
9550 && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val))) | 9552 && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val))) |
9551 { | 9553 { |
9552 val = overlay_arrow_string_or_property (var, pbitmap); | 9554 val = overlay_arrow_string_or_property (var, pbitmap); |
9553 if (FRAME_WINDOW_P (f)) | 9555 if (FRAME_WINDOW_P (it->f) |
9556 && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) | |
9554 return Qt; | 9557 return Qt; |
9555 else if (STRINGP (val)) | 9558 if (STRINGP (val)) |
9556 return val; | 9559 return val; |
9557 break; | 9560 break; |
9558 } | 9561 } |
9559 } | 9562 } |
9560 | 9563 |
14071 | 14074 |
14072 /*********************************************************************** | 14075 /*********************************************************************** |
14073 Building Desired Matrix Rows | 14076 Building Desired Matrix Rows |
14074 ***********************************************************************/ | 14077 ***********************************************************************/ |
14075 | 14078 |
14076 /* Return a temporary glyph row holding the glyphs of an overlay | 14079 /* Return a temporary glyph row holding the glyphs of an overlay arrow. |
14077 arrow. Only used for non-window-redisplay windows. */ | 14080 Used for non-window-redisplay windows, and for windows w/o left fringe. */ |
14078 | 14081 |
14079 static struct glyph_row * | 14082 static struct glyph_row * |
14080 get_overlay_arrow_glyph_row (w, overlay_arrow_string) | 14083 get_overlay_arrow_glyph_row (w, overlay_arrow_string) |
14081 struct window *w; | 14084 struct window *w; |
14082 Lisp_Object overlay_arrow_string; | 14085 Lisp_Object overlay_arrow_string; |
14953 mark this glyph row as the one containing the overlay arrow. | 14956 mark this glyph row as the one containing the overlay arrow. |
14954 This is clearly a mess with variable size fonts. It would be | 14957 This is clearly a mess with variable size fonts. It would be |
14955 better to let it be displayed like cursors under X. */ | 14958 better to let it be displayed like cursors under X. */ |
14956 if (! overlay_arrow_seen | 14959 if (! overlay_arrow_seen |
14957 && (overlay_arrow_string | 14960 && (overlay_arrow_string |
14958 = overlay_arrow_at_row (it->f, row, &overlay_arrow_bitmap), | 14961 = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap), |
14959 !NILP (overlay_arrow_string))) | 14962 !NILP (overlay_arrow_string))) |
14960 { | 14963 { |
14961 /* Overlay arrow in window redisplay is a fringe bitmap. */ | 14964 /* Overlay arrow in window redisplay is a fringe bitmap. */ |
14962 if (!FRAME_WINDOW_P (it->f)) | 14965 if (STRINGP (overlay_arrow_string)) |
14963 { | 14966 { |
14964 struct glyph_row *arrow_row | 14967 struct glyph_row *arrow_row |
14965 = get_overlay_arrow_glyph_row (it->w, overlay_arrow_string); | 14968 = get_overlay_arrow_glyph_row (it->w, overlay_arrow_string); |
14966 struct glyph *glyph = arrow_row->glyphs[TEXT_AREA]; | 14969 struct glyph *glyph = arrow_row->glyphs[TEXT_AREA]; |
14967 struct glyph *arrow_end = glyph + arrow_row->used[TEXT_AREA]; | 14970 struct glyph *arrow_end = glyph + arrow_row->used[TEXT_AREA]; |
14982 while (p2 < end) | 14985 while (p2 < end) |
14983 *p++ = *p2++; | 14986 *p++ = *p2++; |
14984 row->used[TEXT_AREA] = p2 - row->glyphs[TEXT_AREA]; | 14987 row->used[TEXT_AREA] = p2 - row->glyphs[TEXT_AREA]; |
14985 } | 14988 } |
14986 } | 14989 } |
14987 | 14990 else |
14991 { | |
14992 it->w->overlay_arrow_bitmap = overlay_arrow_bitmap; | |
14993 row->overlay_arrow_p = 1; | |
14994 } | |
14988 overlay_arrow_seen = 1; | 14995 overlay_arrow_seen = 1; |
14989 it->w->overlay_arrow_bitmap = overlay_arrow_bitmap; | |
14990 row->overlay_arrow_p = 1; | |
14991 } | 14996 } |
14992 | 14997 |
14993 /* Compute pixel dimensions of this line. */ | 14998 /* Compute pixel dimensions of this line. */ |
14994 compute_line_metrics (it); | 14999 compute_line_metrics (it); |
14995 | 15000 |