diff options
Diffstat (limited to 'include/cru')
-rw-r--r-- | include/cru/osx/graphics/quartz/Brush.hpp | 4 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/Factory.hpp | 10 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/Font.hpp | 2 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/Geometry.hpp | 4 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/Painter.hpp | 2 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/Resource.hpp | 8 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/TextLayout.hpp | 2 | ||||
-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 | ||||
-rw-r--r-- | include/cru/platform/gui/UiApplication.hpp | 2 |
15 files changed, 33 insertions, 28 deletions
diff --git a/include/cru/osx/graphics/quartz/Brush.hpp b/include/cru/osx/graphics/quartz/Brush.hpp index 1b5fd7e4..11f05292 100644 --- a/include/cru/osx/graphics/quartz/Brush.hpp +++ b/include/cru/osx/graphics/quartz/Brush.hpp @@ -11,7 +11,7 @@ namespace cru::platform::graphics::osx::quartz { class QuartzBrush : public OsxQuartzResource, public virtual IBrush { public: - QuartzBrush(IGraphFactory* graphics_factory) + QuartzBrush(IGraphicsFactory* graphics_factory) : OsxQuartzResource(graphics_factory) {} CRU_DELETE_COPY(QuartzBrush) CRU_DELETE_MOVE(QuartzBrush) @@ -24,7 +24,7 @@ class QuartzBrush : public OsxQuartzResource, public virtual IBrush { class QuartzSolidColorBrush : public QuartzBrush, public virtual ISolidColorBrush { public: - QuartzSolidColorBrush(IGraphFactory* graphics_factory, const Color& color); + QuartzSolidColorBrush(IGraphicsFactory* graphics_factory, const Color& color); CRU_DELETE_COPY(QuartzSolidColorBrush) CRU_DELETE_MOVE(QuartzSolidColorBrush) diff --git a/include/cru/osx/graphics/quartz/Factory.hpp b/include/cru/osx/graphics/quartz/Factory.hpp index 5346d039..454b2388 100644 --- a/include/cru/osx/graphics/quartz/Factory.hpp +++ b/include/cru/osx/graphics/quartz/Factory.hpp @@ -5,7 +5,7 @@ namespace cru::platform::graphics::osx::quartz { class QuartzGraphicsFactory : public OsxQuartzResource, - public virtual IGraphFactory { + public virtual IGraphicsFactory { public: QuartzGraphicsFactory() : OsxQuartzResource(this) {} @@ -16,5 +16,13 @@ class QuartzGraphicsFactory : public OsxQuartzResource, public: std::unique_ptr<ISolidColorBrush> CreateSolidColorBrush() override; + + std::unique_ptr<IGeometryBuilder> CreateGeometryBuilder() override; + + std::unique_ptr<IFont> CreateFont(String font_family, + float font_size) override; + + std::unique_ptr<ITextLayout> CreateTextLayout(std::shared_ptr<IFont> font, + String text) override; }; } // namespace cru::platform::graphics::osx::quartz diff --git a/include/cru/osx/graphics/quartz/Font.hpp b/include/cru/osx/graphics/quartz/Font.hpp index 618c4c48..75eeff60 100644 --- a/include/cru/osx/graphics/quartz/Font.hpp +++ b/include/cru/osx/graphics/quartz/Font.hpp @@ -8,7 +8,7 @@ namespace cru::platform::graphics::osx::quartz { class OsxCTFont : public OsxQuartzResource, public virtual IFont { public: - OsxCTFont(IGraphFactory* graphics_factory, const String& name, float size); + OsxCTFont(IGraphicsFactory* graphics_factory, const String& name, float size); CRU_DELETE_COPY(OsxCTFont) CRU_DELETE_MOVE(OsxCTFont) diff --git a/include/cru/osx/graphics/quartz/Geometry.hpp b/include/cru/osx/graphics/quartz/Geometry.hpp index 0c8f840f..565c5b86 100644 --- a/include/cru/osx/graphics/quartz/Geometry.hpp +++ b/include/cru/osx/graphics/quartz/Geometry.hpp @@ -9,7 +9,7 @@ namespace cru::platform::graphics::osx::quartz { class QuartzGeometry : public OsxQuartzResource, public virtual IGeometry { public: - QuartzGeometry(IGraphFactory *graphics_factory, CGPathRef cg_path); + QuartzGeometry(IGraphicsFactory *graphics_factory, CGPathRef cg_path); CRU_DELETE_COPY(QuartzGeometry) CRU_DELETE_MOVE(QuartzGeometry) @@ -27,7 +27,7 @@ class QuartzGeometry : public OsxQuartzResource, public virtual IGeometry { class QuartzGeometryBuilder : public OsxQuartzResource, public virtual IGeometryBuilder { public: - explicit QuartzGeometryBuilder(IGraphFactory *graphics_factory); + explicit QuartzGeometryBuilder(IGraphicsFactory *graphics_factory); CRU_DELETE_COPY(QuartzGeometryBuilder) CRU_DELETE_MOVE(QuartzGeometryBuilder) diff --git a/include/cru/osx/graphics/quartz/Painter.hpp b/include/cru/osx/graphics/quartz/Painter.hpp index 5dcc49dc..9a3df187 100644 --- a/include/cru/osx/graphics/quartz/Painter.hpp +++ b/include/cru/osx/graphics/quartz/Painter.hpp @@ -10,7 +10,7 @@ namespace cru::platform::graphics::osx::quartz { class QuartzCGContextPainter : public OsxQuartzResource, public virtual IPainter { public: - explicit QuartzCGContextPainter(IGraphFactory* graphics_factory, + explicit QuartzCGContextPainter(IGraphicsFactory* graphics_factory, CGContextRef cg_context) : OsxQuartzResource(graphics_factory), cg_context_(cg_context) {} diff --git a/include/cru/osx/graphics/quartz/Resource.hpp b/include/cru/osx/graphics/quartz/Resource.hpp index 2d3b4b08..d7038274 100644 --- a/include/cru/osx/graphics/quartz/Resource.hpp +++ b/include/cru/osx/graphics/quartz/Resource.hpp @@ -5,9 +5,9 @@ namespace cru::platform::graphics::osx::quartz { class OsxQuartzResource : public platform::osx::OsxResource, - public virtual IGraphResource { + public virtual IGraphicsResource { public: - explicit OsxQuartzResource(IGraphFactory* graphics_factory) + explicit OsxQuartzResource(IGraphicsFactory* graphics_factory) : graphics_factory_(graphics_factory) {} CRU_DELETE_COPY(OsxQuartzResource) @@ -17,9 +17,9 @@ class OsxQuartzResource : public platform::osx::OsxResource, public: String GetPlatformId() const override { return u"OSX Quartz"; } - IGraphFactory* GetGraphFactory() override; + IGraphicsFactory* GetGraphicsFactory() override; private: - IGraphFactory* graphics_factory_; + IGraphicsFactory* graphics_factory_; }; } // namespace cru::platform::graphics::osx::quartz diff --git a/include/cru/osx/graphics/quartz/TextLayout.hpp b/include/cru/osx/graphics/quartz/TextLayout.hpp index adcf3b0c..96aabf90 100644 --- a/include/cru/osx/graphics/quartz/TextLayout.hpp +++ b/include/cru/osx/graphics/quartz/TextLayout.hpp @@ -10,7 +10,7 @@ namespace cru::platform::graphics::osx::quartz { class OsxCTTextLayout : public OsxQuartzResource, public virtual ITextLayout { public: - OsxCTTextLayout(IGraphFactory* graphics_factory, + OsxCTTextLayout(IGraphicsFactory* graphics_factory, std::shared_ptr<OsxCTFont> font, const String& str); CRU_DELETE_COPY(OsxCTTextLayout) 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; diff --git a/include/cru/platform/gui/UiApplication.hpp b/include/cru/platform/gui/UiApplication.hpp index 407e4fa1..86eb0904 100644 --- a/include/cru/platform/gui/UiApplication.hpp +++ b/include/cru/platform/gui/UiApplication.hpp @@ -62,7 +62,7 @@ struct CRU_PLATFORM_GUI_API IUiApplication : public virtual IPlatformResource { virtual INativeWindow* CreateWindow(INativeWindow* parent, CreateWindowFlag flags) = 0; - virtual cru::platform::graphics::IGraphFactory* GetGraphFactory() = 0; + virtual cru::platform::graphics::IGraphicsFactory* GetGraphFactory() = 0; virtual ICursorManager* GetCursorManager() = 0; }; |