Files
XCEngine/editor/app/Platform/Win32/Windowing/EditorWindowMessageDispatcher.h

80 lines
2.3 KiB
C++

#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "Windowing/Frame/EditorWindowTransferRequests.h"
#include <windows.h>
namespace XCEngine::UI::Editor::App {
class EditorWindow;
}
namespace XCEngine::UI::Editor::App {
class EditorWindowHostRuntime;
class EditorWindowLifecycleCoordinator;
class EditorUtilityWindowCoordinator;
class EditorWindowWorkspaceCoordinator;
class EditorWindowMessageDispatcher final {
public:
static bool TryDispatch(
HWND hwnd,
EditorWindowHostRuntime& hostRuntime,
EditorWindowLifecycleCoordinator& lifecycleCoordinator,
EditorUtilityWindowCoordinator& utilityCoordinator,
EditorWindowWorkspaceCoordinator& workspaceCoordinator,
EditorWindow& window,
UINT message,
WPARAM wParam,
LPARAM lParam,
LRESULT& outResult);
private:
struct DispatchContext;
static void FinalizeImmediateFrame(
const DispatchContext& context,
const EditorWindowFrameTransferRequests& transferRequests);
static void FlushQueuedCompletedImmediateFrame(const DispatchContext& context);
static void RenderAndHandleWindowFrame(const DispatchContext& context);
static void DispatchWindowFrameTransferRequests(
const DispatchContext& context,
const EditorWindowFrameTransferRequests& transferRequests);
static bool EnsureTrackingMouseLeave(const DispatchContext& context);
static bool TryHandleChromeHoverConsumption(
const DispatchContext& context,
LPARAM lParam,
LRESULT& outResult);
static bool TryDispatchWindowPointerMessage(
const DispatchContext& context,
UINT message,
WPARAM wParam,
LPARAM lParam,
LRESULT& outResult);
static bool TryDispatchWindowInputMessage(
const DispatchContext& context,
UINT message,
WPARAM wParam,
LPARAM lParam,
LRESULT& outResult);
static bool TryDispatchWindowLifecycleMessage(
const DispatchContext& context,
UINT message,
WPARAM wParam,
LPARAM lParam,
LRESULT& outResult);
static bool TryDispatchWindowChromeMessage(
const DispatchContext& context,
UINT message,
WPARAM wParam,
LPARAM lParam,
LRESULT& outResult);
};
} // namespace XCEngine::UI::Editor::App