]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/image.h
Add a datafile statement to set an icon for an Image
[libs/gltk.git] / source / image.h
index efc814487f88c39f38e2cc209382b5d53db0a50e..8b857f41c48ec051309584b2f3d629a6dd0f250e 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_
 
@@ -19,8 +12,16 @@ A widget for displaying images.
 */
 class Image: public Widget
 {
+public:
+       class Loader: public Msp::DataFile::DerivedObjectLoader<Image, Widget::Loader>
+       {
+       public:
+               Loader(Image &);
+       };
+
 private:
        const GL::Texture2D *image;
+       std::string icon_name;
        bool keep_aspect;
 
 public:
@@ -28,11 +29,19 @@ public:
 
        virtual const char *get_class() const { return "image"; }
 
+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