X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fimage.h;h=026aaca82aebbcc4b326b706d4df052f98ea3d8d;hb=9f38197854e699a6093a906ab43f4238f3cd2388;hp=3194216d8bff06b1b69cd7b04db12272d79d6b28;hpb=707b59d45ae50b69c94918f8f74313283b304597;p=libs%2Fgltk.git diff --git a/source/image.h b/source/image.h index 3194216..026aaca 100644 --- a/source/image.h +++ b/source/image.h @@ -2,6 +2,7 @@ #define MSP_GLTK_IMAGE_H_ #include +#include "mspgltk_api.h" #include "widget.h" namespace Msp { @@ -10,11 +11,19 @@ namespace GLtk { /** A widget for displaying images. */ -class Image: public Widget +class MSPGLTK_API Image: public Widget { +public: + class Loader: public Msp::DataFile::DerivedObjectLoader + { + public: + Loader(Image &); + }; + private: - const GL::Texture2D *image; - bool keep_aspect; + const GL::Texture2D *image = 0; + std::string icon_name; + bool keep_aspect = true; public: Image(const GL::Texture2D * = 0); @@ -26,10 +35,14 @@ private: public: void set_image(const GL::Texture2D *); + void set_icon(const std::string &); void set_keep_aspect(bool); private: + void update_icon(); virtual void rebuild_special(const Part &); + virtual void on_style_change(); + virtual void on_reparent(); }; } // namespace GLtk