Skip to main content

Crate ui

Crate ui 

Source

Re-exports§

pub use assoc::assoc_switch;
pub use theme::color_mix;
pub use theme::contrast_ratio;
pub use theme::luminance;
pub use theme::Theme;
pub use theme::ThemeError;
pub use consts::*;
pub use keys::*;

Modules§

consts
i18n
keys
theme

Macros§

app_version
The app’s own version: version= of apps/NAME/PACKAGE, which build_rs.py hands to rustc as JFGUI_VERSION (every program of the app); “0.0.0” without one. An expression of type &'static str: const APP_VERSION: &str = rt::app_version!();, update::Config::new(app, rt::app_version!(), ..).
main
(see above)

Structs§

AppDesc
the app descriptor (APP_DESC): title, AF_* flags, sizes in DIP, accent 0xRRGGBB. Write AppDesc { title: "..", w: .., ..AppDesc::NONE } so later fields keep their defaults.
BarSeries
one series of a bar chart
CanvasDesc
a canvas for ui.canvas_gpu
CanvasView
the view of a canvas: the content point (u, v) shows at the window pixel position (ox + u * scale, oy + v * scale)
CardDesc
what an action card shows (ui.action_card); ..Default::default() for the parts it has not
Chord
a key with modifiers: VK code (the platform’s E_KEY_DOWN codes) and MOD_SHIFT | MOD_CTRL | MOD_ALT | MOD_SUPER
CmdItem
an item of a command bar
CodeDoc
the document of ui.code_editor (see the module header)
CodeStatus
what code_status reports
CodeTheme
the colours of a code editor (0xAARRGGBB); bold / italic: a bit per SY_* kind
Command
CMD record: one row of the app’s command table (AppDesc::cmds)
CompItem
a completion item (see the module header)
CompList
what complete() offers: the items replace the word from start on
DEdge
an edge from key a to key b (ports or nodes) along route DR_* through a range of DModel::wps
DModel
the app’s diagram, borrowed for one call; ver changes with every geometry change
DNode
a node: world rectangle x, y, w, h, its ports (a range of DModel::ports), DN_* flags
DPort
a port: its position relative to the node’s top left corner, DPT_* flags
DeskState
the windows of an area: kept by the app and passed to desk_begin / desk_next / desk_end / desk_taskbar. Plain data: save() / load() turn it into a few lines of text (desk 1, then win KEY X Y W H STATE from the bottom of the z-order to the top – x, y from the area’s start corner, outer size, all DIP; STATE the DW_* bits – and active KEY; unknown lines are skipped). The reserved strip is no part of it.
DeskWin
a window as the app describes it to desk_begin every frame
DgFrame
what a DgPaint gets at render time
DgGeo
the routes of every edge in model order and the spatial buckets of nodes and edges, built once per model version (DgFrame::find asks the buckets)
DgRoute
an edge’s route in world units: the polyline, the indices of its defining points (a, the waypoints, b) in it, its bounding box x0, y0, x1, y1 (empty pts: an end is unknown)
Diag
a diagnostic of a code editor: a part of the text in lines and columns from 1 as compilers report them (columns count characters, a tab is one; the end is exclusive, an end at or before the start marks the one character at the start, past a line’s end the end of the line), a severity DIAG_* and the message (see the module header)
DiagramState
the widget’s state, kept by the app: the view, the selection (node and edge keys), the focused node, grid and snapping, the hover, the gesture in progress and the index
DockPanel
a panel as the app describes it to dock_begin every frame
DockState
the layout of a dock area: kept by the app and passed to dock_begin / dock_next / dock_end. save() / load() turn it into a few lines of text: dock 1, then side S SIZE COLLAPSED, group S TAG SIZE ACTIVE PANEL..., float SLOT X Y W H HOME HOMETAG ACTIVE PANEL..., hidden PANEL S TAG POS X Y W H HOME HOMETAG (unknown lines are skipped).
DonutSlice
one slice of a donut
DragData
the content of one drag (a drop that arrives, or what the app drags)
Finger
a finger that is down (ui.touch_fingers): px of the window, logical in a mirrored one
Fmt
the format of a run of characters; zero / empty fields take the editor’s defaults
FontSel
a font choice (see the module header)
Gfx
the gfx target of a custom draw call (render time): the draw context (clip, origin, colour), the surface and the text engine (its path and rasterizer serve Shapes)
GpuOutput
what a window shows through (Ui::gpu_output): status and counters of the GPU output, for tests and measurements
Grammar
a language (see the module header)
GridCol
a grid column: title, width and minimum width in DIP, GC_* flags
GridEv
what happened in a grid during the pass
GridState
the app-owned state of a grid: selection (by key), current row, sort, column widths
HexEv
what happened in a hex view during the pass
HexMark
a marked byte range of a hex view (a protocol field)
HexState
the app-owned state of a hex view: selection, bytes per row, caret
Highlighter
the highlighter of a grammar (see the module header)
History
the undo and redo steps of a state S
ImageViewState
the app-owned state of an image view (see the module header of imgview.rs)
JumpTask
one task of the jump list: starts this program with args
LcMarker
a marker on the x axis: a line at t0, or the range t0 .. t1 shaded (fault injections)
LcSeries
one series of a line chart: a label, its points, colour, line or area, unit
LcThreshold
a threshold: a dashed horizontal line at a value with a label at its right end
LineChange
a change of the lines: first .. first + old became first .. first + new (at revision rev)
LineChart
what ui.line_chart shows: the series and how (see the module header of chart.rs); build it with LineChart::new(&series) and the setters, or change the fields
MdBlock
a block of the document (see the module header)
MdBox
a box of CSS around blocks: what a block element’s style gives (MdBlock::boxes); lengths in px at 100 % text, the sides top, right, bottom, left
MdDoc
the document (see the module header)
MdEv
what a document view reports (see the module header)
MdField
a field of a form (its first value: the view keeps the current one, MdViewState)
MdFieldSpot
a visible field in reading order: block, byte of its U+FFFC, the field (index + 1)
MdForm
a form of HTML
MdImage
an image of the document
MdLinkSpot
a link in reading order: block, bytes a .. b of its text, the link (index + 1)
MdNode
a node of an HTML document’s element tree (an element or a text): the same across changes of the document; a freed node’s handle refers to nothing (MdDoc::alive)
MdOption
a choice of a drop-down list: the value sent, the text shown
MdSpan
a range of a block’s text with its style
MdSubmit
a form being sent: what a browser would send (MdViewState::form_data)
MdTable
a table: its columns’ alignment (MA_*)
MdViewState
the state of a document view (see the module header)
Monitor
one monitor
NavState
the app-owned state of a navigation pane
Para
a paragraph: its text (no ‘\n’) with runs of formats, and its attributes. The attribute fields may be set directly while building a document (not undoable; RichDoc’s setters are).
RangeF
RANGE_F min, max, step, decimals, flags – descriptor of an f64 value
RibbonGroup
One ribbon group. Reserve id..=id + 3 for its box, overflow and popup.
RibbonLayout
Per-frame ribbon layout: shrink groups before moving them into labeled flyouts.
RibbonMetrics
Style-owned ribbon geometry in DIP. A scrolling ribbon keeps every group’s original arrangement; a collapsing ribbon can use the compact/flyout layouts.
RibbonSample
Explicit typography for a document sample, independent of the application’s theme. Sizes and baseline displacement are 24.8 DIP; positive displacement moves downwards.
RichDoc
the document of ui.richtext (see the module header)
Runtime
An owned application driven one event/tick at a time. Browser hosts and automation use the same passes, input handling and software renderer as native windows.
Sem
semantic record (dump / expect) [SR_*]
SeriesBuf
a time series for line_chart: (t, value) points in a ring that keeps the newest capacity (a full buffer drops its oldest point on push). Times never decrease (push refuses an earlier one, so every lookup is a binary search); a value that is not finite (NaN) is a gap where the line breaks. ver() changes with every change: a chart redraws only then.
SeriesCol
one pixel column of a downsampled series (SeriesBuf::columns): the points with a finite value whose time falls into it
Shared
a value the app shares with the library: the asm passes its address and the library keeps it (a window’s open flag, its WINRECT, a content dialog’s open flag)
SigHelp
signature help inside a call
Slot
persistent per-id state (slot) [SL_*]
Snapshot
an Edit of a whole small value (Clone): before and after
Sp
the SP record: inputs of a widget’s size / paint call (SP_* of style.inc)
Stock
the stock data-view and shell painters (Style::data / Style::shell default)
Svg
a parsed SVG document (immutable; render it as often as needed)
SvgFonts
the faces SvgText may use (taken from the Ui at frame time)
SvgText
an img_svg::TextHook on a text engine
SymPalette
the colours of a symbol’s roles (straight 0xAARRGGBB, index = SYM_* role)
Symbol
a parsed multi-colour symbol (see the module comment)
SymbolCache
rasters of symbols per (id, width, palette), the least recently used one dropped beyond 256
TermState
the state of one console (see the module header); the app keeps it between frames
TextEdit
a change of a CodeDoc’s text: a .. b becomes text (CodeDoc::apply_edits)
TextPos
a place in a document: the line (code) or paragraph (rich text) and a UTF-8 byte offset into its text
TextSel
a selection: the anchor stays where it began, the caret moves (equal: no selection)
TextSurfaceLine
One visual line of a text editing surface, in absolute physical window coordinates.
TextboxPresentation
Opt-in presentation for a multiline editor embedded in document content. Geometry is in physical pixels; callers scale it with the document zoom and DPI. Editing, clipboard, selection, accessibility and IME behavior remain the ordinary textbox implementation.
TimelineState
the app-owned state of a timeline: playhead, visible range, selected range, following
TlTrack
one lane of a timeline: a label and its event ticks
Token
a highlighted part of a line: bytes start .. end
Track
TRACK – the colour gradient of track_slider: TK_* flags and 1..TK_MAXN straight-ARGB stops; with TK_CUSTOM the track is drawn by custom (draw object, user value, version: bump it when the drawing changes) instead
TreeEv
what happened in a tree during the pass
TreeRow
one visible row of a tree (the app flattens its model through TreeState::expanded)
TreeState
the app-owned state of a tree: expanded nodes, current node
TwoFingers
two fingers on a widget that said TF_TWO (ui.touch_two): px of the window, logical in a mirrored one
Ui
the UI context: everything ASMLIB keeps in g_* variables
VListState
the state of a list with rows of different heights (see the module header)
Viewport
what part of the world the canvas shows: zoom (DIP per world unit, 1 = 100 %), the world point at the centre of rect; rect (absolute px) and dpi are kept by ui.diagram
WinParts
the per-window state of the live window: the core’s per-window blocks (ui_ctx_wb0, ui_layout_wb0, ui_cmd_wb0, ui_dirty_wb0, ui_main_wb0) and the families’ (ui_popup, ui_list, ui_chrome). win.rs keeps one of these per window and swaps it with Ui::wp when another window is built (core::mem::swap); a new window starts from WinParts::new.

Enums§

CanvasGpu
how a canvas may use the GPU while its view moves
Cmd
one recorded draw command [C_*]
CodeEv
what the user asked of a code editor in its last pass (ui.code_events)
DEv
what the user did (ui.diagram’s result, in order)
DHit
what a point of the canvas shows
DeskEv
what desk_end reports
HotkeyError
why a shortcut was not registered
LcUnit
how a line chart labels values (axis ticks, the hover card, the summary)
Mi
menu record (MENUBAR / MENU / MI_* of ui.inc); menus are static slices of them
RecentOpen
what recent_open found for a file of the list
RibbonGroupMode
Presentation of an open ribbon group; pass it to ribbon_group_end.
Rule
a rule of a grammar (see the module header)
ScreenError
why a pick or a capture did not happen
TaskbarProgress
what the taskbar button’s progress bar shows
TermEv
what ui.terminal reports
ViewImage
what ui.image_view shows

Constants§

BP_COND
a breakpoint with a condition (a bar across it)
BP_DISABLED
a breakpoint that is there but off (a ring)
BP_ON
a breakpoint’s look (CodeDoc::set_breakpoints): set
CE_BREAKPOINTS
the gutter’s column of breakpoints (a click there: CodeEv::Breakpoint)
CE_FOLDS
the gutter keeps its folding column while the document has no folding ranges
CE_MARKS
the gutter keeps its column of diagnostic markers while the document has none
CE_NO_FIND
no find bar
CE_NO_FRAME
no text box frame
CE_NO_GUTTER
no line numbers
CE_NO_LINE
no highlight of the current line
CE_READONLY
code_editor flags: select, copy and find only
CI_CONSTANT
CI_FIELD
CI_FUNCTION
CI_KEYWORD
CI_METHOD
CI_MODULE
a module or namespace
CI_PARAM
CI_TEXT
completion item kinds: plain text
CI_VALUE
a value of the host (a configuration)
CI_VARIABLE
a variable (let, loop, catch)
DE_ALL
DE_COPY
DE_LINK
DE_MOVE
DG_CONNECT
DG_PAN
DG_PLACE
DG_SELECT
tools of ui.diagram
DIAG_ERROR
Diag::severity: an error
DIAG_INFO
a note, a hint (higher values count as this too)
DIAG_WARNING
a warning
DN_FRAME
DN_HITMIN
DN_LOCKED
node flags (DNode::flags)
DN_NOSELECT
DN_OUTLINE
DN_RESIZE
DN_STEP
DN_TOGGLE
DOCK_BOTTOM
DOCK_CENTER
dock_next: the document area in the middle
DOCK_FLOAT
a floating tool window
DOCK_FLOAT_MAX
floating windows of one dock area at most (fixed: each is a window, WIN_MAX)
DOCK_HOLD_MS
a press on a tab or on the empty part of a tab strip can drag only after this many ms with the button down, so that a slip of the hand during a click neither moves nor floats a panel; clicks, double clicks (they float), the menu and the splitters need no hold
DOCK_LEFT
the sides of a dock area (DockPanel::at, DockState::side); left / right are the start / end side (a mirrored window shows them the other way round)
DOCK_MK_BOTTOM
DOCK_MK_CENTER
DOCK_MK_LEFT
drop marker kinds (StyleShell::dock_marker, sp.value): the part of the place it fills
DOCK_MK_RIGHT
DOCK_MK_TOP
DOCK_RIGHT
DOCK_TAB_HOLD
StyleShell::dock_tab, sp.flags: the press was held long enough, the tab can be moved now (a press on the strip’s empty part: every tab of the group, they would all move)
DPT_HIDDEN
port flags (DPort::flags)
DPT_USED
DP_HIDDEN
starts hidden (until DockState::show / focus); later the layout remembers it
DP_NOCLOSE
DockPanel flags: no hide button or menu row (the app shows and hides it)
DP_NOFLOAT
never floats (a drop outside the markers does nothing)
DR_BEZIER
DR_ORTHO
DR_STRAIGHT
edge routes (DEdge::route)
DTB_ICONS
desk_taskbar flags: icons only
DT_FILES
DT_HTML
DT_IMAGE
DT_STD
DT_TEXT
DT_URL
DT_USER0
DWF_FIXED
a fixed size: no resize grips, no maximising, no snapping to a half
DWF_MAXIMIZED
a new window starts maximised (an IDE)
DWF_NOCLOSE
DeskWin flags: no close button (the app closes the window itself)
DWF_NOMAX
no maximise button (no double click, no snapping to the top edge)
DWF_NOMIN
no minimise button (and no minimising by keys or the taskbar)
DWF_NOTASK
no taskbar button
DW_LEFT
snapped to the start (left) / end (right) half of the area (mirrored windows show it the other way round)
DW_MAX
DeskState::state: maximised (with DW_MIN: it comes back maximised)
DW_MIN
minimised (hidden until restored)
DW_RIGHT
FIND_CASE
find: match the case
FIND_MAX
find_all stops after this many matches
FIND_WORD
find: whole words only
GPU_OUT_FS
GPU_OUT_FS_IMAGE
GPU_OUT_FS_TILE
GPU_OUT_VS
GPU_OUT_WGSL
the embedded shaders of the output and their source (uigputest: the embedding check)
ID_HASH_BASE
the first hashed id; ids written by hand stay below it
IV_NO_BARS
IV_NO_CHECKER
IV_NO_GRID
IV_SMOOTH
IV_TEXT_COLOR
IV_WHEEL_SCROLL
image_view flags
LC_NO_GRID
LC_NO_HOVER
LC_NO_LEGEND
LineChart::flags
LEVEL_MAX
the deepest Para::level
LS_BULLET
a bulleted list item (•, ◦, ▪ by level)
LS_NONE
Para::list: no list
LS_NUMBER
a numbered list item (1., a., i. by level)
LX_NANOS
LX_NUM
LX_SECS
x axes of a line chart (LineChart::x)
MA_CENTER
centred
MA_LEFT
left (start)
MA_NONE
MdTable::aligns: not given
MA_RIGHT
right (end)
MB_CODE
a code block (MdBlock::lang: the fence’s language)
MB_HEADING
a heading (MdBlock::level 1 ..= 6)
MB_PARA
MdBlock::kind: a paragraph
MB_ROW
a table row (MdBlock::cells, table, head)
MB_RULE
a thematic break (no text)
MF_BUTTON
a button without an action of its own (
MF_CHECKBOX
a check box
MF_HIDDEN
a hidden field (no character in the text)
MF_PASSWORD
a password field (its text never leaves the view but in the form’s data)
MF_RADIO
a radio button: one of the radios of its form with its name
MF_RESET
a reset button: the form’s fields get their first values back
MF_SELECT
a drop-down list ( / image)
MF_TEXT
MdField::kind: a one-line text field ( of type text, email, search, url, tel, number and every type not named below)
MF_TEXTAREA
a text area (