diff src/redisplay-x.c @ 373:6240c7796c7a r21-2b2

Import from CVS: tag r21-2b2
author cvs
date Mon, 13 Aug 2007 11:04:06 +0200
parents cc15677e0335
children 8626e4521993
line wrap: on
line diff
--- a/src/redisplay-x.c	Mon Aug 13 11:03:09 2007 +0200
+++ b/src/redisplay-x.c	Mon Aug 13 11:04:06 2007 +0200
@@ -693,8 +693,18 @@
       mask |= GCBackground;
     }
 
-  if (IMAGE_INSTANCEP (bg_pmap)
-      && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
+  /* This special case comes from a request to draw text with a face which has
+     the dim property. We'll use a stippled foreground GC. */
+  if (EQ (bg_pmap, Qdim))
+    {
+      assert (DEVICE_X_GRAY_PIXMAP (d) != None);
+
+      gcv.fill_style = FillStippled;
+      gcv.stipple = DEVICE_X_GRAY_PIXMAP (d);
+      mask |= (GCFillStyle | GCStipple);
+    }
+  else  if (IMAGE_INSTANCEP (bg_pmap)
+	    && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
     {
       if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0)
 	{
@@ -915,6 +925,18 @@
       if (cursor && cursor_cachel && focus && NILP (bar_cursor_value))
 	gc = x_get_gc (d, font, cursor_cachel->foreground,
 		       cursor_cachel->background, Qnil, Qnil);
+      else if (cachel->dim)
+	{
+	  /* Ensure the gray bitmap exists */
+	  if (DEVICE_X_GRAY_PIXMAP (d) == None)
+	    DEVICE_X_GRAY_PIXMAP (d) = 
+	      XCreateBitmapFromData (dpy, x_win, (char *)gray_bits,
+				     gray_width, gray_height);
+
+	  /* Request a GC with the gray stipple pixmap to draw dimmed text */
+	  gc = x_get_gc (d, font, cachel->foreground, cachel->background,
+			 Qdim, Qnil);
+	}
       else
 	gc = x_get_gc (d, font, cachel->foreground, cachel->background,
 		       Qnil, Qnil);