From 453eac7f1f5ef70390ec51087fc1f190811a7507 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 17 Nov 2021 09:47:45 +0100 Subject: Replace sfml with mgl --- include/BodyItem.hpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'include/BodyItem.hpp') diff --git a/include/BodyItem.hpp b/include/BodyItem.hpp index 5889d58..eef674e 100644 --- a/include/BodyItem.hpp +++ b/include/BodyItem.hpp @@ -2,10 +2,10 @@ #include "Text.hpp" #include -#include +#include -namespace sf { - class RenderTarget; +namespace mgl { + class Window; } namespace QuickMedia { @@ -77,21 +77,21 @@ namespace QuickMedia { dirty_timestamp = true; } - void set_title_color(sf::Color new_color) { + void set_title_color(mgl::Color new_color) { if(new_color == title_color) return; title_color = new_color; dirty = true; } - void set_description_color(sf::Color new_color) { + void set_description_color(mgl::Color new_color) { if(new_color == description_color) return; description_color = new_color; dirty_description = true; } - void set_author_color(sf::Color new_color) { + void set_author_color(mgl::Color new_color) { if(new_color == author_color) return; author_color = new_color; @@ -117,13 +117,13 @@ namespace QuickMedia { // In milliseconds int64_t get_timestamp() const { return timestamp; } - sf::Color get_title_color() const { return title_color; } - sf::Color get_description_color() const { return description_color; } - sf::Color get_author_color() const { return author_color; } + mgl::Color get_title_color() const { return title_color; } + mgl::Color get_description_color() const { return description_color; } + mgl::Color get_author_color() const { return author_color; } bool is_selectable() const { return selectable; } - void draw_list(Body *body, sf::RenderTarget &render_target); + void draw_list(Body *body, mgl::Window &render_target); // TODO: Use a list of strings instead, not all plugins need all of these fields std::string url; @@ -138,7 +138,7 @@ namespace QuickMedia { std::unique_ptr title_text; std::unique_ptr description_text; std::unique_ptr author_text; - std::unique_ptr timestamp_text; // TODO: Remove + std::unique_ptr timestamp_text; // TODO: Remove // Used by image boards for example. The elements are indices to other body items std::vector replies_to; // Used by image boards for example. The elements are indices to other body items @@ -148,7 +148,7 @@ namespace QuickMedia { float loaded_height = 0.0f; float height = 0.0f; float prev_height = 0.0f; - sf::Vector2f loaded_image_size; + mgl::vec2f loaded_image_size; float loaded_content_height = 0.0f; FetchStatus embedded_item_status = FetchStatus::NONE; // Important! Should refer to a new BodyItem, not one that already exists in the body. @@ -156,7 +156,7 @@ namespace QuickMedia { // if an embedded item wraps but not the original body item. std::shared_ptr embedded_item; // Used by matrix for example to display reply message body. Note: only the first level of embedded items is rendered (not recursive, this is done on purpose) ThumbnailMaskType thumbnail_mask_type = ThumbnailMaskType::NONE; - sf::Vector2i thumbnail_size; + mgl::vec2i thumbnail_size; std::vector reactions; // TODO: Move to a different body item type std::shared_ptr extra; // TODO: Remove @@ -171,9 +171,9 @@ namespace QuickMedia { std::string description; std::string author; int64_t timestamp; - sf::Color title_color; - sf::Color author_color; - sf::Color description_color; + mgl::Color title_color; + mgl::Color author_color; + mgl::Color description_color; bool selectable; }; -- cgit v1.2.3