aboutsummaryrefslogtreecommitdiff
path: root/include/BodyItem.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-17 09:47:45 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-17 09:59:29 +0100
commit453eac7f1f5ef70390ec51087fc1f190811a7507 (patch)
tree21a32ef6de9a3d7c29562484104b56c12518a6f0 /include/BodyItem.hpp
parentfc49d40c0d2f6edbbe9dde1f1b53d6a17e9d9f7d (diff)
Replace sfml with mgl
Diffstat (limited to 'include/BodyItem.hpp')
-rw-r--r--include/BodyItem.hpp32
1 files changed, 16 insertions, 16 deletions
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 <memory>
-#include <SFML/Graphics/Text.hpp>
+#include <mglpp/graphics/Text.hpp>
-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<Text> title_text;
std::unique_ptr<Text> description_text;
std::unique_ptr<Text> author_text;
- std::unique_ptr<sf::Text> timestamp_text; // TODO: Remove
+ std::unique_ptr<mgl::Text> timestamp_text; // TODO: Remove
// Used by image boards for example. The elements are indices to other body items
std::vector<size_t> 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<BodyItem> 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<Reaction> reactions; // TODO: Move to a different body item type
std::shared_ptr<BodyItemExtra> 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;
};