]> git.tdb.fi Git - libs/gltk.git/blob - source/image.h
3194216d8bff06b1b69cd7b04db12272d79d6b28
[libs/gltk.git] / source / image.h
1 #ifndef MSP_GLTK_IMAGE_H_
2 #define MSP_GLTK_IMAGE_H_
3
4 #include <msp/gl/texture2d.h>
5 #include "widget.h"
6
7 namespace Msp {
8 namespace GLtk {
9
10 /**
11 A widget for displaying images.
12 */
13 class Image: public Widget
14 {
15 private:
16         const GL::Texture2D *image;
17         bool keep_aspect;
18
19 public:
20         Image(const GL::Texture2D * = 0);
21
22         virtual const char *get_class() const { return "image"; }
23
24 private:
25         virtual void autosize_special(const Part &, Geometry &) const;
26
27 public:
28         void set_image(const GL::Texture2D *);
29         void set_keep_aspect(bool);
30
31 private:
32         virtual void rebuild_special(const Part &);
33 };
34
35 } // namespace GLtk
36 } // namespace Msp
37
38 #endif