]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.h
Cache widget parts in meshes
[libs/gltk.git] / source / widget.h
index 9bdc2c0e13eba4a24eca88e585b577a2a706e996..ba49b09e44c90a5abd1644dbbd4f9f3ee276afdd 100644 (file)
@@ -4,6 +4,7 @@
 #include <string>
 #include <msp/datafile/objectloader.h>
 #include "geometry.h"
+#include "partcache.h"
 #include "state.h"
 
 namespace Msp {
@@ -48,6 +49,7 @@ protected:
        bool focusable;
        Container *parent;
        std::string tooltip;
+       std::list<CachedPart> cached_parts;
 
        Widget();
 public:
@@ -102,6 +104,9 @@ protected:
        void clear_state(State s) { set_state(s, NORMAL); }
        void set_state(State, State);
 
+       void rebuild();
+       virtual void rebuild_special(const Part &, CachedPart &) { }
+
 public:
        void render() const;
 protected: