X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fimage.h;h=8b857f41c48ec051309584b2f3d629a6dd0f250e;hb=78e05360d70542d343401241ff9ddddfed18c5cd;hp=afc4826e28c24f46e324ddcd30f994b1f10588d0;hpb=43ac7c4514658754d09552463425bcd344fb9ded;p=libs%2Fgltk.git diff --git a/source/image.h b/source/image.h index afc4826..8b857f4 100644 --- a/source/image.h +++ b/source/image.h @@ -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 + { + public: + Loader(Image &); + }; + private: const GL::Texture2D *image; + std::string icon_name; bool keep_aspect; public: @@ -28,13 +29,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