aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graphics/quartz/Base.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform/graphics/quartz/Base.h')
-rw-r--r--include/cru/platform/graphics/quartz/Base.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/cru/platform/graphics/quartz/Base.h b/include/cru/platform/graphics/quartz/Base.h
new file mode 100644
index 00000000..271d4035
--- /dev/null
+++ b/include/cru/platform/graphics/quartz/Base.h
@@ -0,0 +1,37 @@
+#pragma once
+#include <cru/base/Base.h>
+#include <cru/base/io/Stream.h>
+#include <cru/platform/graphics/Base.h>
+
+#include <CoreGraphics/CoreGraphics.h>
+
+namespace cru::platform::graphics::quartz {
+class OsxQuartzResource : public Object, public virtual IGraphicsResource {
+ public:
+ explicit OsxQuartzResource(IGraphicsFactory* graphics_factory)
+ : graphics_factory_(graphics_factory) {}
+
+ public:
+ std::string GetPlatformId() const override { return "OSX Quartz"; }
+
+ IGraphicsFactory* GetGraphicsFactory() override { return graphics_factory_; }
+
+ private:
+ IGraphicsFactory* graphics_factory_;
+};
+
+CGAffineTransform Convert(const Matrix& matrix);
+Matrix Convert(const CGAffineTransform& matrix);
+
+CGPoint Convert(const Point& point);
+Point Convert(const CGPoint& point);
+
+CGSize Convert(const Size& size);
+Size Convert(const CGSize& size);
+
+CGRect Convert(const Rect& rect);
+Rect Convert(const CGRect& rect);
+
+CGDataProviderRef ConvertStreamToCGDataProvider(io::Stream* stream);
+CGDataConsumerRef ConvertStreamToCGDataConsumer(io::Stream* stream);
+} // namespace cru::platform::graphics::quartz