* alloc.c: Do not define struct catchtag.
[bpt/emacs.git] / src / fringe.c
index 70e14f5..df62bee 100644 (file)
@@ -1,14 +1,14 @@
 /* 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, 2009  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+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 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,12 +16,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include <stdio.h>
+#include <setjmp.h>
 
 #include "lisp.h"
 #include "frame.h"
@@ -484,7 +483,7 @@ static struct fringe_bitmap **fringe_bitmaps;
 static Lisp_Object *fringe_faces;
 static int max_fringe_bitmaps;
 
-static int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
+int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
 
 
 /* Lookup bitmap number for symbol BITMAP.
@@ -586,7 +585,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
       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;
     }
@@ -1371,20 +1370,15 @@ init_fringe_bitmap (which, fb, once_p)
                                   | (swap_nibble[(b>>4) & 0xf] << 8)
                                   | (swap_nibble[(b>>8) & 0xf] << 4)
                                   | (swap_nibble[(b>>12) & 0xf]));
-             *bits++ = (b >> (16 - fb->width));
+             b >>= (16 - fb->width);
+#ifdef WORDS_BIG_ENDIAN
+             b = ((b >> 8) | (b << 8));
+#endif
+             *bits++ = b;
            }
        }
 #endif /* HAVE_X_WINDOWS */
 
-#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;
-         *bits++ = ((b >> 8) & 0xff) | ((b & 0xff) << 8);
-       }
-#endif /* MAC_OS && WORDS_BIG_ENDIAN */
     }
 
   if (!once_p)
@@ -1413,7 +1407,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
-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.  */)
@@ -1563,7 +1557,7 @@ If FACE is nil, reset face to default fringe 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");
     }
@@ -1698,15 +1692,10 @@ init_fringe ()
     }
 }
 
-#if defined (HAVE_NTGUI) || defined (MAC_OS)
+#ifdef HAVE_NTGUI
 
 void
-#ifdef HAVE_NTGUI
-w32_init_fringe (rif)
-#else  /* MAC_OS */
-mac_init_fringe (rif)
-#endif
-     struct redisplay_interface *rif;
+w32_init_fringe (struct redisplay_interface *rif)
 {
   int bt;
 
@@ -1719,9 +1708,7 @@ mac_init_fringe (rif)
       rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width);
     }
 }
-#endif
 
-#ifdef HAVE_NTGUI
 void
 w32_reset_fringes ()
 {