Expand description
The bus: requests, events and the listeners of each, joined (ADR 0029).
A module knows the bus, not its neighbours. A state change another
part may care about is a request, asked with who asks and why (a
step, ADR 0011, named <noun>.<verb>), and an event said once it
is done or refused (the journal, <noun>.<past>). Whoever cares
listens, under a name and at a place it declares, on the bus the
application holds (AppHandle::bus); nobody calls a neighbour to
tell it.
The bus is a contract (ADR 0030,
the bus-contract crate): the application supplies it
(AppBuilder::bus), or egui-pop makes a hook kernel of its own.
egui-pop declares its points from CONTRACT and registers its
listeners on it; it never constructs a bus it is given.
The window lifecycle is the first family on it. Its points
(WindowOpen, WindowClose, WindowReparent, PopupOpen,
PopupClose) take a WindowRequest; the registry
(REGISTRY) listens to them and is the one list of what is on
screen (AppHandle::windows_list). Closing an application window
(AppHandle::request_window_close) runs, in one call and in this
order:
CHILDREN: what belongs to the window goes with it (its dialogs);- the owner’s listener (
pop.admin.windowfor the Settings app): the state the window showed closes; FOCUS: the window worked in before becomes the active one;REGISTRY: the window is closed, no longer declared to the backend, hidden where the system allows;PLACE: its place is kept (written to disk later);INVARIANTS: last, checks the registry agrees.
window.closed is said after the last of them, so whoever reads it
finds the owner’s state, the focus and the registry already agree.
order_dump prints who runs when; the bus collector of the debug
bridge shows it too.
The Settings app’s window is wholly on the bus: the app asks
pop.window.open and pop.window.close for it as its owner, in the call that
changed what it wants, and its listener (pop.admin.window) keeps the
app’s state with the window on both points. A plugin disconnected has
its windows closed (OWNER_GONE, reason owner-gone).
The shell’s windows are on the bus too: opening an application window
is its pop.window.open (AppHandle::request_window_open, the
application as owner for AppHandle::open_window); the main
window’s close, whatever asked (the system, its title bar’s Close,
AppHandle::close_window, AppHandle::quit with the reason
quit), is its pop.window.close, which closes every other window by its
own pop.window.close first; a window’s content moving into the main
window when it closes, and back when the main window is asked to its
front, is a pop.window.reparent (AppHandle::request_window_reparent).
Detached panels’ windows are the workbench’s: detaching a panel is its
window’s pop.window.open, docking it back its pop.window.reparent into the
main window, closing its window its pop.window.close, the workbench’s
listener (WORKBENCH_WINDOW) changing the layout whoever asked.
Dialogs and file choices are on the bus too: a dialog coming up is its
pop.popup.open (dialog:<n>, parent: its window), a file choice started
its pop.popup.open (file:<n>), or pop.window.open of a native window for
the system’s chooser (AppHandle::request_native_open); each ends by
its pop.popup.close or pop.window.close. A window closing closes its
popups and native windows first, each by its own request (reason
parent-closed), and their owners’ listeners (pop.dialogs.popup,
pop.files.choice) cancel what they showed in the same call. The overlay
stack’s overlays (the palette, menus, flyouts, popovers) and the egui
popups it follows (context menus, the menu bar’s menus, hover cards)
are popups too: each opening and closing is its pop.popup.open or
pop.popup.close, asked in that call with how it closed (how), and a
close asked by anyone closes it in the stack (OVERLAY_STACK);
tooltips and a field’s lists stay off, per-frame painting.
The active window, the one the person works in, is the registry’s too
(WindowActivate, AppHandle::request_window_activate): a press
or a key in a window asks it (user), a window gaining the system’s
focus asks it (system), the application asking a window to the
front asks it (command, raised by RAISE, the one place egui-pop
sends ViewportCommand::Focus); window.activated is said when it
changed, and a window closing while active hands it to the window
worked in before it.
The job lifecycle is the second family. Asking about a job is a
request (JobCancel, JobPause, JobResume, JobRetry, each
a JobAsk, asked by AppHandle::request_job); whoever runs the
job does the work and answers with its job events, published typed on
JobEvents (pop.job.event, a JobEvent of a JobEventKind)
with a JobPublisher. Those events, and the job commands’ dispatch
and answer, are delivered to its listeners in journal order, once each
(AppHandle::deliver_events): the jobs plugin’s model is one of them
(pop.jobs.model), so no job state changes but on the bus. A plugin
connecting or disconnecting is asked on PluginConnect and
PluginDisconnect (a PluginChange), the disconnection before
plugin.disconnected is said: the jobs a plugin leaves are cancelled
or said orphaned by a listener of its disconnection, and taken back by
one of its connection.
An application’s own rows in the jobs list are on it too
(job_rows): a row source is declared,
its rows replaced, by pop.jobs.rows (JobRowsSet) and taken away
by pop.jobs.source.drop (JobSourceDrop), from any thread; the
jobs plugin’s listener (JOB_SOURCES) keeps them for the list.
Files dropped from another program are on it too: every window’s pass
reads the files dropped on it once, as its pop.files.drop (FilesDrop,
a FileDrop naming the window); whoever takes them listens, and
nobody taking them is said as files.refused.
Settings are on it too: every change of a setting’s value is said
once by the value store, its one writer, as pop.settings.changed
(SettingsChanged, a SettingChange: path, scope, by), whether
it was made here or by another client of the host’s store; the theme,
the pointer profile and the main window’s frame are its listeners
(THEME_INSTALL, POINTER_PROFILE, FRAME_DECORATIONS), and an
application’s part that follows a setting listens there too.
A drag across windows is on it too (drag): a drag begins as
pop.drag.start (DragStart, its kind and window); let go over a drop
target that takes it, in its window or another, it is pop.drag.drop
(DragDrop) and drag.dropped; refused, let go over nothing or
cancelled, drag.refused with the reason. Where it hovers each pass
stays off the bus (per-frame painting).
The screens are on it too: a screen plugged in or
unplugged, as told by whatever runs the event loop
(crate::window::set_screens), is said as pop.screen.added
(ScreenAdded) or pop.screen.removed (ScreenRemoved), by its
name; on pop.screen.removed a detached panel’s window kept on it docks
back (WORKBENCH_SCREENS) and every other window left off every
screen moves onto one (PLACE).
The layout is on it too: every real change of the workbench’s layout
is said once, when the gesture that made it ends, as pop.layout.changed
(LayoutChanged, a LayoutChange naming its causes); the layout
is saved by its listener (LAYOUT_SAVE), an application’s copy of
it follows after.
A panel’s state is on it too: whoever knows a panel’s content is not
current asks pop.panel.state (PanelStateSet, from any thread), and
the workbench’s chrome shows it (PANEL_CHROME), never the panel.
What a declared panel is, its kind (whether it edits) included, is
pop.panel.describe (PanelDescribe, answered by PANEL_DESCRIBE).
Opening a panel, wherever it is asked from (a menu, a tab bar’s “+”,
a group’s menu, its toggle command, an agent), is pop.panel.open
(PanelOpen, a PanelOpenAsk naming the panel and where it opens:
where it was, here or an area; answered by PANEL_OPEN).
Naming an open panel instance’s tab title, or giving it its generated
title back, is pop.panel.retitle (PanelRetitle, a
PanelRetitleAsk; answered by PANEL_RETITLE).
The interactive areas each window’s last pass registered, what each
writes (display, navigate, edit) and whether an edit area is inert,
are pop.ui.areas (UiAreas, answered by AREA_REGISTRY).
Which panel zen mode shows when none is named and the focused panel
is not a view is the application’s, asked on pop.zen.panel
(ZenPanel).
A command’s live title and tooltip, for a command whose text follows
the application’s state, are the application’s, asked on
pop.command.label (CommandLabel, a CommandText).
Notices are on it too (docs/notices.md): a message for
the user (an error, a warning, a success, a question) is raised once
as pop.notice.raised (NoticeRaised, AppHandle::report); a
condition ending is pop.notice.resolved, notices read
pop.notice.seen, notices put away pop.notice.dismissed; egui-pop’s
store (NOTICE_STORE) keeps the last ones (AppHandle::notices).
Re-exports§
pub use drawing::DrawingPanel;pub use drawing::TopologyOf;pub use drawing::drawing_panel;pub use drag::DRAG_POINTS;pub use drag::DragBegin;pub use drag::DragDelivery;pub use drag::DragDrop;pub use drag::DragStart;pub use drag::TARGET as DRAG_TARGET;pub use bus_contract;pub use bus_contract_crossing;pub use bus_contract_defer;pub use bus_contract_journal;pub use bus_contract_timings;pub use egui_pop_hooks;
Modules§
- drag
- A drag across windows, on the bus (ADR 0029).
- drawing
- The panel being drawn: a scope egui-pop holds around each panel’s draw, so what runs inside it (an emit, a listener, an ask, a sink of the bus’s trace tap) knows which panel, window and topology it runs for.
- trace
- The kernel’s trace tap (bus-kernel’s
Tracecapability): a sink observing the bus hears each emit, listener heard, ask and drain, on the emitting thread, wheredrawing_panelnames the panel drawing. The trace tap: each emit, each listener heard, each ask and its drain, reported as it happens to the sinks that observe the kernel.
Structs§
- Command
Ask - A command about to run: which, with what, for whom, and in which window.
- Command
Label - A command’s live title and tooltip (
pop.command.label): the input is the command, the value what the application says of it, empty while no listener answers. - Command
Run - A command is about to run (
pop.command.run): its listeners run in their declared order before the handler; one may refuse the run with a reason. Fail-closed: a listener’s failure refuses it too. The value is what the listeners noted, one line each. - Command
Text - A command’s text as an application says it now;
Nonekeeps the declared one. - File
Drop - Files dropped on a window: which window, the files, where the pointer was.
- Files
Drop - Files are dropped on a window (
pop.files.drop): each listener that takes them says what it did, one line, in the value. Nobody taking them is a refusal. - Host
Event - An event egui-pop publishes, as the bus’s journal keeps it: who did it, its name and its data (its number and cause are the entry’s).
- Host
Events - egui-pop’s events on the bus’s journal (
pop.journal): each one the host journal records when it is the bus’s, delivered to this point’s listeners by the journal’s pump, after the publisher moved on. - JobAsk
- A request about a job, asked of whoever runs it (the host, or the application’s own runner): which job, what, and why when it is not the person asking.
- JobCancel
- A job is asked to stop (
pop.job.cancel); its listeners say what they did, one line each, in the value. - JobEvent
- A job event, as
JobEventscarries it: what happened, typed (JobEventKind), its data (seeegui_pop_model::jobs), who said it, and its number and cause in the journal it is recorded in. - JobEvents
- A job event was said (
pop.job.event): each event the host published with aJobPublisher(AppHandle::publish_job), and each event of a job command (dispatched, done, failed), delivered once, in journal order (AppHandle::deliver_events). The point’s kind is typed: no listener reads a journal entry’s name, and an entry namedjob.*that was not published on this point is not a job event. - JobPause
- A job is asked to pause (
pop.job.pause). - JobPublisher
- Publishes job events on
pop.job.event, from any thread: the host’s side of the jobs contract. The application hands one to its host (Host::set_job_publisher);AppHandle::job_publishergives one too. Each event is recorded in the journal (under its kind’s label,JobEventKind::name, for the journal’s readers) and delivered to the point’s listeners at the next delivery, in the order said; the interface is woken. - JobResume
- A paused job is asked to go on (
pop.job.resume). - JobRetry
- A failed or cancelled job is asked to run again (
pop.job.retry). - JobRows
Ask - A source’s rows, asked: the source, its title (the filter’s label), who asks, and every row it has now (the set replaces the last one).
- JobRows
Set - A source’s rows are asked (
pop.jobs.rows); its listeners say what they did, one line each, in the value. - JobSource
Ask - A source taken away: which, and who asks.
- JobSource
Drop - A source is taken away (
pop.jobs.source.drop). - Layout
Change - What changed the layout: the workbench step’s id (
workbench.move,workbench.detach, …),layout.set(a layout put in),layout.repair(repaired against the panels declared),pop.window.place(a detached window moved or resized),palette.place(a palette following the window’s edges),input(a button let go or a key pressed: what a dock changed). - Layout
Changed - The layout changed (
pop.layout.changed), said once per real change, once the gesture that made it ended. - Notice
Badge - What the status bar’s badge counts: the notices routed to it
(
Surface::StatusBadge) not seen yet, and for a condition not resolved yet. - Notice
Dismissed - Notices were put away by the user (
pop.notice.dismissed). - Notice
Raised - A notice is raised (
pop.notice.raised). - Notice
Resolved - A condition ended (
pop.notice.resolved). - Notice
Seen - Notices were read (
pop.notice.seen). - Panel
Describe - A panel is described (
pop.panel.describe): the input is its id, the value its description,Nonewhile nobody knows it. - Panel
Description - A declared panel, as the bus describes it.
- Panel
Home - The window a panel opening goes to (
pop.panel.home), the application’s choice over rule A: the value is a window’s id (mainfor the main window),Nonewhile no listener picks one. A window that is not shown is passed over. egui-pop has no listener of its own. - Panel
Home Area - The area a panel opening docks in (
pop.panel.home_area), the application’s choice over the panel’s declared area: asked afterPanelHome, so an application answering a window there may answer its area here.Nonewhile no listener picks one: the declared area. Used where the declared area would be (a panel back to its last place stays there; an area named by the ask wins); an area the panel’s rules refuse is passed over. egui-pop has no listener of its own. - Panel
Home Area Ask - Which area a panel opening goes to, asked of the application
(
PanelHomeArea): the panel and the window it opens in. - Panel
Home Ask - Where a panel opening goes, asked of the application
(
PanelHome): the panel and the window it is asked from. - Panel
Open - A panel is asked open (
pop.panel.open); its listeners say what they did, one line each, in the value. - Panel
Open Ask - A panel asked open: which panel, where, and who asks.
- Panel
Retitle - A panel instance is asked retitled (
pop.panel.retitle); its listeners say what they did, one line each, in the value. - Panel
Retitle Ask - A panel instance asked retitled: which instance, its title (
None: the generated one again). - Panel
State Ask - A panel’s state asked: which panel, its state, who asks, and the event that caused it.
- Panel
State Set - A panel’s state is asked (
pop.panel.state); its listeners say what they did, one line each, in the value. - Plugin
Change - A plugin connecting or disconnecting: which, its owner id, why, and the commands it registered (gone with it on a disconnection).
- Plugin
Connect - A plugin is connected (
pop.plugin.connect), what it registers in place; its listeners take back what it had left. - Plugin
Disconnect - A plugin is disconnected (
pop.plugin.disconnect), what it registered removed, beforeplugin.disconnectedis said: each listener adds what it did to the value (jobs_cancelled…), which the event’sremovedcarries. - Popup
Close - A popup closes (
pop.popup.close). - Popup
Open - A popup opens in a window (
pop.popup.open). - Screen
Added - A screen was plugged in (
pop.screen.added). - Screen
Change - A screen come or gone: its name as the system gives it (winit’s
MonitorHandle::name; none when it gives none), its rectangle in points ([x, y, width, height]) and its scale factor. - Screen
Removed - A screen was unplugged (
pop.screen.removed): the windows on it move onto a screen left, or dock back. - Setting
Change - A setting changed: its store path (
settings/<id>), the value scope it changed in (app, a host’s scope such aslibrary,run), who wrote it (user,agent:<session>,storefor another client of the host’s store) and the value store’s sequence number of the write. - Settings
Changed - A setting changed (
pop.settings.changed), said once per change of its value by the value store, its one writer. - UiAreas
- The interactive areas are listed (
pop.ui.areas): the value is the list, each window’s last pass, the main window’s first. - Window
Activate - A window becomes the active one, the window worked in (
pop.window.activate): the person pressed or typed in it (user), the system gave it the focus (system), or the application asks it to the front (command, raised byRAISE). - Window
Close - A window closes (
pop.window.close). - Window
Open - A window opens (
pop.window.open); its listeners say what they did, one line each, in the value. - Window
Record - A window or popup as the registry holds it.
- Window
Reparent - A window’s content moves to another window (
pop.window.reparent). - Window
Request - A window or popup request: which, of what kind, who asks, why, and the event that caused it.
- ZenPanel
- Which panel zen mode shows (
pop.zen.panel): the value is the panel’s id,Nonewhile no listener picks one.
Enums§
- JobEvent
Kind - What a job event says: the kind the host gives when it publishes the
event on
pop.job.event(egui-pop-api’sJobEvents). The model folds events by this kind, never by a journal entry’s name;name(job.started…) is only the label the event is journaled under. - Open
Place - Where a panel opens (
PanelOpenAsk::place). Written"last","here"or an area’s name ("start_side","end_side","bottom","center"). - Panel
State - Whether what a panel shows is current.
- Reason
- Why a window or a popup opens or closes.
- TabMark
- The mark a panel’s tab holds, one at a time: the highest rank wins
(
TabMark::rank). - Window
Kind - What a window of the registry is.
Constants§
- AREA_
POINTS - The area points, in the order
super::order_dumpprints them. - AREA_
REGISTRY - The registry’s listener of
pop.ui.areas: lists the areas registered. - ARGS_
VALIDATOR - Who refuses a run whose arguments do not match its command’s JSON
Schema (
CommandSpec::schema): thebyof itscommand.refused. The check is not a listener: it runs beforepop.command.runis asked, for every origin. - CHILDREN
- What belongs to a closing window goes with it: its dialogs.
- COMMAND_
LABEL_ POINTS - The command text points, in the order
super::order_dumpprints them. - COMMAND_
POINTS - The command points, in the order
super::order_dumpprints them. - CONTRACT
- egui-pop’s contract table (ADR 0030): every point it declares on the bus it is given, with its kind and description, readable before an application is built.
- FILES_
BROWSER - egui-pop’s listener of
pop.files.drop, first: what the widgets of the window’s pass took (the file browser over one of its targets). - FILES_
POINTS - The files points, in the order
super::order_dumpprints them. - FOCUS
- The window worked in before a closing one becomes the active one.
- FRAME_
DECORATIONS - egui-pop’s listener giving the main window the decorations
window.frameasks for. - HOST_
JOURNAL - The declaration of
HostEvents: journaled, so declared only on a bus offering the journal capability (it is not inCONTRACT, which every bus takes). - INVARIANTS
- Checks, last, the window invariants (
crate::window_invariants). - JOB_
POINTS - The job points, in the order
order_dumpprints them. - JOB_
ROW_ POINTS - The row source points, in the order
super::order_dumpprints them. - JOB_
SOURCES - The jobs plugin’s listener of the row source points: keeps each source’s rows for the list.
- KEYS
- Another window becoming the active one drops every window’s shortcut in progress: a chord begun in one window is never finished in another (a local listener: the windows’ key dispatchers are the interface’s).
- LAYOUT_
POINTS - The layout points, in the order
super::order_dumpprints them. - LAYOUT_
SAVE - egui-pop’s listener saving the layout to the host’s document (the
layout.savestep). An application’s copy of the layout runs after it. - LAYOUT_
SETTLE - How long a place followed from the system (a window, a palette) stays still before its change is said, in seconds.
- NOTICE_
POINTS - The notice points, in the order
super::order_dumpprints them. - NOTICE_
ROUTE - egui-pop’s listener of
pop.notice.raisedafter the store: routes each notice to its views (AppHandle::route_notices). - NOTICE_
STORE - egui-pop’s listener of the notice points: keeps the last notices
raised (
AppHandle::notices). - OVERLAY_
OWNER - The owner of an overlay its owner did not name.
- OVERLAY_
POPUP_ PREFIX - The start of an unnamed overlay’s popup id.
- OVERLAY_
STACK - Closes in the stack a popup closed by a request (
pop.popup.close). - OWNER
- What owns egui-pop’s own listeners.
- OWNER_
GONE - Closes the application windows a disconnected plugin owned, before
plugin.disconnectedis said: each apop.window.close(owner-gone), counted aswindows_closed. - PANEL_
CHROME - The workbench’s listener of
pop.panel.state: keeps each panel’s state for its chrome. - PANEL_
DESCRIBE - The workbench’s listener of
pop.panel.describe: describes a declared panel from its declaration. - PANEL_
DESCRIBE_ POINTS - The panel description points, in the order
super::order_dumpprints them. - PANEL_
OPEN - The workbench’s listener of
pop.panel.open: opens the panel through theworkbench.showstep. - PANEL_
OPEN_ POINTS - The panel opening points, in the order
super::order_dumpprints them. - PANEL_
RETITLE - The workbench’s listener of
pop.panel.retitle: keeps the title in the layout’s instance entry. - PANEL_
RETITLE_ POINTS - The panel retitling points, in the order
super::order_dumpprints them. - PANEL_
STATE_ POINTS - The panel state points, in the order
super::order_dumpprints them. - PLACE
- A window’s place, kept when it closes, and moved onto a screen left
when its screen is unplugged (
pop.screen.removed). - PLUGIN_
POINTS - The plugin points, in the order
order_dumpprints them. - POINTER_
PROFILE - egui-pop’s listener loading the pointer profile the setting names.
- POINTS
- Every point egui-pop declares: the window, job, plugin, files, settings, drag, screen, panel state, layout, panel description and command, area, panel opening, panel retitling, zen and command label, notice and job row source points.
- RAISE
- A window asked to the front by a command (
pop.window.activate, reasoncommand) is shown, restored and given the system’s focus: the one place egui-pop sendsViewportCommand::Focus. - REGISTRY
- The one list of windows and popups (
AppHandle::windows_list). - SCREEN_
POINTS - The screen points, in the order
super::order_dumpprints them. - SETTINGS_
POINTS - The settings points, in the order
super::order_dumpprints them. - STEP_
WINDOW_ CLOSE - The
window.closestep: the request as steps trace it (before-hooks may veto or redirect it). - STEP_
WINDOW_ REPARENT - The
window.reparentstep: the request as steps trace it (before-hooks may veto it). - THEME_
INSTALL - egui-pop’s listener installing the theme a setting changes.
- WINDOW_
POINTS - The window and popup points, in the order
order_dumpprints them. - WORKBENCH_
OWNER - What owns the detached panels’ windows.
- WORKBENCH_
SCREENS - The workbench’s listener of
pop.screen.removed: a detached panel’s window kept on the screen gone docks back. - WORKBENCH_
WINDOW - The workbench’s listener on the window points: the layout follows the request, whoever asked.
- ZEN_
POINTS - The zen points, in the order
super::order_dumpprints them.
Traits§
- BusTrace
- The kernel’s trace tap (bus-kernel’s
Tracecapability): a sink observing the bus hears each emit, listener heard, ask and drain, on the emitting thread, wheredrawing_panelnames the panel drawing. The trace of a bus, found through its capability lookup.
Functions§
- asking
- The application whose request runs now, for a listener (listeners
are
Send + Syncand keep no handle): an application’s listener ofpop.files.dropruns its import command on it.Noneoutside a request. - mark_id
- The indicator id of a panel’s mark on its content (
panel-state:<id>) and on its tab or palette band (panel-state-tab:<id>, its one mark slot: the busy, failed or edits mark), for tests and agents. - missing_
targets - The ordering constraints of
pointsthat name a listener not there:point: listener -> target. A test ends with none. - order_
dump - The order the listeners of
pointsrun in, one point after the other, each listener with its owner and what it declares: “who runs when”, read rather than remembered. - raise_
main_ window - The main window shown, restored and focused, for a program without an
egui-pop application (the platform readers used standalone): what
RAISEdoes for apop.window.activateof the main window. An application askspop.window.activateinstead (AppHandle::request_window_activate).