Refactor new editor state ownership model

This commit is contained in:
2026-04-19 04:36:52 +08:00
parent 48bfde28e3
commit f45b34a03a
46 changed files with 1979 additions and 217 deletions

View File

@@ -27,6 +27,7 @@
namespace XCEngine::UI::Editor::App {
class BuiltInIcons;
class EditorCommandFocusService;
class ProjectPanel final : public EditorEditCommandRoute {
public:
enum class CursorKind : std::uint8_t {
@@ -69,6 +70,7 @@ public:
void Initialize(const std::filesystem::path& repoRoot);
void SetProjectRuntime(EditorProjectRuntime* projectRuntime);
void SetCommandFocusService(EditorCommandFocusService* commandFocusService);
void SetBuiltInIcons(const BuiltInIcons* icons);
void SetTextMeasurer(const ::XCEngine::UI::Editor::UIEditorTextMeasurer* textMeasurer);
void ResetInteractionState();
@@ -205,6 +207,10 @@ private:
const ::XCEngine::UI::UIRect& bounds,
bool allowInteraction,
bool panelActive) const;
void ClaimCommandFocus(
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
const ::XCEngine::UI::UIRect& bounds,
bool allowInteraction);
UIEditorHostCommandEvaluationResult EvaluateAssetCommand(
std::string_view commandId,
std::string_view explicitItemId,
@@ -224,6 +230,7 @@ private:
std::unique_ptr<EditorProjectRuntime> m_ownedProjectRuntime = {};
EditorProjectRuntime* m_projectRuntime = nullptr;
EditorCommandFocusService* m_commandFocusService = nullptr;
const BuiltInIcons* m_icons = nullptr;
const ::XCEngine::UI::Editor::UIEditorTextMeasurer* m_textMeasurer = nullptr;
::XCEngine::UI::Widgets::UISelectionModel m_folderSelection = {};