]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/image.h
Add support for displaying named icons in an Image widget
[libs/gltk.git] / source / image.h
index afc4826e28c24f46e324ddcd30f994b1f10588d0..18556108b9ae3c67edf0766234111d4e5e946d42 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2010-2011  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GLTK_IMAGE_H_
 #define MSP_GLTK_IMAGE_H_
 
@@ -21,6 +14,7 @@ class Image: public Widget
 {
 private:
        const GL::Texture2D *image;
+       std::string icon_name;
        bool keep_aspect;
 
 public:
@@ -28,13 +22,19 @@ public:
 
        virtual const char *get_class() const { return "image"; }
 
-       virtual void autosize();
+private:
+       virtual void autosize_special(const Part &, Geometry &) const;
 
+public:
        void set_image(const GL::Texture2D *);
+       void set_icon(const std::string &);
        void set_keep_aspect(bool);
 
 private:
-       virtual void render_special(const Part &) const;
+       void update_icon();
+       virtual void rebuild_special(const Part &);
+       virtual void on_style_change();
+       virtual void on_reparent();
 };
 
 } // namespace GLtk