]> code.delx.au - gnu-emacs/commitdiff
(mac_draw_bitmap): Add overlay_p arg.
authorKim F. Storm <storm@cua.dk>
Mon, 9 Feb 2004 09:18:17 +0000 (09:18 +0000)
committerKim F. Storm <storm@cua.dk>
Mon, 9 Feb 2004 09:18:17 +0000 (09:18 +0000)
(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.

src/macterm.c

index b9e76d47d16f6dc0563753caa9525eba2a66055e..b4efe061d3d97a17ba9dc949e6ed70ec97747078 100644 (file)
@@ -467,12 +467,13 @@ XClearWindow (display, w)
 /* 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 @@ mac_draw_bitmap (display, w, gc, x, y, bitmap)
 
     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 @@ x_draw_fringe_bitmap (w, row, p)
       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
+                       : face->foreground);
+      gcv.background = face->background;
 
-      mac_draw_bitmap (display, window, &gcv, p->x, p->y, &bitmap);
+      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);