diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/ui/Control.cpp | 9 | ||||
-rw-r--r-- | src/ui/Window.cpp | 4 | ||||
-rw-r--r-- | src/ui/controls/TextControlService.hpp | 4 | ||||
-rw-r--r-- | src/ui/host/RoutedEventDispatch.hpp (renamed from src/ui/RoutedEventDispatch.hpp) | 0 | ||||
-rw-r--r-- | src/ui/host/WindowHost.cpp (renamed from src/ui/WindowHost.cpp) | 4 | ||||
-rw-r--r-- | src/ui/render/RenderObject.cpp | 4 |
7 files changed, 15 insertions, 16 deletions
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 45f64c88..d7b924cb 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -2,7 +2,7 @@ set(CRU_UI_INCLUDE_DIR ${CRU_INCLUDE_DIR}/cru/ui) add_library(cru_ui STATIC Helper.hpp - RoutedEventDispatch.hpp + host/RoutedEventDispatch.hpp ClickDetector.cpp ContentControl.cpp @@ -14,7 +14,6 @@ add_library(cru_ui STATIC UiEvent.cpp UiManager.cpp Window.cpp - WindowHost.cpp controls/Button.cpp controls/Container.cpp controls/FlexLayout.cpp @@ -22,6 +21,7 @@ add_library(cru_ui STATIC controls/TextBlock.cpp controls/TextBox.cpp controls/TextControlService.hpp + host/WindowHost.cpp render/BorderRenderObject.cpp render/CanvasRenderObject.cpp render/FlexLayoutRenderObject.cpp @@ -43,7 +43,6 @@ target_sources(cru_ui PUBLIC ${CRU_UI_INCLUDE_DIR}/UiEvent.hpp ${CRU_UI_INCLUDE_DIR}/UiManager.hpp ${CRU_UI_INCLUDE_DIR}/Window.hpp - ${CRU_UI_INCLUDE_DIR}/WindowHost.hpp ${CRU_UI_INCLUDE_DIR}/controls/Base.hpp ${CRU_UI_INCLUDE_DIR}/controls/Button.hpp ${CRU_UI_INCLUDE_DIR}/controls/Container.hpp @@ -51,6 +50,7 @@ target_sources(cru_ui PUBLIC ${CRU_UI_INCLUDE_DIR}/controls/StackLayout.hpp ${CRU_UI_INCLUDE_DIR}/controls/TextBox.hpp ${CRU_UI_INCLUDE_DIR}/controls/TextBlock.hpp + ${CRU_UI_INCLUDE_DIR}/host/WindowHost.hpp ${CRU_UI_INCLUDE_DIR}/render/Base.hpp ${CRU_UI_INCLUDE_DIR}/render/BorderRenderObject.hpp ${CRU_UI_INCLUDE_DIR}/render/CanvasRenderObject.hpp diff --git a/src/ui/Control.cpp b/src/ui/Control.cpp index cae48c66..23a3cef2 100644 --- a/src/ui/Control.cpp +++ b/src/ui/Control.cpp @@ -1,11 +1,10 @@ #include "cru/ui/Control.hpp" -#include "RoutedEventDispatch.hpp" #include "cru/common/Base.hpp" #include "cru/platform/gui/Cursor.hpp" #include "cru/platform/gui/UiApplication.hpp" #include "cru/ui/Base.hpp" -#include "cru/ui/WindowHost.hpp" +#include "cru/ui/host/WindowHost.hpp" #include "cru/ui/render/RenderObject.hpp" #include <memory> @@ -31,7 +30,7 @@ Control::~Control() { for (const auto child : children_) delete child; } -WindowHost* Control::GetWindowHost() const { return window_host_; } +host::WindowHost* Control::GetWindowHost() const { return window_host_; } void Control::TraverseDescendants( const std::function<void(Control*)>& predicate) { @@ -152,7 +151,7 @@ void Control::OnParentChanged(Control* old_parent, Control* new_parent) { CRU_UNUSED(new_parent) } -void Control::OnAttachToHost(WindowHost* host) { CRU_UNUSED(host) } +void Control::OnAttachToHost(host::WindowHost* host) { CRU_UNUSED(host) } -void Control::OnDetachFromHost(WindowHost* host) { CRU_UNUSED(host) } +void Control::OnDetachFromHost(host::WindowHost* host) { CRU_UNUSED(host) } } // namespace cru::ui diff --git a/src/ui/Window.cpp b/src/ui/Window.cpp index 051e67ef..c49140a4 100644 --- a/src/ui/Window.cpp +++ b/src/ui/Window.cpp @@ -1,7 +1,7 @@ #include "cru/ui/Window.hpp" #include "cru/common/Base.hpp" -#include "cru/ui/WindowHost.hpp" +#include "cru/ui/host/WindowHost.hpp" #include "cru/ui/render/Base.hpp" #include "cru/ui/render/StackLayoutRenderObject.hpp" @@ -10,7 +10,7 @@ Window* Window::CreateOverlapped() { return new Window(); } Window::Window() : render_object_(new render::StackLayoutRenderObject()) { render_object_->SetAttachedControl(this); - window_host_ = std::make_unique<WindowHost>(this); + window_host_ = std::make_unique<host::WindowHost>(this); } Window::~Window() {} diff --git a/src/ui/controls/TextControlService.hpp b/src/ui/controls/TextControlService.hpp index 8ad87416..a7e4e440 100644 --- a/src/ui/controls/TextControlService.hpp +++ b/src/ui/controls/TextControlService.hpp @@ -12,7 +12,7 @@ #include "cru/ui/DebugFlags.hpp" #include "cru/ui/ShortcutHub.hpp" #include "cru/ui/UiEvent.hpp" -#include "cru/ui/WindowHost.hpp" +#include "cru/ui/host/WindowHost.hpp" #include "cru/ui/render/CanvasRenderObject.hpp" #include "cru/ui/render/ScrollRenderObject.hpp" #include "cru/ui/render/TextRenderObject.hpp" @@ -136,7 +136,7 @@ class TextControlService : public Object { } platform::gui::IInputMethodContext* GetInputMethodContext() { - WindowHost* host = this->control_->GetWindowHost(); + host::WindowHost* host = this->control_->GetWindowHost(); if (!host) return nullptr; platform::gui::INativeWindow* native_window = host->GetNativeWindow(); if (!native_window) return nullptr; diff --git a/src/ui/RoutedEventDispatch.hpp b/src/ui/host/RoutedEventDispatch.hpp index de94a598..de94a598 100644 --- a/src/ui/RoutedEventDispatch.hpp +++ b/src/ui/host/RoutedEventDispatch.hpp diff --git a/src/ui/WindowHost.cpp b/src/ui/host/WindowHost.cpp index b0908e4f..eac247c1 100644 --- a/src/ui/WindowHost.cpp +++ b/src/ui/host/WindowHost.cpp @@ -1,4 +1,4 @@ -#include "cru/ui/WindowHost.hpp" +#include "cru/ui/host/WindowHost.hpp" #include "RoutedEventDispatch.hpp" #include "cru/common/Logger.hpp" @@ -13,7 +13,7 @@ #include <cstddef> -namespace cru::ui { +namespace cru::ui::host { using platform::gui::INativeWindow; using platform::gui::IUiApplication; diff --git a/src/ui/render/RenderObject.cpp b/src/ui/render/RenderObject.cpp index 09410113..a40ce9b8 100644 --- a/src/ui/render/RenderObject.cpp +++ b/src/ui/render/RenderObject.cpp @@ -3,7 +3,7 @@ #include "cru/common/Logger.hpp" #include "cru/platform/graphics/util/Painter.hpp" #include "cru/ui/DebugFlags.hpp" -#include "cru/ui/WindowHost.hpp" +#include "cru/ui/host/WindowHost.hpp" #include <algorithm> #include <string> @@ -303,7 +303,7 @@ std::u16string RenderObject::GetDebugPathInTree() const { return result; } -void RenderObject::SetWindowHostRecursive(WindowHost* host) { +void RenderObject::SetWindowHostRecursive(host::WindowHost* host) { if (window_host_ != nullptr) { detach_from_host_event_.Raise(nullptr); } |