From 3364e8c6291907ea88e45314c5add9624b81c110 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 7 Dec 2019 18:10:12 +0100 Subject: Add support for viewing videos/gifs on image boards (4chan) --- include/Body.hpp | 2 +- include/QuickMedia.hpp | 5 +++++ include/StringUtils.hpp | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/Body.hpp b/include/Body.hpp index e727244..a485aac 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -29,7 +29,7 @@ namespace QuickMedia { std::string title; std::string url; std::string thumbnail_url; - std::string fullsize_image_url; + std::string attached_content_url; std::string author; bool visible; // Used by image boards for example. The elements are indices to other body items diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index abfe270..9cc85d5 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace QuickMedia { class Plugin; @@ -44,6 +45,9 @@ namespace QuickMedia { LoadImageResult load_image_by_index(int image_index, sf::Texture &image_texture, sf::String &error_message); void download_chapter_images_if_needed(Manganelo *image_plugin); void select_episode(BodyItem *item, bool start_from_beginning); + + // Returns Page::EXIT if empty + Page pop_page_stack(); private: sf::RenderWindow window; sf::Vector2f window_size; @@ -54,6 +58,7 @@ namespace QuickMedia { sf::Texture plugin_logo; std::unique_ptr search_bar; Page current_page; + std::stack page_stack; // TODO: Combine these std::string images_url; std::string content_title; diff --git a/include/StringUtils.hpp b/include/StringUtils.hpp index c6ae244..dd4b99b 100644 --- a/include/StringUtils.hpp +++ b/include/StringUtils.hpp @@ -10,4 +10,5 @@ namespace QuickMedia { void string_split(const std::string &str, char delimiter, StringSplitCallback callback_func); void string_replace_all(std::string &str, const std::string &old_str, const std::string &new_str); std::string strip(const std::string &str); + bool string_ends_with(const std::string &str, const std::string &ends_with_str); } \ No newline at end of file -- cgit v1.2.3