diff options
| author | crupest <crupest@outlook.com> | 2019-12-12 19:53:17 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2019-12-12 19:53:17 +0800 |
| commit | e69911a8b161b81ce3f7b209175766da2b7b3d4b (patch) | |
| tree | 76b1f4b6f9f5ad6111578771be783ee456aeb912 /include/cru/win/graph/direct/brush.hpp | |
| parent | 154b5b838edfdcef93cd0a33c013ad7f5f9d7337 (diff) | |
| download | cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.gz cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.bz2 cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.zip | |
...
Diffstat (limited to 'include/cru/win/graph/direct/brush.hpp')
| -rw-r--r-- | include/cru/win/graph/direct/brush.hpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/include/cru/win/graph/direct/brush.hpp b/include/cru/win/graph/direct/brush.hpp index 1f1c319f..0726ec3f 100644 --- a/include/cru/win/graph/direct/brush.hpp +++ b/include/cru/win/graph/direct/brush.hpp @@ -1,44 +1,39 @@ #pragma once #include "com_resource.hpp" -#include "direct_factory.hpp" -#include "platform_id.hpp" +#include "resource.hpp" #include "cru/platform/graph/brush.hpp" namespace cru::platform::graph::win::direct { -struct ID2DBrush { - virtual ~ID2DBrush() = default; - +struct ID2DBrush : virtual IBrush { virtual ID2D1Brush* GetD2DBrushInterface() const = 0; }; -class D2DSolidColorBrush : public SolidColorBrush, - public ID2DBrush, - public IComResource<ID2D1SolidColorBrush> { +class D2DSolidColorBrush : public DirectGraphResource, + public virtual ISolidColorBrush, + public virtual ID2DBrush, + public virtual IComResource<ID2D1SolidColorBrush> { public: - explicit D2DSolidColorBrush(IDirectFactory* factory); - - D2DSolidColorBrush(const D2DSolidColorBrush& other) = delete; - D2DSolidColorBrush& operator=(const D2DSolidColorBrush& other) = delete; + explicit D2DSolidColorBrush(DirectGraphFactory* factory); - D2DSolidColorBrush(D2DSolidColorBrush&& other) = delete; - D2DSolidColorBrush& operator=(D2DSolidColorBrush&& other) = delete; + CRU_DELETE_COPY(D2DSolidColorBrush) + CRU_DELETE_MOVE(D2DSolidColorBrush) ~D2DSolidColorBrush() override = default; - CRU_PLATFORMID_IMPLEMENT_DIRECT - public: + Color GetColor() override { return color_; } + void SetColor(const Color& color) override; + ID2D1Brush* GetD2DBrushInterface() const override { return brush_.Get(); } ID2D1SolidColorBrush* GetComInterface() const override { return brush_.Get(); } - protected: - void OnSetColor(const Color& color) override; - private: + Color color_ = colors::black; + Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> brush_; }; } // namespace cru::platform::graph::win::direct |
