aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/graph/win_brush.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-10 19:42:46 +0800
committercrupest <crupest@outlook.com>2019-04-10 19:42:46 +0800
commit7351020a582d70a1495249fba87d342c8a1fb634 (patch)
treee80f225041dc3816b3dce21c7e15aadbb211602e /include/cru/win/graph/win_brush.hpp
parenta94a806f69586e08a30fff0cdb3e52b0ce7acfa5 (diff)
downloadcru-7351020a582d70a1495249fba87d342c8a1fb634.tar.gz
cru-7351020a582d70a1495249fba87d342c8a1fb634.tar.bz2
cru-7351020a582d70a1495249fba87d342c8a1fb634.zip
Refactor.
Diffstat (limited to 'include/cru/win/graph/win_brush.hpp')
-rw-r--r--include/cru/win/graph/win_brush.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/cru/win/graph/win_brush.hpp b/include/cru/win/graph/win_brush.hpp
new file mode 100644
index 00000000..69cd952d
--- /dev/null
+++ b/include/cru/win/graph/win_brush.hpp
@@ -0,0 +1,33 @@
+#pragma once
+#include "../win_pre_config.hpp"
+
+#include "cru/platform/graph/brush.hpp"
+
+namespace cru::win::graph {
+class GraphManager;
+
+struct WinBrush : virtual platform::graph::Brush {
+ virtual ID2D1Brush* GetD2DBrush() = 0;
+};
+
+class WinSolidColorBrush : public Object,
+ public virtual platform::graph::SolidColorBrush,
+ public virtual WinBrush {
+ public:
+ explicit WinSolidColorBrush(GraphManager* graph_manager,
+ const ui::Color& color);
+ WinSolidColorBrush(const WinSolidColorBrush& other) = delete;
+ WinSolidColorBrush(WinSolidColorBrush&& other) = delete;
+ WinSolidColorBrush& operator=(const WinSolidColorBrush& other) = delete;
+ WinSolidColorBrush& operator=(WinSolidColorBrush&& other) = delete;
+ ~WinSolidColorBrush() override = default;
+
+ ui::Color GetColor() override;
+ void SetColor(const ui::Color& color) override;
+
+ ID2D1Brush* GetD2DBrush() override { return brush_.Get(); }
+
+ private:
+ Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> brush_;
+};
+} // namespace cru::win::graph