summaryrefslogtreecommitdiff
path: root/components/chatmessage.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-01-16 23:49:27 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2021-01-16 23:49:27 -0500
commit3f6024ddf213b83cf0c815b68f8ad8de3f3afa44 (patch)
treec0f172c0d6af12250f20279c4ffff59c4895c47a /components/chatmessage.hpp
parent3a25249a0dc5b8ebbb7039da2af9fefb69fcf04d (diff)
downloadabaddon-portaudio-3f6024ddf213b83cf0c815b68f8ad8de3f3afa44.tar.gz
abaddon-portaudio-3f6024ddf213b83cf0c815b68f8ad8de3f3afa44.zip
improve image loading a bit (close #6)
Diffstat (limited to 'components/chatmessage.hpp')
-rw-r--r--components/chatmessage.hpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/components/chatmessage.hpp b/components/chatmessage.hpp
index 92eb8af..43bf7a2 100644
--- a/components/chatmessage.hpp
+++ b/components/chatmessage.hpp
@@ -13,12 +13,9 @@ public:
// attributes = edited, deleted
void UpdateAttributes();
void UpdateContent();
- void UpdateImage(std::string url, Glib::RefPtr<Gdk::Pixbuf> buf);
void UpdateReactions();
protected:
- bool EmitImageLoad(std::string url);
-
void AddClickHandler(Gtk::Widget *widget, std::string);
Gtk::TextView *CreateTextComponent(const Message *data); // Message.Content
void UpdateTextComponent(Gtk::TextView *tv);
@@ -29,9 +26,6 @@ protected:
Gtk::Widget *CreateReactionsComponent(const Message &data);
Gtk::Widget *CreateReplyComponent(const Message &data);
void ReactionUpdateImage(Gtk::Image *img, const Glib::RefPtr<Gdk::Pixbuf> &pb);
- void HandleImage(int w, int h, Gtk::Image &img, std::string url);
-
- void OnEmbedImageLoad(const Glib::RefPtr<Gdk::Pixbuf> &pixbuf);
static Glib::ustring GetText(const Glib::RefPtr<Gtk::TextBuffer> &buf);
@@ -59,8 +53,6 @@ protected:
std::map<Glib::RefPtr<Gtk::TextTag>, std::string> m_link_tagmap;
std::map<Glib::RefPtr<Gtk::TextTag>, Snowflake> m_channel_tagmap;
- std::unordered_map<std::string, std::pair<Gtk::Image *, std::pair<int, int>>> m_img_loadmap; // url -> [img, [w, h]]
-
void AttachEventHandlers(Gtk::Widget &widget);
void ShowMenu(GdkEvent *event);
@@ -78,16 +70,12 @@ protected:
Gtk::EventBox *m_ev;
Gtk::Box *m_main;
Gtk::Label *m_attrib_label = nullptr;
- Gtk::Image *m_embed_img = nullptr; // yes this is hacky no i dont care (for now)
- std::string m_embed_imgurl;
Gtk::TextView *m_text_component = nullptr;
Gtk::Widget *m_embed_component = nullptr;
Gtk::Widget *m_reactions_component = nullptr;
public:
- typedef sigc::signal<void, std::string> type_signal_image_load;
-
typedef sigc::signal<void> type_signal_action_delete;
typedef sigc::signal<void> type_signal_action_edit;
typedef sigc::signal<void, Snowflake> type_signal_channel_click;
@@ -101,17 +89,12 @@ public:
type_signal_channel_click signal_action_channel_click();
type_signal_action_reaction_add signal_action_reaction_add();
type_signal_action_reaction_remove signal_action_reaction_remove();
-
- type_signal_image_load signal_image_load();
-
private:
type_signal_action_delete m_signal_action_delete;
type_signal_action_edit m_signal_action_edit;
type_signal_channel_click m_signal_action_channel_click;
type_signal_action_reaction_add m_signal_action_reaction_add;
type_signal_action_reaction_remove m_signal_action_reaction_remove;
-
- type_signal_image_load m_signal_image_load;
};
class ChatMessageHeader : public Gtk::ListBoxRow {