(syms_of_ntproc) <w32-get-true-file-attributes>: Doc fix.
[bpt/emacs.git] / src / fringe.c
index a3a28ba..1456ee9 100644 (file)
@@ -1,13 +1,13 @@
 /* Fringe handling (split from xdisp.c).
    Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997,
                  1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 /* Fringe handling (split from xdisp.c).
    Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997,
                  1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007  Free Software Foundation, Inc.
+                 2006, 2007, 2008  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -29,6 +29,7 @@ Boston, MA 02110-1301, USA.  */
 #include "dispextern.h"
 #include "buffer.h"
 #include "blockinput.h"
 #include "dispextern.h"
 #include "buffer.h"
 #include "blockinput.h"
+#include "termhooks.h"
 
 #ifdef HAVE_WINDOW_SYSTEM
 
 
 #ifdef HAVE_WINDOW_SYSTEM
 
@@ -585,7 +586,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
       Lisp_Object face;
 
       if ((face = fringe_faces[which], NILP (face))
       Lisp_Object face;
 
       if ((face = fringe_faces[which], NILP (face))
-         || (face_id = lookup_derived_face (f, face, 'A', FRINGE_FACE_ID, 0),
+         || (face_id = lookup_derived_face (f, face, FRINGE_FACE_ID, 0),
              face_id < 0))
        face_id = FRINGE_FACE_ID;
     }
              face_id < 0))
        face_id = FRINGE_FACE_ID;
     }
@@ -686,7 +687,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
       break;
     }
 
       break;
     }
 
-  rif->draw_fringe_bitmap (w, row, &p);
+  FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p);
 }
 
 static int
 }
 
 static int
@@ -1278,6 +1279,8 @@ destroy_fringe_bitmap (n)
   fbp = &fringe_bitmaps[n];
   if (*fbp && (*fbp)->dynamic)
     {
   fbp = &fringe_bitmaps[n];
   if (*fbp && (*fbp)->dynamic)
     {
+      /* XXX Is SELECTED_FRAME OK here? */
+      struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
       if (rif && rif->destroy_fringe_bitmap)
        rif->destroy_fringe_bitmap (n);
       xfree (*fbp);
       if (rif && rif->destroy_fringe_bitmap)
        rif->destroy_fringe_bitmap (n);
       xfree (*fbp);
@@ -1327,6 +1330,14 @@ If BITMAP overrides a standard fringe bitmap, the original bitmap is restored.
    On W32 and MAC (little endian), there's no need to do this.
 */
 
    On W32 and MAC (little endian), there's no need to do this.
 */
 
+#if defined (HAVE_X_WINDOWS)
+static unsigned char swap_nibble[16] = {
+  0x0, 0x8, 0x4, 0xc,           /* 0000 1000 0100 1100 */
+  0x2, 0xa, 0x6, 0xe,           /* 0010 1010 0110 1110 */
+  0x1, 0x9, 0x5, 0xd,           /* 0001 1001 0101 1101 */
+  0x3, 0xb, 0x7, 0xf};          /* 0011 1011 0111 1111 */
+#endif                          /* HAVE_X_WINDOWS */
+
 void
 init_fringe_bitmap (which, fb, once_p)
      int which;
 void
 init_fringe_bitmap (which, fb, once_p)
      int which;
@@ -1336,11 +1347,6 @@ init_fringe_bitmap (which, fb, once_p)
   if (once_p || fb->dynamic)
     {
 #if defined (HAVE_X_WINDOWS)
   if (once_p || fb->dynamic)
     {
 #if defined (HAVE_X_WINDOWS)
-      static unsigned char swap_nibble[16]
-       = { 0x0, 0x8, 0x4, 0xc,    /* 0000 1000 0100 1100 */
-           0x2, 0xa, 0x6, 0xe,    /* 0010 1010 0110 1110 */
-           0x1, 0x9, 0x5, 0xd,    /* 0001 1001 0101 1101 */
-           0x3, 0xb, 0x7, 0xf };  /* 0011 1011 0111 1111 */
       unsigned short *bits = fb->bits;
       int j;
 
       unsigned short *bits = fb->bits;
       int j;
 
@@ -1383,6 +1389,9 @@ init_fringe_bitmap (which, fb, once_p)
 
   if (!once_p)
     {
 
   if (!once_p)
     {
+      /* XXX Is SELECTED_FRAME OK here? */
+      struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
+
       destroy_fringe_bitmap (which);
 
       if (rif && rif->define_fringe_bitmap)
       destroy_fringe_bitmap (which);
 
       if (rif && rif->define_fringe_bitmap)
@@ -1404,7 +1413,7 @@ 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 fifth arg ALIGN may be one of `top', `center', or `bottom',
 indicating the positioning of the bitmap relative to the rows where it
 WIDTH must be an integer between 1 and 16, or nil which defaults to 8.
 Optional fifth 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
+is used; the default is to center the bitmap.  Fifth arg may also be a
 list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap
 should be repeated.
 If BITMAP already exists, the existing definition is replaced.  */)
 list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap
 should be repeated.
 If BITMAP already exists, the existing definition is replaced.  */)
@@ -1554,7 +1563,7 @@ If FACE is nil, reset face to default fringe face.  */)
   if (!NILP (face))
     {
       face_id = lookup_derived_face (SELECTED_FRAME (), face,
   if (!NILP (face))
     {
       face_id = lookup_derived_face (SELECTED_FRAME (), face,
-                                    'A', FRINGE_FACE_ID, 1);
+                                    FRINGE_FACE_ID, 1);
       if (face_id < 0)
        error ("No such face");
     }
       if (face_id < 0)
        error ("No such face");
     }
@@ -1693,10 +1702,11 @@ init_fringe ()
 
 void
 #ifdef HAVE_NTGUI
 
 void
 #ifdef HAVE_NTGUI
-w32_init_fringe ()
+w32_init_fringe (rif)
 #else  /* MAC_OS */
 #else  /* MAC_OS */
-mac_init_fringe ()
+mac_init_fringe (rif)
 #endif
 #endif
+     struct redisplay_interface *rif;
 {
   int bt;
 
 {
   int bt;
 
@@ -1717,6 +1727,7 @@ w32_reset_fringes ()
 {
   /* Destroy row bitmaps.  */
   int bt;
 {
   /* Destroy row bitmaps.  */
   int bt;
+  struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
 
   if (!rif)
     return;
 
   if (!rif)
     return;