diff options
author | crupest <crupest@outlook.com> | 2018-10-07 17:15:32 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-10-07 17:15:32 +0800 |
commit | 00abb6f0c8678086860c07eedb17aa348b13fd76 (patch) | |
tree | 45976fd277758fbc6be8c2e38e1f560118ff8efc /src/ui/cursor.h | |
parent | 508c69d6706ddfdba5bac7970ea95b8158992323 (diff) | |
download | cru-00abb6f0c8678086860c07eedb17aa348b13fd76.tar.gz cru-00abb6f0c8678086860c07eedb17aa348b13fd76.tar.bz2 cru-00abb6f0c8678086860c07eedb17aa348b13fd76.zip |
Add cursor.
Diffstat (limited to 'src/ui/cursor.h')
-rw-r--r-- | src/ui/cursor.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ui/cursor.h b/src/ui/cursor.h new file mode 100644 index 00000000..b57db9b7 --- /dev/null +++ b/src/ui/cursor.h @@ -0,0 +1,33 @@ +#pragma once + +#include "system_headers.h" +#include <memory> +#include <unordered_map> + +#include "base.h" + +namespace cru::ui +{ + class Cursor : public Object + { + public: + using Ptr = std::shared_ptr<Cursor>; + + Cursor(HCURSOR handle, bool auto_release); + Cursor(const Cursor& other) = delete; + Cursor(Cursor&& other) = delete; + Cursor& operator=(const Cursor& other) = delete; + Cursor& operator=(Cursor&& other) = delete; + ~Cursor() override; + + private: + HCURSOR handle_; + bool auto_release_; + }; + + + extern std::unordered_map<String, Cursor::Ptr> cursors; + constexpr auto cursor_arrow_key = L"System_Arrow"; + constexpr auto cursor_hand_key = L"System_Hand"; + constexpr auto cursor_i_beam_key = L"System_IBeam"; +} |