From 6aa2201797a9ed64ce0178215ae941d0c5f09579 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 30 Oct 2020 00:07:57 +0800 Subject: ... --- include/cru/win/graph/direct/TextLayout.hpp | 55 ----------------------------- 1 file changed, 55 deletions(-) delete mode 100644 include/cru/win/graph/direct/TextLayout.hpp (limited to 'include/cru/win/graph/direct/TextLayout.hpp') diff --git a/include/cru/win/graph/direct/TextLayout.hpp b/include/cru/win/graph/direct/TextLayout.hpp deleted file mode 100644 index 016009ab..00000000 --- a/include/cru/win/graph/direct/TextLayout.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once -#include "ComResource.hpp" -#include "Resource.hpp" - -#include "cru/platform/graph/TextLayout.hpp" - -#include -#include - -namespace cru::platform::graph::win::direct { -class DWriteFont; - -class DWriteTextLayout : public DirectGraphResource, - public virtual ITextLayout, - public virtual IComResource { - public: - DWriteTextLayout(DirectGraphFactory* factory, std::shared_ptr font, - std::u16string text); - - CRU_DELETE_COPY(DWriteTextLayout) - CRU_DELETE_MOVE(DWriteTextLayout) - - ~DWriteTextLayout() override; - - public: - IDWriteTextLayout* GetComInterface() const override { - return text_layout_.Get(); - } - - public: - std::u16string GetText() override; - std::u16string_view GetTextView() override; - void SetText(std::u16string new_text) override; - - std::shared_ptr GetFont() override; - void SetFont(std::shared_ptr font) override; - - void SetMaxWidth(float max_width) override; - void SetMaxHeight(float max_height) override; - - Rect GetTextBounds() override; - // Return empty vector if text_range.count is 0. Text range could be in - // reverse direction, it should be normalized first in implementation. - std::vector TextRangeRect(const TextRange& text_range) override; - Point TextSinglePoint(Index position, bool trailing) override; - TextHitTestResult HitTest(const Point& point) override; - - private: - std::u16string text_; - std::shared_ptr font_; - float max_width_ = std::numeric_limits::max(); - float max_height_ = std::numeric_limits::max(); - Microsoft::WRL::ComPtr text_layout_; -}; -} // namespace cru::platform::graph::win::direct -- cgit v1.2.3