1 #ifndef MSP_GLTK_IMAGE_H_
2 #define MSP_GLTK_IMAGE_H_
4 #include <msp/gl/texture2d.h>
5 #include "mspgltk_api.h"
12 A widget for displaying images.
14 class MSPGLTK_API Image: public Widget
17 class Loader: public Msp::DataFile::DerivedObjectLoader<Image, Widget::Loader>
24 const GL::Texture2D *image = nullptr;
25 std::string icon_name;
26 bool keep_aspect = true;
29 Image(const GL::Texture2D * = nullptr);
31 const char *get_class() const override { return "image"; }
34 void autosize_special(const Part &, Geometry &) const override;
37 void set_image(const GL::Texture2D *);
38 void set_icon(const std::string &);
39 void set_keep_aspect(bool);
43 void rebuild_special(const Part &) override;
44 void on_style_change() override;
45 void on_reparent() override;