Expand description
The application: an AppBuilder takes plugins and a theme, sorts and
connects the plugins, and gives an App that draws the shell (menu
bar, zones, panels, the command palette) and dispatches keys. It runs
in eframe (feature eframe) or headless, driven by tests.
Re-exports§
pub use crate::palette::CMD_PALETTE;
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.
- Call
- What a command handler receives.
- Declared
Icon - Diagnostic codes recomputed by each rebuild.
An icon name a declaration gives, as the
iconscollector and theunknown-icondiagnostic read it. - Dormant
Key - A key binding kept dormant (ADR 0028): its command went with a plugin now disconnected. It stays in its layer, saved, takes no key, and is live again when the plugin reconnects.
- Overlay
Rect - An overlay on screen: what it is, a name for it (
dialog:3, the overlay’s label,toasts), where it was drawn last, in points. - Theme
Service - The theme, as a service: read it, ask for another (installed between
frames), and choose between its light and dark variants when it has
a counterpart (the
SETTING_THEME_PREFERENCEsetting).
Enums§
- Overlay
Kind - What an overlay is, as
AppHandle::overlay_rectsreports it. - Request
- What a block or a handler asks of the application, done before the next frame.
Constants§
- BRIDGE
- The bridge’s own collector:
bridge.describe,bridge.wait. - CMD_
QUIT - CMD_
REDO - CMD_
SAVE - CMD_
THEME_ TOGGLE - The command switching between the theme’s light and dark variants.
- CMD_
UNDO - Undo and redo: the keys, menu items and
whenchecks are egui-pop’s, what an undo does is the history owner’s (Host::history, ADR 0014), each run going through theSTEP_UNDOandSTEP_REDOsteps. - CONTEXT_
FOCUSED_ PANEL_ KIND - The context key holding the kind of the focused panel
(
PanelId::kind): the panel’s own id, orapp.gallerywhile its instanceapp.gallery#2has the focus, so one clause reaches every instance:when: "focusedPanelKind == 'app.gallery'". - CONTEXT_
REDO_ NEEDS_ VIEW CONTEXT_UNDO_NEEDS_VIEW’s twin for Ctrl+Shift+Z.- CONTEXT_
UNDO_ NEEDS_ VIEW - The context key true when, under focus routing
(
Routing::Focus), Ctrl+Z goes nowhere only because no view was focused yet while a step waits somewhere (needs_view): Edit › Undo stays live to say why. - CONTEXT_
WINDOW - The main menu bar.
The context key holding the detached panel whose window is drawn
(empty in the main window):
when: "window == 'app.log'". - FOCUS_
MODE - The focus mode (click or hover, the system’s way and the user’s choice), as a service.
- MENU_
BAR_ END - The end of the main menu bar: its command items show there as icon
buttons (
menus::bar_end), the last at the bar’s end, each pressed while itscheckedclause holds and left out where its command does not apply. Commands go there as into any menu (CommandSpec::menu(MENU_BAR_END, group, order)): the devtools’ inspect mode does. - MENU_
EDIT - MENU_
FILE - MENU_
HELP - MENU_
MAIN - MENU_
VIEW - SETTING_
ACCENT_ COLOR - The setting generating the accent from a colour (
#rrggbb), for the theme and its counterpart; empty for the theme’s own accent. - SETTING_
FOCUS - The setting choosing the focus mode:
system,click,hover. - SETTING_
THEME_ PREFERENCE - The setting choosing between a theme’s light and dark variants:
system,light,dark. - STEP_
DEBUG_ CALL - A debug collector’s action is called (
{ "collector", "action", "args", "origin" }, the origin as the journal’s sources write it:agent:debug-bridge,user): by an agent through the bridge (AppHandle::debug_call) or by the user (AppHandle::debug_call_as, the devtools panel). A before-hook may veto it, for every caller (a kiosk build); the caller is not redirected. A call that only reads (a read-only command’scommands.runincluded) is published and traced only when vetoed or failed. A call the bridge’s mode or the action’sagentflag refuses never reaches the step: it is refused first (debug.call.refused). - STEP_
EXIT - The application closes: its default writes what is still waiting
(the settings, the keymap, the layout and the documents plugins
offered, when a directory was given). A plugin replaces it to save
elsewhere, or follows it; a veto writes nothing more. Saving does not
wait for the exit: what changes is written about a second later
(
AppHandle::save_later). - STEP_
LAYOUT_ LOAD - The workbench’s layout is loaded (
{ "document" }, fromHost::layout_document): at the start, and onApp::load_layout. A before-hook may redirect the document or veto; a run-hook loads it from elsewhere (and callsAppHandle::set_layout). - STEP_
LAYOUT_ SAVE - The workbench’s layout is saved (
{ "document" }): byApp::save(so at exit) andApp::save_layout. A before-hook may redirect or veto; a run-hook saves it elsewhere (AppHandle::layout). - STEP_
LOAD_ KEYMAP - A keymap document is loaded into a layer (
{ "layer", "bindings" }). - STEP_
REBIND - The user gives a command new keys, or none (
{ "command", "keys", "layer" };keysa shortcut,null, or an array of several: a pointer gesture’s triggers). - STEP_
REDO - STEP_
UNDO - The steps of an undo and a redo (ADR 0011): a before-hook may veto
one (a gesture in progress) or redirect it (another
scope), a run-hook does it instead of the owner, an after-hook follows. Their arguments:label(what it takes back, as the menu said),originandscope(the history focus picked). Their result:{"undone": label, "scope", "steps", "rev", "head"}("redone"), the labelnullwhen there was nothing. Besides the step’s own signal, the journal saysedit.undone/edit.redonewith the label, oredit.undo_failed/edit.redo_failedwith the error or the veto; andhistory.changedorhistory.refused. - THEME
- The theme service’s token.
Functions§
- declared_
icons - Every icon name the commands, panels, frames (places and modes) and status items declare.
- parse_
preference - A preference from its name in the setting.
- preference_
name - A preference’s name in the setting:
system,light,dark.
Type Aliases§
- Command
Fn - A command handler.
- ExitFn
- Runs when the application closes (
AppBuilder::on_exit), before theapp.exitstep. - Make
Error - Why
make(ofAppBuilder::run_native_with) gave no application. - WrapUi
- Draws around the whole application (
AppBuilder::wrap): gets theUi, the handle, and the application’s drawing to call where it likes.