diff options
| author | Kim F. Storm | 2004-02-09 09:18:17 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-02-09 09:18:17 +0000 |
| commit | 41840482b07840a5f8f5cbc9ea99bb08f26afcd8 (patch) | |
| tree | 606a4dcfdf5b8f662ce012b40c051061332d617a | |
| parent | a3993cc86ec396deb0eb684507ef0ea2b5a7d016 (diff) | |
| download | emacs-41840482b07840a5f8f5cbc9ea99bb08f26afcd8.tar.gz emacs-41840482b07840a5f8f5cbc9ea99bb08f26afcd8.zip | |
(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.
| -rw-r--r-- | src/macterm.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/src/macterm.c b/src/macterm.c index b9e76d47d16..b4efe061d3d 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -467,12 +467,13 @@ XClearWindow (display, w) | |||
| 467 | /* Mac replacement for XCopyArea. */ | 467 | /* Mac replacement for XCopyArea. */ |
| 468 | 468 | ||
| 469 | static void | 469 | static void |
| 470 | mac_draw_bitmap (display, w, gc, x, y, bitmap) | 470 | mac_draw_bitmap (display, w, gc, x, y, bitmap, overlay_p) |
| 471 | Display *display; | 471 | Display *display; |
| 472 | WindowPtr w; | 472 | WindowPtr w; |
| 473 | GC gc; | 473 | GC gc; |
| 474 | int x, y; | 474 | int x, y; |
| 475 | BitMap *bitmap; | 475 | BitMap *bitmap; |
| 476 | int overlay_p; | ||
| 476 | { | 477 | { |
| 477 | Rect r; | 478 | Rect r; |
| 478 | 479 | ||
| @@ -491,11 +492,13 @@ mac_draw_bitmap (display, w, gc, x, y, bitmap) | |||
| 491 | 492 | ||
| 492 | LockPortBits (GetWindowPort (w)); | 493 | LockPortBits (GetWindowPort (w)); |
| 493 | pmh = GetPortPixMap (GetWindowPort (w)); | 494 | pmh = GetPortPixMap (GetWindowPort (w)); |
| 494 | CopyBits (bitmap, (BitMap *) *pmh, &(bitmap->bounds), &r, srcCopy, 0); | 495 | CopyBits (bitmap, (BitMap *) *pmh, &(bitmap->bounds), &r, |
| 496 | overlay_p ? srcOr : srcCopy, 0); | ||
| 495 | UnlockPortBits (GetWindowPort (w)); | 497 | UnlockPortBits (GetWindowPort (w)); |
| 496 | } | 498 | } |
| 497 | #else /* not TARGET_API_MAC_CARBON */ | 499 | #else /* not TARGET_API_MAC_CARBON */ |
| 498 | CopyBits (bitmap, &(w->portBits), &(bitmap->bounds), &r, srcCopy, 0); | 500 | CopyBits (bitmap, &(w->portBits), &(bitmap->bounds), &r, |
| 501 | overlay_p ? srcOr : srcCopy, 0); | ||
| 499 | #endif /* not TARGET_API_MAC_CARBON */ | 502 | #endif /* not TARGET_API_MAC_CARBON */ |
| 500 | } | 503 | } |
| 501 | 504 | ||
| @@ -1345,39 +1348,16 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 1345 | BitMap bitmap; | 1348 | BitMap bitmap; |
| 1346 | 1349 | ||
| 1347 | mac_create_bitmap_from_bitmap_data (&bitmap, bits, p->wd, p->h); | 1350 | mac_create_bitmap_from_bitmap_data (&bitmap, bits, p->wd, p->h); |
| 1348 | gcv.foreground = face->foreground; | ||
| 1349 | gcv.background = face->background; | ||
| 1350 | 1351 | ||
| 1351 | #if 0 /* TODO: fringe overlay_p and cursor_p */ | ||
| 1352 | gcv.foreground = (p->cursor_p | 1352 | gcv.foreground = (p->cursor_p |
| 1353 | ? (p->overlay_p ? face->background | 1353 | ? (p->overlay_p ? face->background |
| 1354 | : f->output_data.mac->cursor_pixel) | 1354 | : f->output_data.mac->cursor_pixel) |
| 1355 | : face->foreground)); | 1355 | : face->foreground); |
| 1356 | 1356 | gcv.background = face->background; | |
| 1357 | if (p->overlay_p) | ||
| 1358 | { | ||
| 1359 | clipmask = XCreatePixmapFromBitmapData (display, | ||
| 1360 | FRAME_X_DISPLAY_INFO (f)->root_window, | ||
| 1361 | bits, p->wd, p->h, | ||
| 1362 | 1, 0, 1); | ||
| 1363 | gcv.clip_mask = clipmask; | ||
| 1364 | gcv.clip_x_origin = p->x; | ||
| 1365 | gcv.clip_y_origin = p->y; | ||
| 1366 | XChangeGC (display, gc, GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcv); | ||
| 1367 | } | ||
| 1368 | #endif | ||
| 1369 | 1357 | ||
| 1370 | mac_draw_bitmap (display, window, &gcv, p->x, p->y, &bitmap); | 1358 | mac_draw_bitmap (display, window, &gcv, p->x, p->y, &bitmap, |
| 1359 | p->overlay_p); | ||
| 1371 | mac_free_bitmap (&bitmap); | 1360 | mac_free_bitmap (&bitmap); |
| 1372 | |||
| 1373 | #if 0 /* TODO: fringe overlay_p and cursor_p */ | ||
| 1374 | if (p->overlay_p) | ||
| 1375 | { | ||
| 1376 | gcv.clip_mask = (Pixmap) 0; | ||
| 1377 | XChangeGC (display, gc, GCClipMask, &gcv); | ||
| 1378 | XFreePixmap (display, clipmask); | ||
| 1379 | } | ||
| 1380 | #endif | ||
| 1381 | } | 1361 | } |
| 1382 | 1362 | ||
| 1383 | mac_reset_clipping (display, window); | 1363 | mac_reset_clipping (display, window); |