vibed a cached downloader for images
This commit is contained in:
19
include/services/textureCache.hpp
Normal file
19
include/services/textureCache.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "gdkmm/texture.h"
|
||||
#include "glibmm/refptr.h"
|
||||
|
||||
class TextureCacheService {
|
||||
public:
|
||||
static TextureCacheService *getInstance();
|
||||
|
||||
Glib::RefPtr<Gdk::Texture> getTexture(const std::string &url);
|
||||
|
||||
private:
|
||||
TextureCacheService() = default;
|
||||
|
||||
std::unordered_map<std::string, Glib::RefPtr<Gdk::Texture>> cache;
|
||||
};
|
||||
Reference in New Issue
Block a user