Skip to main content

Module prelude

Module prelude 

Source
Expand description

What most applications use.

Modules§

zones
Zones and blocks (ADR 0005). A zone is a named place; blocks are drawn in it, lightest first. Four operations: add, replace, extend (before or after a block) and wrap (around a block, receiving it as a closure). They are resolved when the application is built or a plugin comes or goes, never per frame; what cannot apply is reported with what happens instead.

Structs§

App
A built application.
AppBuilder
Builds an application.
AppHandle
The application at run time, cheap to clone: blocks, panels, stories and command handlers reach services, the store and the command runner through it.
BlockId
A block in a zone.
Call
What a command handler receives.
CommandId
A command: view.palette, file.save.
CommandSpec
What a command declares.
Ctx
What a plugin registers through.
DefaultPlugins
What most applications want: the command palette, dialogs, the file chooser, toasts, links (opened through one policy), the Settings app (Ctrl+,) with the settings window behind its Advanced page, the window’s place, named arrangements of the workbench (and the next components of the paved road as they come).
Descriptor
What a value is and how it is shown and moved.
Hook
An alter hook: an id, what it alters, a priority (higher first) and the hooks it must run after.
HookId
A hook point declarations are altered at.
MenuId
A menu: app.main, panel.tab.
MinimalPlugins
The framework alone: the shell, its menus, undo and redo, quit, the focus mode setting. No palette, dialogs or toasts.
PanelId
A panel: app.log; an instance of a panel declared with several (PanelSpec::instances) adds #<n>: app.gallery#2.
PluginId
A plugin: gallery.overview.
ServiceId
A service plugins share.
ServiceToken
A service’s id and type: ctx.service(&TOKEN, value) provides it, app.service(&TOKEN) gets it back typed.
SettingId
A setting, also its path in the value store under settings/.
StepId
A step of a feature’s life that plugins may watch, veto, replace or extend: frame.close, workbench.detach.
StepSpec
A step as declared: its id, what it does, an example of its arguments.
Story
A story as contributed.
StoryId
A gallery story.
ThemeSpec
What to resolve: a base theme (mode and contrast), a density, an accent, reduced motion and the user’s own overrides, composed in that order. The base theme’s counterpart (Counterpart), when it has one, is resolved with the same density, accent, reduced motion and overrides (Themes::resolve_counterpart), or with overrides of its own (ThemeSpec::counterpart_overrides).
Tokens
The system tokens of a resolved theme, typed for egui. Custom widgets read it with Tokens::of instead of hard-coding a colour or a size; a component’s look is in its kit (Kit::of(ctx).<component>), and any other token in Tokens::resolved.
ZoneId
A zone where blocks are drawn: app.sidebar.

Enums§

Before
What a before-hook decides.
Binding
How a widget’s value is held.
Block
A block operation, as a plugin declares it.
Density
How much room the interface takes: an overlay of space and size tokens only.
On
Which lifecycle events a handler wants.
Origin
Who asked for a command: shown in the history, and used to keep an agent from fighting a human’s gesture.
Outcome
How a step ended.
Place
Where an extending block goes.
PluginError
Why a plugin did not connect.
Space
Spacing by intent (space.inline, group, section, page): what the space is for, each an alias of a step of the spacing scale, so densities scale it.
TextRole
A text role: what a piece of text is (text-role.*), each a size, a colour and a weight over the size scale and the text colours.
Tone
What a part says, the same names for every component. Neutral is the component’s own box (no tone); the others are read from component.tone.<name>, their defaults aliasing the system’s status tokens (accent.default, info, success, warning, danger, text.muted; record aliases danger too). Serialized by its token name ("danger").

Traits§

Plugin
An application feature.
UiPop
Layout helpers named by role, on egui’s [Ui]. Each is a few lines over the theme’s tokens and kit; see the module.

Type Aliases§

SharedStore
A store shared between the application, its widgets and its commands.