diff options
| author | Kim F. Storm | 2004-02-08 23:21:19 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-02-08 23:21:19 +0000 |
| commit | fe1a14c1eb1983bac79cce48fad03b8937f80d52 (patch) | |
| tree | 80b473a0e7d36d8f462bac634e0eac1138c05737 /src | |
| parent | 6d9257263ebfa2dc2d39809584a4e67f5f8b4662 (diff) | |
| download | emacs-fe1a14c1eb1983bac79cce48fad03b8937f80d52.tar.gz emacs-fe1a14c1eb1983bac79cce48fad03b8937f80d52.zip | |
(x_draw_fringe_bitmap): Handle overlayed fringe bitmaps.
Use cursor color for displaying cursor in fringe.
(x_redisplay_interface): Add null handlers for
define_fringe_bitmap and destroy_fringe_bitmap functions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c index 9197e07b72e..a7eaf1ca547 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -715,7 +715,7 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 715 | else | 715 | else |
| 716 | x_clip_to_row (w, row, gc); | 716 | x_clip_to_row (w, row, gc); |
| 717 | 717 | ||
| 718 | if (p->bx >= 0) | 718 | if (p->bx >= 0 && !p->overlay_p) |
| 719 | { | 719 | { |
| 720 | /* In case the same realized face is used for fringes and | 720 | /* In case the same realized face is used for fringes and |
| 721 | for something displayed in the text (e.g. face `region' on | 721 | for something displayed in the text (e.g. face `region' on |
| @@ -733,20 +733,44 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 733 | XSetForeground (display, face->gc, face->foreground); | 733 | XSetForeground (display, face->gc, face->foreground); |
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | if (p->which != NO_FRINGE_BITMAP) | 736 | if (p->which) |
| 737 | { | 737 | { |
| 738 | unsigned char *bits = fringe_bitmaps[p->which].bits + p->dh; | 738 | unsigned char *bits = p->bits + p->dh; |
| 739 | Pixmap pixmap; | 739 | Pixmap pixmap, clipmask = (Pixmap) 0; |
| 740 | int depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f)); | 740 | int depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f)); |
| 741 | XGCValues gcv; | ||
| 741 | 742 | ||
| 742 | /* Draw the bitmap. I believe these small pixmaps can be cached | 743 | /* Draw the bitmap. I believe these small pixmaps can be cached |
| 743 | by the server. */ | 744 | by the server. */ |
| 744 | pixmap = XCreatePixmapFromBitmapData (display, window, bits, p->wd, p->h, | 745 | pixmap = XCreatePixmapFromBitmapData (display, window, bits, p->wd, p->h, |
| 745 | face->foreground, | 746 | (p->cursor_p |
| 747 | ? (p->overlay_p ? face->background | ||
| 748 | : f->output_data.x->cursor_pixel) | ||
| 749 | : face->foreground), | ||
| 746 | face->background, depth); | 750 | face->background, depth); |
| 751 | |||
| 752 | if (p->overlay_p) | ||
| 753 | { | ||
| 754 | clipmask = XCreatePixmapFromBitmapData (display, | ||
| 755 | FRAME_X_DISPLAY_INFO (f)->root_window, | ||
| 756 | bits, p->wd, p->h, | ||
| 757 | 1, 0, 1); | ||
| 758 | gcv.clip_mask = clipmask; | ||
| 759 | gcv.clip_x_origin = p->x; | ||
| 760 | gcv.clip_y_origin = p->y; | ||
| 761 | XChangeGC (display, gc, GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcv); | ||
| 762 | } | ||
| 763 | |||
| 747 | XCopyArea (display, pixmap, window, gc, 0, 0, | 764 | XCopyArea (display, pixmap, window, gc, 0, 0, |
| 748 | p->wd, p->h, p->x, p->y); | 765 | p->wd, p->h, p->x, p->y); |
| 749 | XFreePixmap (display, pixmap); | 766 | XFreePixmap (display, pixmap); |
| 767 | |||
| 768 | if (p->overlay_p) | ||
| 769 | { | ||
| 770 | gcv.clip_mask = (Pixmap) 0; | ||
| 771 | XChangeGC (display, gc, GCClipMask, &gcv); | ||
| 772 | XFreePixmap (display, clipmask); | ||
| 773 | } | ||
| 750 | } | 774 | } |
| 751 | 775 | ||
| 752 | XSetClipMask (display, gc, None); | 776 | XSetClipMask (display, gc, None); |
| @@ -10867,6 +10891,8 @@ static struct redisplay_interface x_redisplay_interface = | |||
| 10867 | x_get_glyph_overhangs, | 10891 | x_get_glyph_overhangs, |
| 10868 | x_fix_overlapping_area, | 10892 | x_fix_overlapping_area, |
| 10869 | x_draw_fringe_bitmap, | 10893 | x_draw_fringe_bitmap, |
| 10894 | 0, /* define_fringe_bitmap */ | ||
| 10895 | 0, /* destroy_fringe_bitmap */ | ||
| 10870 | x_per_char_metric, | 10896 | x_per_char_metric, |
| 10871 | x_encode_char, | 10897 | x_encode_char, |
| 10872 | x_compute_glyph_string_overhangs, | 10898 | x_compute_glyph_string_overhangs, |