aboutsummaryrefslogtreecommitdiff
path: root/include/QuickMedia.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/QuickMedia.hpp')
-rw-r--r--include/QuickMedia.hpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp
index 45c499a..bdbafef 100644
--- a/include/QuickMedia.hpp
+++ b/include/QuickMedia.hpp
@@ -5,6 +5,7 @@
#include "Page.hpp"
#include "Storage.hpp"
#include "Tab.hpp"
+#include "MessageQueue.hpp"
#include <vector>
#include <memory>
#include <SFML/Graphics/Font.hpp>
@@ -14,10 +15,7 @@
#include <unordered_set>
#include <future>
#include <thread>
-#include <mutex>
-#include <condition_variable>
#include <stack>
-#include <deque>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
@@ -26,6 +24,8 @@ namespace QuickMedia {
class FileManager;
class MangaImagesPage;
class ImageBoardThreadPage;
+ class RoomData;
+ class MatrixChatPage;
enum class ImageViewMode {
SINGLE,
@@ -50,16 +50,19 @@ namespace QuickMedia {
bool load_manga_content_storage(const char *service_name, const std::string &manga_title, const std::string &manga_id);
void select_file(const std::string &filepath);
+
+ bool is_window_focused();
+ RoomData* get_current_chat_room();
private:
void base_event_handler(sf::Event &event, PageType previous_page, Body *body, SearchBar *search_bar, bool handle_key_press = true, bool handle_searchbar = true);
- void page_loop(std::vector<Tab> tabs);
+ void page_loop(std::vector<Tab> &tabs);
void video_content_page(Page *page, std::string video_url, std::string video_title);
// Returns -1 to go to previous chapter, 0 to stay on same chapter and 1 to go to next chapter
int image_page(MangaImagesPage *images_page, Body *chapters_body);
void image_continuous_page(MangaImagesPage *images_page);
void image_board_thread_page(ImageBoardThreadPage *thread_page, Body *thread_body);
void chat_login_page();
- void chat_page();
+ void chat_page(MatrixChatPage *chat_page, RoomData *current_room);
enum class LoadImageResult {
OK,
@@ -110,10 +113,8 @@ namespace QuickMedia {
std::future<std::string> autocomplete_future;
std::future<void> image_download_future;
std::thread image_upscale_thead;
- std::mutex image_upscale_mutex;
- std::deque<CopyOp> images_to_upscale;
+ MessageQueue<CopyOp> images_to_upscale_queue;
std::vector<char> image_upscale_status;
- std::condition_variable image_upscale_cv;
std::string downloading_chapter_url;
bool image_download_cancel = false;
int exit_code = 0;
@@ -127,5 +128,6 @@ namespace QuickMedia {
ImageViewMode image_view_mode = ImageViewMode::SINGLE;
std::vector<std::string> selected_files;
bool fit_image_to_window = false;
+ RoomData *current_chat_room = nullptr;
};
} \ No newline at end of file