/[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.23 by kfstorm, Fri Nov 26 15:14:16 2004 UTC revision 1.24 by kfstorm, Thu Jan 6 22:03:00 2005 UTC
# Line 446  struct fringe_bitmap standard_bitmaps[MA Line 446  struct fringe_bitmap standard_bitmaps[MA
446  };  };
447    
448  static struct fringe_bitmap **fringe_bitmaps;  static struct fringe_bitmap **fringe_bitmaps;
449  static unsigned *fringe_faces;  static Lisp_Object *fringe_faces;
450  static int max_fringe_bitmaps;  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;
# Line 547  draw_fringe_bitmap_1 (w, row, left_p, ov Line 547  draw_fringe_bitmap_1 (w, row, left_p, ov
547      }      }
548    
549    if (face_id == DEFAULT_FACE_ID)    if (face_id == DEFAULT_FACE_ID)
550      face_id = fringe_faces[which];      {
551          Lisp_Object face;
552    
553          if ((face = fringe_faces[which], NILP (face))
554              || (face_id = lookup_named_face (f, face, 'A', 1), face_id < 0))
555            face_id = FRINGE_FACE_ID;
556        }
557    
558    fb = fringe_bitmaps[which];    fb = fringe_bitmaps[which];
559    if (fb == NULL)    if (fb == NULL)
# Line 574  draw_fringe_bitmap_1 (w, row, left_p, ov Line 580  draw_fringe_bitmap_1 (w, row, left_p, ov
580    
581    if (p.face == NULL)    if (p.face == NULL)
582      {      {
583        /* Why does this happen?  ++kfs */        /* This could happen after clearing face cache.
584             But it shouldn't happen anymore.  ++kfs */
585        return;        return;
586      }      }
587    
# Line 1073  destroy_fringe_bitmap (n) Line 1080  destroy_fringe_bitmap (n)
1080  {  {
1081    struct fringe_bitmap **fbp;    struct fringe_bitmap **fbp;
1082    
1083    fringe_faces[n] = FRINGE_FACE_ID;    fringe_faces[n] = Qnil;
1084    
1085    fbp = &fringe_bitmaps[n];    fbp = &fringe_bitmaps[n];
1086    if (*fbp && (*fbp)->dynamic)    if (*fbp && (*fbp)->dynamic)
# Line 1294  If BITMAP already exists, the existing d Line 1301  If BITMAP already exists, the existing d
1301                  = ((struct fringe_bitmap **)                  = ((struct fringe_bitmap **)
1302                     xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *)));                     xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *)));
1303                fringe_faces                fringe_faces
1304                  = (unsigned *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (unsigned));                  = (unsigned *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (Lisp_Object));
1305    
1306                for (; i < max_fringe_bitmaps; i++)                for (; i < max_fringe_bitmaps; i++)
1307                  {                  {
1308                    fringe_bitmaps[i] = NULL;                    fringe_bitmaps[i] = NULL;
1309                    fringe_faces[i] = FRINGE_FACE_ID;                    fringe_faces[i] = Qnil;
1310                  }                  }
1311              }              }
1312          }          }
# Line 1357  If FACE is nil, reset face to default fr Line 1364  If FACE is nil, reset face to default fr
1364        if (face_id < 0)        if (face_id < 0)
1365          error ("No such face");          error ("No such face");
1366      }      }
   else  
     face_id = FRINGE_FACE_ID;  
1367    
1368    fringe_faces[n] = face_id;    fringe_faces[n] = face;
1369    
1370    return Qnil;    return Qnil;
1371  }  }
# Line 1434  You must (require 'fringe) to use fringe Line 1439  You must (require 'fringe) to use fringe
1439    Vfringe_bitmaps = Qnil;    Vfringe_bitmaps = Qnil;
1440  }  }
1441    
1442    /* Garbage collection hook */
1443    
1444    void
1445    mark_fringe_data ()
1446    {
1447      int i;
1448    
1449      for (i = 0; i < max_fringe_bitmaps; i++)
1450        if (!NILP (fringe_faces[i]))
1451          mark_object (fringe_faces[i]);
1452    }
1453    
1454  /* Initialize this module when Emacs starts.  */  /* Initialize this module when Emacs starts.  */
1455    
1456  void  void
# Line 1455  init_fringe () Line 1472  init_fringe ()
1472    fringe_bitmaps    fringe_bitmaps
1473      = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *));      = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *));
1474    fringe_faces    fringe_faces
1475      = (unsigned *) xmalloc (max_fringe_bitmaps * sizeof (unsigned));      = (unsigned *) xmalloc (max_fringe_bitmaps * sizeof (Lisp_Object));
1476    
1477    for (i = 0; i < max_fringe_bitmaps; i++)    for (i = 0; i < max_fringe_bitmaps; i++)
1478      {      {
1479        fringe_bitmaps[i] = NULL;        fringe_bitmaps[i] = NULL;
1480        fringe_faces[i] = FRINGE_FACE_ID;        fringe_faces[i] = Qnil;
1481      }      }
1482  }  }
1483    

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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