Files
bar/include/services/textureCache.hpp
2026-02-09 21:01:56 +01:00

23 lines
449 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);
void pruneCache();
void clear();
private:
TextureCacheService();
~TextureCacheService();
std::unordered_map<std::string, Glib::RefPtr<Gdk::Texture>> cache;
};