aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph/text_layout.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
committercrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
commite69911a8b161b81ce3f7b209175766da2b7b3d4b (patch)
tree76b1f4b6f9f5ad6111578771be783ee456aeb912 /include/cru/platform/graph/text_layout.hpp
parent154b5b838edfdcef93cd0a33c013ad7f5f9d7337 (diff)
downloadcru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.gz
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.bz2
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.zip
...
Diffstat (limited to 'include/cru/platform/graph/text_layout.hpp')
-rw-r--r--include/cru/platform/graph/text_layout.hpp28
1 files changed, 7 insertions, 21 deletions
diff --git a/include/cru/platform/graph/text_layout.hpp b/include/cru/platform/graph/text_layout.hpp
index 56943098..4f6e81e1 100644
--- a/include/cru/platform/graph/text_layout.hpp
+++ b/include/cru/platform/graph/text_layout.hpp
@@ -1,33 +1,19 @@
#pragma once
-#include "../graphic_base.hpp"
-#include "../native_resource.hpp"
+#include "resource.hpp"
#include <memory>
#include <string>
#include <vector>
namespace cru::platform::graph {
-class Font;
+struct IFont;
-class TextLayout : public NativeResource {
- protected:
- TextLayout() = default;
+struct ITextLayout : virtual IGraphResource {
+ virtual std::string GetText() = 0;
+ virtual void SetText(std::string new_text) = 0;
- public:
- TextLayout(const TextLayout& other) = delete;
- TextLayout& operator=(const TextLayout& other) = delete;
-
- TextLayout(TextLayout&& other) = delete;
- TextLayout& operator=(TextLayout&& other) = delete;
-
- ~TextLayout() override = default;
-
- public:
- virtual std::wstring GetText() = 0;
- virtual void SetText(std::wstring new_text) = 0;
-
- virtual std::shared_ptr<Font> GetFont() = 0;
- virtual void SetFont(std::shared_ptr<Font> font) = 0;
+ virtual std::shared_ptr<IFont> GetFont() = 0;
+ virtual void SetFont(std::shared_ptr<IFont> font) = 0;
virtual void SetMaxWidth(float max_width) = 0;
virtual void SetMaxHeight(float max_height) = 0;