Skip to main content

Crate ferroui_designer

Crate ferroui_designer 

Source
Expand description

Reusable native workspace for editing FerroUI XAML.

DesignerSession is the UI-thread transaction boundary used by source editing, visual tools and automation. DesignerWorkspace is an optional embeddable view of that session. Neither starts a window, server or background transport.

Re-exports§

pub use ferroui_designer_tools as tools;

Modules§

sharing
UI-thread coordination for the reusable room service. Workers own all transport, credentials and disk I/O; the session remains the only authority that mutates authored/preview state.

Structs§

AssetToolbox
CanvasGuide
CanvasGuideEditSnapshot
Accepted source and view identity for a staged guide editor. A source change retires the draft even when it returns to the same text; camera changes alone are harmless.
CanvasGuideSettings
CanvasGuideViewSnapshot
Retained tab presentation. This can only restore into the matching document allocation.
CanvasGuidesEditor
CanvasLayerChoice
One authored control in the native front-to-back hit stack. The path distinguishes unnamed controls and repeated names in separate XAML namescopes.
CanvasSelectionSnapshot
Accepted canvas context. Native identities and geometry supplement document/view epochs: runtime-only layout or template replacement also retires a retained menu.
CanvasViewport
Maps authored artboard coordinates to a clipped native canvas without remeasuring application content: viewport = artboard * zoom + offset.
ComponentEditPreview
ComponentLibrary
ComponentLibraryItem
A definition in the current document or an application-registered asset. IDs are host identities, independent of display names and resource aliases.
CopiedProperty
A displayable immutable clipboard entry. Its private value retains the exact source literal or namespace-closed object graph, rather than the current rendered value.
DefinitionPreviewOptions
DefinitionPreviewSettings
DefinitionPropertyField
A host-created typed editor, shared with the regular property inspector.
DefinitionReference
DefinitionScope
DesignSurface
Transparent native adorner for selecting, moving, resizing and rotating live controls. Motion changes only the adorner; release commits one semantic transaction. Escape and capture loss cancel the gesture, so neither source nor history receive partial drags.
DesignTimeEditor
DesignTimeEditorModel
DesignTimeProperty
DesignTimeSnapshot
A popup owns an immutable acceptance token. Leaving and returning to the same selection or definition cannot make an obsolete draft current again.
DesignerAsset
A source snippet available to a designer host. Custom controls can register their own category, description and vector icon without modifying the shell.
DesignerDefinitionAsset
Exact XAML supplied by a library or a project. The designer does not reconstruct a compiled template from live visuals. The source is copied through an AST edit.
DesignerSession
Shared UI-thread state. All authored changes pass through the same document history; runtime load errors preserve both source and the last successfully rendered tree.
DesignerWorkspace
A native, embeddable workspace. The host retains the returned Rc for the lifetime of the view. Event callbacks capture it weakly, and dropping it stops the preview timer.
Document
An owned source buffer with a last-valid syntax snapshot and bounded history. Runtime acceptance is deliberately separate: the host may keep an older live tree when compilation fails, while authored and syntactically valid XAML stays available for correction.
DragVisualGhost
A native drag snapshot. Capture after the move threshold and drop it when the gesture finishes or cancels; no accepted control property is changed.
EasingPreview
A small native graph of the incoming keyframe easing. Hosts can embed it beside their own editor; sampling follows the animation engine, including overshoot.
FocusLabelAssociation
A real Label.Target association and the authored inputs reachable in its namescope.
FocusLabelTarget
FocusOrderCatalog
FocusOrderEditor
A staged editor for group-local order, tab eligibility, modes and Label.Target. Every command is submitted together on Apply; Cancel discards the complete draft.
FocusOrderItem
One runtime tab stop or group entry. An absent source identity is intentional: generated controls can influence navigation without being editable XAML nodes.
FocusOrderScope
Each non-Continue container establishes a separate native TabIndex group. Continue descendants share the nearest group’s index space.
FocusOrderSnapshot
A retained dialog cannot edit another document, another definition scope, or a preview whose navigation semantics have changed without a source edit.
GridTrackEditor
An axis picker, length/unit editor and insertion/removal commands in one native row. Configure it from accepted state; a change callback must validate and apply the intent.
LayerEditSnapshot
Immutable source-row/host intent. A lock/unlock round trip invalidates a retained callback just as a source, document or definition-scope transition does.
LayerState
Source-row presentation. Direct flags can be changed on this row; inherited flags require changing their ancestor. Isolation preserves visible ancestor context.
LayerViewSnapshot
A tab retains this alongside its Document clone. It restores only into the exact same syntax allocation and URI, never a new document that happens to reuse NodeIds.
LayoutEditPreview
Immutable, validated authoring result paired with the geometry presented to the user. A rejected result still contains an explicit target and explanation for red feedback. The edit list is private: commit applies the exact accepted preview after checking its source, selection, permissions and provider identity again.
LayoutHelperRenderState
Optional view state; neither hovering nor rendering changes authored layout.
LayoutHelperSnapshot
Portable panel-local helper geometry and its measured affine mapping to the artboard. Renderers transform vertices explicitly so their pens, labels and hit targets can stay constant in screen space under zoom, rotation, reflection and shear.
PreviewEnvironment
PreviewEnvironmentEditor
The host retains this object while its control is visible. Callbacks are weak and do not make control/host cycles; applying validates the complete draft before notifying the host.
PreviewHostOptions
PreviewPrototype
PreviewPrototypeElementChoice
The workspace supplies only eligible authored elements from its accepted sources.
PreviewPrototypeFlow
PreviewPrototypeFlowEditor
PreviewPrototypeFlowManifest
PreviewPrototypeHotspot
Clipped bounds are expressed in the accepted stage host’s logical coordinates.
PreviewPrototypeLink
PreviewPrototypeLinkEditor
PreviewPrototypeLinkManifest
PreviewPrototypeManifest
Portable graph descriptors. Every stage reference is an index into the owning preview-stage manifest, never a runtime ID or a source node’s transient identity.
PreviewPrototypeOverlay
PreviewPrototypeOverlayOptions
Presentation settings for one overlay entry. Outside dismissal is opt-in; explicit CloseOverlay and Back remain available regardless of that setting.
PreviewPrototypePlaybackInfo
PreviewPrototypePlayerLayer
A retained native screen in the base screen’s logical coordinate space. The first layer is the base screen; subsequent layers are modal overlays.
PreviewPrototypePlayerView
PreviewPrototypeSession
A bounded navigation cursor over one accepted graph. It owns no source session, controls, timers or application state. Hosts validate native/source authority before activating an interaction and can retain native views across Back.
PreviewPrototypeView
PreviewRequest
A factory receives the actual authored document and base URI. It may instantiate a real registered code-behind class and call populate to apply XAML before wiring its handlers.
PreviewSizePreset
PreviewSourceAnchor
A namespace-qualified source path. No runtime or session-local numeric node ID is persisted. Named/keyed paths survive sibling insertion and reordering, while ambiguous unnamed siblings are rejected instead of guessing which view was meant.
PreviewSourceSegment
PreviewStageBoard
One UI-thread collection of native comparison stages across the host’s open document buffers. It never owns document history or performs authored mutations.
PreviewStageConfiguration
PreviewStageEditor
A reusable form with an independently scrolling body and fixed Apply/Cancel footer. Source documents are immutable snapshots used to offer actual definitions and states.
PreviewStageExportOptions
Raster density relative to the stage’s existing logical layout. This changes the bitmap density, never the application’s available layout space.
PreviewStageImage
A captured PNG and the dimensions of the exact native frame that produced it. The image is owned bytes, so a save picker may await without retaining controls.
PreviewStageInfo
PreviewStageManifest
PreviewStageMatrix
An empty environment axis keeps the base stage’s value. Each nonempty axis participates in the Cartesian product. State axes override only their named owner/group; the base stage’s other selected state endpoints remain intact.
PreviewStageMatrixEditor
Empty check-box groups retain the original stage’s values. Applying requests a complete matrix only after the host verifies the source and board still match.
PreviewStageMatrixSize
PreviewStageSelection
PreviewStageSelectionToken
An accepted native/source identity. Its private weak reference and retained AST prevent callers from manufacturing a source selection using a stale visual ID.
PreviewStageSize
Resolved native logical dimensions, independent from a card’s visual scaling.
PreviewStageSource
A host-supplied authored buffer. pending means text has been staged but its accepted runtime update has not yet been requested; the board never applies it.
PreviewStageState
PreviewStageStateAxis
PreviewStageView
The view never owns document or runtime state. A host supplies stable native stage controls and immutable descriptions, then handles explicit guarded commands.
PropertyBindingDraft
Edits only arguments that were explicitly changed. Unknown arguments, nested extensions, aliases, quoting and spacing in every untouched argument are retained. binding_extension must be the host’s namespace-resolved framework extension; an application extension with the same local name is deliberately not accepted.
PropertyBindingEditor
Native structured controls and an exact-expression fallback. value() accepts either the fields or the expression. When both were edited, the user must reload the fields explicitly, preventing a stale form from overwriting a newer expression.
PropertyClipboard
Workspace-local clipboard. Literal and self-contained object values can be pasted into another document. Resources additionally require the exact captured source AST and identical unambiguous lookup at every destination; they never silently rebind.
PropertyColorEditor
A native swatch and XAML color field with a staged spectrum/palette flyout.
PropertyComponentsEditor
A linked value or compact 2 × 2 editor for Margin, Padding, BorderThickness or CornerRadius. All fields commit together on Enter; Escape restores the accepted value. A linked edit deliberately sets every component and is also valid for mixed selections.
PropertyEditorContext
PropertyEditorMetadata
PropertyInspectorView
Local, reusable inspector preferences. No source or undo entries are created.
PropertyNumberOptions
Numeric interaction policy shared by labels, keyboard nudging and component editors.
PropertyNumberScrubber
A property-name label that also scrubs a numeric value. Dragging shows a local draft; releasing commits once. Escape, pointer capture loss and reconfiguration cancel.
PropertyObjectDraft
PropertyPasteChange
PropertyPastePreview
An accepted set of compatible destination writes. Unsupported destinations are reported explicitly; malformed values or protected layers reject planning as a whole.
PropertyResourceChoice
PropertyTransferEditor
A native picker with fixed Apply/Cancel controls and an independently scrolling body. Compatible authored values are selected initially; every skipped value is explained.
PropertyTransferIssue
PropertyVectorEditor
Labeled Point/Size/Vector/Rect/Matrix and relative-value editor. Enter commits all components once. Mixed fields remain empty until every component has been supplied.
ResourceDefinitionEditor
ResourceDefinitionModel
RuntimeNode
One live-tree row; inspector identities remain shared with MCP and DevTools.
TimelineLane

Enums§

AssetIcon
AssetViewMode
The asset library keeps the same filtering and insertion semantics in both presentations.
CanvasGuideAxis
CanvasWheelMode
Wheel behavior for the design canvas. Fractional native wheel deltas are preserved.
ComponentLibraryFilter
CopiedPropertyKind
DefinitionCreationKind
DefinitionEditorCommand
DesignGesture
Semantic pointer results. A host translates these into layout-adapter transactions.
DesignTimeEdit
Every command changes only a design-namespace value. Application attributes, bindings and property elements retain their exact source spelling.
Edit
Commands are evaluated against a private candidate, then committed once. Consecutive attribute edits are validated together, allowing a property and its namespace declaration in either order. Other commands observe preceding commands. Element-child indices exclude text, whitespace and comments. Move indices refer to the destination list after removing the moving node.
FocusOrderEdit
LayerCommand
LayoutMatch
Match logical layout dimensions to the first selected control. Render transforms and ancestor scaling remain intact, so matching dimensions need not match screen-space size.
LayoutReset
Remove authored values so the native style, inheritance and default layers take effect. All includes margin, alignment, explicit dimensions and min/max constraints. It does not change padding, content alignment, transforms, panel placement or child definitions.
NavigationPane
OutlineCommand
Structural edits in source order. Commands operate on the outermost selected elements, preserve their identities, and reject partial moves across incompatible content hosts.
OutlineMode
PreviewFlowDirection
PreviewPrototypeAction
PreviewPrototypeActionManifest
PreviewPrototypeOverlayPlacement
Placement in the base screen’s logical coordinate space. The native presenter constrains the resulting visible rectangle to the prototype viewport.
PreviewPrototypePlayerAction
PreviewPrototypeViewAction
PreviewStageAction
Commands retain the card’s accepted epoch. Hosts reject callbacks from a replaced graph or dismissed menu rather than applying them to a different preview scenario.
PreviewStageComparison
PreviewStageLayout
Native measurement policy for a stage. Environment dimensions are the finite layout proposal and maximum size; fitting axes use the content’s desired size.
PreviewStageMode
PreviewStageStatus
PreviewStageTarget
PreviewStatus
The authored document and preview have independent acceptance states.
PreviewTheme
PropertyBindingOption
PropertyBindingSource
PropertyComponentsKind
Four-component property ordering. The two-value XAML shorthand differs between thickness (horizontal/vertical) and corner radius (top/bottom).
PropertyEditorKind
PropertyInspectorFilter
A source filter applies in addition to the property search text.
PropertyInspectorSort
How property rows are arranged. This changes only the inspector view.
PropertyValueEdit
PropertyValueSource
WorkspaceViewMode

Constants§

MAX_PREVIEW_PROTOTYPE_FLOWS
MAX_PREVIEW_PROTOTYPE_HISTORY
MAX_PREVIEW_PROTOTYPE_LINKS
MAX_PREVIEW_PROTOTYPE_OVERLAYS
MAX_PREVIEW_PROTOTYPE_OVERLAY_OFFSET
MAX_PREVIEW_STAGES
MAX_PREVIEW_STAGE_EXPORT_BYTES
MAX_PREVIEW_STAGE_EXPORT_PIXELS
PREVIEW_SIZE_PRESETS
Generic logical sizes deliberately avoid claiming a particular device’s scale factor.
STARTER_XAML
The self-contained example opened by Designer Studio and usable by hosts.

Traits§

PropertyEditorFactory
Return a native control when this factory handles the property; otherwise let the next factory try. Hosts register factories in priority order on crate::DesignerWorkspace.

Functions§

binding_expression
Build a binding without interpolating path/key strings into markup syntax. Existing converter, fallback, validation and extension arguments survive structured changes.
capture_preview_stage_png
Capture a native stage at its existing arranged size, excluding all ancestors such as the board’s Viewbox, card title and commands. Pass the board’s stage control, not its card. No application input, layout, source or clock is changed.
create_property_editor
Shared inspector/definition-editor pipeline. First matching registered factory wins; built-ins and a source-safe fallback follow. Hosts supply a revision-bound commit.
default_designer_assets
Practical defaults rather than runtime-only infrastructure types. Hosts may append project-specific controls using AssetToolbox::register.
designer_chrome_style
Load the reusable, scoped designer chrome styles and semantic color resources.
hit_test_layout_handle
Find the nearest editable grip in screen space. Disabled or singular scenes remain visible but cannot intercept a pointer gesture.
hover_layout_handle
Find the nearest visible grip for hover feedback, including disabled grips so their reason can be explained. Use hit_test_layout_handle to begin an edit.
navigation_mode_name
plan_design_time_edits
Source-only planning is independently reusable by host editors and automation. A private candidate evaluates the complete batch before the caller commits once.
plan_element_names
Plan an atomic name change using the language service’s namescope-aware reference grammar. Existing Name/XAML directive aliases, quoting, unrelated strings and comments are retained. None removes names only when doing so cannot leave a known reference unresolved.
property_value_data_format
Cross-process native drag format for a single XAML property value, such as a color, resource expression or binding. Targets still validate against their active document.
render_layout_helpers
Draw a model scene using the standard designer adorner palette.
render_layout_helpers_with_state
Draw a scene with native hover/drag feedback and optional viewport clipping.
render_manipulation_metrics
Paint bounded alignment guides, neighboring gaps and measured selection size. Inputs are artboard-space bounds. This provides visual feedback only; snapping and accepted layout changes remain owned by the gesture/session engines.
resolve_property_editor_metadata
Resolve actual runtime enum members, nullable forms and parsers when a property is available. The type-name fallback also supports source-only/template setter editors.

Type Aliases§

NodeId
Stable document-local identity. IDs are never reused, including after undo.
PreviewFactory
PreviewStageId
PreviewStageSnapshot
PropertyLiteralValidator
PropertyValueCommit
ResourcePreviewFactory