]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/image.h
Add API declarations
[libs/gltk.git] / source / image.h
index 5d113ccf33c83cd900d77f400bdfad38a000babb..77357561ead0a54fc147681e580bd67fa80c989c 100644 (file)
@@ -1,14 +1,8 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GLTK_IMAGE_H_
 #define MSP_GLTK_IMAGE_H_
 
 #include <msp/gl/texture2d.h>
+#include "mspgltk_api.h"
 #include "widget.h"
 
 namespace Msp {
@@ -17,20 +11,38 @@ namespace GLtk {
 /**
 A widget for displaying images.
 */
-class Image: public Widget
+class MSPGLTK_API 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:
-       Image(const Resources &, const GL::Texture2D * = 0);
+       Image(const GL::Texture2D * = 0);
+
+       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 const char *get_class() const { return "image"; }
-       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