diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-12-07 18:10:12 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-12-07 18:10:12 +0100 |
commit | 3364e8c6291907ea88e45314c5add9624b81c110 (patch) | |
tree | f832ea211c8c4fc7f132ba68c8c0c32bfce3e3bb /include | |
parent | 623cfeb9de7ff4bcc710b5a4e41cc354bb2e3f0c (diff) |
Add support for viewing videos/gifs on image boards (4chan)
Diffstat (limited to 'include')
-rw-r--r-- | include/Body.hpp | 2 | ||||
-rw-r--r-- | include/QuickMedia.hpp | 5 | ||||
-rw-r--r-- | include/StringUtils.hpp | 1 |
3 files changed, 7 insertions, 1 deletions
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 <json/value.h> #include <unordered_set> #include <future> +#include <stack> 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<SearchBar> search_bar; Page current_page; + std::stack<Page> 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 |