summaryrefslogtreecommitdiff
path: root/imgmanager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'imgmanager.hpp')
-rw-r--r--imgmanager.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/imgmanager.hpp b/imgmanager.hpp
new file mode 100644
index 0000000..80262a8
--- /dev/null
+++ b/imgmanager.hpp
@@ -0,0 +1,17 @@
+#pragma once
+#include <string>
+#include <unordered_map>
+#include <functional>
+#include <gtkmm.h>
+#include "filecache.hpp"
+
+class ImageManager {
+public:
+ Cache &GetCache();
+ void LoadFromURL(std::string url, std::function<void(Glib::RefPtr<Gdk::Pixbuf>)> cb);
+ Glib::RefPtr<Gdk::Pixbuf> GetFromURLIfCached(std::string url);
+
+private:
+ std::unordered_map<std::string, Glib::RefPtr<Gdk::Pixbuf>> m_pixs;
+ Cache m_cache;
+};