aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph/factory.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
committercrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
commite69911a8b161b81ce3f7b209175766da2b7b3d4b (patch)
tree76b1f4b6f9f5ad6111578771be783ee456aeb912 /include/cru/platform/graph/factory.hpp
parent154b5b838edfdcef93cd0a33c013ad7f5f9d7337 (diff)
downloadcru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.gz
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.bz2
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.zip
...
Diffstat (limited to 'include/cru/platform/graph/factory.hpp')
-rw-r--r--include/cru/platform/graph/factory.hpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/cru/platform/graph/factory.hpp b/include/cru/platform/graph/factory.hpp
new file mode 100644
index 00000000..2c52cbb8
--- /dev/null
+++ b/include/cru/platform/graph/factory.hpp
@@ -0,0 +1,27 @@
+#pragma once
+#include "base.hpp"
+
+#include "brush.hpp"
+#include "font.hpp"
+#include "geometry.hpp"
+#include "text_layout.hpp"
+
+#include <memory>
+#include <string>
+#include <string_view>
+#include <utility>
+
+namespace cru::platform::graph {
+// Entry point of the graph module.
+struct IGraphFactory : virtual INativeResource {
+ virtual std::unique_ptr<ISolidColorBrush> CreateSolidColorBrush() = 0;
+
+ virtual std::unique_ptr<IGeometryBuilder> CreateGeometryBuilder() = 0;
+
+ virtual std::unique_ptr<IFont> CreateFont(const std::string_view& font_family,
+ float font_size) = 0;
+
+ virtual std::unique_ptr<ITextLayout> CreateTextLayout(
+ std::shared_ptr<IFont> font, std::string text) = 0;
+};
+} // namespace cru::platform::graph