summaryrefslogtreecommitdiff
path: root/emojis.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-10-24 19:42:06 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-10-24 19:42:06 -0400
commit7c31190adcf2dd7c45114f7c0e7e87825f106744 (patch)
tree5312d9ded299d0ba80cbfe5058733a8d626c7d5c /emojis.hpp
parentcb73bba135933357878dc47f6e7a6bec3168d001 (diff)
downloadabaddon-portaudio-7c31190adcf2dd7c45114f7c0e7e87825f106744.tar.gz
abaddon-portaudio-7c31190adcf2dd7c45114f7c0e7e87825f106744.zip
render emojis
Diffstat (limited to 'emojis.hpp')
-rw-r--r--emojis.hpp24
1 files changed, 24 insertions, 0 deletions
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 <string>
+#include <cstdio>
+#include <unordered_map>
+#include <vector>
+#include <gtkmm.h>
+
+// shoutout to gtk for only supporting .svg's sometimes
+
+class EmojiResource {
+public:
+ EmojiResource(std::string filepath);
+ bool Load();
+ Glib::RefPtr<Gdk::Pixbuf> GetPixBuf(const Glib::ustring &pattern);
+ static Glib::ustring PatternToHex(const Glib::ustring &pattern);
+ static Glib::ustring HexToPattern(Glib::ustring hex);
+ const std::vector<Glib::ustring> &GetPatterns() const;
+
+private:
+ std::unordered_map<std::string, std::pair<int, int>> m_index; // pattern -> [pos, len]
+ FILE *m_fp = nullptr;
+ std::string m_filepath;
+ std::vector<Glib::ustring> m_patterns;
+};