SDK · crate

kinogaki-studio-ui-api

SDK

Kinogaki Studio's UI layer for plugins.

Repository
SDK (kinogaki/studio-sdk)
Folder
sdk/crates/ui-api
Source
42 files, 8,691 lines
Tests
5 files, 1,783 lines
Depends on This crate Used by Kinogaki Studio's headless plugin API.kinogaki-studio-api Kinogaki's viewport packet contract: what a data type hands Studio's viewport to draw, with no GPU or UI API.kinogaki-viewport-api kinogaki-studio-ui-api A Kinogaki Studio plugin that brings a context with its UI.example-pin-board Core's own SDK package (`kinogaki.core`): what Studio holds whatever plugins are installed.kinogaki-core-package Kinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one.kinogaki-editor Studio's test harness: the real editor, its event routing and its background work, driven offscreen with only the packages a test names.kinogaki-harness The Layout context: a page on the 2D canvas and the pieces arranged on it, images and text, back to front in the order their nodes run.kinogaki-layout The Mesh plugin: polygon modelling, Maya's and Houdini's toolset on core's editing API (`plugins/mesh/PLAN.md` holds the inventory and its groups).kinogaki-mesh The plugin SDK's UI layer over lib-ui: the SDK's [`Ui`](studio_ui_api::Ui) and [`Painter`](studio_ui_api::Painter), its sheets and the host's services, implemented over lib-ui.kinogaki-sdk-ui The crates Studio and its plugins share, built once as a Rust dylib.kinogaki-shared The UI layer's test support (a dev-dependency only): headless fakes of the host's UI for plugin unit tests: [`RecordingUi`] and [`RecordingPainter`] record what a plugin asks to show and draw, and play back scripted user actions, with no window and no GPU ...kinogaki-studio-ui-api-testing Kinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin.kinogaki-testkit
depends onused by tests alonedependencies for tests alone are listed below, not drawn

What it is

Kinogaki Studio's UI layer for plugins.

The host draws; plugins never see its UI toolkit. A plugin's panels, tool cards, overlays and settings pages are written against this crate's own types and traits, and Studio implements them over its private UI library. So the SDK stays self-contained (this crate depends on the standard library and kinogaki-studio-api alone), and Studio can change how it draws without breaking a plugin.

What a plugin uses, from the most declarative to the most direct:

  • Data the host draws. A sheet::Sheet of typed fields is an inspector, a tool's card body or a settings page (Ui::sheet, UiExt::sheet_keyed); a CardSpec or a PopoverSpec frames floating content; ValueFields are the heads-up boxes a drawing tool types into (Ui::value_fields).
  • Immediate widgets on Ui: labels, buttons, toggles, number fields, sliders, text fields, choices, swatches, menus, and layout (horizontal, vertical, child, scroll_vertical, enabled).
  • **A Painter** for overlays: segments, circles, rectangles, polylines, text and icons, single or in batches, measured text, and reserved Slots. Meshes and surfaces are not painted: they are the data types' display surfaces, drawn by the host's viewport.
  • **UserInput**: this frame's pointer, keys and typing as plain data.

And the plain values they exchange: geom (points, vectors, rectangles, alignment, in f32 screen points), Color (premultiplied sRGBA bytes), the host-filled Theme, Fonts by role and icons by name (Studio's own, "cube", or a package's, "acme.trees/leaf": see kinogaki_studio_api::icon; an unknown name draws Studio's neutral icon), and Ids.

Pure viewport maths the host's own tools use is here too, so a plugin's tools behave exactly like Studio's: the transform gizmo's geometry and hit testing (gizmo) and point-label placement (labels), over a host-provided ViewProjection.

The host interface (host) is what a package's UI asks of Studio: undo and gestures, the session's slots, selections, the document, objects' networks, views, status, the shell, the transform tool and settings, reached through one call context (host::Cx). A package's UI (package) is its contexts, each a set of parts (levels, a viewport layer, an inspector, a vocabulary…) over the package's own state, which the host keeps and lends for one call at a time.

The companion crate kinogaki-studio-ui-api-testing (a dev-dependency only) has headless fakes (RecordingUi, RecordingPainter, and FakeHost with its in-memory FakeNetworks and Hosting for a package's parts) for plugin unit tests.

Depends on

CrateRepositoryAsWhat it is
kinogaki-studio-apiSDKnormalKinogaki Studio's headless plugin API.
kinogaki-viewport-apiSDKnormalKinogaki's viewport packet contract: what a data type hands Studio's viewport to draw, with no GPU or UI API.

Third-party

None.

Used by

CrateRepositoryAsWhat it is
example-box-nodeSDKtestsA Kinogaki Studio plugin that adds a Box node.
example-pin-boardSDKnormalA Kinogaki Studio plugin that brings a context with its UI.
kinogaki-compComptestsComp as an SDK package (kinogaki.comp): what fills Studio's Comp context (kinogaki.core.comp, core declares it, inside a Render Output object).
kinogaki-core-packageCore and the appnormalCore's own SDK package (kinogaki.core): what Studio holds whatever plugins are installed.
kinogaki-editorCore and the appnormalKinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one.
kinogaki-harnessCore and the appnormalStudio's test harness: the real editor, its event routing and its background work, driven offscreen with only the packages a test names.
kinogaki-layoutLayoutnormalThe Layout context: a page on the 2D canvas and the pieces arranged on it, images and text, back to front in the order their nodes run.
kinogaki-meshMeshnormalThe Mesh plugin: polygon modelling, Maya's and Houdini's toolset on core's editing API (plugins/mesh/PLAN.md holds the inventory and its groups).
kinogaki-sdk-uiCore and the appnormalThe plugin SDK's UI layer over lib-ui: the SDK's Ui and Painter, its sheets and the host's services, implemented over lib-ui.
kinogaki-sharedCore and the appnormalThe crates Studio and its plugins share, built once as a Rust dylib.
kinogaki-spectreSpectretestsSpectre, the spectral path tracer, as a Kinogaki Studio render plugin.
kinogaki-studioCore and the apptestsKinogaki Studio: the editor in a window, after the plugins load.
kinogaki-studio-ui-api-testingSDKnormalThe UI layer's test support (a dev-dependency only): headless fakes of the host's UI for plugin unit tests: RecordingUi and RecordingPainter record what a plugin asks to show and draw, and play back scripted user actions, with no window and no GPU ...
kinogaki-testkitCore and the appnormalKinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin.
kinogaki-workflowsWorkflowstestsTests alone: tests/workflows drives what a person does across the plugins the app ships, through the real editor offscreen.

Modules

Public types and traits

At the crate root

Traits PainterUiUiExt

Structs Align2ButtonSpecCardResponseCardSpecCircleColorEditsFieldKeyFontIconShapeIdInnerResponseKeyFilterMenuItemMetricsModifiersPointerPopoverSpecPosRadiiRectRectShapeResponseScrollSpecSegmentSenseSheetStyleSlotStrokeTextEditSpecTextShapeTextStyleThemeUserInputValueFieldValueFieldsVec2ViewProjection

Enums AlignChoiceLookEventFontRoleKeyOrderPointerButtonPopoverLookScrollUnitShapeStrokeKind

Type aliases BodyRowMenu

By module: 159 public types and traits in 36 modules

card CardResponseCardSpecOrderPopoverLookPopoverSpec

color Color

geom AlignAlign2PosRectVec2

gizmo TransformTool

gizmo::geometry GizmoFrameHandle

gizmo::pivot PivotPivotFrame

gizmo::step TransformPhaseTransformSpaceTransformStep

host CxHostLatestExtInspectorCxLatestAskedLatestJobLatestKeyLatestResultSnapOnUnitsServiceViewCxWaker

host::capabilities HostDocHostDocExtHostSelectionHostShellHostSlotsHostSlotsExtHostStatusHostToolsHostTransformHostUndoHostView

host::data GroundHostPrefsInspectedNodeRowsPlacePointerOverViewViewCamera

host::network HostNetwork

id Id

input EventKeyKeyFilterModifiersPointerPointerButtonScrollUnitUserInput

labels Label

package ContextPartUiPackageWithUi

package::data CandidateEndedGizmoUseLevelPresetLevelSpecLiveHandlesPanelPanelScopeTakes

package::display DisplayKindDisplayOptionDisplayScope

package::edited EditedGhostGhostTone

package::hosting RegisteredState

package::library BarMenuBarSectionContextMenuSpecHeldKeyBindingKeysActiveKeyStoreLevelItemsLibraryMarkingDefaultMenuDefaultsMenuEntryObjectMenusPlacesSharedShelfShelfEntrySituationSuggestedTabSpecViewMenusViewportSpecVocabularyItemWhen

package::parts::content InvokedRowAction

package::settings SettingsPage

package::view HoldsKeyPress

paint CircleIconShapePainterRectShapeSegmentShapeSlotStrokeStrokeKindTextShape

projection ViewProjection

response InnerResponseResponseSense

sheet SheetStyleText

sheet::edits ActionEdits

sheet::items AnimationBandFieldItemSheet

sheet::keyed FieldKeyKeyed

sheet::kind ChipFileDialogFileFilterKindPathChoiceSocketSocketKindTrailing

text FontFontRoleTextStyle

theme MetricsRadiiTheme

ui BodyRowMenuUiUiExt

value_fields ValueFieldValueFields

widgets ButtonSpecChoiceLookMenuItemScrollSpecTextEditSpec

Besides these, 3 public functions at module level.