diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-30 16:47:40 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-30 18:30:46 +0100 |
commit | 928f2525c29929de0c2ab520f48c82b5cb882aa7 (patch) | |
tree | e97130909f65e7835e4740824e9f38f58e4c0fbe /include | |
parent | e422322650f9cb057937182987071438f9c79e84 (diff) |
Matrix: re-add /logout, cancel task immediately
Cancel video download when pressing escape,
other fixes..
Diffstat (limited to 'include')
-rw-r--r-- | include/AsyncTask.hpp | 9 | ||||
-rw-r--r-- | include/Body.hpp | 3 | ||||
-rw-r--r-- | include/Program.hpp (renamed from include/Program.h) | 16 | ||||
-rw-r--r-- | include/QuickMedia.hpp | 1 |
4 files changed, 17 insertions, 12 deletions
diff --git a/include/AsyncTask.hpp b/include/AsyncTask.hpp new file mode 100644 index 0000000..81be1ee --- /dev/null +++ b/include/AsyncTask.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include <functional> +#include <deque> +#include <mutex> + +namespace QuickMedia { + +}
\ No newline at end of file diff --git a/include/Body.hpp b/include/Body.hpp index 9cdcd7b..1dc1fe8 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -147,14 +147,13 @@ namespace QuickMedia { // Select next item, ignoring invisible items. Returns true if the item was changed. This can be used to check if the bottom was hit when wrap_around is set to false bool select_next_item(); - void set_selected_item(int item); + void set_selected_item(int item, bool reset_prev_selected_item = true); // Returns -1 if item can't be found int get_index_by_body_item(BodyItem *body_item); void select_first_item(); void select_last_item(); - void reset_selected(); void clear_items(); void prepend_items(BodyItems new_items); void append_items(BodyItems new_items); diff --git a/include/Program.h b/include/Program.hpp index cab8d26..8ac2d2d 100644 --- a/include/Program.h +++ b/include/Program.hpp @@ -1,11 +1,8 @@ -#ifndef QUICKMEDIA_PROGRAM_H -#define QUICKMEDIA_PROGRAM_H +#ifndef QUICKMEDIA_PROGRAM_HPP +#define QUICKMEDIA_PROGRAM_HPP #include <sys/types.h> - -#ifdef __cplusplus -extern "C" { -#endif +#include <thread> typedef struct { pid_t pid; @@ -41,8 +38,7 @@ int wait_program_non_blocking(pid_t process_id, int *status); */ int exec_program_async(const char **args, pid_t *result_process_id); -#ifdef __cplusplus -} -#endif +void program_clear_current_thread(); +void program_kill_in_thread(const std::thread::id &thread_id); -#endif +#endif /* QUICKMEDIA_PROGRAM_HPP */ diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 99bab7a..6f8e3ff 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -63,6 +63,7 @@ namespace QuickMedia { void image_board_thread_page(ImageBoardThreadPage *thread_page, Body *thread_body); void chat_login_page(); void chat_page(MatrixChatPage *chat_page, RoomData *current_room); + void after_matrix_login_page(); enum class LoadImageResult { OK, |