20 lines
390 B
C++
20 lines
390 B
C++
#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;
|
|
};
|