Mercurial > emacs
changeset 53899:e45e1fbbe83e
(mac_draw_bitmap): Add overlay_p arg.
(x_draw_fringe_bitmap): Handle overlayed fringe bitmaps;
thanks to YAMAMOTO Mitsuharu for advice on how to do this.
Use cursor color for displaying cursor in fringe.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Mon, 09 Feb 2004 09:18:17 +0000 |
parents | d9e22d65acd3 |
children | 5d607f751ba3 |
files | src/macterm.c |
diffstat | 1 files changed, 12 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/src/macterm.c Mon Feb 09 09:17:22 2004 +0000 +++ b/src/macterm.c Mon Feb 09 09:18:17 2004 +0000 @@ -467,12 +467,13 @@ /* Mac replacement for XCopyArea. */ static void -mac_draw_bitmap (display, w, gc, x, y, bitmap) +mac_draw_bitmap (display, w, gc, x, y, bitmap, overlay_p) Display *display; WindowPtr w; GC gc; int x, y; BitMap *bitmap; + int overlay_p; { Rect r; @@ -491,11 +492,13 @@ LockPortBits (GetWindowPort (w)); pmh = GetPortPixMap (GetWindowPort (w)); - CopyBits (bitmap, (BitMap *) *pmh, &(bitmap->bounds), &r, srcCopy, 0); + CopyBits (bitmap, (BitMap *) *pmh, &(bitmap->bounds), &r, + overlay_p ? srcOr : srcCopy, 0); UnlockPortBits (GetWindowPort (w)); } #else /* not TARGET_API_MAC_CARBON */ - CopyBits (bitmap, &(w->portBits), &(bitmap->bounds), &r, srcCopy, 0); + CopyBits (bitmap, &(w->portBits), &(bitmap->bounds), &r, + overlay_p ? srcOr : srcCopy, 0); #endif /* not TARGET_API_MAC_CARBON */ } @@ -1345,39 +1348,16 @@ BitMap bitmap; mac_create_bitmap_from_bitmap_data (&bitmap, bits, p->wd, p->h); - gcv.foreground = face->foreground; - gcv.background = face->background; - -#if 0 /* TODO: fringe overlay_p and cursor_p */ + gcv.foreground = (p->cursor_p ? (p->overlay_p ? face->background : f->output_data.mac->cursor_pixel) - : face->foreground)); - - if (p->overlay_p) - { - clipmask = XCreatePixmapFromBitmapData (display, - FRAME_X_DISPLAY_INFO (f)->root_window, - bits, p->wd, p->h, - 1, 0, 1); - gcv.clip_mask = clipmask; - gcv.clip_x_origin = p->x; - gcv.clip_y_origin = p->y; - XChangeGC (display, gc, GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcv); - } -#endif - - mac_draw_bitmap (display, window, &gcv, p->x, p->y, &bitmap); + : face->foreground); + gcv.background = face->background; + + mac_draw_bitmap (display, window, &gcv, p->x, p->y, &bitmap, + p->overlay_p); mac_free_bitmap (&bitmap); - -#if 0 /* TODO: fringe overlay_p and cursor_p */ - if (p->overlay_p) - { - gcv.clip_mask = (Pixmap) 0; - XChangeGC (display, gc, GCClipMask, &gcv); - XFreePixmap (display, clipmask); - } -#endif } mac_reset_clipping (display, window);