]> code.delx.au - gnu-emacs/blobdiff - src/fringe.c
Merged in changes from CVS trunk.
[gnu-emacs] / src / fringe.c
index 0ceffad34f4f6f4f9b94fef6b7bd238de4ab05c7..aecb51349fcc2280cbece56f6eccaa1d586ae2cc 100644 (file)
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA.  */
 #include "dispextern.h"
 #include "buffer.h"
 #include "blockinput.h"
+#include "termhooks.h"
 
 #ifdef HAVE_WINDOW_SYSTEM
 
@@ -588,7 +589,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
       break;
     }
 
-  rif->draw_fringe_bitmap (w, row, &p);
+  FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p);
 }
 
 void
@@ -636,7 +637,10 @@ draw_fringe_bitmap (w, row, left_p)
   draw_fringe_bitmap_1 (w, row, left_p, overlay, NO_FRINGE_BITMAP);
 
   if (left_p && row->overlay_arrow_p)
-    draw_fringe_bitmap_1 (w, row, 1, 1, OVERLAY_ARROW_BITMAP);
+    draw_fringe_bitmap_1 (w, row, 1, 1,
+                         (w->overlay_arrow_bitmap
+                          ? w->overlay_arrow_bitmap
+                          : OVERLAY_ARROW_BITMAP));
 }
 
 
@@ -737,7 +741,7 @@ update_window_fringes (w, force_p)
        {
          unsigned indicate_bob_p, indicate_top_line_p;
          unsigned indicate_eob_p, indicate_bottom_line_p;
-         
+
          row = w->desired_matrix->rows + rn;
          if (!row->enabled_p)
            row = w->current_matrix->rows + rn;
@@ -746,7 +750,7 @@ update_window_fringes (w, force_p)
          indicate_top_line_p = row->indicate_top_line_p;
          indicate_eob_p = row->indicate_eob_p;
          indicate_bottom_line_p = row->indicate_bottom_line_p;
-         
+
          row->indicate_bob_p = row->indicate_top_line_p = 0;
          row->indicate_eob_p = row->indicate_bottom_line_p = 0;
 
@@ -799,10 +803,6 @@ update_window_fringes (w, force_p)
          left = row->left_user_fringe_bitmap;
          left_face_id = row->left_user_fringe_face_id;
        }
-#if 0  /* this is now done via an overlay */
-      else if (row->overlay_arrow_p)
-       left = OVERLAY_ARROW_BITMAP;
-#endif
       else if (row->indicate_bob_p && boundary_pos <= 0)
        left = ((row->indicate_eob_p && boundary_pos < 0)
                ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP);
@@ -881,7 +881,7 @@ update_window_fringes (w, force_p)
 }
 
 
-/* Compute actual fringe widths for frame F.  
+/* Compute actual fringe widths for frame F.
 
    If REDRAW is 1, redraw F if the fringe settings was actually
    modified and F is visible.
@@ -998,8 +998,9 @@ If WHICH overrides a standard fringe bitmap, the original bitmap is restored.  *
   fbp = &fringe_bitmaps[n];
   if (*fbp && (*fbp)->dynamic)
     {
-      if (rif->destroy_fringe_bitmap)
-       rif->destroy_fringe_bitmap (n);
+      /* XXX Is SELECTED_FRAME OK here? */
+      if (FRAME_RIF (SELECTED_FRAME ())->destroy_fringe_bitmap)
+       FRAME_RIF (SELECTED_FRAME ())->destroy_fringe_bitmap (n);
       xfree (*fbp);
       *fbp = NULL;
     }
@@ -1067,6 +1068,7 @@ init_fringe_bitmap (which, fb, once_p)
 
 #if defined (MAC_OS) && defined (WORDS_BIG_ENDIAN)
       unsigned short *bits = fb->bits;
+      int j;
       for (j = 0; j < fb->height; j++)
        {
          unsigned short b = *bits;
@@ -1079,8 +1081,9 @@ init_fringe_bitmap (which, fb, once_p)
     {
       Fdestroy_fringe_bitmap (make_number (which));
 
-      if (rif->define_fringe_bitmap)
-       rif->define_fringe_bitmap (which, fb->bits, fb->height, fb->width);
+      /* XXX Is SELECTED_FRAME OK here? */
+      if (FRAME_RIF (SELECTED_FRAME ())->define_fringe_bitmap)
+       FRAME_RIF (SELECTED_FRAME ())->define_fringe_bitmap (which, fb->bits, fb->height, fb->width);
 
       fringe_bitmaps[which] = fb;
       if (which >= max_used_fringe_bitmap)
@@ -1095,7 +1098,7 @@ DEFUN ("define-fringe-bitmap", Fdefine_fringe_bitmap, Sdefine_fringe_bitmap,
 BITS is either a string or a vector of integers.
 HEIGHT is height of bitmap.  If HEIGHT is nil, use length of BITS.
 WIDTH must be an integer between 1 and 16, or nil which defaults to 8.
-Optional forth arg ALIGN may be one of `top', `center', or `bottom',
+Optional fourth arg ALIGN may be one of `top', `center', or `bottom',
 indicating the positioning of the bitmap relative to the rows where it
 is used; the default is to center the bitmap.  Fourth arg may also be a
 list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap
@@ -1129,7 +1132,7 @@ Return new bitmap number, or nil of no more free bitmap slots.  */)
          fill2 = fb.height - h - fill1;
        }
     }
-  
+
   if (NILP (width))
     fb.width = 8;
   else
@@ -1165,7 +1168,7 @@ Return new bitmap number, or nil of no more free bitmap slots.  */)
   if (NILP (which))
     {
       if (max_used_fringe_bitmap < MAX_FRINGE_BITMAPS)
-       n = make_number (max_used_fringe_bitmap++);
+       n = max_used_fringe_bitmap++;
       else
        {
          for (n = MAX_STANDARD_FRINGE_BITMAPS;
@@ -1188,9 +1191,9 @@ Return new bitmap number, or nil of no more free bitmap slots.  */)
 
   fb.dynamic = 1;
 
-  xfb = (struct fringe_bitmap *)xmalloc (sizeof fb
-                                        + fb.height * BYTES_PER_BITMAP_ROW);
-  fb.bits = b = (unsigned short *)(xfb+1);
+  xfb = (struct fringe_bitmap *) xmalloc (sizeof fb
+                                         + fb.height * BYTES_PER_BITMAP_ROW);
+  fb.bits = b = (unsigned short *) (xfb + 1);
   bzero (b, fb.height);
 
   j = 0;
@@ -1198,7 +1201,7 @@ Return new bitmap number, or nil of no more free bitmap slots.  */)
     {
       for (i = 0; i < fill1 && j < fb.height; i++)
        b[j++] = 0;
-      for (i = 0; i < h & j < fb.height; i++)
+      for (i = 0; i < h && j < fb.height; i++)
        {
          Lisp_Object elt = Faref (bits, make_number (i));
          b[j++] = NUMBERP (elt) ? XINT (elt) : 0;
@@ -1216,7 +1219,7 @@ Return new bitmap number, or nil of no more free bitmap slots.  */)
 
 DEFUN ("set-fringe-bitmap-face", Fset_fringe_bitmap_face, Sset_fringe_bitmap_face,
        1, 2, 0,
-       doc:  /* Set face for fringe bitmap FRINGE-ID to FACE.
+       doc: /* Set face for fringe bitmap FRINGE-ID to FACE.
 If FACE is nil, reset face to default fringe face.  */)
   (fringe_id, face)
      Lisp_Object fringe_id, face;
@@ -1243,7 +1246,7 @@ If FACE is nil, reset face to default fringe face.  */)
 
 DEFUN ("fringe-bitmaps-at-pos", Ffringe_bitmaps_at_pos, Sfringe_bitmaps_at_pos,
        0, 2, 0,
-       doc:  /* Return fringe bitmaps of row containing position POS in window WINDOW.
+       doc: /* Return fringe bitmaps of row containing position POS in window WINDOW.
 If WINDOW is nil, use selected window.  If POS is nil, use value of point
 in that window.  Return value is a cons (LEFT . RIGHT) where LEFT and RIGHT
 are the fringe bitmap numbers for the bitmaps in the left and right fringe,
@@ -1252,7 +1255,6 @@ resp.  Return nil if POS is not visible in WINDOW.  */)
      Lisp_Object pos, window;
 {
   struct window *w;
-  struct buffer *old_buffer = NULL;
   struct glyph_row *row;
   int textpos;
 
@@ -1345,7 +1347,7 @@ w32_reset_fringes ()
 {
   /* Destroy row bitmaps.  */
   int bt;
-  
+
   for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++)
     rif->destroy_fringe_bitmap (bt);
 }