diff options
author | crupest <crupest@outlook.com> | 2021-09-15 19:23:45 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-09-15 19:23:45 +0800 |
commit | e6dd695fc757b59571f67a278e4d88ad54cd36ae (patch) | |
tree | 0b95ec353d34ecbf82adb717f786bdbd07d9abda /include/cru/platform/graphics | |
parent | cb981f5a337f3a8fc9d450b891c358c2b8dc29d3 (diff) | |
download | cru-e6dd695fc757b59571f67a278e4d88ad54cd36ae.tar.gz cru-e6dd695fc757b59571f67a278e4d88ad54cd36ae.tar.bz2 cru-e6dd695fc757b59571f67a278e4d88ad54cd36ae.zip |
...
Diffstat (limited to 'include/cru/platform/graphics')
-rw-r--r-- | include/cru/platform/graphics/Base.hpp | 2 | ||||
-rw-r--r-- | include/cru/platform/graphics/Brush.hpp | 2 | ||||
-rw-r--r-- | include/cru/platform/graphics/Factory.hpp | 9 | ||||
-rw-r--r-- | include/cru/platform/graphics/Font.hpp | 2 | ||||
-rw-r--r-- | include/cru/platform/graphics/Geometry.hpp | 4 | ||||
-rw-r--r-- | include/cru/platform/graphics/Resource.hpp | 6 | ||||
-rw-r--r-- | include/cru/platform/graphics/TextLayout.hpp | 2 |
7 files changed, 12 insertions, 15 deletions
diff --git a/include/cru/platform/graphics/Base.hpp b/include/cru/platform/graphics/Base.hpp index 60af40ab..62ff15c3 100644 --- a/include/cru/platform/graphics/Base.hpp +++ b/include/cru/platform/graphics/Base.hpp @@ -8,7 +8,7 @@ namespace cru::platform::graphics { // forward declarations -struct IGraphFactory; +struct IGraphicsFactory; struct IBrush; struct ISolidColorBrush; struct IFont; diff --git a/include/cru/platform/graphics/Brush.hpp b/include/cru/platform/graphics/Brush.hpp index 18d9705e..aa21f79d 100644 --- a/include/cru/platform/graphics/Brush.hpp +++ b/include/cru/platform/graphics/Brush.hpp @@ -2,7 +2,7 @@ #include "Resource.hpp" namespace cru::platform::graphics { -struct IBrush : virtual IGraphResource {}; +struct IBrush : virtual IGraphicsResource {}; struct ISolidColorBrush : virtual IBrush { virtual Color GetColor() = 0; diff --git a/include/cru/platform/graphics/Factory.hpp b/include/cru/platform/graphics/Factory.hpp index 4ee10204..ad198929 100644 --- a/include/cru/platform/graphics/Factory.hpp +++ b/include/cru/platform/graphics/Factory.hpp @@ -6,21 +6,18 @@ #include "Geometry.hpp" #include "TextLayout.hpp" -#include <string> -#include <string_view> - namespace cru::platform::graphics { // Entry point of the graph module. -struct IGraphFactory : virtual IPlatformResource { +struct IGraphicsFactory : virtual IPlatformResource { virtual std::unique_ptr<ISolidColorBrush> CreateSolidColorBrush() = 0; virtual std::unique_ptr<IGeometryBuilder> CreateGeometryBuilder() = 0; - virtual std::unique_ptr<IFont> CreateFont(std::u16string font_family, + virtual std::unique_ptr<IFont> CreateFont(String font_family, float font_size) = 0; virtual std::unique_ptr<ITextLayout> CreateTextLayout( - std::shared_ptr<IFont> font, std::u16string text) = 0; + std::shared_ptr<IFont> font, String text) = 0; std::unique_ptr<ISolidColorBrush> CreateSolidColorBrush(const Color& color) { std::unique_ptr<ISolidColorBrush> brush = CreateSolidColorBrush(); diff --git a/include/cru/platform/graphics/Font.hpp b/include/cru/platform/graphics/Font.hpp index c8a155fc..e1a419eb 100644 --- a/include/cru/platform/graphics/Font.hpp +++ b/include/cru/platform/graphics/Font.hpp @@ -2,7 +2,7 @@ #include "Resource.hpp" namespace cru::platform::graphics { -struct IFont : virtual IGraphResource { +struct IFont : virtual IGraphicsResource { virtual float GetFontSize() = 0; }; } // namespace cru::platform::graphics diff --git a/include/cru/platform/graphics/Geometry.hpp b/include/cru/platform/graphics/Geometry.hpp index cc8f8761..f01132fb 100644 --- a/include/cru/platform/graphics/Geometry.hpp +++ b/include/cru/platform/graphics/Geometry.hpp @@ -2,13 +2,13 @@ #include "Resource.hpp" namespace cru::platform::graphics { -struct IGeometry : virtual IGraphResource { +struct IGeometry : virtual IGraphicsResource { virtual bool FillContains(const Point& point) = 0; }; // After called Build, calling every method will throw a -struct IGeometryBuilder : virtual IGraphResource { +struct IGeometryBuilder : virtual IGraphicsResource { virtual void BeginFigure(const Point& point) = 0; virtual void LineTo(const Point& point) = 0; virtual void QuadraticBezierTo(const Point& control_point, diff --git a/include/cru/platform/graphics/Resource.hpp b/include/cru/platform/graphics/Resource.hpp index 212e5b18..cd1e5283 100644 --- a/include/cru/platform/graphics/Resource.hpp +++ b/include/cru/platform/graphics/Resource.hpp @@ -2,9 +2,9 @@ #include "Base.hpp" namespace cru::platform::graphics { -struct IGraphFactory; +struct IGraphicsFactory; -struct IGraphResource : virtual IPlatformResource { - virtual IGraphFactory* GetGraphFactory() = 0; +struct IGraphicsResource : virtual IPlatformResource { + virtual IGraphicsFactory* GetGraphicsFactory() = 0; }; } // namespace cru::platform::graphics diff --git a/include/cru/platform/graphics/TextLayout.hpp b/include/cru/platform/graphics/TextLayout.hpp index 716c8047..ec3c2d96 100644 --- a/include/cru/platform/graphics/TextLayout.hpp +++ b/include/cru/platform/graphics/TextLayout.hpp @@ -5,7 +5,7 @@ #include <vector> namespace cru::platform::graphics { -struct ITextLayout : virtual IGraphResource { +struct ITextLayout : virtual IGraphicsResource { virtual String GetText() = 0; virtual void SetText(String new_text) = 0; |