Refactor editor windowing and update renderer regression
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#include "Platform/Win32/Windowing/EditorWindowPointerCapture.h"
|
||||
#include "Platform/Win32/Windowing/EditorWindowSession.h"
|
||||
#include "Windowing/Host/EditorWindowHostInterfaces.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@@ -64,7 +64,7 @@ class EditorWindowWorkspaceCoordinator;
|
||||
class EditorWindowSession;
|
||||
struct EditorWorkspaceWindowProjection;
|
||||
|
||||
class EditorWindow {
|
||||
class EditorWindow final : public EditorHostWindow {
|
||||
public:
|
||||
EditorWindow(
|
||||
std::string windowId,
|
||||
@@ -80,25 +80,27 @@ public:
|
||||
EditorWindow(EditorWindow&&) = delete;
|
||||
EditorWindow& operator=(EditorWindow&&) = delete;
|
||||
|
||||
std::string_view GetWindowId() const;
|
||||
std::string_view GetWindowId() const override;
|
||||
HWND GetHwnd() const;
|
||||
bool HasHwnd() const;
|
||||
EditorWindowCategory GetCategory() const;
|
||||
const EditorWindowChromePolicy& GetChromePolicy() const;
|
||||
EditorWindowLifecycleState GetLifecycleState() const;
|
||||
bool IsPrimary() const;
|
||||
bool IsWorkspaceWindow() const;
|
||||
bool IsUtilityWindow() const;
|
||||
bool IsClosing() const;
|
||||
bool IsDestroyed() const;
|
||||
const std::wstring& GetTitle() const;
|
||||
EditorWindowLifecycleState GetLifecycleState() const override;
|
||||
bool IsPrimary() const override;
|
||||
bool IsWorkspaceWindow() const override;
|
||||
bool IsUtilityWindow() const override;
|
||||
bool IsClosing() const override;
|
||||
bool IsDestroyed() const override;
|
||||
bool HasLiveHostWindow() const override;
|
||||
const std::wstring& GetTitle() const override;
|
||||
std::string_view GetCachedTitleText() const;
|
||||
const UIEditorWorkspaceController* TryGetWorkspaceController() const;
|
||||
const EditorWorkspaceWindowProjection* TryGetWorkspaceProjection() const;
|
||||
const UIEditorWorkspaceController* TryGetWorkspaceController() const override;
|
||||
const EditorWorkspaceWindowProjection* TryGetWorkspaceProjection() const override;
|
||||
const UIEditorWorkspaceController& GetWorkspaceController() const;
|
||||
EditorWindowDockHostBinding* TryGetDockHostBinding();
|
||||
const EditorWindowDockHostBinding* TryGetDockHostBinding() const;
|
||||
::XCEngine::UI::UIPoint ConvertScreenPixelsToClientDips(const POINT& screenPoint) const;
|
||||
EditorWindowDockHostBinding* TryGetDockHostBinding() override;
|
||||
const EditorWindowDockHostBinding* TryGetDockHostBinding() const override;
|
||||
::XCEngine::UI::UIPoint ConvertScreenPixelsToClientDips(
|
||||
const EditorWindowScreenPoint& screenPoint) const override;
|
||||
|
||||
private:
|
||||
friend class EditorWindowChromeController;
|
||||
@@ -108,33 +110,39 @@ private:
|
||||
friend class EditorWindowLifecycleCoordinator;
|
||||
friend class EditorWindowWorkspaceCoordinator;
|
||||
|
||||
bool IsRenderReady() const;
|
||||
bool IsRenderReady() const override;
|
||||
bool TryResolveDockTabDragHotspot(
|
||||
std::string_view nodeId,
|
||||
std::string_view panelId,
|
||||
const POINT& screenPoint,
|
||||
POINT& outHotspot) const;
|
||||
const EditorWindowScreenPoint& screenPoint,
|
||||
EditorWindowScreenPoint& outHotspot) const override;
|
||||
bool TryResolveDockTabDropTarget(
|
||||
const POINT& screenPoint,
|
||||
UIEditorDockHostTabDropTarget& outTarget) const;
|
||||
void InvalidateHostWindow() const;
|
||||
const EditorWindowScreenPoint& screenPoint,
|
||||
UIEditorDockHostTabDropTarget& outTarget) const override;
|
||||
void InvalidateHostWindow() const override;
|
||||
|
||||
void AttachHwnd(HWND hwnd);
|
||||
void MarkInitializing();
|
||||
void MarkRunning();
|
||||
void MarkDestroyed();
|
||||
void MarkClosing();
|
||||
void SetPrimary(bool primary);
|
||||
void SetTitle(std::wstring title);
|
||||
void RefreshWorkspaceProjection(EditorWorkspaceWindowProjection projection);
|
||||
void MarkDestroyed() override;
|
||||
void MarkClosing() override;
|
||||
void SetPrimary(bool primary) override;
|
||||
void SetTitle(std::wstring title) override;
|
||||
void ApplyHostWindowTitle() override;
|
||||
void RefreshWorkspaceProjection(EditorWorkspaceWindowProjection projection) override;
|
||||
|
||||
bool Initialize(
|
||||
const std::filesystem::path& repoRoot,
|
||||
EditorContext& editorContext,
|
||||
const std::filesystem::path& captureRoot,
|
||||
bool autoCaptureOnStartup);
|
||||
void Shutdown();
|
||||
void ResetInteractionState();
|
||||
void Shutdown() override;
|
||||
void ResetInteractionState() override;
|
||||
bool TryGetHostScreenRect(EditorWindowScreenRect& outRect) const override;
|
||||
void SetHostScreenPosition(const EditorWindowScreenPoint& screenPoint) override;
|
||||
void FocusHostWindow() override;
|
||||
void PostCloseToHost() override;
|
||||
void DestroyHostWindow() override;
|
||||
|
||||
EditorWindowFrameTransferRequests RenderFrame(
|
||||
EditorContext& editorContext,
|
||||
@@ -156,8 +164,8 @@ private:
|
||||
bool ApplyCurrentCursor() const;
|
||||
bool HasInteractiveCaptureState() const;
|
||||
bool OwnsPointerCapture(EditorWindowPointerCaptureOwner owner) const;
|
||||
void AcquirePointerCapture(EditorWindowPointerCaptureOwner owner);
|
||||
void ReleasePointerCapture(EditorWindowPointerCaptureOwner owner);
|
||||
void AcquirePointerCapture(EditorWindowPointerCaptureOwner owner) override;
|
||||
void ReleasePointerCapture(EditorWindowPointerCaptureOwner owner) override;
|
||||
void ForceReleasePointerCapture();
|
||||
void TryStartImmediateShellPointerCapture(LPARAM lParam);
|
||||
|
||||
@@ -179,6 +187,8 @@ private:
|
||||
::XCEngine::UI::UIRect ResolveWorkspaceBounds(
|
||||
float clientWidthDips,
|
||||
float clientHeightDips) const;
|
||||
static POINT ToNativePoint(const EditorWindowScreenPoint& screenPoint);
|
||||
static EditorWindowScreenPoint FromNativePoint(const POINT& screenPoint);
|
||||
EditorWindowFrameTransferRequests RenderRuntimeFrame(
|
||||
EditorContext& editorContext,
|
||||
bool globalTabDragActive,
|
||||
|
||||
Reference in New Issue
Block a user