]> code.delx.au - gnu-emacs/commitdiff
(w32_draw_fringe_bitmap): Handle overlay fringe bitmaps.
authorJason Rumney <jasonr@gnu.org>
Mon, 16 Feb 2004 00:54:02 +0000 (00:54 +0000)
committerJason Rumney <jasonr@gnu.org>
Mon, 16 Feb 2004 00:54:02 +0000 (00:54 +0000)
src/w32term.c

index 7fa3ca0fece507c3ef6dba4a55c38d4ad676568e..d2e8f8993b814eeaf1590e53c15296016931f2b0 100644 (file)
@@ -711,43 +711,33 @@ w32_draw_fringe_bitmap (w, row, p)
       HANDLE horig_obj;
 
       compat_hdc = CreateCompatibleDC (hdc);
+
       SaveDC (hdc);
 
       horig_obj = SelectObject (compat_hdc, pixmap);
       SetTextColor (hdc, face->background);
-      SetBkColor (hdc, face->foreground);
-
-#if 0  /* TODO: fringe overlay_p and cursor_p */
-      SetBkColor (hdc, (p->cursor_p
-                       ? (p->overlay_p ? face->background
+      SetBkColor (hdc, p->cursor_p
+                       ? (p->overlay_p ? face->background
                           : f->output_data.w32->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
-
-      BitBlt (hdc, p->x, p->y, p->wd, p->h,
-             compat_hdc, 0, p->dh,
-             SRCCOPY);
+                          : face->foreground);
 
-#if 0  /* TODO: fringe overlay_p and cursor_p */
+      /* Paint overlays transparently.  */
       if (p->overlay_p)
        {
-         gcv.clip_mask = (Pixmap) 0;
-         XChangeGC (display, gc, GCClipMask, &gcv);
-         XFreePixmap (display, clipmask);
+       BitBlt (hdc, p->x, p->y, p->wd, p->h,
+               compat_hdc, 0, p->dh,
+               DSTINVERT);
+       BitBlt (hdc, p->x, p->y, p->wd, p->h,
+               compat_hdc, 0, p->dh,
+               MERGEPAINT);
+       BitBlt (hdc, p->x, p->y, p->wd, p->h,
+               compat_hdc, 0, p->dh,
+               DSTINVERT);
        }
-#endif
+      else
+       BitBlt (hdc, p->x, p->y, p->wd, p->h,
+               compat_hdc, 0, p->dh,
+               SRCCOPY);
 
       SelectObject (compat_hdc, horig_obj);
       DeleteDC (compat_hdc);