diff options
| author | crupest <crupest@outlook.com> | 2019-06-27 15:29:13 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2019-06-27 15:29:13 +0800 |
| commit | 8c5b05bcfce96495b4ffc4209ab8feda12597729 (patch) | |
| tree | a0a8bc99d8ffb42dc231696a4e4dfd1e7607eea0 /include/cru/win/graph/direct/brush.hpp | |
| parent | baa7cf141b8121473edceae16c1a20a6d47bd202 (diff) | |
| download | cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.tar.gz cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.tar.bz2 cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.zip | |
...
Diffstat (limited to 'include/cru/win/graph/direct/brush.hpp')
| -rw-r--r-- | include/cru/win/graph/direct/brush.hpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/cru/win/graph/direct/brush.hpp b/include/cru/win/graph/direct/brush.hpp index 9775b5c1..1f1c319f 100644 --- a/include/cru/win/graph/direct/brush.hpp +++ b/include/cru/win/graph/direct/brush.hpp @@ -1,21 +1,39 @@ #pragma once #include "com_resource.hpp" #include "direct_factory.hpp" +#include "platform_id.hpp" #include "cru/platform/graph/brush.hpp" namespace cru::platform::graph::win::direct { +struct ID2DBrush { + virtual ~ID2DBrush() = default; + + virtual ID2D1Brush* GetD2DBrushInterface() const = 0; +}; + class D2DSolidColorBrush : public SolidColorBrush, + public ID2DBrush, public IComResource<ID2D1SolidColorBrush> { public: explicit D2DSolidColorBrush(IDirectFactory* factory); + D2DSolidColorBrush(const D2DSolidColorBrush& other) = delete; - D2DSolidColorBrush(D2DSolidColorBrush&& other) = delete; D2DSolidColorBrush& operator=(const D2DSolidColorBrush& other) = delete; + + D2DSolidColorBrush(D2DSolidColorBrush&& other) = delete; D2DSolidColorBrush& operator=(D2DSolidColorBrush&& other) = delete; + ~D2DSolidColorBrush() override = default; - ID2D1SolidColorBrush* GetComInterface() override { return brush_.Get(); } + CRU_PLATFORMID_IMPLEMENT_DIRECT + + public: + ID2D1Brush* GetD2DBrushInterface() const override { return brush_.Get(); } + + ID2D1SolidColorBrush* GetComInterface() const override { + return brush_.Get(); + } protected: void OnSetColor(const Color& color) override; |
