summaryrefslogtreecommitdiff
path: root/imgmanager.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-12-21 19:08:44 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2020-12-21 19:08:44 -0500
commitd8ff05ddf898dfcd6fa0e3398cc38abcab07e2fe (patch)
tree667eb93e54d0698b62f098e911a24e70fb0448be /imgmanager.hpp
parent486d184c8306d3e8a4889a5b079cd9b3003896c2 (diff)
downloadabaddon-portaudio-d8ff05ddf898dfcd6fa0e3398cc38abcab07e2fe.tar.gz
abaddon-portaudio-d8ff05ddf898dfcd6fa0e3398cc38abcab07e2fe.zip
support animated guild icon
Diffstat (limited to 'imgmanager.hpp')
-rw-r--r--imgmanager.hpp5
1 files changed, 5 insertions, 0 deletions
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<void(Glib::RefPtr<Gdk::PixbufAnimation>)>;
using callback_type = sigc::slot<void(Glib::RefPtr<Gdk::Pixbuf>)>;
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<Gdk::Pixbuf> GetFromURLIfCached(std::string url);
+ Glib::RefPtr<Gdk::PixbufAnimation> GetAnimationFromURLIfCached(std::string url, int w, int h);
Glib::RefPtr<Gdk::Pixbuf> GetPlaceholder(int size);
private:
Glib::RefPtr<Gdk::Pixbuf> ReadFileToPixbuf(std::string path);
+ Glib::RefPtr<Gdk::PixbufAnimation> ReadFileToPixbufAnimation(std::string path, int w, int h);
mutable std::mutex m_load_mutex;
void RunCallbacks();