载入中...
搜索中...
未找到
PcgDraggableWindow.cpp
浏览该文件的文档.
11Result<void> PcgDraggableWindow::configure(float x, float y, float width, float height, float screenWidth,
14 !std::isfinite(screenWidth) || !std::isfinite(screenHeight) || !std::isfinite(scale) || width <= 0 ||
17 Diagnostic::error(DiagnosticCode::InvalidArgument, "invalid draggable-window geometry", "ui.pcgDraggableWindow"));
32 Diagnostic::error(DiagnosticCode::InvalidArgument, "draggable window is not configured", "ui.pcgDraggableWindow"));
34 Diagnostic::error(DiagnosticCode::InvalidArgument, "pointer delta must be finite", "ui.pcgDraggableWindow"));
59 cls.addFunc("configure", [vm](PcgDraggableWindow* self, float x, float y, float width, float height,
67 cls.addFunc("pointerDown", [](PcgDraggableWindow* self, bool middle) { self->pointerDown(middle); });
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Caller-owned state for Pcg's draggable photo-mode window.
Definition PcgDraggableWindow.h:9
Result< void > configure(float x, float y, float width, float height, float screenWidth, float screenHeight, float canvasScale)
Configure geometry and remember the exact reset position atomically.
Definition PcgDraggableWindow.cpp:11
Result< void > drag(float deltaX, float deltaY)
Apply one pointer delta divided by canvas scale and clamp to Pcg bounds.
Definition PcgDraggableWindow.cpp:30
PcgUiRequestStatus consumeBringToFront() noexcept
Consume the request to move the window to the front.
Definition PcgDraggableWindow.cpp:50
void pointerDown(bool middleButtonDown) noexcept
Process pointer-down; middleButtonDown restores the initial position.
Definition PcgDraggableWindow.cpp:42
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:470
Definition Component.cpp:5
void exposePcgDraggableWindowBindings(ssq::Table &table)
Register Pcg draggable-window bindings.
Definition PcgDraggableWindow.cpp:56
PcgUiRequestStatus
Explicit status returned when consuming a one-shot Pcg UI request.
Definition PcgUiStatus.h:4
@ Requested
@ InvalidArgument