From e69911a8b161b81ce3f7b209175766da2b7b3d4b Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 12 Dec 2019 19:53:17 +0800 Subject: ... --- include/cru/platform/graph/text_layout.hpp | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'include/cru/platform/graph/text_layout.hpp') 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 #include #include 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 GetFont() = 0; - virtual void SetFont(std::shared_ptr font) = 0; + virtual std::shared_ptr GetFont() = 0; + virtual void SetFont(std::shared_ptr font) = 0; virtual void SetMaxWidth(float max_width) = 0; virtual void SetMaxHeight(float max_height) = 0; -- cgit v1.2.3