载入中...
搜索中...
未找到
UI.cpp
浏览该文件的文档.
66 if (SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer *>(&self), nullptr)) || !self) return nullptr;
87 if (n < 4 || n > 6) return sq_throwerror(vm, "UI.animateHostPos expects (x, y, durationMs [, ease [, delayMs]])");
94 self->animateHostPos(float(x), float(y), float(durationMs), optionalEase(vm, 5, n), optionalDelay(vm, 6, n));
101 if (n < 4 || n > 6) return sq_throwerror(vm, "UI.animateHostSize expects (w, h, durationMs [, ease [, delayMs]])");
108 self->animateHostSize(float(w), float(h), float(durationMs), optionalEase(vm, 5, n), optionalDelay(vm, 6, n));
116 return sq_throwerror(vm, "UI.animateHostOverlayAlpha expects (alpha, durationMs [, ease [, delayMs]])");
122 self->animateHostOverlayAlpha(float(alpha), float(durationMs), optionalEase(vm, 4, n), optionalDelay(vm, 5, n));
130 return sq_throwerror(vm, "UI.animateItemOpacity expects (id, opacity, durationMs [, ease [, delayMs]])");
137 return sq_throwerror(vm, "UI.animateItemOpacity expects (string id, float opacity, float durationMs)");
138 self->animateItemOpacity(id ? id : "", float(opacity), float(durationMs), optionalEase(vm, 5, n),
147 return sq_throwerror(vm, "UI.animateItemPos expects (id, x, y, durationMs [, ease [, delayMs]])");
152 if (SQ_FAILED(sq_getstring(vm, 2, &id)) || SQ_FAILED(sq_getfloat(vm, 3, &x)) || SQ_FAILED(sq_getfloat(vm, 4, &y)) ||
155 self->animateItemPos(id ? id : "", float(x), float(y), float(durationMs), optionalEase(vm, 6, n),
171 if (SQ_FAILED(sq_getstring(vm, 2, &id))) return sq_throwerror(vm, "UI.cancelItemTweens id must be a string");
176void addOptionalTweenFunc(ssq::Class &cls, const char *name, SQFUNCTION func, SQInteger minParams,
668UIHostHandle UI::findHostByOwner(uint32_t ownerId) const { return UISystem::findHostByOwner(ownerId); }
732UIHostHandle UI::remountAs(const std::string &name, WidgetDesc root) { return mountAs(name, std::move(root)); }
734eve::OptionalRef<UIHost> UI::resolveSelected() const noexcept { return UIHost::resolve(selected_); }
840 if (j == "spacearound" || j == "space-around" || j == "around") return FlexJustify::SpaceAround;
966void UI::addIconButton(const std::string &name, const std::string &label, const std::string &id) {
972void UI::addSameLine(const std::string &id) { currentParent().children.push_back(sameLine(id)); }
1037void UI::addInputText(const std::string &label, const std::string &value, const std::string &id) {
1324 window(host->get().getName().empty() ? "List" : host->get().getName(), {std::move(listNode)}, "root"));
1691void UI::animateHostPos(float x, float y, float durationMs, const std::string &ease, float delayMs) {
1696void UI::animateHostSize(float w, float h, float durationMs, const std::string &ease, float delayMs) {
1701void UI::animateHostOverlayAlpha(float alpha, float durationMs, const std::string &ease, float delayMs) {
1703 tweens_.animateHostOverlayAlpha(selected_, alpha, durationMs, ease, delayMs, uiTweenWallClockMs());
1750void UI::animateItemOpacity(const std::string &id, float opacity, float durationMs, const std::string &ease,
1754 tweens_.animateItemOpacity(selected_, id, opacity, durationMs, ease, delayMs, uiTweenWallClockMs())
1758void UI::animateItemPos(const std::string &id, float x, float y, float durationMs, const std::string &ease,
1780std::string UI::setStyleClassColor(const std::string &name, const std::string &property, float r,
1785std::string UI::setStyleClassMetric(const std::string &name, const std::string &property, float x,
2028 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().canvas;
2037 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().hovered;
2044 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().active;
2051 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().mouseX;
2058 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().mouseY;
2065 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().dragDX;
2072 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().dragDY;
2079 if (auto state = UISystem::viewportState(host->get().getName(), id)) return state->get().wheel;
2151 if (s == "colorPalette" || s == "color-palette" || s == "color") return NodeType::ColorPalette;
2583 entry.set("readOnly", property_access::hasFlag(property.flags, property_access::PropertyFlag::ReadOnly));
2639 eve::Diagnostic::error(eve::DiagnosticCode::NotFound, "database panel is not open", {}, {}, "ui"));
2895 addOptionalTweenFunc(cls, "animateHostOverlayAlpha", sqAnimateHostOverlayAlpha, 3, _SC("xffsf"));
The single Squirrel projection for common Result, Status and Value.
Explicit Value/Owned/Borrowed semantics at the Squirrel boundary.
Owning, renderer-independent dynamic values.
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 Runtime * runtime()
Active runtime associated with the last expose() call, or nullptr. @ownership Borrowed; the embedding...
Definition Module.cpp:292
eve::Result< ResourcePin > pin(Resource *resource)
Keeps one cached resource alive across unload()/clear()/reload.
Definition Resource.cpp:311
void ignore(std::string_view reason={}) const noexcept
Explicitly discard this result after documenting the reason.
Definition Result.h:537
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static constexpr RuntimeHandle fromPacked(std::uint64_t value) noexcept
Reconstructs a handle from an explicit packed boundary value.
Definition RuntimeHandle.h:190
HSQUIRRELVM handle() const noexcept
Raw Squirrel VM handle; nullptr after shutdown.
Definition Runtime.cpp:481
void set(const std::string &key, Value value)
Insert or replace an object member.
Definition Value.cpp:118
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
static Document parse(const std::string &text, std::string *error=nullptr)
Parse.
Definition Json.cpp:581
Adapts one live Squirrel instance to the renderer-independent property model.
Definition ReflectedPropertyModel.h:25
Releases C++-owned Squirrel roots before Runtime destroys its VM.
Definition SquirrelOwnership.h:108
virtual void releaseSquirrelRoots() noexcept=0
Drops every C++-owned Squirrel root this listener still holds.
RAII keep-alive for one RuntimeObjectRegistry entry.
Definition RuntimeRegistry.h:276
T * get() const noexcept
Borrows the pinned object; valid until the pin is released.
Definition RuntimeRegistry.h:317
static ObjectRegistry & instance()
Returns the process-local singleton owned by the UI module.
Definition ObjectRegistry.cpp:45
static UIHostHandle createHost(const std::string &name="")
Creates an ECS-owned UI host.
Definition UIHost.cpp:48
static eve::OptionalRef< UIHost > resolve(UIHostHandle handle) noexcept
Resolves a UI host handle with ECS generation checking.
Definition UIHost.cpp:61
static void setBackend(UIBackend &backend)
Sets the borrowed backend used for the current UI/render lifetime.
Definition UISystem.cpp:1643
static void clearBackend() noexcept
Clears the backend association before the backend is shut down.
Definition UISystem.cpp:1644
static eve::OptionalRef< ViewportState > viewportState(const std::string &hostName, const std::string &nodeId)
Returns viewport state for a host/node key when it exists.
Definition UISystem.cpp:1684
static void enqueuePlatformFileDrop(const std::string &path)
Copies an OS file-drop path into UI-owned pending state.
Definition UISystem.cpp:1631
static std::string consumeChange()
Pop next change as "name/node"; empty if none.
Definition UISystem.cpp:1912
static UIHostHandle findHost(const std::string &name)
Lookup by Meta.name across the UIHost View.
Definition UISystem.cpp:1691
static eve::ResultRef< ViewportState > ensureViewport(const std::string &key, int w, int h)
Creates or refreshes offscreen state for a viewport key.
Definition UISystem.cpp:1651
static DragDropSupport dragDropSupport() noexcept
Returns retained drag-and-drop availability for this build target.
Definition UISystem.cpp:1622
static std::string consumeClick()
Pop next click as "name/node"; empty if none.
Definition UISystem.cpp:1894
static UIHostHandle findHostByOwner(uint32_t ownerId)
Find the first host with Meta.ownerId equal to ownerId, or null.
Definition UISystem.cpp:1703
static std::optional< UIDrop > consumeDrop()
Pops the oldest completed drop, or returns empty when none exists.
Definition UISystem.cpp:1636
bool inspectSelectClass(const std::string &name)
Selects a class in the inspector (creates its first instance).
Definition UI.cpp:2457
void addCombo(const std::string &label, const std::string &options, int selected, const std::string &id="")
Adds combo.
Definition UI.cpp:1023
void setHostWorldAnchor(float x, float y, float z)
Projects the selected host from a 3D world point through the active Camera3D.
Definition UI.cpp:1602
void addSectionHeader(const std::string &label, const std::string &id="")
Adds a non-collapsible section heading.
Definition UI.cpp:1054
void setItemTheme(const std::string &theme)
Overrides the last item's subtree theme: "inherit", "dark", or "light".
Definition UI.cpp:1198
void setItemDragSource(const std::string &payloadType, const std::string &payloadText)
Marks the most recently added item as a desktop drag source.
Definition UI.cpp:1161
bool setImageNinePatchFile(const std::string &id, const std::string &path)
Applies a .9.png texture and its parsed stretch metadata to an image.
Definition UI.cpp:1471
bool wantCaptureKeyboard() const
True when the UI wants to capture keyboard input this frame.
Definition UI.cpp:662
uint64_t registerTexture(graphics::Texture *tex)
Register an engine texture for UI drawing.
Definition UI.cpp:1411
std::string consumeClick()
Returns the id of the clicked widget since the last frame (or "").
Definition UI.cpp:1706
void setItemFlexShrink(float shrink)
Sets shrink weight on the most recently added flex item.
Definition UI.cpp:1073
UIHostHandle mount(WidgetDesc root)
Mounts the tree as an auto-named host and selects it.
Definition UI.cpp:712
void setThemeScope(const std::string &theme)
Overrides the current open container's inherited subtree theme.
Definition UI.cpp:1203
void setColor(const std::string &id, float r, float g, float b, float a=1.f)
Sets RGBA on a ColorPalette (or image tint) node.
Definition UI.cpp:1362
void animateHostOverlayAlpha(float alpha, float durationMs, const std::string &ease="smoothstep", float delayMs=0.f)
Animate the selected host's overlay background alpha.
Definition UI.cpp:1701
void setImageTextureId(const std::string &id, uint64_t textureId)
Sets the image texture id.
Definition UI.cpp:1405
void setHostPos(float x, float y, float pivotX=0.f, float pivotY=0.f)
Positions the host window with a pivot (0..1 each axis).
Definition UI.cpp:1591
bool editorSelectPanel(const std::string &name)
Shows one docked panel ("inspector"/"database"; "" hides all).
Definition UI.cpp:2667
bool inspectPickScene()
Calls the pick handler and inspects the returned object.
Definition UI.cpp:2525
std::size_t getItemTweenCount() const
Number of pending item tweens (diagnostics / tests).
Definition UI.cpp:596
void dispatchEvents()
Dispatches queued widget callbacks (click/toggle/value/text).
Definition UI.cpp:598
void setItemFocusMode(const std::string &mode)
Sets the last item's focus mode: "none", "click", or "all".
Definition UI.cpp:1188
void bindOwner(uint32_t ownerId)
Binds the selected host to a UI/scene owner id.
Definition UI.cpp:677
void addText(const std::string &content, const std::string &id="")
Adds a text label to the current container.
Definition UI.cpp:946
void setImageCornerRadius(const std::string &id, float radius)
Sets the image corner radius.
Definition UI.cpp:1399
std::string getHostWorldState() const
Returns the selected host projection state as a stable lowercase name.
Definition UI.cpp:1642
void processEvent(const SDL_Event *event)
Feeds an SDL event into the UI backend (before window/game handling).
Definition UI.cpp:574
bool inspectOpen()
Opens the auto-generated inspector (scans reflected classes).
Definition UI.cpp:2440
std::string getDropSource() const
Returns the source as "host/node", or empty for an OS file.
Definition UI.cpp:1734
void componentOnClick(uint64_t owner, const std::string &id, ssq::Function fn)
Internal UIComponent callback registration scoped to one component owner.
Definition UI.cpp:636
void animateHostSize(float w, float h, float durationMs, const std::string &ease="smoothstep", float delayMs=0.f)
Animate the selected host's explicit window size (px).
Definition UI.cpp:1696
void setItemFlexBasis(float basis)
Sets its main-axis basis; negative restores automatic measurement.
Definition UI.cpp:1078
bool sceneSetPickHandler(ssq::Function fn)
Registers the script callback for the scene panel Pick button. The callback (stored as eve....
Definition UI.cpp:2688
void addSpacer(const std::string &id="", float grow=1.f)
Flexible empty space inside Flex (default grow=1).
Definition UI.cpp:1063
void addImage(const std::string &id="", float width=0.f, float height=0.f)
Adds image.
Definition UI.cpp:996
void setNavKeyboard(bool enabled)
Enables/disables keyboard navigation support.
Definition UI.cpp:1792
void unregisterTexture(uint64_t textureId)
Release a texture id previously returned by registerTexture().
Definition UI.cpp:1418
float getColorR(const std::string &id) const
ColorPalette / image tint channels; missing nodes return 0.
Definition UI.cpp:1436
void setHostWorldOverlap(bool enabled, int priority=0, float padding=4.f, float maxDisplacement=96.f)
Configures deterministic overlap avoidance for projected hosts.
Definition UI.cpp:1630
UIHostHandle findHostByOwner(uint32_t ownerId) const
Finds the host bound to an owner id, or null when absent.
Definition UI.cpp:668
void addIcon(const std::string &name, const std::string &id="")
Adds a semantic icon by name (for example "search" or "save").
Definition UI.cpp:960
void setLayoutOverflow(const std::string &overflow)
Sets overflow behavior: visible, clip, or scroll.
Definition UI.cpp:1270
bool setListItems(const std::string &listId, const std::vector< std::string > &items)
Replace children of a Group listId with buttons for each label (reconcile). Host must already exist a...
Definition UI.cpp:1317
UIHostHandle remountReconcile(WidgetDesc root)
Remount with key reconcile (props-only when structure matches).
Definition UI.cpp:726
void setItemAspectRatio(float ratio)
Sets width/height ratio on the most recently added item.
Definition UI.cpp:1089
void setItemFlexGrow(float grow)
Set flex item props on the most recently added child of the current open container....
Definition UI.cpp:1067
void beginWindow(const std::string &title, const std::string &id="root")
Opens a window for the current build pass.
Definition UI.cpp:749
void setItemAccessibility(const std::string &role, const std::string &name, const std::string &description="")
Sets the last item's accessibility role, name and description.
Definition UI.cpp:1236
bool remountBuildAs(const std::string &name)
Like mountBuildAs but reconciles by key when possible.
Definition UI.cpp:1304
eve::Result< void > dbUnregister(uint64_t id)
Removes an entry from the database grid using its packed handle.
Definition UI.cpp:2636
void beginFlex(const std::string &direction="row", const std::string &id="", float gap=-1.f)
Begin a Flex container.
Definition UI.cpp:905
void addInputText(const std::string &label, const std::string &value, const std::string &id="")
Adds an editable text field.
Definition UI.cpp:1037
void setHostMovable(bool movable)
Allows or prevents user movement after the initial position.
Definition UI.cpp:1583
void tickTweens(double nowMs)
Advance pending UI tweens using an explicit clock (ms).
Definition UI.cpp:592
void setItemSelected(bool selected)
Marks the most recently added button as the selected tool/action.
Definition UI.cpp:1183
bool editorOpen()
Opens the menu bar and docks the inspector + database panels.
Definition UI.cpp:2646
void addViewport(const std::string &id, float width=0.f, float height=0.f)
Adds viewport.
Definition UI.cpp:1019
void addImageButton(const std::string &id, float width, float height)
Adds image button.
Definition UI.cpp:1015
UIHostHandle findHost(const std::string &name) const
Finds a host by name, or null when absent.
Definition UI.cpp:666
void addSearchField(const std::string &hint, const std::string &value="", const std::string &id="")
Adds a compact search field.
Definition UI.cpp:1041
void beginToolbox(const std::string &id="", float cellSize=0.f, int columns=0)
Opens a wrapping editor tool grid.
Definition UI.cpp:797
void beginGroup(const std::string &id="")
Opens a group container in the current build pass.
Definition UI.cpp:754
void cancelItemTweens(const std::string &id="")
Cancel pending item tweens on the selected host.
Definition UI.cpp:1770
std::string setStyleClassColor(const std::string &name, const std::string &property, float r, float g, float b, float a=1.f)
Sets a named class color token and returns a stable status string.
Definition UI.cpp:1780
void beginCollapsing(const std::string &label, const std::string &id="", bool open=true)
Opens a collapsible header.
Definition UI.cpp:758
bool setTheme(const std::string &name)
Named preset: "dark" / "light" (case-insensitive). Returns false if unknown.
Definition UI.cpp:1742
void setHostResizable(bool resizable)
Allows or prevents user resizing after the initial size.
Definition UI.cpp:1587
void setItemAbsolute(float anchorX, float anchorY, float x=0.f, float y=0.f)
Sets the item absolute.
Definition UI.cpp:1145
UIHostHandle mountAs(const std::string &name, WidgetDesc root)
Creates/replaces a named host from a WidgetDesc tree and selects it.
Definition UI.cpp:697
void beginGrid(int columns, const std::string &id="", float columnGap=-1.f, float rowGap=-1.f)
Begins a fixed-column grid container.
Definition UI.cpp:915
bool select(const std::string &name)
Selects a named host; false when it does not exist.
Definition UI.cpp:670
void addIconButton(const std::string &name, const std::string &label="", const std::string &id="")
Adds a semantic icon button with an optional visible label.
Definition UI.cpp:966
std::string getAccessibilitySnapshot() const
JSON accessibility snapshot for semantically named nodes in the selected tree.
Definition UI.cpp:1837
std::string getDropType() const
Returns the payload type of the last successfully consumed drop.
Definition UI.cpp:1730
UIHostHandle remountAs(const std::string &name, WidgetDesc root)
Creates/replaces a named host (does not select it).
Definition UI.cpp:732
void setItemFocusNeighbors(const std::string &left, const std::string &right, const std::string &up, const std::string &down)
Sets explicit directional focus neighbors on the last item.
Definition UI.cpp:1226
void beginColumn(const std::string &id="", float gap=-1.f)
Opens a column flex container.
Definition UI.cpp:913
void setItemSize(float width, float height)
Sets width/height on the most recently added child.
Definition UI.cpp:1099
void setHostModal(bool modal)
Marks the host as a modal (blocks other hosts) / overlay.
Definition UI.cpp:1571
void addCheckbox(const std::string &label, bool checked, const std::string &id="")
Adds a checkbox.
Definition UI.cpp:978
bool inspectRefresh()
Re-scans script classes; true when any class is reflected.
Definition UI.cpp:2451
bool dbSelectClass(const std::string &name)
Selects the class shown in the grid.
Definition UI.cpp:2614
void beginBuild()
Imperative builder: open a new build pass (see beginWindow etc.).
Definition UI.cpp:736
void addSlider(const std::string &label, float value, float minV, float maxV, const std::string &id="")
Adds a slider.
Definition UI.cpp:982
void setFlexAlign(const std::string &align)
Set Flex container align/justify on the current open Flex (no-op otherwise).
Definition UI.cpp:1245
bool moveFocus(const std::string &direction)
Moves focus by "next", "previous", "left", "right", "up", or "down".
Definition UI.cpp:1551
void addProgress(float fraction, const std::string &id="", const std::string &overlay="")
Adds a progress bar.
Definition UI.cpp:992
void addSwitch(const std::string &label, bool checked, const std::string &id="")
Adds a modern boolean switch.
Definition UI.cpp:1046
uint64_t dbRegister(ssq::Object object, const std::string &label)
Registers a live script object in the database grid.
Definition UI.cpp:2620
std::string defineStyleClass(const std::string &name, const std::string &parent="")
Declares/replaces a named style class and returns a stable status string.
Definition UI.cpp:1746
void setHostWorldDistanceScale(bool enabled, float referenceDistance=10.f, float minScale=0.65f, float maxScale=1.25f)
Configures distance scaling.
Definition UI.cpp:1619
std::string dragDropSupport() const
Returns "supported" on desktop builds and "unsupported-platform" elsewhere.
Definition UI.cpp:1710
void setStyleScope(const std::string &name)
Applies a named style class to the current open container.
Definition UI.cpp:1212
void animateItemPos(const std::string &id, float x, float y, float durationMs, const std::string &ease="smoothstep", float delayMs=0.f)
Animate one node's absolute placement offset (marks the node absolute).
Definition UI.cpp:1758
std::string getFocusedId() const
Returns the focused control id, or an empty string.
Definition UI.cpp:1558
void setItemGridColumnSpan(int span)
Sets the grid-column span of the most recently added item.
Definition UI.cpp:1094
void beginStatusBar(const std::string &id="")
Opens a compact horizontal status strip.
Definition UI.cpp:805
graphics::Canvas * viewportCanvas(const std::string &id)
Returns the offscreen render target of a selected-host Viewport widget.
Definition UI.cpp:2024
uint64_t dbCreateInstance()
Creates and registers an instance of the selected class.
Definition UI.cpp:2628
void setImageUv(const std::string &id, float u0, float v0, float u1, float v1)
Sets the image uv.
Definition UI.cpp:1377
ssq::Object propertySchema(ssq::Object instance)
Return the reflection-derived PropertySchema for a live script instance.
Definition UI.cpp:2566
void clearHostWorldAnchor()
Returns the selected host to ordinary screen-space placement.
Definition UI.cpp:1606
void addTextWrapped(const std::string &content, float width, const std::string &id="")
Adds text wrapped.
Definition UI.cpp:950
void setItemTooltip(const std::string &text)
Sets hover help on the most recently added item.
Definition UI.cpp:1155
bool beginNinePatch(const std::string &path, const std::string &id="", float width=0.f, float height=0.f)
Opens a stretchable .9.png panel; false means the asset is invalid.
Definition UI.cpp:768
void setText(const std::string &id, const std::string &text)
Widget state setters/getters on the current host (by node id).
Definition UI.cpp:1332
void addMenuItem(const std::string &label, const std::string &shortcut="", const std::string &id="")
Adds a selectable menu command.
Definition UI.cpp:1058
void beginList(const std::string &id)
Opens a list container (rows added with addListItem).
Definition UI.cpp:756
void beginChild(const std::string &id, float width=0.f, float height=120.f)
Opens a sized child region.
Definition UI.cpp:762
void addBadge(const std::string &label, const std::string &id="")
Adds a compact status/category badge.
Definition UI.cpp:1050
float getHostWorldScreenY() const
Returns the selected host's derived screen Y coordinate.
Definition UI.cpp:1661
bool requestFocus(const std::string &id)
Requests keyboard/gamepad focus for a mounted control.
Definition UI.cpp:1546
void setItemMouseFilter(const std::string &filter)
Sets the last item's pointer filter: "stop", "pass", or "ignore".
Definition UI.cpp:1193
bool addNinePatch(const std::string &path, const std::string &id="", float width=0.f, float height=0.f)
Adds a .9.png image after removing its one-pixel marker frame.
Definition UI.cpp:1000
void setImageNinePatch(const std::string &id, float l, float t, float r, float b)
Sets the image nine patch.
Definition UI.cpp:1388
void setEnabled(const std::string &id, bool enabled)
Enables or disables a mounted control.
Definition UI.cpp:1346
void setImageTint(const std::string &id, float r, float g, float b, float a=1.f)
Sets the image tint.
Definition UI.cpp:1366
void beginSplitPane(const std::string &direction="row", float ratio=0.25f, const std::string &id="")
Opens a two-child resizable split pane.
Definition UI.cpp:922
std::string getDropText() const
Returns the owning payload text of the last successfully consumed drop.
Definition UI.cpp:1732
void animateHostPos(float x, float y, float durationMs, const std::string &ease="smoothstep", float delayMs=0.f)
Animate the selected host's window position (px).
Definition UI.cpp:1691
void releaseSquirrelRoots() noexcept
Drops database-panel Squirrel roots while the Runtime VM is alive.
Definition UI.cpp:541
bool inspectObject(ssq::Object object)
Inspects a caller-provided live script instance.
Definition UI.cpp:2464
void beginToolbar(const std::string &id="")
Opens a horizontal editor command strip.
Definition UI.cpp:795
std::string consumeChange()
Returns the id of the changed widget since the last frame (or "").
Definition UI.cpp:1708
bool inspectAddInstance()
Creates another instance of the selected inspector class.
Definition UI.cpp:2534
void setHostOverlayAlpha(float alpha)
Sets overlay opacity (0..1); zero also removes the host border and outer padding.
Definition UI.cpp:1579
void beginScrollList(const std::string &id="", float height=0.f, float itemHeight=0.f)
Begins scroll list.
Definition UI.cpp:807
void setHostWorldEdgePolicy(const std::string &policy, float safeMargin=8.f)
Configures off-screen handling and safe-edge margin.
Definition UI.cpp:1610
void addColorPalette(const std::string &label, float r, float g, float b, float a=1.f, const std::string &id="")
Adds a color palette (ColorEdit + swatch grid). RGBA is stored on the node tint; read back with getCo...
Definition UI.cpp:987
void setValueText(const std::string &id, const std::string &value)
Sets the value text.
Definition UI.cpp:1358
std::string setStyleClassMetric(const std::string &name, const std::string &property, float x, float y=0.f)
Sets a named class metric token and returns a stable status string.
Definition UI.cpp:1785
std::size_t getHostTweenCount() const
Number of pending host tweens (diagnostics / tests).
Definition UI.cpp:594
void mountSimple(const std::string &title, const std::string &labelText, const std::string &buttonText)
One-shot convenience: a window with a label and a button.
Definition UI.cpp:2433
std::string getDropOrigin() const
Returns "internal", "os-file", or an empty string.
Definition UI.cpp:1736
void beginRow(const std::string &id="", float gap=-1.f)
Opens a row flex container.
Definition UI.cpp:911
void componentClearHandlers(uint64_t owner)
Removes every callback owned by one UIComponent; idempotent on the UI thread.
Definition UI.cpp:651
void setFlexWrap(bool wrap)
Enables or disables line wrapping on the current Flex.
Definition UI.cpp:1264
bool wantCaptureMouse() const
True when the UI wants to capture mouse input this frame.
Definition UI.cpp:658
void addButton(const std::string &label, const std::string &id="")
Adds a button to the current container.
Definition UI.cpp:956
void beginMenu(const std::string &label, const std::string &id="")
Opens a popup menu.
Definition UI.cpp:791
bool mountBuildAs(const std::string &name)
Finishes the build pass and mounts as a named host.
Definition UI.cpp:1295
bool inspectSetPickHandler(ssq::Function fn)
Registers the script callback used by the inspector Pick button. The callback is stored on the script...
Definition UI.cpp:2471
void setItemEnabled(bool enabled)
Enables or disables the most recently added item.
Definition UI.cpp:1178
void setFlexJustify(const std::string &justify)
Sets Flex container justify on the current open Flex.
Definition UI.cpp:1251
void beginSidebar(const std::string &id="", float width=0.f)
Opens a vertical editor side panel.
Definition UI.cpp:801
std::string consumeDrop()
Pops one drop and returns its target as "host/node", or an empty string.
Definition UI.cpp:1716
void setItemStyleClass(const std::string &name)
Applies a named style class to the most recently added item.
Definition UI.cpp:1207
void addListItem(const std::string &label, const std::string &id="")
Append one list row button (call inside beginList).
Definition UI.cpp:1276
void setLayoutGaps(float columnGap, float rowGap)
Sets independent column and row gaps on the current Flex/Grid.
Definition UI.cpp:1257
void componentOnChange(uint64_t owner, const std::string &id, ssq::Function fn)
Internal UIComponent value callback registration scoped to one component owner.
Definition UI.cpp:643
void animateItemOpacity(const std::string &id, float opacity, float durationMs, const std::string &ease="smoothstep", float delayMs=0.f)
Smoothly animates one retained node's transient opacity without rebuilding its tree.
Definition UI.cpp:1750
void setItemTabIndex(int index)
Sets the last item's sequential focus order; negative excludes it.
Definition UI.cpp:1214
void setItemAlignSelf(const std::string &align)
Sets its cross-axis alignment: inherit, start, center, end, or stretch.
Definition UI.cpp:1083
void setItemDropTarget(const std::string &acceptedType)
Marks the most recently added item as a desktop drop target.
Definition UI.cpp:1170
void setItemFocusOrder(const std::string &previous, const std::string &next)
Sets explicit previous and next focus neighbors on the last item.
Definition UI.cpp:1219
float getHostWorldScreenX() const
Returns the selected host's derived screen X coordinate.
Definition UI.cpp:1656
std::string getLayoutDiagnostics() const
JSON diagnostics for measured size and overflow of the selected retained tree.
Definition UI.cpp:1820
void animateHostSize(UIHostHandle host, float w, float h, float durationMs, const std::string &ease, float delayMs, double nowMs)
Animate selected-host explicit window size.
Definition UiTween.cpp:216
void cancelItem(UIHostHandle host, const std::string &id={})
Cancel every pending item tween for host + id (empty id = all items).
Definition UiTween.cpp:340
std::size_t hostTweenCount() const noexcept
Number of pending host tweens (tests / diagnostics).
Definition UiTween.h:166
eve::Result< void > animateItemPos(UIHostHandle host, const std::string &id, float x, float y, float durationMs, const std::string &ease, float delayMs, double nowMs)
Animate one absolute node's placement offset.
Definition UiTween.cpp:297
void cancelHost(UIHostHandle host)
Cancel every pending host tween for host.
Definition UiTween.cpp:334
eve::Result< void > animateItemOpacity(UIHostHandle host, const std::string &id, float opacity, float durationMs, const std::string &ease, float delayMs, double nowMs)
Animate one node's transient opacity.
Definition UiTween.cpp:265
void animateHostOverlayAlpha(UIHostHandle host, float alpha, float durationMs, const std::string &ease, float delayMs, double nowMs)
Animate selected-host overlay background alpha.
Definition UiTween.cpp:243
std::size_t itemTweenCount() const noexcept
Number of pending item tweens (tests / diagnostics).
Definition UiTween.h:169
void animateHostPos(UIHostHandle host, float x, float y, float durationMs, const std::string &ease, float delayMs, double nowMs)
Animate selected-host window position.
Definition UiTween.cpp:189
SDL2 desktop/mobile implementation of eve::window::Window.
Definition Window.h:16
char * encode(std::string format, const char *src, size_t srclen, size_t &dstlen, size_t linelen)
Encodes raw bytes (e.g. hex / base64) into a text buffer.
Definition DataModule.cpp:204
char * decode(std::string format, const char *src, size_t srclen, size_t &dstlen)
Decodes a text buffer (hex / base64) back into raw bytes.
Definition DataModule.cpp:212
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:26
Result< std::string > stringify(const eve::Value &value)
Serialize the canonical owning Value as deterministic compact JSON.
Definition Json.cpp:563
constexpr bool hasFlag(PropertyFlag value, PropertyFlag flag)
True when flag.
Definition PropertyAccess.h:60
PropertyKind
Semantic property kind used by renderer-independent presenters.
Definition PropertyAccess.h:19
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
WidgetDesc collapsingHeader(std::string label, std::vector< WidgetDesc > children, std::string id, bool defaultOpen)
Collapsible header containing child widgets.
Definition Widget.cpp:623
void exposePcgScreenshotSavedNoticeBindings(ssq::Table &t)
Register Pcg screenshot-notice bindings.
Definition PcgScreenshotSavedNotice.cpp:10
StyleClassStatus defineStyleClass(const std::string &name, const std::string &parent)
Declares or replaces one sparse style class. @thread UI thread only. @reentrancy Does not invoke call...
Definition Theme.cpp:82
WidgetDesc menuItem(std::string label, std::string shortcut, std::string id, std::function< void()> onClick, bool selected)
Selectable menu command with an optional shortcut hint.
Definition Widget.cpp:550
void exposePcgPhotoModePanelsBindings(ssq::Table &t)
Register Pcg photo-mode panel bindings.
Definition PcgPhotoModePanels.cpp:11
void registerEditorHostCapabilities()
Registers editor host capabilities.
Definition EditorHostCapabilities.cpp:79
void exposePcgColorPreviewSyncBindings(ssq::Table &table)
Register Pcg color-preview bindings.
Definition PcgColorPreviewSync.cpp:17
@ OperatingSystemFile
void exposePcgPhotoModeSessionBindings(ssq::Table &table)
Register Pcg photo-mode session bindings.
Definition PcgPhotoModeSession.cpp:80
@ Supported
WidgetDesc badge(std::string label, std::string id)
Compact status/category pill. Tint controls its background color.
Definition Widget.cpp:489
void exposePcgTooltipBindings(ssq::Table &t)
Register Pcg tooltip bindings.
Definition PcgTooltip.cpp:14
WidgetDesc checkbox(std::string label, bool checked, std::string id, std::function< void(bool)> onToggle)
Checkbox with a label; fires onToggle.
Definition Widget.cpp:353
@ None
const std::string & globalThemeName()
Current preset name: "dark", "light", or "custom".
Definition Theme.cpp:279
WidgetDesc combo(std::string label, std::vector< std::string > options, int selected, std::string id, std::function< void(float)> onValue)
Combo.
Definition Widget.cpp:405
WidgetDesc statusBar(std::vector< WidgetDesc > children, std::string id)
Compact horizontal status strip; Spacer children absorb free width.
Definition Widget.cpp:596
WidgetDesc slider(std::string label, float value, float minV, float maxV, std::string id, std::function< void(float)> onValue)
Horizontal slider; fires onValue.
Definition Widget.cpp:365
void exposePcgDraggableWindowBindings(ssq::Table &table)
Register Pcg draggable-window bindings.
Definition PcgDraggableWindow.cpp:56
@ NoWrap
@ Wrap
@ Column
void exposePcgPhotoModeValuesBindings(ssq::Table &t)
Register complete Pcg photo-mode value bindings.
Definition PcgPhotoModeValues.cpp:156
void clearStyleClasses()
Clears user-defined style classes. Intended for runtime/test teardown.
Definition Theme.cpp:160
@ Ignore
WidgetDesc imageButton(std::string id, float width, float height, std::function< void()> onClick)
Image button.
Definition Widget.cpp:432
WidgetDesc inputText(std::string label, std::string value, std::string id, std::function< void(const std::string &)> onChange)
Editable text field; fires onTextChange.
Definition Widget.cpp:453
bool setThemeByName(const std::string &name)
Apply a named preset ("dark" / "light"). Case-insensitive. Returns false if unknown.
Definition Theme.cpp:288
void setThemeUiScale(float scale)
Logical (point-space) UI scale. Default 1.0.
Definition Theme.cpp:301
void exposePcgLoadingScreenBindings(ssq::Table &table)
Register Pcg loading-screen bindings.
Definition PcgLoadingScreen.cpp:116
WidgetDesc window(std::string title, std::vector< WidgetDesc > children, std::string id)
Top-level window widget with a title bar.
Definition Widget.cpp:292
bool parseNinePatch(const image::ImageData &source, NinePatchInfo &out, std::string *error)
Parse a raw, uncompiled Android .9.png image.
Definition NinePatch.cpp:55
void bindUIEventSinkOwner(UI *owner) noexcept
Bind the live UI module into the platform event sink. @ownership Borrowed; cleared when the UI module...
Definition EventSink.cpp:39
WidgetDesc spacer(std::string id, float grow)
Flexible empty space; default flexGrow=1 so it absorbs free space in a Flex parent.
Definition Widget.cpp:697
void exposePcgPhotoModeColorPickerBindings(ssq::Table &t)
Register Pcg photo-mode color-picker bindings.
Definition PcgPhotoModeColorPicker.cpp:14
WidgetDesc child(std::string id, std::vector< WidgetDesc > children, float width, float height)
Scrollable child region with an explicit size.
Definition Widget.cpp:635
@ InputText
@ Group
@ Separator
@ ImageButton
@ Flex
@ ScrollList
@ Card
@ Sidebar
@ Slider
@ NinePatchPanel
@ SameLine
@ Badge
@ Progress
@ Checkbox
@ Grid
@ Spacer
@ ColorPalette
@ Toolbox
@ Button
@ Viewport
@ SplitPane
@ Text
@ Child
@ MenuBar
@ Menu
@ Switch
@ Image
@ Window
@ MenuItem
@ SearchField
@ SectionHeader
@ Combo
@ Toolbar
@ StatusBar
@ CollapsingHeader
FocusDirection
Logical focus movement understood by keyboard, gamepad and automation.
Definition UIHost.h:82
@ Previous
StyleClassStatus setStyleClassMetric(const std::string &name, const std::string &property, float x, float y)
Sets padding, rounding, or alpha on an existing style class.
Definition Theme.cpp:128
WidgetDesc toolbar(std::vector< WidgetDesc > children, std::string id)
Horizontal editor command strip; Spacer children absorb free width.
Definition Widget.cpp:563
WidgetDesc menu(std::string label, std::vector< WidgetDesc > children, std::string id)
Popup menu container used inside a MenuBar or another Menu.
Definition Widget.cpp:540
@ Click
@ None
WidgetDesc progress(float fraction, std::string id, std::string overlay)
Progress bar; fraction is clamped to [0,1].
Definition Widget.cpp:395
@ Center
@ Start
@ SpaceAround
@ SpaceBetween
bool iconFromName(std::string_view name, Icon *out)
Resolves a semantic icon name; accepts kebab-case names case-insensitively.
Definition Icons.cpp:90
const char * styleClassStatusName(StyleClassStatus status)
Stable script-facing spelling of a mutation status.
Definition Theme.cpp:162
WidgetDesc colorPalette(std::string label, float r, float g, float b, float a, std::string id, std::function< void(float)> onValue)
Color editor with a swatch grid (调色板). RGBA is stored in tint channels. valueText may list extra swat...
Definition Widget.cpp:379
WidgetDesc ninePatchPanel(std::vector< WidgetDesc > children, std::string id, uint64_t textureId)
Stretchable textured container with asset-defined content padding.
Definition Widget.cpp:511
void exposeParentScalerBindings(ssq::Table &table)
Register ParentScaler value types and evaluator with the root script table.
Definition ParentScalerBindings.cpp:9
void exposePcgPhotoModeRangesBindings(ssq::Table &t)
Register Pcg photo-mode range bindings.
Definition PcgPhotoModeRanges.cpp:73
WidgetDesc iconButton(Icon value, std::string label, std::string id, std::function< void()> onClick)
Button containing a semantic icon and optional visible label.
Definition Widget.cpp:323
std::unique_ptr< image::ImageData > stripNinePatchBorder(const image::ImageData &source)
Copy the drawable interior of a parsed .9.png without marker pixels.
Definition NinePatch.cpp:109
WidgetDesc grid(int columns, std::vector< WidgetDesc > children, std::string id)
Fixed-column grid; children are placed in source order.
Definition Widget.cpp:687
@ Light
@ Inherit
void exposePcgPhotoModeRuntimeUIBindings(ssq::Table &table)
Register Pcg photo-mode runtime UI bindings.
Definition PcgPhotoModeRuntimeUI.cpp:70
WidgetDesc listButtons(std::string listId, const std::vector< std::string > &items)
Default list: one Button per item, id = listId + "/" + index.
Definition Widget.cpp:728
WidgetDesc searchField(std::string hint, std::string value, std::string id, std::function< void(const std::string &)> onChange)
Compact search field with placeholder text and a bundled search icon.
Definition Widget.cpp:465
WidgetDesc button(std::string label, std::string id, std::function< void()> onClick)
Clickable button; fires onClick.
Definition Widget.cpp:311
WidgetDesc flex(FlexDirection direction, std::vector< WidgetDesc > children, std::string id)
Elastic layout container (row/column). Prefer row / column shorthands.
Definition Widget.cpp:669
WidgetDesc toggleSwitch(std::string label, bool checked, std::string id, std::function< void(bool)> onToggle)
Modern boolean toggle; fires onToggle when changed.
Definition Widget.cpp:477
WidgetDesc sidebar(std::vector< WidgetDesc > children, std::string id, float width)
Vertical editor side panel. Width defaults to 240 logical pixels.
Definition Widget.cpp:586
double uiTweenWallClockMs()
Wall-clock milliseconds from steady_clock (presentation clock).
Definition UiTween.cpp:115
WidgetDesc card(std::vector< WidgetDesc > children, std::string id)
Bordered surface container with editor-friendly padding.
Definition Widget.cpp:502
@ Scroll
@ Visible
@ BehindCamera
@ Crowded
@ OutsideViewport
@ Disabled
@ NoCamera
@ Visible
@ Center
@ Start
@ Stretch
std::unique_ptr< UIBackend > createImGuiBackend()
Default backend: Dear ImGui + SDL + Vulkan (see ui/imgui/).
Definition ImGuiBackend.cpp:167
WidgetDesc toolbox(std::vector< WidgetDesc > children, std::string id, float cellSize, int columns)
Wrapping grid of editor tools with uniform square cells.
Definition Widget.cpp:574
WidgetDesc scrollList(std::string id, std::vector< WidgetDesc > children, float height, float itemHeight)
Scroll list.
Definition Widget.cpp:646
WidgetDesc sectionHeader(std::string label, std::string id)
Non-collapsible editor section heading with an accent marker.
Definition Widget.cpp:522
void exposePcgControllerSelectionBindings(ssq::Table &t)
Register Pcg controller-selection bindings.
Definition PcgControllerSelection.cpp:9
@ Progress
@ Checkbox
@ ListItem
@ TextInput
@ MenuItem
WidgetDesc sameLine(std::string id)
Holds the next widget on the same line as the previous one.
Definition Widget.cpp:337
void registerUIAutomationCapabilities()
Registers ui automation capabilities.
Definition UIAutomationCapabilities.cpp:316
void exposePcgPhotoModeApplyPlanBindings(ssq::Table &t)
Register Pcg photo-mode application-plan bindings.
Definition PcgPhotoModeApplyPlan.cpp:137
StyleClassStatus setStyleClassColor(const std::string &name, const std::string &property, float r, float g, float b, float a)
Sets text/background/border/accent RGBA on an existing style class.
Definition Theme.cpp:99
WidgetDesc menuBar(std::vector< WidgetDesc > children, std::string id)
Window menu bar container. Must be a direct child of a Window.
Definition Widget.cpp:531
@ InvalidArgument
@ NotFound
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
One stable property description consumed by any UI shell.
Definition PropertyAccess.h:72
Retained UI widget node (arena tree). Conceptual counterpart of eve::scene::SceneNode; built declarat...
Definition UIHost.h:128
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:15