aboutsummaryrefslogtreecommitdiff
path: root/src/ui/control.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-13 01:02:47 +0800
committercrupest <crupest@outlook.com>2019-12-13 01:02:47 +0800
commit9110574bb51e9e2959842a7641f598d34c3cd847 (patch)
tree96ee1f5b3c40095e4e923fc763de0663ee6a01aa /src/ui/control.cpp
parentf2aa96fba0b72eeeadf5160ea5df2c8143ec8aa0 (diff)
downloadcru-9110574bb51e9e2959842a7641f598d34c3cd847.tar.gz
cru-9110574bb51e9e2959842a7641f598d34c3cd847.tar.bz2
cru-9110574bb51e9e2959842a7641f598d34c3cd847.zip
...
Diffstat (limited to 'src/ui/control.cpp')
-rw-r--r--src/ui/control.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 8e8819de..5f760939 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -2,10 +2,9 @@
#include "cru/platform/native/basic_types.hpp"
#include "cru/platform/native/cursor.hpp"
-#include "cru/platform/native/native_window.hpp"
#include "cru/platform/native/ui_application.hpp"
+#include "cru/platform/native/window.hpp"
#include "cru/ui/base.hpp"
-#include "cru/ui/event/ui_event.hpp"
#include "cru/ui/window.hpp"
#include "routed_event_dispatch.hpp"
@@ -13,9 +12,9 @@
#include <memory>
namespace cru::ui {
-using platform::native::Cursor;
-using platform::native::SystemCursor;
-using platform::native::UiApplication;
+using platform::native::ICursor;
+using platform::native::IUiApplication;
+using platform::native::SystemCursorType;
Control::Control() {
MouseEnterEvent()->Direct()->AddHandler(
@@ -85,20 +84,20 @@ bool Control::IsMouseCaptured() {
return GetWindow()->GetMouseCaptureControl() == this;
}
-std::shared_ptr<Cursor> Control::GetCursor() { return cursor_; }
+std::shared_ptr<ICursor> Control::GetCursor() { return cursor_; }
-std::shared_ptr<Cursor> Control::GetInheritedCursor() {
+std::shared_ptr<ICursor> Control::GetInheritedCursor() {
Control* control = this;
while (control != nullptr) {
const auto cursor = control->GetCursor();
if (cursor != nullptr) return cursor;
control = control->GetParent();
}
- return UiApplication::GetInstance()->GetCursorManager()->GetSystemCursor(
- SystemCursor::Arrow);
+ return IUiApplication::GetInstance()->GetCursorManager()->GetSystemCursor(
+ SystemCursorType::Arrow);
}
-void Control::SetCursor(std::shared_ptr<Cursor> cursor) {
+void Control::SetCursor(std::shared_ptr<ICursor> cursor) {
cursor_ = std::move(cursor);
const auto window = GetWindow();
if (window != nullptr) {