]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/partcache.h
Add a signal for selection changes in Entry
[libs/gltk.git] / source / partcache.h
index 86a3f364abe21260395493f40580d278f5b5775c..4eef1166d1d9e75f0bc39bd27b087350e8cbf3c1 100644 (file)
@@ -22,15 +22,31 @@ struct CachedPart
 class PartCache
 {
 public:
+       class Rebuild
+       {
+       private:
+               PartCache &cache;
+
+       public:
+               Rebuild(PartCache &c): cache(c) { cache.begin_rebuild(); }
+               ~Rebuild() { cache.end_rebuild(); }
+       };
+
        typedef std::list<CachedPart> PartList;
 
 private:
+       bool rebuilding;
        PartList parts;
+       PartList::iterator next;
+       PartList::iterator current;
 
 public:
-       void clear();
+       PartCache();
+
+       void begin_rebuild();
        void insert_special(const Part &);
        GL::Mesh &create_mesh(const Part &, const GL::Texture2D &);
+       void end_rebuild();
 
        const PartList &get_parts() const { return parts; }
 };