From 7c31190adcf2dd7c45114f7c0e7e87825f106744 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 24 Oct 2020 19:42:06 -0400 Subject: render emojis --- emojis.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 emojis.hpp (limited to 'emojis.hpp') diff --git a/emojis.hpp b/emojis.hpp new file mode 100644 index 0000000..b3c2925 --- /dev/null +++ b/emojis.hpp @@ -0,0 +1,24 @@ +#pragma once +#include +#include +#include +#include +#include + +// shoutout to gtk for only supporting .svg's sometimes + +class EmojiResource { +public: + EmojiResource(std::string filepath); + bool Load(); + Glib::RefPtr GetPixBuf(const Glib::ustring &pattern); + static Glib::ustring PatternToHex(const Glib::ustring &pattern); + static Glib::ustring HexToPattern(Glib::ustring hex); + const std::vector &GetPatterns() const; + +private: + std::unordered_map> m_index; // pattern -> [pos, len] + FILE *m_fp = nullptr; + std::string m_filepath; + std::vector m_patterns; +}; -- cgit v1.2.3