X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fwidget.h;h=270d2a3f67eb2e1d890dbfc1426a8adac65fe0db;hb=9fdbf99cdb3c5620e665c3ecb34e83d778cb311a;hp=665ca9d0e7605161ab8e5a3f0648e45d1d55994e;hpb=d88af5a7898020e4493fef8ec0cb9e88666b66df;p=libs%2Fgltk.git diff --git a/source/widget.h b/source/widget.h index 665ca9d..270d2a3 100644 --- a/source/widget.h +++ b/source/widget.h @@ -3,7 +3,9 @@ #include #include +#include #include "geometry.h" +#include "partcache.h" #include "state.h" namespace Msp { @@ -48,6 +50,7 @@ protected: bool focusable; Container *parent; std::string tooltip; + std::list cached_parts; Widget(); public: @@ -97,9 +100,18 @@ public: bool is_focusable() const { return focusable; } void set_focus(); - void render() const; protected: - virtual void render_special(const Part &) const { } + void set_state(State s) { set_state(s, s); } + 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(GL::Renderer &) const; +protected: + virtual void render_special(const Part &, GL::Renderer &) const { } public: // Events