aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp2
-rw-r--r--include/MessageQueue.hpp9
2 files changed, 11 insertions, 0 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index f4742bc..236a02d 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -207,6 +207,8 @@ namespace QuickMedia {
float get_page_scroll() const { return page_scroll; }
bool is_last_item_fully_visible() const { return last_item_fully_visible; }
+ bool is_body_full_with_items() const { return items_cut_off; }
+
sf::Text progress_text;
sf::Text replies_text;
sf::Text embedded_item_load_text;
diff --git a/include/MessageQueue.hpp b/include/MessageQueue.hpp
index 4f1e036..7c34d51 100644
--- a/include/MessageQueue.hpp
+++ b/include/MessageQueue.hpp
@@ -31,6 +31,15 @@ namespace QuickMedia {
return data;
}
+ std::optional<T> pop_if_available() {
+ std::unique_lock<std::mutex> lock(mutex);
+ if(data_queue.empty())
+ return std::nullopt;
+ T data = std::move(data_queue.front());
+ data_queue.pop_front();
+ return data;
+ }
+
void close() {
std::unique_lock<std::mutex> lock(mutex);
running = false;