X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fimage.h;h=77357561ead0a54fc147681e580bd67fa80c989c;hb=56c41b294aa47a38ac3e1be70d4868f260cb4274;hp=efc814487f88c39f38e2cc209382b5d53db0a50e;hpb=2bdaf4955fdb94e73704adcdcf0adc2b353f0ff0;p=libs%2Fgltk.git diff --git a/source/image.h b/source/image.h index efc8144..7735756 100644 --- a/source/image.h +++ b/source/image.h @@ -1,14 +1,8 @@ -/* $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_ #include +#include "mspgltk_api.h" #include "widget.h" namespace Msp { @@ -17,10 +11,18 @@ namespace GLtk { /** A widget for displaying images. */ -class Image: public Widget +class MSPGLTK_API Image: public Widget { +public: + class Loader: public Msp::DataFile::DerivedObjectLoader + { + public: + Loader(Image &); + }; + private: const GL::Texture2D *image; + std::string icon_name; bool keep_aspect; public: @@ -28,11 +30,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