2023-07-28 18:03:45 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <solanaceae/message3/registry_message_model.hpp>
|
2023-07-29 20:07:59 +02:00
|
|
|
#include <solanaceae/util/config_model.hpp>
|
2023-07-28 18:03:45 +02:00
|
|
|
|
|
|
|
#include "./texture_uploader.hpp"
|
2023-07-31 20:47:22 +02:00
|
|
|
#include "./texture_cache.hpp"
|
2023-08-01 13:21:16 +02:00
|
|
|
#include "./tox_avatar_loader.hpp"
|
2023-07-28 18:03:45 +02:00
|
|
|
#include "./file_selector.hpp"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
class ChatGui4 {
|
2023-07-29 20:07:59 +02:00
|
|
|
ConfigModelI& _conf;
|
2023-07-28 18:03:45 +02:00
|
|
|
RegistryMessageModel& _rmm;
|
|
|
|
Contact3Registry& _cr;
|
|
|
|
|
2023-08-01 13:21:16 +02:00
|
|
|
ToxAvatarLoader _tal;
|
|
|
|
TextureCache<void*, Contact3, ToxAvatarLoader> _contact_tc;
|
2023-07-31 20:47:22 +02:00
|
|
|
//TextureCache<Message3Handle> _msg_tc;
|
|
|
|
|
2023-07-28 18:03:45 +02:00
|
|
|
FileSelector _fss;
|
|
|
|
|
|
|
|
std::optional<Contact3> _selected_contact;
|
|
|
|
|
|
|
|
bool _show_chat_extra_info {true};
|
|
|
|
|
|
|
|
float TEXT_BASE_WIDTH {1};
|
|
|
|
float TEXT_BASE_HEIGHT {1};
|
|
|
|
|
|
|
|
public:
|
|
|
|
ChatGui4(
|
2023-07-29 20:07:59 +02:00
|
|
|
ConfigModelI& conf,
|
2023-07-28 18:03:45 +02:00
|
|
|
RegistryMessageModel& rmm,
|
|
|
|
Contact3Registry& cr,
|
|
|
|
TextureUploaderI& tu
|
|
|
|
);
|
|
|
|
|
|
|
|
public:
|
|
|
|
void render(void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void renderMessageBodyText(Message3Registry& reg, const Message3 e);
|
|
|
|
void renderMessageBodyFile(Message3Registry& reg, const Message3 e);
|
|
|
|
void renderMessageExtra(Message3Registry& reg, const Message3 e);
|
|
|
|
|
|
|
|
void renderContactList(void);
|
|
|
|
bool renderContactListContactBig(const Contact3 c);
|
|
|
|
bool renderContactListContactSmall(const Contact3 c);
|
|
|
|
bool renderSubContactListContact(const Contact3 c);
|
|
|
|
};
|
|
|
|
|
|
|
|
|