/[emacs]/emacs/src/fringe.c
ViewVC logotype

Diff of /emacs/src/fringe.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by kfstorm, Wed Sep 29 11:57:48 2004 UTC revision 1.15 by kfstorm, Wed Sep 29 14:22:25 2004 UTC
# Line 445  struct fringe_bitmap standard_bitmaps[MA Line 445  struct fringe_bitmap standard_bitmaps[MA
445    { FRBITS (zv_bits),                 8, 3, ALIGN_BITMAP_TOP,    0 },    { FRBITS (zv_bits),                 8, 3, ALIGN_BITMAP_TOP,    0 },
446  };  };
447    
448  static struct fringe_bitmap *fringe_bitmaps[MAX_FRINGE_BITMAPS];  static struct fringe_bitmap **fringe_bitmaps;
449  static unsigned fringe_faces[MAX_FRINGE_BITMAPS];  static unsigned *fringe_faces;
450    static int max_fringe_bitmaps;
451    
452  static int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;  static int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
453    
# Line 1192  If BITMAP already exists, the existing d Line 1193  If BITMAP already exists, the existing d
1193    
1194    CHECK_SYMBOL (bitmap);    CHECK_SYMBOL (bitmap);
1195    
   n = lookup_fringe_bitmap (bitmap);  
   
1196    if (!STRINGP (bits) && !VECTORP (bits))    if (!STRINGP (bits) && !VECTORP (bits))
1197      bits = wrong_type_argument (Qstringp, bits);      bits = wrong_type_argument (Qstringp, bits);
1198    
# Line 1245  If BITMAP already exists, the existing d Line 1244  If BITMAP already exists, the existing d
1244    else if (!NILP (align) && !EQ (align, Qcenter))    else if (!NILP (align) && !EQ (align, Qcenter))
1245      error ("Bad align argument");      error ("Bad align argument");
1246    
1247      n = lookup_fringe_bitmap (bitmap);
1248    if (!n)    if (!n)
1249      {      {
1250        if (max_used_fringe_bitmap < MAX_FRINGE_BITMAPS)        if (max_used_fringe_bitmap < max_fringe_bitmaps)
1251          n = max_used_fringe_bitmap++;          n = max_used_fringe_bitmap++;
1252        else        else
1253          {          {
1254            for (n = MAX_STANDARD_FRINGE_BITMAPS;            for (n = MAX_STANDARD_FRINGE_BITMAPS;
1255                 n < MAX_FRINGE_BITMAPS;                 n < max_fringe_bitmaps;
1256                 n++)                 n++)
1257              if (fringe_bitmaps[n] == NULL)              if (fringe_bitmaps[n] == NULL)
1258                break;                break;
1259            if (n == MAX_FRINGE_BITMAPS)  
1260              error ("Cannot define more fringe bitmaps");            if (n == max_fringe_bitmaps)
1261                {
1262                  if ((max_fringe_bitmaps + 20) > MAX_FRINGE_BITMAPS)
1263                    error ("No free fringe bitmap slots");
1264    
1265                  i = max_fringe_bitmaps;
1266                  max_fringe_bitmaps += 20;
1267                  fringe_bitmaps
1268                    = ((struct fringe_bitmap **)
1269                       xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *)));
1270                  fringe_faces
1271                    = (unsigned *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (unsigned));
1272    
1273                  for (; i < max_fringe_bitmaps; i++)
1274                    {
1275                      fringe_bitmaps[i] = NULL;
1276                      fringe_faces[i] = FRINGE_FACE_ID;
1277                    }
1278                }
1279          }          }
1280    
1281        Vfringe_bitmaps = Fcons (bitmap, Vfringe_bitmaps);        Vfringe_bitmaps = Fcons (bitmap, Vfringe_bitmaps);
# Line 1405  init_fringe () Line 1423  init_fringe ()
1423  {  {
1424    int i;    int i;
1425    
1426    bzero (fringe_bitmaps, sizeof fringe_bitmaps);    max_fringe_bitmaps = MAX_STANDARD_FRINGE_BITMAPS + 20;
1427    for (i = 0; i < MAX_FRINGE_BITMAPS; i++)  
1428      fringe_faces[i] = FRINGE_FACE_ID;    fringe_bitmaps
1429        = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *));
1430      fringe_faces
1431        = (unsigned *) xmalloc (max_fringe_bitmaps * sizeof (unsigned));
1432    
1433      for (i = 0; i < max_fringe_bitmaps; i++)
1434        {
1435          fringe_bitmaps[i] = NULL;
1436          fringe_faces[i] = FRINGE_FACE_ID;
1437        }
1438  }  }
1439    
1440  #ifdef HAVE_NTGUI  #ifdef HAVE_NTGUI

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26