diff options
Diffstat (limited to 'include/cru/ui/render/text_render_object.hpp')
-rw-r--r-- | include/cru/ui/render/text_render_object.hpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/include/cru/ui/render/text_render_object.hpp b/include/cru/ui/render/text_render_object.hpp index 527fcd71..9f03551d 100644 --- a/include/cru/ui/render/text_render_object.hpp +++ b/include/cru/ui/render/text_render_object.hpp @@ -5,18 +5,18 @@ #include <string> // forward declarations -namespace cru::platform { +namespace cru::platform::graph { struct Brush; struct FontDescriptor; struct TextLayout; -} // namespace cru::platform +} // namespace cru::platform::graph namespace cru::ui::render { class TextRenderObject : public RenderObject { public: - TextRenderObject(std::shared_ptr<platform::Brush> brush, - std::shared_ptr<platform::FontDescriptor> font, - std::shared_ptr<platform::Brush> selection_brush); + TextRenderObject(std::shared_ptr<platform::graph::Brush> brush, + std::shared_ptr<platform::graph::FontDescriptor> font, + std::shared_ptr<platform::graph::Brush> selection_brush); TextRenderObject(const TextRenderObject& other) = delete; TextRenderObject(TextRenderObject&& other) = delete; TextRenderObject& operator=(const TextRenderObject& other) = delete; @@ -26,13 +26,13 @@ class TextRenderObject : public RenderObject { std::wstring GetText() const; void SetText(std::wstring new_text); - std::shared_ptr<platform::Brush> GetBrush() const { return brush_; } - void SetBrush(std::shared_ptr<platform::Brush> new_brush) { + std::shared_ptr<platform::graph::Brush> GetBrush() const { return brush_; } + void SetBrush(std::shared_ptr<platform::graph::Brush> new_brush) { new_brush.swap(brush_); } - std::shared_ptr<platform::FontDescriptor> GetFont() const; - void SetFont(std::shared_ptr<platform::FontDescriptor> font); + std::shared_ptr<platform::graph::FontDescriptor> GetFont() const; + void SetFont(std::shared_ptr<platform::graph::FontDescriptor> font); std::optional<TextRange> GetSelectionRange() const { return selection_range_; @@ -41,14 +41,14 @@ class TextRenderObject : public RenderObject { selection_range_ = std::move(new_range); } - std::shared_ptr<platform::Brush> GetSelectionBrush() const { + std::shared_ptr<platform::graph::Brush> GetSelectionBrush() const { return selection_brush_; } - void SetSelectionBrush(std::shared_ptr<platform::Brush> new_brush) { + void SetSelectionBrush(std::shared_ptr<platform::graph::Brush> new_brush) { new_brush.swap(selection_brush_); } - void Draw(platform::Painter* painter) override; + void Draw(platform::graph::Painter* painter) override; RenderObject* HitTest(const Point& point) override; @@ -59,11 +59,11 @@ class TextRenderObject : public RenderObject { void OnLayoutContent(const Rect& content_rect) override; private: - std::shared_ptr<platform::Brush> brush_; - std::shared_ptr<platform::FontDescriptor> font_; - std::shared_ptr<platform::TextLayout> text_layout_; + std::shared_ptr<platform::graph::Brush> brush_; + std::shared_ptr<platform::graph::FontDescriptor> font_; + std::shared_ptr<platform::graph::TextLayout> text_layout_; std::optional<TextRange> selection_range_ = std::nullopt; - std::shared_ptr<platform::Brush> selection_brush_; + std::shared_ptr<platform::graph::Brush> selection_brush_; }; } // namespace cru::ui::render |