feat(new_editor): wire project, inspector, and viewport runtime
This commit is contained in:
58
new_editor/include/XCEditor/App/EditorHostCommandBridge.h
Normal file
58
new_editor/include/XCEditor/App/EditorHostCommandBridge.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/App/EditorEditCommandRoute.h>
|
||||
#include <XCEditor/App/EditorSession.h>
|
||||
#include <XCEditor/Foundation/UIEditorCommandDispatcher.h>
|
||||
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
class EditorHostCommandBridge : public UIEditorHostCommandHandler {
|
||||
public:
|
||||
void BindSession(EditorSession& session);
|
||||
void BindEditCommandRoutes(
|
||||
EditorEditCommandRoute* hierarchyRoute,
|
||||
EditorEditCommandRoute* projectRoute,
|
||||
EditorEditCommandRoute* sceneRoute = nullptr,
|
||||
EditorEditCommandRoute* inspectorRoute = nullptr);
|
||||
void SetExitRequestHandler(std::function<void()> handler);
|
||||
|
||||
UIEditorHostCommandEvaluationResult EvaluateHostCommand(
|
||||
std::string_view commandId) const override;
|
||||
UIEditorHostCommandDispatchResult DispatchHostCommand(
|
||||
std::string_view commandId) override;
|
||||
|
||||
private:
|
||||
UIEditorHostCommandEvaluationResult BuildDisabledResult(
|
||||
std::string_view message) const;
|
||||
UIEditorHostCommandEvaluationResult BuildExecutableResult(
|
||||
std::string_view message) const;
|
||||
UIEditorHostCommandEvaluationResult EvaluateFileCommand(
|
||||
std::string_view commandId) const;
|
||||
UIEditorHostCommandEvaluationResult EvaluateAssetCommand(
|
||||
std::string_view commandId) const;
|
||||
UIEditorHostCommandEvaluationResult EvaluateRunCommand(
|
||||
std::string_view commandId) const;
|
||||
UIEditorHostCommandEvaluationResult EvaluateScriptCommand(
|
||||
std::string_view commandId) const;
|
||||
UIEditorHostCommandEvaluationResult EvaluateEditCommand(
|
||||
std::string_view commandId) const;
|
||||
UIEditorHostCommandDispatchResult DispatchAssetCommand(
|
||||
std::string_view commandId);
|
||||
UIEditorHostCommandDispatchResult DispatchEditCommand(
|
||||
std::string_view commandId);
|
||||
UIEditorHostCommandEvaluationResult EvaluateUnsupportedHostCommand(
|
||||
std::string_view commandId) const;
|
||||
EditorEditCommandRoute* ResolveEditCommandRoute(EditorActionRoute route) const;
|
||||
|
||||
EditorSession* m_session = nullptr;
|
||||
EditorEditCommandRoute* m_hierarchyRoute = nullptr;
|
||||
EditorEditCommandRoute* m_projectRoute = nullptr;
|
||||
EditorEditCommandRoute* m_sceneRoute = nullptr;
|
||||
EditorEditCommandRoute* m_inspectorRoute = nullptr;
|
||||
std::function<void()> m_requestExit = {};
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user