]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/imageloader.h
Add some state checking to ImageLoader
[libs/gui.git] / source / graphics / imageloader.h
index f0b8d52c36412ec6cf3e9901d5b2a43c51aefdd6..cb3f54ac204f303afe23e5bfc30b111ece28f33a 100644 (file)
@@ -23,6 +23,13 @@ public:
 
 class ImageLoader
 {
+public:
+       enum State
+       {
+               INITIAL,
+               FINISHED
+       };
+
 protected:
        class RegisterBase
        {
@@ -56,6 +63,7 @@ protected:
 
 private:
        IO::Base *source;
+       State state;
 
 protected:
        ImageLoader();
@@ -66,8 +74,11 @@ public:
        static ImageLoader *open_io(IO::Seekable &);
 
        virtual void load(Image::Data &);
-       virtual void load_headers(Image::Data &) { }
-       virtual void load_data(Image::Data &) { }
+protected:
+       virtual void load_(Image::Data &) = 0;
+
+public:
+       State get_state() const { return state; }
 
        template<typename T>
        static void register_loader();