Declarative UI module (eve.UI). 更多...
#include <UI.h>
Public 成员函数 | |
| Module_REG (UI) | |
| UI () | |
| Ui. | |
| ~UI () override | |
| Ui. | |
| void | releaseSquirrelRoots () noexcept |
| Drops database-panel Squirrel roots while the Runtime VM is alive. | |
| bool | initBackend () |
| Creates the platform UI backend (ImGui); true on success. | |
| void | shutdownBackend () |
| Destroys the platform UI backend. | |
| bool | isBackendReady () const |
| True once the backend exists. | |
| void | processEvent (const SDL_Event *event) |
| Feeds an SDL event into the UI backend (before window/game handling). | |
| void | beginFrameAndRender () |
| Builds and presents the current frame's UI. | |
| void | dispatchEvents () |
| Dispatches queued widget callbacks (click/toggle/value/text). | |
| bool | wantCaptureMouse () const |
| True when the UI wants to capture mouse input this frame. | |
| bool | wantCaptureKeyboard () const |
| True when the UI wants to capture keyboard input this frame. | |
| UIHostHandle | mountAs (const std::string &name, WidgetDesc root) |
| Creates/replaces a named host from a WidgetDesc tree and selects it. | |
| UIHostHandle | mount (WidgetDesc root) |
| Mounts the tree as an auto-named host and selects it. | |
| UIHostHandle | remount (WidgetDesc root) |
| Replaces the selected host's tree. | |
| UIHostHandle | remountReconcile (WidgetDesc root) |
| Remount with key reconcile (props-only when structure matches). | |
| UIHostHandle | remountAs (const std::string &name, WidgetDesc root) |
| Creates/replaces a named host (does not select it). | |
| bool | select (const std::string &name) |
| Selects a named host; false when it does not exist. | |
| UIHostHandle | findHost (const std::string &name) const |
| Finds a host by name, or null when absent. | |
| UIHostHandle | findHostByOwner (uint32_t ownerId) const |
| Finds the host bound to an owner id, or null when absent. | |
| UIHostHandle | current () const noexcept |
| Returns the currently selected host, or null. | |
| void | bindOwner (uint32_t ownerId) |
| Binds the selected host to a UI/scene owner id. | |
| void | beginBuild () |
| Imperative builder: open a new build pass (see beginWindow etc.). | |
| void | beginWindow (const std::string &title, const std::string &id="root") |
| Opens a window for the current build pass. | |
| void | beginGroup (const std::string &id="") |
| Opens a group container in the current build pass. | |
| void | beginList (const std::string &id) |
| Opens a list container (rows added with addListItem). | |
| void | beginCollapsing (const std::string &label, const std::string &id="", bool open=true) |
| Opens a collapsible header. | |
| void | beginChild (const std::string &id, float width=0.f, float height=120.f) |
| Opens a sized child region. | |
| void | beginCard (const std::string &id="") |
| Opens a bordered card surface. | |
| 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. | |
| void | beginMenuBar (const std::string &id="") |
| Opens a window menu bar. | |
| void | beginMenu (const std::string &label, const std::string &id="") |
| Opens a popup menu. | |
| void | beginToolbar (const std::string &id="") |
| Opens a horizontal editor command strip. | |
| void | beginToolbox (const std::string &id="", float cellSize=0.f, int columns=0) |
| Opens a wrapping editor tool grid. | |
| void | beginSidebar (const std::string &id="", float width=0.f) |
| Opens a vertical editor side panel. | |
| void | beginStatusBar (const std::string &id="") |
| Opens a compact horizontal status strip. | |
| void | beginSplitPane (const std::string &direction="row", float ratio=0.25f, const std::string &id="") |
| Opens a two-child resizable split pane. | |
| void | beginScrollList (const std::string &id="", float height=0.f, float itemHeight=0.f) |
| Begins scroll list. | |
| void | beginFlex (const std::string &direction="row", const std::string &id="", float gap=-1.f) |
| Begin a Flex container. | |
| void | beginRow (const std::string &id="", float gap=-1.f) |
| Opens a row flex container. | |
| void | beginColumn (const std::string &id="", float gap=-1.f) |
| Opens a column flex container. | |
| void | beginGrid (int columns, const std::string &id="", float columnGap=-1.f, float rowGap=-1.f) |
| Begins a fixed-column grid container. | |
| void | end () |
| Closes the innermost open container. | |
| void | addText (const std::string &content, const std::string &id="") |
| Adds a text label to the current container. | |
| void | addTextWrapped (const std::string &content, float width, const std::string &id="") |
| Adds text wrapped. | |
| void | addButton (const std::string &label, const std::string &id="") |
| Adds a button to the current container. | |
| void | addIcon (const std::string &name, const std::string &id="") |
| Adds a semantic icon by name (for example "search" or "save"). | |
| void | addIconButton (const std::string &name, const std::string &label="", const std::string &id="") |
| Adds a semantic icon button with an optional visible label. | |
| void | addSameLine (const std::string &id="") |
| Adds an inline-break spacer. | |
| void | addSeparator (const std::string &id="") |
| Adds a separator line. | |
| void | addCheckbox (const std::string &label, bool checked, const std::string &id="") |
| Adds a checkbox. | |
| void | addSlider (const std::string &label, float value, float minV, float maxV, const std::string &id="") |
| Adds a slider. | |
| 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 getColorR/G/B/A. | |
| void | addProgress (float fraction, const std::string &id="", const std::string &overlay="") |
| Adds a progress bar. | |
| void | addImage (const std::string &id="", float width=0.f, float height=0.f) |
| Adds image. | |
| 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. | |
| void | addImageButton (const std::string &id, float width, float height) |
| Adds image button. | |
| void | addViewport (const std::string &id, float width=0.f, float height=0.f) |
| Adds viewport. | |
| void | addCombo (const std::string &label, const std::string &options, int selected, const std::string &id="") |
| Adds combo. | |
| void | addInputText (const std::string &label, const std::string &value, const std::string &id="") |
| Adds an editable text field. | |
| void | addSearchField (const std::string &hint, const std::string &value="", const std::string &id="") |
| Adds a compact search field. | |
| void | addSwitch (const std::string &label, bool checked, const std::string &id="") |
| Adds a modern boolean switch. | |
| void | addBadge (const std::string &label, const std::string &id="") |
| Adds a compact status/category badge. | |
| void | addSectionHeader (const std::string &label, const std::string &id="") |
| Adds a non-collapsible section heading. | |
| void | addMenuItem (const std::string &label, const std::string &shortcut="", const std::string &id="") |
| Adds a selectable menu command. | |
| void | addSpacer (const std::string &id="", float grow=1.f) |
| Flexible empty space inside Flex (default grow=1). | |
| void | setItemFlexGrow (float grow) |
| Set flex item props on the most recently added child of the current open container. No-op if there is no current child. | |
| void | setItemFlexShrink (float shrink) |
| Sets shrink weight on the most recently added flex item. | |
| void | setItemFlexBasis (float basis) |
| Sets its main-axis basis; negative restores automatic measurement. | |
| void | setItemAlignSelf (const std::string &align) |
| Sets its cross-axis alignment: inherit, start, center, end, or stretch. | |
| void | setItemAspectRatio (float ratio) |
| Sets width/height ratio on the most recently added item. | |
| void | setItemGridColumnSpan (int span) |
| Sets the grid-column span of the most recently added item. | |
| void | setItemSize (float width, float height) |
| Sets width/height on the most recently added child. | |
| void | setItemMargin (float l, float t, float r, float b) |
| Sets the item margin. | |
| void | setItemPadding (float l, float t, float r, float b) |
| Sets the item padding. | |
| void | setItemMinSize (float w, float h) |
| Sets the item min size. | |
| void | setItemMaxSize (float w, float h) |
| Sets the item max size. | |
| void | setItemPercent (float w, float h) |
| Sets the item percent. | |
| void | setItemAbsolute (float anchorX, float anchorY, float x=0.f, float y=0.f) |
| Sets the item absolute. | |
| void | setItemTooltip (const std::string &text) |
| Sets hover help on the most recently added item. | |
| void | setItemDragSource (const std::string &payloadType, const std::string &payloadText) |
| Marks the most recently added item as a desktop drag source. | |
| void | setItemDropTarget (const std::string &acceptedType) |
| Marks the most recently added item as a desktop drop target. | |
| void | setItemEnabled (bool enabled) |
| Enables or disables the most recently added item. | |
| void | setItemSelected (bool selected) |
| Marks the most recently added button as the selected tool/action. | |
| void | setItemFocusMode (const std::string &mode) |
| Sets the last item's focus mode: "none", "click", or "all". | |
| void | setItemMouseFilter (const std::string &filter) |
| Sets the last item's pointer filter: "stop", "pass", or "ignore". | |
| void | setItemTheme (const std::string &theme) |
| Overrides the last item's subtree theme: "inherit", "dark", or "light". | |
| void | setThemeScope (const std::string &theme) |
| Overrides the current open container's inherited subtree theme. | |
| void | setItemStyleClass (const std::string &name) |
| Applies a named style class to the most recently added item. | |
| void | setStyleScope (const std::string &name) |
| Applies a named style class to the current open container. | |
| void | setItemTabIndex (int index) |
| Sets the last item's sequential focus order; negative excludes it. | |
| void | setItemFocusOrder (const std::string &previous, const std::string &next) |
| Sets explicit previous and next focus neighbors on the last item. | |
| 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. | |
| void | setItemAccessibility (const std::string &role, const std::string &name, const std::string &description="") |
| Sets the last item's accessibility role, name and description. | |
| void | setFlexAlign (const std::string &align) |
| Set Flex container align/justify on the current open Flex (no-op otherwise). | |
| void | setFlexJustify (const std::string &justify) |
| Sets Flex container justify on the current open Flex. | |
| void | setLayoutGaps (float columnGap, float rowGap) |
| Sets independent column and row gaps on the current Flex/Grid. | |
| void | setFlexWrap (bool wrap) |
| Enables or disables line wrapping on the current Flex. | |
| void | setLayoutOverflow (const std::string &overflow) |
| Sets overflow behavior: visible, clip, or scroll. | |
| void | addListItem (const std::string &label, const std::string &id="") |
| Append one list row button (call inside beginList). | |
| bool | mountBuild () |
| Finishes the build pass and mounts the built tree. | |
| bool | mountBuildAs (const std::string &name) |
| Finishes the build pass and mounts as a named host. | |
| bool | remountBuildAs (const std::string &name) |
| Like mountBuildAs but reconciles by key when possible. | |
| 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 and contain a group with that id. | |
| void | setText (const std::string &id, const std::string &text) |
| Widget state setters/getters on the current host (by node id). | |
| void | setTextWrap (const std::string &id, float width) |
| Sets the text wrap. | |
| void | setVisible (const std::string &id, bool visible) |
| Sets the visible. | |
| void | setEnabled (const std::string &id, bool enabled) |
| Enables or disables a mounted control. | |
| void | setChecked (const std::string &id, bool checked) |
| Sets the checked. | |
| void | setValue (const std::string &id, float value) |
| Sets the value. | |
| void | setValueText (const std::string &id, const std::string &value) |
| Sets the value text. | |
| 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. | |
| void | setImageTint (const std::string &id, float r, float g, float b, float a=1.f) |
| Sets the image tint. | |
| void | setImageUv (const std::string &id, float u0, float v0, float u1, float v1) |
| Sets the image uv. | |
| void | setImageNinePatch (const std::string &id, float l, float t, float r, float b) |
| Sets the image nine patch. | |
| bool | setImageNinePatchFile (const std::string &id, const std::string &path) |
| Applies a .9.png texture and its parsed stretch metadata to an image. | |
| void | setImageCornerRadius (const std::string &id, float radius) |
| Sets the image corner radius. | |
| void | setImageTextureId (const std::string &id, uint64_t textureId) |
| Sets the image texture id. | |
| uint64_t | registerTexture (graphics::Texture *tex) |
| Register an engine texture for UI drawing. | |
| void | unregisterTexture (uint64_t textureId) |
| Release a texture id previously returned by registerTexture(). | |
| float | getValue (const std::string &id) const |
| Returns the value. | |
| std::string | getValueText (const std::string &id) const |
| Returns the value text. | |
| float | getColorR (const std::string &id) const |
| ColorPalette / image tint channels; missing nodes return 0. | |
| float | getColorG (const std::string &id) const |
| Returns the color g. | |
| float | getColorB (const std::string &id) const |
| Returns the color b. | |
| float | getColorA (const std::string &id) const |
| Returns the color a. | |
| bool | getChecked (const std::string &id) const |
| Returns the checked. | |
| bool | requestFocus (const std::string &id) |
| Requests keyboard/gamepad focus for a mounted control. | |
| bool | moveFocus (const std::string &direction) |
| Moves focus by "next", "previous", "left", "right", "up", or "down". | |
| std::string | getFocusedId () const |
| Returns the focused control id, or an empty string. | |
| void | setHostVisible (bool visible) |
| Host-level state. | |
| void | setHostLayer (int layer) |
| Sets the host layer. | |
| void | setHostModal (bool modal) |
| Marks the host as a modal (blocks other hosts) / overlay. | |
| void | setHostOverlay (bool overlay) |
| Sets the host overlay. | |
| void | setHostOverlayAlpha (float alpha) |
| Sets overlay opacity (0..1); zero also removes the host border and outer padding. | |
| void | setHostMovable (bool movable) |
| Allows or prevents user movement after the initial position. | |
| void | setHostResizable (bool resizable) |
| Allows or prevents user resizing after the initial size. | |
| 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). | |
| void | setHostWorldAnchor (float x, float y, float z) |
| Projects the selected host from a 3D world point through the active Camera3D. | |
| void | clearHostWorldAnchor () |
| Returns the selected host to ordinary screen-space placement. | |
| void | setHostWorldEdgePolicy (const std::string &policy, float safeMargin=8.f) |
| Configures off-screen handling and safe-edge margin. | |
| void | setHostWorldDistanceScale (bool enabled, float referenceDistance=10.f, float minScale=0.65f, float maxScale=1.25f) |
| Configures distance scaling. | |
| void | setHostWorldOverlap (bool enabled, int priority=0, float padding=4.f, float maxDisplacement=96.f) |
| Configures deterministic overlap avoidance for projected hosts. | |
| std::string | getHostWorldState () const |
| Returns the selected host projection state as a stable lowercase name. | |
| float | getHostWorldScreenX () const |
| Returns the selected host's derived screen X coordinate. | |
| float | getHostWorldScreenY () const |
| Returns the selected host's derived screen Y coordinate. | |
| void | setHostAnchor (float x, float y) |
| Sets the host anchor. | |
| void | setHostSize (float w, float h) |
| Sets the host size. | |
| void | setHostPercent (float w, float h) |
| Sets the host percent. | |
| 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). | |
| 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). | |
| void | animateHostOverlayAlpha (float alpha, float durationMs, const std::string &ease="smoothstep", float delayMs=0.f) |
| Animate the selected host's overlay background alpha. | |
| 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. | |
| 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). | |
| void | cancelHostTweens () |
| Cancel pending host-level tweens on the selected host. | |
| void | cancelItemTweens (const std::string &id="") |
| Cancel pending item tweens on the selected host. | |
| void | cancelAllTweens () |
| Cancel every pending tween on the selected host. | |
| void | tickTweens (double nowMs) |
| Advance pending UI tweens using an explicit clock (ms). | |
| std::size_t | getHostTweenCount () const |
| Number of pending host tweens (diagnostics / tests). | |
| std::size_t | getItemTweenCount () const |
| Number of pending item tweens (diagnostics / tests). | |
| std::string | consumeClick () |
| Returns the id of the clicked widget since the last frame (or ""). | |
| std::string | consumeChange () |
| Returns the id of the changed widget since the last frame (or ""). | |
| std::string | dragDropSupport () const |
| Returns "supported" on desktop builds and "unsupported-platform" elsewhere. | |
| std::string | consumeDrop () |
| Pops one drop and returns its target as "host/node", or an empty string. | |
| std::string | getDropType () const |
| Returns the payload type of the last successfully consumed drop. | |
| std::string | getDropText () const |
| Returns the owning payload text of the last successfully consumed drop. | |
| std::string | getDropSource () const |
| Returns the source as "host/node", or empty for an OS file. | |
| std::string | getDropOrigin () const |
| Returns "internal", "os-file", or an empty string. | |
| void | onClick (const std::string &id, ssq::Function fn) |
| On click. | |
| void | onChange (const std::string &id, ssq::Function fn) |
| On change. | |
| void | componentOnClick (uint64_t owner, const std::string &id, ssq::Function fn) |
| Internal UIComponent callback registration scoped to one component owner. | |
| void | componentOnChange (uint64_t owner, const std::string &id, ssq::Function fn) |
| Internal UIComponent value callback registration scoped to one component owner. | |
| void | componentClearHandlers (uint64_t owner) |
| Removes every callback owned by one UIComponent; idempotent on the UI thread. | |
| void | setThemeDark () |
| Applies the dark/light built-in theme. | |
| void | setThemeLight () |
| Sets the theme light. | |
| bool | setTheme (const std::string &name) |
| Named preset: "dark" / "light" (case-insensitive). Returns false if unknown. | |
| std::string | getTheme () const |
| Name of the active theme. | |
| std::string | defineStyleClass (const std::string &name, const std::string &parent="") |
| Declares/replaces a named style class and returns a stable status string. | |
| 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. | |
| 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. | |
| void | clearStyleClasses () |
| Clears all named style classes. | |
| void | setNavKeyboard (bool enabled) |
| Enables/disables keyboard navigation support. | |
| void | setNavGamepad (bool enabled) |
| Sets the nav gamepad. | |
| void | setScale (float scale) |
| Global UI scale factor (default 1). | |
| float | getScale () const |
| Current UI scale factor. | |
| std::string | getStats () const |
| Returns the stats. | |
| std::string | getLayoutDiagnostics () const |
| JSON diagnostics for measured size and overflow of the selected retained tree. | |
| std::string | getAccessibilitySnapshot () const |
| JSON accessibility snapshot for semantically named nodes in the selected tree. | |
| std::string | saveTreeJson () const |
| Saves tree json. | |
| bool | loadTreeJson (const std::string &json) |
| Loads tree json. | |
| graphics::Canvas * | viewportCanvas (const std::string &id) |
| Returns the offscreen render target of a selected-host Viewport widget. | |
| bool | viewportHovered (const std::string &id) |
| Viewport hovered. | |
| bool | viewportActive (const std::string &id) |
| Viewport active. | |
| float | viewportMouseX (const std::string &id) |
| Viewport mouse x. | |
| float | viewportMouseY (const std::string &id) |
| Viewport mouse y. | |
| float | viewportDragDX (const std::string &id) |
| Viewport drag dx. | |
| float | viewportDragDY (const std::string &id) |
| Viewport drag dy. | |
| float | viewportWheel (const std::string &id) |
| Viewport wheel. | |
| 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. | |
| bool | inspectOpen () |
| Opens the auto-generated inspector (scans reflected classes). | |
| void | inspectClose () |
| Closes the inspector panel. | |
| bool | inspectRefresh () |
| Re-scans script classes; true when any class is reflected. | |
| bool | inspectSelectClass (const std::string &name) |
| Selects a class in the inspector (creates its first instance). | |
| bool | inspectObject (ssq::Object object) |
| Inspects a caller-provided live script instance. | |
| bool | inspectSetPickHandler (ssq::Function fn) |
| Registers the script callback used by the inspector Pick button. The callback is stored on the script side (eve._inspectorPickHandler) and must return a live script instance (or null). | |
| bool | inspectPickScene () |
| Calls the pick handler and inspects the returned object. | |
| bool | inspectAddInstance () |
| Creates another instance of the selected inspector class. | |
| ssq::Object | propertySchema (ssq::Object instance) |
Return the reflection-derived PropertySchema for a live script instance. | |
| bool | dbOpen () |
| Opens the database panel (class menu + editable instance grid). | |
| void | dbClose () |
| Closes the database panel. | |
| bool | dbRefresh () |
| Re-scans reflected classes; true when any class exists. | |
| bool | dbSelectClass (const std::string &name) |
| Selects the class shown in the grid. | |
| uint64_t | dbRegister (ssq::Object object, const std::string &label) |
| Registers a live script object in the database grid. | |
| uint64_t | dbCreateInstance () |
| Creates and registers an instance of the selected class. | |
| eve::Result< void > | dbUnregister (uint64_t id) |
| Removes an entry from the database grid using its packed handle. | |
| bool | editorOpen () |
| Opens the menu bar and docks the inspector + database panels. | |
| void | editorClose () |
| Closes the editor shell (and its docked panels). | |
| bool | editorSelectPanel (const std::string &name) |
| Shows one docked panel ("inspector"/"database"; "" hides all). | |
| bool | sceneOpen () |
| Opens the scene panel (tree + selected node properties). | |
| void | sceneClose () |
| Closes the scene panel. | |
| bool | sceneSelectNode (const std::string &id) |
| Selects a scene node by id. | |
| bool | sceneSetPickHandler (ssq::Function fn) |
| Registers the script callback for the scene panel Pick button. The callback (stored as eve._scenePickHandler) receives the node id and typically maps it to a script instance, then calls ui.inspectObject(). | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
Declarative UI module (eve.UI).
ECS: named UIHost panels. Builder + Component.build (C++/script) + list/when/theme.
构造及析构函数说明
◆ UI()
| eve::ui::UI::UI | ( | ) |
◆ ~UI()
|
override |
成员函数说明
◆ addBadge()
| void eve::ui::UI::addBadge | ( | const std::string & | label, |
| const std::string & | id = "" |
||
| ) |
Adds a compact status/category badge.
引用了 eve::ui::badge(), eve::ui::WidgetDesc::children , 以及 label.
◆ addButton()
| void eve::ui::UI::addButton | ( | const std::string & | label, |
| const std::string & | id = "" |
||
| ) |
Adds a button to the current container.
引用了 eve::ui::button(), eve::ui::WidgetDesc::children , 以及 label.
◆ addCheckbox()
| void eve::ui::UI::addCheckbox | ( | const std::string & | label, |
| bool | checked, | ||
| const std::string & | id = "" |
||
| ) |
Adds a checkbox.
引用了 eve::ui::checkbox(), eve::ui::WidgetDesc::children , 以及 label.
◆ addColorPalette()
| void eve::ui::UI::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 getColorR/G/B/A.
引用了 a, b, eve::ui::WidgetDesc::children, eve::ui::colorPalette(), g, label , 以及 r.
◆ addCombo()
| void eve::ui::UI::addCombo | ( | const std::string & | label, |
| const std::string & | options, | ||
| int | selected, | ||
| const std::string & | id = "" |
||
| ) |
Adds combo.
Dropdown; options separated by '
', selected = initial index.
引用了 eve::ui::WidgetDesc::children, eve::ui::combo(), end(), label, options , 以及 start.
◆ addIcon()
| void eve::ui::UI::addIcon | ( | const std::string & | name, |
| const std::string & | id = "" |
||
| ) |
Adds a semantic icon by name (for example "search" or "save").
引用了 eve::ui::WidgetDesc::children, icon, eve::ui::iconFromName(), name, eve::ui::None , 以及 value.
◆ addIconButton()
| void eve::ui::UI::addIconButton | ( | const std::string & | name, |
| const std::string & | label = "", |
||
| const std::string & | id = "" |
||
| ) |
Adds a semantic icon button with an optional visible label.
引用了 eve::ui::WidgetDesc::children, eve::ui::iconButton(), eve::ui::iconFromName(), label, name, eve::ui::None , 以及 value.
◆ addImage()
◆ addImageButton()
| void eve::ui::UI::addImageButton | ( | const std::string & | id, |
| float | width, | ||
| float | height | ||
| ) |
Adds image button.
Clickable image button (click routes through consumeClick / callbacks).
引用了 eve::ui::WidgetDesc::children, height, eve::ui::imageButton() , 以及 width.
◆ addInputText()
| void eve::ui::UI::addInputText | ( | const std::string & | label, |
| const std::string & | value, | ||
| const std::string & | id = "" |
||
| ) |
Adds an editable text field.
引用了 eve::ui::WidgetDesc::children, eve::ui::inputText(), label , 以及 value.
◆ addListItem()
| void eve::ui::UI::addListItem | ( | const std::string & | label, |
| const std::string & | id = "" |
||
| ) |
◆ addMenuItem()
| void eve::ui::UI::addMenuItem | ( | const std::string & | label, |
| const std::string & | shortcut = "", |
||
| const std::string & | id = "" |
||
| ) |
Adds a selectable menu command.
引用了 eve::ui::WidgetDesc::children, label , 以及 eve::ui::menuItem().
◆ addNinePatch()
◆ addProgress()
| void eve::ui::UI::addProgress | ( | float | fraction, |
| const std::string & | id = "", |
||
| const std::string & | overlay = "" |
||
| ) |
Adds a progress bar.
◆ addSameLine()
| void eve::ui::UI::addSameLine | ( | const std::string & | id = "" | ) |
Adds an inline-break spacer.
◆ addSearchField()
| void eve::ui::UI::addSearchField | ( | const std::string & | hint, |
| const std::string & | value = "", |
||
| const std::string & | id = "" |
||
| ) |
Adds a compact search field.
引用了 eve::ui::WidgetDesc::children, eve::ui::searchField() , 以及 value.
◆ addSectionHeader()
| void eve::ui::UI::addSectionHeader | ( | const std::string & | label, |
| const std::string & | id = "" |
||
| ) |
Adds a non-collapsible section heading.
引用了 eve::ui::WidgetDesc::children, label , 以及 eve::ui::sectionHeader().
◆ addSeparator()
| void eve::ui::UI::addSeparator | ( | const std::string & | id = "" | ) |
Adds a separator line.
引用了 eve::ui::WidgetDesc::children , 以及 eve::ui::separator().
◆ addSlider()
| void eve::ui::UI::addSlider | ( | const std::string & | label, |
| float | value, | ||
| float | minV, | ||
| float | maxV, | ||
| const std::string & | id = "" |
||
| ) |
Adds a slider.
引用了 eve::ui::WidgetDesc::children, label, eve::ui::slider() , 以及 value.
◆ addSpacer()
| void eve::ui::UI::addSpacer | ( | const std::string & | id = "", |
| float | grow = 1.f |
||
| ) |
Flexible empty space inside Flex (default grow=1).
◆ addSwitch()
| void eve::ui::UI::addSwitch | ( | const std::string & | label, |
| bool | checked, | ||
| const std::string & | id = "" |
||
| ) |
Adds a modern boolean switch.
引用了 eve::ui::WidgetDesc::children, label , 以及 eve::ui::toggleSwitch().
◆ addText()
| void eve::ui::UI::addText | ( | const std::string & | content, |
| const std::string & | id = "" |
||
| ) |
Adds a text label to the current container.
引用了 eve::ui::WidgetDesc::children , 以及 text.
◆ addTextWrapped()
| void eve::ui::UI::addTextWrapped | ( | const std::string & | content, |
| float | width, | ||
| const std::string & | id = "" |
||
| ) |
◆ addViewport()
Adds viewport.
Embedded viewport widget (see viewportCanvas / viewport* input getters).
引用了 eve::ui::WidgetDesc::children, height, eve::ui::viewport() , 以及 width.
◆ animateHostOverlayAlpha()
| void eve::ui::UI::animateHostOverlayAlpha | ( | float | alpha, |
| float | durationMs, | ||
| const std::string & | ease = "smoothstep", |
||
| float | delayMs = 0.f |
||
| ) |
Animate the selected host's overlay background alpha.
- 参数
-
alpha Target alpha clamped to [0,1]. durationMs Duration; <=0 jumps immediately (after delay). ease Ease kind (default "smoothstep"). delayMs Delay before the first sample moves.
引用了 eve::ui::UiTweenDriver::animateHostOverlayAlpha() , 以及 eve::ui::uiTweenWallClockMs().
◆ animateHostPos()
| void eve::ui::UI::animateHostPos | ( | float | x, |
| float | y, | ||
| float | durationMs, | ||
| const std::string & | ease = "smoothstep", |
||
| float | delayMs = 0.f |
||
| ) |
Animate the selected host's window position (px).
- 参数
-
x Target posX in pixels. y Target posY in pixels. durationMs Duration; <=0 jumps immediately (after delay). ease Ease kind (default "smoothstep"; see evaluateUiEase). delayMs Delay before the first sample moves.
- 注解
- Retrigger replaces any prior pos tween on the same host. Driven by the presentation clock inside beginFrameAndRender() / tickTweens().
引用了 eve::ui::UiTweenDriver::animateHostPos(), eve::ui::uiTweenWallClockMs(), x , 以及 y.
◆ animateHostSize()
| void eve::ui::UI::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).
- 参数
-
w Target width. h Target height. durationMs Duration; <=0 jumps immediately (after delay). ease Ease kind (default "smoothstep"). delayMs Delay before the first sample moves.
引用了 eve::ui::UiTweenDriver::animateHostSize(), h, eve::ui::uiTweenWallClockMs() , 以及 w.
◆ animateItemOpacity()
| void eve::ui::UI::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.
- 参数
-
id Node id on the selected host. opacity Target opacity clamped to [0,1]. durationMs Duration; <=0 jumps immediately (after delay). ease Ease kind (default "smoothstep"). delayMs Delay before the first sample moves.
引用了 eve::ui::UiTweenDriver::animateItemOpacity(), eve::Result< void >::ignore(), opacity , 以及 eve::ui::uiTweenWallClockMs().
◆ animateItemPos()
| void eve::ui::UI::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).
- 参数
-
id Node id on the selected host. x Target posX. y Target posY. durationMs Duration; <=0 jumps immediately (after delay). ease Ease kind (default "smoothstep"). delayMs Delay before the first sample moves.
引用了 eve::ui::UiTweenDriver::animateItemPos(), eve::Result< void >::ignore(), eve::ui::uiTweenWallClockMs(), x , 以及 y.
◆ beginBuild()
| void eve::ui::UI::beginBuild | ( | ) |
Imperative builder: open a new build pass (see beginWindow etc.).
被这些函数引用 beginWindow().
◆ beginCard()
| void eve::ui::UI::beginCard | ( | const std::string & | id = "" | ) |
◆ beginChild()
◆ beginCollapsing()
| void eve::ui::UI::beginCollapsing | ( | const std::string & | label, |
| const std::string & | id = "", |
||
| bool | open = true |
||
| ) |
◆ beginColumn()
| void eve::ui::UI::beginColumn | ( | const std::string & | id = "", |
| float | gap = -1.f |
||
| ) |
◆ beginFlex()
| void eve::ui::UI::beginFlex | ( | const std::string & | direction = "row", |
| const std::string & | id = "", |
||
| float | gap = -1.f |
||
| ) |
Begin a Flex container.
- 参数
-
direction "row" / "column" (case-insensitive; default row) id stable node id gap spacing between children; <0 uses theme ItemSpacing
引用了 d, direction, eve::ui::flex(), gap, eve::ui::WidgetDesc::gap , 以及 id.
被这些函数引用 beginColumn() , 以及 beginRow().
◆ beginFrameAndRender()
| void eve::ui::UI::beginFrameAndRender | ( | ) |
Builds and presents the current frame's UI.
引用了 initBackend(), isBackendReady(), eve::ui::UISystem::render(), tickTweens() , 以及 eve::ui::uiTweenWallClockMs().
◆ beginGrid()
| void eve::ui::UI::beginGrid | ( | int | columns, |
| const std::string & | id = "", |
||
| float | columnGap = -1.f, |
||
| float | rowGap = -1.f |
||
| ) |
Begins a fixed-column grid container.
引用了 eve::ui::WidgetDesc::columnGap, columns, d, eve::ui::grid() , 以及 id.
◆ beginGroup()
| void eve::ui::UI::beginGroup | ( | const std::string & | id = "" | ) |
◆ beginList()
| void eve::ui::UI::beginList | ( | const std::string & | id | ) |
◆ beginMenu()
| void eve::ui::UI::beginMenu | ( | const std::string & | label, |
| const std::string & | id = "" |
||
| ) |
◆ beginMenuBar()
| void eve::ui::UI::beginMenuBar | ( | const std::string & | id = "" | ) |
◆ beginNinePatch()
| bool eve::ui::UI::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.
引用了 d, height, id, eve::ui::ninePatchPanel(), path, eve::ui::WidgetDesc::sizeX , 以及 width.
◆ beginRow()
| void eve::ui::UI::beginRow | ( | const std::string & | id = "", |
| float | gap = -1.f |
||
| ) |
◆ beginScrollList()
| void eve::ui::UI::beginScrollList | ( | const std::string & | id = "", |
| float | height = 0.f, |
||
| float | itemHeight = 0.f |
||
| ) |
Begins scroll list.
Virtualized scroll list; rows are the children added before end().
引用了 height , 以及 eve::ui::scrollList().
◆ beginSidebar()
| void eve::ui::UI::beginSidebar | ( | const std::string & | id = "", |
| float | width = 0.f |
||
| ) |
◆ beginSplitPane()
| void eve::ui::UI::beginSplitPane | ( | const std::string & | direction = "row", |
| float | ratio = 0.25f, |
||
| const std::string & | id = "" |
||
| ) |
Opens a two-child resizable split pane.
引用了 d, direction, id, eve::ui::SplitPane , 以及 eve::ui::WidgetDesc::type.
◆ beginStatusBar()
| void eve::ui::UI::beginStatusBar | ( | const std::string & | id = "" | ) |
◆ beginToolbar()
| void eve::ui::UI::beginToolbar | ( | const std::string & | id = "" | ) |
◆ beginToolbox()
| void eve::ui::UI::beginToolbox | ( | const std::string & | id = "", |
| float | cellSize = 0.f, |
||
| int | columns = 0 |
||
| ) |
◆ beginWindow()
| void eve::ui::UI::beginWindow | ( | const std::string & | title, |
| const std::string & | id = "root" |
||
| ) |
Opens a window for the current build pass.
引用了 beginBuild(), id, title , 以及 eve::ui::window().
◆ bindOwner()
| void eve::ui::UI::bindOwner | ( | uint32_t | ownerId | ) |
◆ cancelAllTweens()
| void eve::ui::UI::cancelAllTweens | ( | ) |
Cancel every pending tween on the selected host.
◆ cancelHostTweens()
| void eve::ui::UI::cancelHostTweens | ( | ) |
Cancel pending host-level tweens on the selected host.
◆ cancelItemTweens()
| void eve::ui::UI::cancelItemTweens | ( | const std::string & | id = "" | ) |
Cancel pending item tweens on the selected host.
- 参数
-
id Node id; empty cancels every item tween on the host.
◆ clearHostWorldAnchor()
| void eve::ui::UI::clearHostWorldAnchor | ( | ) |
◆ clearStyleClasses()
| void eve::ui::UI::clearStyleClasses | ( | ) |
◆ componentClearHandlers()
| void eve::ui::UI::componentClearHandlers | ( | uint64_t | owner | ) |
◆ componentOnChange()
| void eve::ui::UI::componentOnChange | ( | uint64_t | owner, |
| const std::string & | id, | ||
| ssq::Function | fn | ||
| ) |
◆ componentOnClick()
| void eve::ui::UI::componentOnClick | ( | uint64_t | owner, |
| const std::string & | id, | ||
| ssq::Function | fn | ||
| ) |
◆ consumeChange()
| std::string eve::ui::UI::consumeChange | ( | ) |
Returns the id of the changed widget since the last frame (or "").
◆ consumeClick()
| std::string eve::ui::UI::consumeClick | ( | ) |
Returns the id of the clicked widget since the last frame (or "").
◆ consumeDrop()
| std::string eve::ui::UI::consumeDrop | ( | ) |
Pops one drop and returns its target as "host/node", or an empty string.
引用了 eve::ui::UISystem::consumeDrop() , 以及 eve::ui::OperatingSystemFile.
◆ current()
|
inlinenoexcept |
Returns the currently selected host, or null.
- 返回
- Borrowed nullable host owned by the UI ECS world. @ownership UI owns the host; callers must not delete it. @lifetime Valid until selection/host removal or UI module teardown. @thread Call on the UI thread. @reentrancy The accessor invokes no callbacks and is invalid across selection mutation.
Returns the generation-qualified selected host handle, or empty.
◆ dbClose()
◆ dbCreateInstance()
| uint64_t eve::ui::UI::dbCreateInstance | ( | ) |
◆ dbOpen()
| bool eve::ui::UI::dbOpen | ( | ) |
◆ dbRefresh()
| bool eve::ui::UI::dbRefresh | ( | ) |
◆ dbRegister()
| uint64_t eve::ui::UI::dbRegister | ( | ssq::Object | object, |
| const std::string & | label | ||
| ) |
Registers a live script object in the database grid.
- 参数
-
object Live script instance. label Optional display label ("" = auto "Class #n").
- 返回
- Explicit packed process-local ObjectHandle, or 0 on failure.
- 备注
- This integer is a Squirrel compatibility projection. C++ code should use ui::ObjectHandle from ObjectRegistry directly; it is not a persistent ID.
引用了 label.
◆ dbSelectClass()
| bool eve::ui::UI::dbSelectClass | ( | const std::string & | name | ) |
◆ dbUnregister()
| eve::Result< void > eve::ui::UI::dbUnregister | ( | uint64_t | id | ) |
Removes an entry from the database grid using its packed handle.
- 参数
-
id Process-local generation-qualified ObjectHandle packed for the Squirrel-facing API.
- 返回
- Applied on success, or a structured failure when the panel is unavailable or the handle is invalid/stale. @thread Call on the UI thread.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::RuntimeHandle< UiObjectHandleTag >::fromPacked(), handle, eve::NotFound , 以及 eve::Result< T >::success().
◆ defineStyleClass()
| std::string eve::ui::UI::defineStyleClass | ( | const std::string & | name, |
| const std::string & | parent = "" |
||
| ) |
Declares/replaces a named style class and returns a stable status string.
引用了 eve::ui::defineStyleClass(), name, parent , 以及 eve::ui::styleClassStatusName().
◆ dispatchEvents()
| void eve::ui::UI::dispatchEvents | ( | ) |
Dispatches queued widget callbacks (click/toggle/value/text).
引用了 eve::ui::UISystem::dispatchEvents(), events, eve::ui::UISystem::pendingEvents() , 以及 eve::ui::UIHost::resolve().
◆ dragDropSupport()
| std::string eve::ui::UI::dragDropSupport | ( | ) | const |
Returns "supported" on desktop builds and "unsupported-platform" elsewhere.
引用了 eve::ui::UISystem::dragDropSupport() , 以及 eve::ui::Supported.
◆ editorClose()
| void eve::ui::UI::editorClose | ( | ) |
◆ editorOpen()
| bool eve::ui::UI::editorOpen | ( | ) |
◆ editorSelectPanel()
| bool eve::ui::UI::editorSelectPanel | ( | const std::string & | name | ) |
◆ end()
| void eve::ui::UI::end | ( | ) |
◆ findHost()
| UIHostHandle eve::ui::UI::findHost | ( | const std::string & | name | ) | const |
Finds a host by name, or null when absent.
- 返回
- Borrowed nullable host owned by the UI ECS world. @ownership UI/ECS owns the host; callers must not delete it. @lifetime Valid until host removal or UI module teardown. @thread Call on the UI thread. @reentrancy The lookup invokes no callbacks and is invalid across host mutation.
引用了 eve::ui::UISystem::findHost() , 以及 name.
被这些函数引用 mountAs(), remountBuildAs() , 以及 select().
◆ findHostByOwner()
| UIHostHandle eve::ui::UI::findHostByOwner | ( | uint32_t | ownerId | ) | const |
Finds the host bound to an owner id, or null when absent.
◆ getAccessibilitySnapshot()
| std::string eve::ui::UI::getAccessibilitySnapshot | ( | ) | const |
◆ getChecked()
| bool eve::ui::UI::getChecked | ( | const std::string & | id | ) | const |
◆ getColorA()
| float eve::ui::UI::getColorA | ( | const std::string & | id | ) | const |
◆ getColorB()
| float eve::ui::UI::getColorB | ( | const std::string & | id | ) | const |
◆ getColorG()
| float eve::ui::UI::getColorG | ( | const std::string & | id | ) | const |
◆ getColorR()
| float eve::ui::UI::getColorR | ( | const std::string & | id | ) | const |
◆ getDropOrigin()
| std::string eve::ui::UI::getDropOrigin | ( | ) | const |
◆ getDropSource()
| std::string eve::ui::UI::getDropSource | ( | ) | const |
◆ getDropText()
| std::string eve::ui::UI::getDropText | ( | ) | const |
◆ getDropType()
| std::string eve::ui::UI::getDropType | ( | ) | const |
◆ getFocusedId()
| std::string eve::ui::UI::getFocusedId | ( | ) | const |
◆ getHostTweenCount()
| std::size_t eve::ui::UI::getHostTweenCount | ( | ) | const |
Number of pending host tweens (diagnostics / tests).
◆ getHostWorldScreenX()
| float eve::ui::UI::getHostWorldScreenX | ( | ) | const |
◆ getHostWorldScreenY()
| float eve::ui::UI::getHostWorldScreenY | ( | ) | const |
◆ getHostWorldState()
| std::string eve::ui::UI::getHostWorldState | ( | ) | const |
Returns the selected host projection state as a stable lowercase name.
- 返回
- State name.
引用了 eve::ui::BehindCamera, eve::ui::Crowded, eve::ui::Disabled, host, eve::ui::NoCamera, eve::ui::OutsideViewport , 以及 eve::ui::Visible.
◆ getItemTweenCount()
| std::size_t eve::ui::UI::getItemTweenCount | ( | ) | const |
Number of pending item tweens (diagnostics / tests).
◆ getLayoutDiagnostics()
| std::string eve::ui::UI::getLayoutDiagnostics | ( | ) | const |
◆ getScale()
| float eve::ui::UI::getScale | ( | ) | const |
◆ getStats()
| std::string eve::ui::UI::getStats | ( | ) | const |
Returns the stats.
"hosts=.. nodes=.. measureMs=.. walkMs=.." from the last render frame.
引用了 s , 以及 eve::ui::UISystem::stats().
◆ getTheme()
| std::string eve::ui::UI::getTheme | ( | ) | const |
◆ getValue()
| float eve::ui::UI::getValue | ( | const std::string & | id | ) | const |
◆ getValueText()
| std::string eve::ui::UI::getValueText | ( | const std::string & | id | ) | const |
◆ initBackend()
| bool eve::ui::UI::initBackend | ( | ) |
Creates the platform UI backend (ImGui); true on success.
引用了 eve::ui::createImGuiBackend(), ok , 以及 eve::ui::UISystem::setBackend().
被这些函数引用 beginFrameAndRender(), registerTexture() , 以及 setScale().
◆ inspectAddInstance()
| bool eve::ui::UI::inspectAddInstance | ( | ) |
◆ inspectClose()
◆ inspectObject()
| bool eve::ui::UI::inspectObject | ( | ssq::Object | object | ) |
◆ inspectOpen()
| bool eve::ui::UI::inspectOpen | ( | ) |
◆ inspectPickScene()
| bool eve::ui::UI::inspectPickScene | ( | ) |
◆ inspectRefresh()
| bool eve::ui::UI::inspectRefresh | ( | ) |
◆ inspectSelectClass()
| bool eve::ui::UI::inspectSelectClass | ( | const std::string & | name | ) |
◆ inspectSetPickHandler()
| bool eve::ui::UI::inspectSetPickHandler | ( | ssq::Function | fn | ) |
Registers the script callback used by the inspector Pick button. The callback is stored on the script side (eve._inspectorPickHandler) and must return a live script instance (or null).
引用了 fn, eve::Runtime::handle(), eve::ModuleManager::runtime() , 以及 top.
◆ isBackendReady()
| bool eve::ui::UI::isBackendReady | ( | ) | const |
True once the backend exists.
被这些函数引用 beginFrameAndRender(), registerTexture() , 以及 setScale().
◆ loadTreeJson()
| bool eve::ui::UI::loadTreeJson | ( | const std::string & | json | ) |
Loads tree json.
Replace the selected host's tree from JSON produced by saveTreeJson().
◆ Module_REG()
| eve::ui::UI::Module_REG | ( | UI | ) |
◆ mount()
| UIHostHandle eve::ui::UI::mount | ( | WidgetDesc | root | ) |
Mounts the tree as an auto-named host and selects it.
- 返回
- Borrowed nullable host owned by the UI ECS world. @ownership UI/ECS owns the host; callers must not delete it. @lifetime Valid until host removal or UI module teardown; retain the generation handle across frames. @thread Call on the UI thread. @reentrancy The operation may rebuild widgets but does not invoke external callbacks before returning.
◆ mountAs()
| UIHostHandle eve::ui::UI::mountAs | ( | const std::string & | name, |
| WidgetDesc | root | ||
| ) |
Creates/replaces a named host from a WidgetDesc tree and selects it.
- 返回
- Borrowed nullable host owned by the UI ECS world. @ownership UI/ECS owns the host; callers must not delete it. @lifetime Valid until host removal or UI module teardown; retain the generation handle across frames. @thread Call on the UI thread. @reentrancy The operation may rebuild widgets but does not invoke external callbacks before returning.
引用了 eve::ui::UIHost::createHost(), findHost(), handle, host, name, eve::ui::UIHost::resolve() , 以及 root.
被这些函数引用 mount(), mountBuildAs(), mountSimple() , 以及 remountAs().
◆ mountBuild()
| bool eve::ui::UI::mountBuild | ( | ) |
Finishes the build pass and mounts the built tree.
引用了 handle, remount() , 以及 eve::ui::UIHost::resolve().
◆ mountBuildAs()
| bool eve::ui::UI::mountBuildAs | ( | const std::string & | name | ) |
◆ mountSimple()
| void eve::ui::UI::mountSimple | ( | const std::string & | title, |
| const std::string & | labelText, | ||
| const std::string & | buttonText | ||
| ) |
One-shot convenience: a window with a label and a button.
引用了 eve::ui::button(), handle, mountAs(), eve::ui::UIHost::resolve(), text, title , 以及 eve::ui::window().
◆ moveFocus()
| bool eve::ui::UI::moveFocus | ( | const std::string & | direction | ) |
Moves focus by "next", "previous", "left", "right", "up", or "down".
引用了 direction, host , 以及 eve::ui::Next.
◆ onChange()
| void eve::ui::UI::onChange | ( | const std::string & | id, |
| ssq::Function | fn | ||
| ) |
◆ onClick()
| void eve::ui::UI::onClick | ( | const std::string & | id, |
| ssq::Function | fn | ||
| ) |
On click.
Script-side event callbacks (P0-3): register a closure on a node id of the selected host. onClick registers a callback for a node; onChange registers a value callback whose kind is toggle, value or text. Handlers run inside dispatchEvents after C++ callbacks and before poll queues.
◆ processEvent()
| void eve::ui::UI::processEvent | ( | const SDL_Event * | event | ) |
Feeds an SDL event into the UI backend (before window/game handling).
引用了 eve::ui::UISystem::dragDropSupport(), eve::ui::UISystem::enqueuePlatformFileDrop() , 以及 eve::ui::Supported.
◆ propertySchema()
| ssq::Object eve::ui::UI::propertySchema | ( | ssq::Object | instance | ) |
Return the reflection-derived PropertySchema for a live script instance.
The schema is built by ReflectedPropertyModel (attributes → kinds/flags) and projected as a Squirrel table { typeId, version, properties = [ { path, kind, displayName, description, category, readOnly, choices, min, max, step, units, presenterHint }, ... ] }. Scripts use this to inspect or drive custom UI; the authoritative editable view remains ui.inspectObject / PropertyView.
引用了 choices, eve::property_access::hasFlag(), model, properties, eve::property_access::ReadOnly, eve::ModuleManager::runtime() , 以及 vm.
◆ registerTexture()
| uint64_t eve::ui::UI::registerTexture | ( | graphics::Texture * | tex | ) |
Register an engine texture for UI drawing.
- 参数
-
tex Live engine texture retained by the caller until unregisterTexture().
- 返回
- Opaque backend-neutral id, or zero on failure.
引用了 initBackend() , 以及 isBackendReady().
◆ releaseSquirrelRoots()
|
noexcept |
Drops database-panel Squirrel roots while the Runtime VM is alive.
- 备注
- Invoked from Runtime shutdown via ISquirrelRootReleaser.
引用了 eve::ui::ObjectRegistry::clearAll(), eve::ui::ObjectRegistry::instance() , 以及 eve::ModuleManager::runtime().
被这些函数引用 shutdownBackend().
◆ remount()
| UIHostHandle eve::ui::UI::remount | ( | WidgetDesc | root | ) |
Replaces the selected host's tree.
- 返回
- Borrowed nullable selected host, or null when no host is selected. @ownership UI/ECS owns the host; callers must not delete it. @lifetime Valid until host removal or UI module teardown. @thread Call on the UI thread. @reentrancy Tree callbacks are not invoked while the returned pointer is being acquired.
引用了 handle, host, eve::ui::UIHost::resolve() , 以及 root.
被这些函数引用 mountBuild().
◆ remountAs()
| UIHostHandle eve::ui::UI::remountAs | ( | const std::string & | name, |
| WidgetDesc | root | ||
| ) |
Creates/replaces a named host (does not select it).
◆ remountBuildAs()
| bool eve::ui::UI::remountBuildAs | ( | const std::string & | name | ) |
Like mountBuildAs but reconciles by key when possible.
引用了 eve::ui::UIHost::createHost(), findHost(), h, host, name , 以及 eve::ui::UIHost::resolve().
◆ remountReconcile()
| UIHostHandle eve::ui::UI::remountReconcile | ( | WidgetDesc | root | ) |
Remount with key reconcile (props-only when structure matches).
- 返回
- Borrowed nullable selected host, or null when no host is selected. @ownership UI/ECS owns the host; callers must not delete it. @lifetime Valid until host removal or UI module teardown. @thread Call on the UI thread. @reentrancy Reconciliation callbacks are completed before the pointer is returned.
引用了 handle, host, eve::ui::UIHost::resolve() , 以及 root.
◆ requestFocus()
| bool eve::ui::UI::requestFocus | ( | const std::string & | id | ) |
◆ saveTreeJson()
| std::string eve::ui::UI::saveTreeJson | ( | ) | const |
◆ sceneClose()
◆ sceneOpen()
| bool eve::ui::UI::sceneOpen | ( | ) |
◆ sceneSelectNode()
| bool eve::ui::UI::sceneSelectNode | ( | const std::string & | id | ) |
◆ sceneSetPickHandler()
| bool eve::ui::UI::sceneSetPickHandler | ( | ssq::Function | fn | ) |
Registers the script callback for the scene panel Pick button. The callback (stored as eve._scenePickHandler) receives the node id and typically maps it to a script instance, then calls ui.inspectObject().
引用了 fn, eve::Runtime::handle(), eve::ModuleManager::runtime() , 以及 top.
◆ select()
| bool eve::ui::UI::select | ( | const std::string & | name | ) |
Selects a named host; false when it does not exist.
引用了 findHost(), h, name , 以及 eve::ui::UIHost::resolve().
◆ setChecked()
| void eve::ui::UI::setChecked | ( | const std::string & | id, |
| bool | checked | ||
| ) |
◆ setColor()
| void eve::ui::UI::setColor | ( | const std::string & | id, |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
◆ setEnabled()
| void eve::ui::UI::setEnabled | ( | const std::string & | id, |
| bool | enabled | ||
| ) |
◆ setFlexAlign()
| void eve::ui::UI::setFlexAlign | ( | const std::string & | align | ) |
Set Flex container align/justify on the current open Flex (no-op otherwise).
Set Flex container align/justify on the current open Flex (no-op otherwise).
引用了 eve::ui::Flex , 以及 parent.
◆ setFlexJustify()
| void eve::ui::UI::setFlexJustify | ( | const std::string & | justify | ) |
Sets Flex container justify on the current open Flex.
引用了 eve::ui::Flex , 以及 parent.
◆ setFlexWrap()
| void eve::ui::UI::setFlexWrap | ( | bool | wrap | ) |
Enables or disables line wrapping on the current Flex.
引用了 eve::ui::Flex, eve::ui::NoWrap, parent , 以及 eve::ui::Wrap.
◆ setHostAnchor()
| void eve::ui::UI::setHostAnchor | ( | float | x, |
| float | y | ||
| ) |
◆ setHostLayer()
| void eve::ui::UI::setHostLayer | ( | int | layer | ) |
◆ setHostModal()
| void eve::ui::UI::setHostModal | ( | bool | modal | ) |
◆ setHostMovable()
| void eve::ui::UI::setHostMovable | ( | bool | movable | ) |
◆ setHostOverlay()
| void eve::ui::UI::setHostOverlay | ( | bool | overlay | ) |
◆ setHostOverlayAlpha()
| void eve::ui::UI::setHostOverlayAlpha | ( | float | alpha | ) |
◆ setHostPercent()
| void eve::ui::UI::setHostPercent | ( | float | w, |
| float | h | ||
| ) |
◆ setHostPos()
◆ setHostResizable()
| void eve::ui::UI::setHostResizable | ( | bool | resizable | ) |
◆ setHostSize()
| void eve::ui::UI::setHostSize | ( | float | w, |
| float | h | ||
| ) |
◆ setHostVisible()
| void eve::ui::UI::setHostVisible | ( | bool | visible | ) |
◆ setHostWorldAnchor()
| void eve::ui::UI::setHostWorldAnchor | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setHostWorldDistanceScale()
◆ setHostWorldEdgePolicy()
| void eve::ui::UI::setHostWorldEdgePolicy | ( | const std::string & | policy, |
| float | safeMargin = 8.f |
||
| ) |
Configures off-screen handling and safe-edge margin.
- 参数
-
policy Either "hide" or "clamp". safeMargin Minimum distance from the viewport edge in pixels.
引用了 anchor, eve::ui::Clamp, eve::ui::Hide , 以及 host.
◆ setHostWorldOverlap()
| void eve::ui::UI::setHostWorldOverlap | ( | bool | enabled, |
| int | priority = 0, |
||
| float | padding = 4.f, |
||
| float | maxDisplacement = 96.f |
||
| ) |
Configures deterministic overlap avoidance for projected hosts.
- 参数
-
enabled Whether this host may be displaced to avoid overlap. priority Higher values claim space first. padding Extra separation around the measured host rectangle. maxDisplacement Maximum vertical displacement in pixels.
引用了 eve::ui::Allow, anchor, eve::ui::Avoid, enabled, host , 以及 priority.
◆ setImageCornerRadius()
| void eve::ui::UI::setImageCornerRadius | ( | const std::string & | id, |
| float | radius | ||
| ) |
◆ setImageNinePatch()
| void eve::ui::UI::setImageNinePatch | ( | const std::string & | id, |
| float | l, | ||
| float | t, | ||
| float | r, | ||
| float | b | ||
| ) |
◆ setImageNinePatchFile()
| bool eve::ui::UI::setImageNinePatchFile | ( | const std::string & | id, |
| const std::string & | path | ||
| ) |
Applies a .9.png texture and its parsed stretch metadata to an image.
引用了 host, eve::ui::Image, eve::ui::ImageButton, n, eve::ui::NinePatchPanel , 以及 path.
◆ setImageTextureId()
| void eve::ui::UI::setImageTextureId | ( | const std::string & | id, |
| uint64_t | textureId | ||
| ) |
Sets the image texture id.
Bind a texture id from registerTexture() to an Image/ImageButton node.
◆ setImageTint()
| void eve::ui::UI::setImageTint | ( | const std::string & | id, |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
◆ setImageUv()
| void eve::ui::UI::setImageUv | ( | const std::string & | id, |
| float | u0, | ||
| float | v0, | ||
| float | u1, | ||
| float | v1 | ||
| ) |
◆ setItemAbsolute()
◆ setItemAccessibility()
| void eve::ui::UI::setItemAccessibility | ( | const std::string & | role, |
| const std::string & | name, | ||
| const std::string & | description = "" |
||
| ) |
Sets the last item's accessibility role, name and description.
引用了 description, name , 以及 parent.
◆ setItemAlignSelf()
| void eve::ui::UI::setItemAlignSelf | ( | const std::string & | align | ) |
◆ setItemAspectRatio()
| void eve::ui::UI::setItemAspectRatio | ( | float | ratio | ) |
◆ setItemDragSource()
| void eve::ui::UI::setItemDragSource | ( | const std::string & | payloadType, |
| const std::string & | payloadText | ||
| ) |
Marks the most recently added item as a desktop drag source.
- 参数
-
payloadType Stable application-defined type; "file" is reserved for OS files. payloadText Owning UTF-8 payload copied into retained state.
引用了 parent, payloadText , 以及 payloadType.
◆ setItemDropTarget()
| void eve::ui::UI::setItemDropTarget | ( | const std::string & | acceptedType | ) |
◆ setItemEnabled()
| void eve::ui::UI::setItemEnabled | ( | bool | enabled | ) |
◆ setItemFlexBasis()
| void eve::ui::UI::setItemFlexBasis | ( | float | basis | ) |
◆ setItemFlexGrow()
| void eve::ui::UI::setItemFlexGrow | ( | float | grow | ) |
◆ setItemFlexShrink()
| void eve::ui::UI::setItemFlexShrink | ( | float | shrink | ) |
◆ setItemFocusMode()
| void eve::ui::UI::setItemFocusMode | ( | const std::string & | mode | ) |
◆ setItemFocusNeighbors()
| void eve::ui::UI::setItemFocusNeighbors | ( | const std::string & | left, |
| const std::string & | right, | ||
| const std::string & | up, | ||
| const std::string & | down | ||
| ) |
◆ setItemFocusOrder()
| void eve::ui::UI::setItemFocusOrder | ( | const std::string & | previous, |
| const std::string & | next | ||
| ) |
◆ setItemGridColumnSpan()
| void eve::ui::UI::setItemGridColumnSpan | ( | int | span | ) |
◆ setItemMargin()
| void eve::ui::UI::setItemMargin | ( | float | l, |
| float | t, | ||
| float | r, | ||
| float | b | ||
| ) |
◆ setItemMaxSize()
| void eve::ui::UI::setItemMaxSize | ( | float | w, |
| float | h | ||
| ) |
◆ setItemMinSize()
| void eve::ui::UI::setItemMinSize | ( | float | w, |
| float | h | ||
| ) |
◆ setItemMouseFilter()
| void eve::ui::UI::setItemMouseFilter | ( | const std::string & | filter | ) |
◆ setItemPadding()
| void eve::ui::UI::setItemPadding | ( | float | l, |
| float | t, | ||
| float | r, | ||
| float | b | ||
| ) |
◆ setItemPercent()
| void eve::ui::UI::setItemPercent | ( | float | w, |
| float | h | ||
| ) |
◆ setItemSelected()
| void eve::ui::UI::setItemSelected | ( | bool | selected | ) |
◆ setItemSize()
| void eve::ui::UI::setItemSize | ( | float | width, |
| float | height | ||
| ) |
◆ setItemStyleClass()
| void eve::ui::UI::setItemStyleClass | ( | const std::string & | name | ) |
◆ setItemTabIndex()
| void eve::ui::UI::setItemTabIndex | ( | int | index | ) |
◆ setItemTheme()
| void eve::ui::UI::setItemTheme | ( | const std::string & | theme | ) |
◆ setItemTooltip()
| void eve::ui::UI::setItemTooltip | ( | const std::string & | text | ) |
◆ setLayoutGaps()
| void eve::ui::UI::setLayoutGaps | ( | float | columnGap, |
| float | rowGap | ||
| ) |
Sets independent column and row gaps on the current Flex/Grid.
引用了 eve::ui::Flex, eve::ui::Grid , 以及 parent.
◆ setLayoutOverflow()
| void eve::ui::UI::setLayoutOverflow | ( | const std::string & | overflow | ) |
Sets overflow behavior: visible, clip, or scroll.
引用了 eve::ui::Flex, eve::ui::Grid , 以及 parent.
◆ setListItems()
| bool eve::ui::UI::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 and contain a group with that id.
引用了 eve::ui::Group, host, eve::ui::listButtons() , 以及 eve::ui::window().
◆ setNavGamepad()
| void eve::ui::UI::setNavGamepad | ( | bool | enabled | ) |
Sets the nav gamepad.
引用了 enabled, eve::ui::globalTheme() , 以及 eve::ui::Theme::navEnableGamepad.
◆ setNavKeyboard()
| void eve::ui::UI::setNavKeyboard | ( | bool | enabled | ) |
Enables/disables keyboard navigation support.
引用了 enabled, eve::ui::globalTheme() , 以及 eve::ui::Theme::navEnableKeyboard.
◆ setScale()
| void eve::ui::UI::setScale | ( | float | scale | ) |
Global UI scale factor (default 1).
引用了 getScale(), initBackend(), isBackendReady(), scale , 以及 eve::ui::setThemeUiScale().
◆ setStyleClassColor()
| std::string eve::ui::UI::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.
引用了 a, b, g, name, r, eve::ui::setStyleClassColor() , 以及 eve::ui::styleClassStatusName().
◆ setStyleClassMetric()
| std::string eve::ui::UI::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.
引用了 name, eve::ui::setStyleClassMetric(), eve::ui::styleClassStatusName(), x , 以及 y.
◆ setStyleScope()
| void eve::ui::UI::setStyleScope | ( | const std::string & | name | ) |
Applies a named style class to the current open container.
引用了 name , 以及 eve::ui::WidgetDesc::styleClass.
◆ setText()
| void eve::ui::UI::setText | ( | const std::string & | id, |
| const std::string & | text | ||
| ) |
◆ setTextWrap()
| void eve::ui::UI::setTextWrap | ( | const std::string & | id, |
| float | width | ||
| ) |
◆ setTheme()
| bool eve::ui::UI::setTheme | ( | const std::string & | name | ) |
Named preset: "dark" / "light" (case-insensitive). Returns false if unknown.
引用了 name , 以及 eve::ui::setThemeByName().
◆ setThemeDark()
| void eve::ui::UI::setThemeDark | ( | ) |
◆ setThemeLight()
| void eve::ui::UI::setThemeLight | ( | ) |
◆ setThemeScope()
| void eve::ui::UI::setThemeScope | ( | const std::string & | theme | ) |
Overrides the current open container's inherited subtree theme.
引用了 theme , 以及 eve::ui::WidgetDesc::themePreset.
◆ setValue()
| void eve::ui::UI::setValue | ( | const std::string & | id, |
| float | value | ||
| ) |
◆ setValueText()
| void eve::ui::UI::setValueText | ( | const std::string & | id, |
| const std::string & | value | ||
| ) |
◆ setVisible()
| void eve::ui::UI::setVisible | ( | const std::string & | id, |
| bool | visible | ||
| ) |
◆ shutdownBackend()
| void eve::ui::UI::shutdownBackend | ( | ) |
Destroys the platform UI backend.
引用了 eve::ui::UISystem::clearBackend() , 以及 releaseSquirrelRoots().
被这些函数引用 ~UI().
◆ tickTweens()
| void eve::ui::UI::tickTweens | ( | double | nowMs | ) |
Advance pending UI tweens using an explicit clock (ms).
- 参数
-
nowMs Monotonic presentation clock in milliseconds.
- 注解
- beginFrameAndRender() calls this with the wall clock; tests inject time here.
引用了 eve::ui::UiTweenDriver::tick().
被这些函数引用 beginFrameAndRender().
◆ unregisterTexture()
| void eve::ui::UI::unregisterTexture | ( | uint64_t | textureId | ) |
Release a texture id previously returned by registerTexture().
- 参数
-
textureId Opaque backend-neutral texture id; zero is ignored.
◆ viewportActive()
| bool eve::ui::UI::viewportActive | ( | const std::string & | id | ) |
◆ viewportCanvas()
| graphics::Canvas * eve::ui::UI::viewportCanvas | ( | const std::string & | id | ) |
Returns the offscreen render target of a selected-host Viewport widget.
- 返回
- Borrowed nullable Canvas owned by Graphics; null precedes layout or when the id is absent. @ownership Graphics owns the canvas; UI only registers and presents it. @lifetime Valid until viewport recreation, graphics reset, or the next mutation that replaces the target; copy no pointer across frames. @thread Call on the render/UI thread. @reentrancy The query invokes no callbacks; do not destroy or replace the target re-entrantly.
引用了 eve::ui::UISystem::ensureViewport(), host, id, key, state , 以及 eve::ui::UISystem::viewportState().
◆ viewportDragDX()
| float eve::ui::UI::viewportDragDX | ( | const std::string & | id | ) |
◆ viewportDragDY()
| float eve::ui::UI::viewportDragDY | ( | const std::string & | id | ) |
◆ viewportHovered()
| bool eve::ui::UI::viewportHovered | ( | const std::string & | id | ) |
◆ viewportMouseX()
| float eve::ui::UI::viewportMouseX | ( | const std::string & | id | ) |
◆ viewportMouseY()
| float eve::ui::UI::viewportMouseY | ( | const std::string & | id | ) |
◆ viewportWheel()
| float eve::ui::UI::viewportWheel | ( | const std::string & | id | ) |
◆ wantCaptureKeyboard()
| bool eve::ui::UI::wantCaptureKeyboard | ( | ) | const |
◆ wantCaptureMouse()
| bool eve::ui::UI::wantCaptureMouse | ( | ) | const |
该类的文档由以下文件生成:
Public 成员函数 继承自