diff options
author | crupest <crupest@outlook.com> | 2019-12-13 01:02:47 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-12-13 01:02:47 +0800 |
commit | 9110574bb51e9e2959842a7641f598d34c3cd847 (patch) | |
tree | 96ee1f5b3c40095e4e923fc763de0663ee6a01aa /include/cru/ui/control.hpp | |
parent | f2aa96fba0b72eeeadf5160ea5df2c8143ec8aa0 (diff) | |
download | cru-9110574bb51e9e2959842a7641f598d34c3cd847.tar.gz cru-9110574bb51e9e2959842a7641f598d34c3cd847.tar.bz2 cru-9110574bb51e9e2959842a7641f598d34c3cd847.zip |
...
Diffstat (limited to 'include/cru/ui/control.hpp')
-rw-r--r-- | include/cru/ui/control.hpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/include/cru/ui/control.hpp b/include/cru/ui/control.hpp index cf4f9053..1fe49261 100644 --- a/include/cru/ui/control.hpp +++ b/include/cru/ui/control.hpp @@ -1,15 +1,18 @@ #pragma once #include "base.hpp" -#include "cru/common/base.hpp" -#include "cru/platform/native/basic_types.hpp" -#include "cru/platform/native/cursor.hpp" -#include "event/ui_event.hpp" +#include "cru/common/event.hpp" +#include "ui_event.hpp" +#include <functional> #include <memory> #include <string_view> #include <vector> +namespace cru::platform::native { +struct ICursor; +} + namespace cru::ui { class Window; namespace render { @@ -30,7 +33,7 @@ class Control : public Object { ~Control() override = default; public: - virtual std::wstring_view GetControlType() const = 0; + virtual std::string_view GetControlType() const = 0; //*************** region: tree *************** public: @@ -74,13 +77,13 @@ class Control : public Object { // Cursor is inherited from parent recursively if not set. public: // null for not set - std::shared_ptr<platform::native::Cursor> GetCursor(); + std::shared_ptr<platform::native::ICursor> GetCursor(); // will not return nullptr - std::shared_ptr<platform::native::Cursor> GetInheritedCursor(); + std::shared_ptr<platform::native::ICursor> GetInheritedCursor(); // null to unset - void SetCursor(std::shared_ptr<platform::native::Cursor> cursor); + void SetCursor(std::shared_ptr<platform::native::ICursor> cursor); //*************** region: events *************** public: @@ -163,6 +166,6 @@ class Control : public Object { bool right; } click_map_; - std::shared_ptr<platform::native::Cursor> cursor_ = nullptr; + std::shared_ptr<platform::native::ICursor> cursor_ = nullptr; }; } // namespace cru::ui |