changeset 53885:693745d24f76

(x_draw_fringe_bitmap): Copy unadapted code from xterm.c to handle overlayed fringe bitmaps and to 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:20:10 +0000
parents 1b20aa00ebc2
children e1b1c388f74d
files src/macterm.c
diffstat 1 files changed, 34 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Sun Feb 08 23:19:48 2004 +0000
+++ b/src/macterm.c	Sun Feb 08 23:20:10 2004 +0000
@@ -1313,7 +1313,7 @@
   else
     x_clip_to_row (w, row, gc);
 
-  if (p->bx >= 0)
+  if (p->bx >= 0 && !p->overlay_p)
     {
       XGCValues gcv;
       gcv.foreground = face->background;
@@ -1339,18 +1339,45 @@
 #endif
     }
 
-  if (p->which != NO_FRINGE_BITMAP)
-    {
-      unsigned char *bits = fringe_bitmaps[p->which].bits + p->dh;
+  if (p->which)
+    {
+      unsigned char *bits = p->bits + p->dh;
       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
+
       mac_draw_bitmap (display, window, &gcv, p->x, p->y, &bitmap);
-
       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);
@@ -8517,6 +8544,8 @@
   x_get_glyph_overhangs,
   x_fix_overlapping_area,
   x_draw_fringe_bitmap,
+  0, /* define_fringe_bitmap */
+  0, /* destroy_fringe_bitmap */
   mac_per_char_metric,
   mac_encode_char,
   NULL, /* mac_compute_glyph_string_overhangs */