changeset 53888:57b27e42bf9e

(x_draw_fringe_bitmap): Handle overlayed fringe bitmaps. Use cursor color for displaying cursor in fringe. (x_redisplay_interface): Add null handlers for define_fringe_bitmap and destroy_fringe_bitmap functions.
author Kim F. Storm <storm@cua.dk>
date Sun, 08 Feb 2004 23:21:19 +0000
parents ed7d265e860f
children 8226dc2ed3b7
files src/xterm.c
diffstat 1 files changed, 32 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Sun Feb 08 23:20:52 2004 +0000
+++ b/src/xterm.c	Sun Feb 08 23:21:19 2004 +0000
@@ -715,7 +715,7 @@
   else
     x_clip_to_row (w, row, gc);
 
-  if (p->bx >= 0)
+  if (p->bx >= 0 && !p->overlay_p)
     {
       /* In case the same realized face is used for fringes and
 	 for something displayed in the text (e.g. face `region' on
@@ -733,20 +733,44 @@
 	XSetForeground (display, face->gc, face->foreground);
     }
 
-  if (p->which != NO_FRINGE_BITMAP)
-    {
-      unsigned char *bits = fringe_bitmaps[p->which].bits + p->dh;
-      Pixmap pixmap;
+  if (p->which)
+    {
+      unsigned char *bits = p->bits + p->dh;
+      Pixmap pixmap, clipmask = (Pixmap) 0;
       int depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f));
+      XGCValues gcv;
 
       /* Draw the bitmap.  I believe these small pixmaps can be cached
 	 by the server.  */
       pixmap = XCreatePixmapFromBitmapData (display, window, bits, p->wd, p->h,
-					    face->foreground,
+					    (p->cursor_p
+					     ? (p->overlay_p ? face->background
+						: f->output_data.x->cursor_pixel)
+					     : face->foreground),
 					    face->background, depth);
+
+      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);
+	}
+
       XCopyArea (display, pixmap, window, gc, 0, 0,
 		 p->wd, p->h, p->x, p->y);
       XFreePixmap (display, pixmap);
+
+      if (p->overlay_p)
+	{
+	  gcv.clip_mask = (Pixmap) 0;
+	  XChangeGC (display, gc, GCClipMask, &gcv);
+	  XFreePixmap (display, clipmask);
+	}
     }
 
   XSetClipMask (display, gc, None);
@@ -10867,6 +10891,8 @@
   x_get_glyph_overhangs,
   x_fix_overlapping_area,
   x_draw_fringe_bitmap,
+  0, /* define_fringe_bitmap */
+  0, /* destroy_fringe_bitmap */
   x_per_char_metric,
   x_encode_char,
   x_compute_glyph_string_overhangs,