From d8ff05ddf898dfcd6fa0e3398cc38abcab07e2fe Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 21 Dec 2020 19:08:44 -0500 Subject: support animated guild icon --- imgmanager.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'imgmanager.hpp') diff --git a/imgmanager.hpp b/imgmanager.hpp index 46d8ab3..f665a7b 100644 --- a/imgmanager.hpp +++ b/imgmanager.hpp @@ -10,16 +10,21 @@ class ImageManager { public: ImageManager(); + using callback_anim_type = sigc::slot)>; using callback_type = sigc::slot)>; Cache &GetCache(); void LoadFromURL(std::string url, callback_type cb); + // animations need dimensions before loading since there is no (easy) way to scale a PixbufAnimation + void LoadAnimationFromURL(std::string url, int w, int h, callback_anim_type cb); void Prefetch(std::string url); Glib::RefPtr GetFromURLIfCached(std::string url); + Glib::RefPtr GetAnimationFromURLIfCached(std::string url, int w, int h); Glib::RefPtr GetPlaceholder(int size); private: Glib::RefPtr ReadFileToPixbuf(std::string path); + Glib::RefPtr ReadFileToPixbufAnimation(std::string path, int w, int h); mutable std::mutex m_load_mutex; void RunCallbacks(); -- cgit v1.2.3