mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-10 22:20:09 +00:00
19 lines
491 B
C++
19 lines
491 B
C++
#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);
|
|
Glib::RefPtr<Gdk::Pixbuf> GetPlaceholder(int size);
|
|
|
|
private:
|
|
std::unordered_map<std::string, Glib::RefPtr<Gdk::Pixbuf>> m_pixs;
|
|
Cache m_cache;
|
|
};
|