diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-08-21 00:42:46 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-08-21 00:42:46 -0400 |
commit | 6f11aa4dae4c7334b150752f5cf8d270ce746d9c (patch) | |
tree | 45d7ed1776b9294ce5a0f89f872aff5e21a1f425 /components/chatwindow.hpp | |
parent | a201d5905ad9188e890eeb0cc0aee8d4fb9dcf3c (diff) | |
download | abaddon-portaudio-6f11aa4dae4c7334b150752f5cf8d270ce746d9c.tar.gz abaddon-portaudio-6f11aa4dae4c7334b150752f5cf8d270ce746d9c.zip |
shitty MESSAGE_CREATE handling
Diffstat (limited to 'components/chatwindow.hpp')
-rw-r--r-- | components/chatwindow.hpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/components/chatwindow.hpp b/components/chatwindow.hpp index 9b4a16d..05e0c42 100644 --- a/components/chatwindow.hpp +++ b/components/chatwindow.hpp @@ -4,22 +4,31 @@ #include <mutex> #include "../discord/discord.hpp" +class Abaddon; class ChatWindow { public: ChatWindow(); + void SetAbaddon(Abaddon *ptr); + Gtk::Widget *GetRoot() const; void SetActiveChannel(Snowflake id); Snowflake GetActiveChannel() const; void SetMessages(std::unordered_set<const MessageData *> msgs); + void AddNewMessage(Snowflake id); protected: void ScrollToBottom(); void SetMessagesInternal(); + void AddNewMessageInternal(); Gtk::ListBoxRow *CreateChatEntryComponentText(const MessageData *data); Gtk::ListBoxRow *CreateChatEntryComponent(const MessageData *data); - Glib::Dispatcher m_update_dispatcher; - std::queue<std::unordered_set<const MessageData *>> m_update_queue; + bool on_key_press_event(GdkEventKey *e); + + Glib::Dispatcher m_message_set_dispatch; + std::queue<std::unordered_set<const MessageData *>> m_message_set_queue; + Glib::Dispatcher m_new_message_dispatch; + std::queue<Snowflake> m_new_message_queue; std::mutex m_update_mutex; Snowflake m_active_channel; @@ -30,4 +39,6 @@ protected: Gtk::ScrolledWindow *m_scroll; Gtk::ScrolledWindow *m_entry_scroll; Gtk::TextView *m_input; + + Abaddon *m_abaddon = nullptr; }; |