blob: fa0ef18c6c635e98a4601001c0f0b4c5b79b2431 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#pragma once
#include "Resource.hpp"
#include "cru/common/Base.hpp"
#include "cru/platform/graphics/Base.hpp"
#include "cru/platform/graphics/Brush.hpp"
#include <CoreGraphics/CoreGraphics.h>
namespace cru::platform::graphics::osx::quartz {
class QuartzBrush : public OsxQuartzResource, public virtual IBrush {
public:
QuartzBrush(IGraphFactory* graphics_factory)
: OsxQuartzResource(graphics_factory) {}
CRU_DELETE_COPY(QuartzBrush)
CRU_DELETE_MOVE(QuartzBrush)
~QuartzBrush() override = default;
};
class QuartzSolidColorBrush : public QuartzBrush,
public virtual ISolidColorBrush {
public:
QuartzSolidColorBrush(IGraphFactory* graphics_factory, const Color& color);
CRU_DELETE_COPY(QuartzSolidColorBrush)
CRU_DELETE_MOVE(QuartzSolidColorBrush)
~QuartzSolidColorBrush() override;
Color GetColor() override { return color_; }
void SetColor(const Color& color) override;
CGColorRef GetCGColorRef() const { return cg_color_; }
private:
Color color_;
CGColorRef cg_color_;
};
} // namespace cru::platform::graphics::osx::quartz
|