11#include "../attributes.hpp"
24namespace morph::qt_quick {
32using ShellFactory = std::function<std::unique_ptr<ui::MountedShell>(
59 std::function<void(QQmlEngine& engine, QQuickWindow& window)>
onEngine;
90 [[nodiscard]] std::string_view
name()
const override;
The QML components a client renders beside the built-in kinds (spec 5 §10).
std::string_view name() const override
The name --ui= and MORPH_UI select this frontend by.
int run(ui::AppSource &source) override
Runs the application the source opens until it quits or its window closes.
Frontend(int &argc, char **argv, FrontendConfig config)
A frontend that runs with the process's command line.
What a frontend lends the source it opens and the screens it mounts.
Where the screens and the models are: a server (remote) or the application linked in-process (local).
A frontend: owns an event loop and a renderer, and runs one source's screens.
Makes widgets. Each factory appends the new widget to parent, or makes a root when it is null,...
std::function< std::unique_ptr< ui::MountedShell >( ui::AppContext &context, ui::IViewBackend &backend, std::expected< ui::Bundle, ui::ConnectError > opened)> ShellFactory
Mounts the application's shell for what the source delivered, on the window's widgets.
bool usableHere(ui::EnvironmentReader const &env=ui::processEnvironment())
Whether a Qt Quick window can be shown here: on macOS, Windows and WebAssembly always; elsewhere when...
BundleTheme
Whether the bundle's theme is applied when the source opens.
@ Apply
The bundle's theme index, or the defaults for a bundle without one, replaces the Theme singleton's.
@ Ignore
The theme stays as FrontendConfig::onEngine set it; a bundle that carries a theme is reported.
ui::FrontendOption frontendOption(int &argc, char **argv, FrontendConfig config)
The Qt Quick frontend's entry for ui::selectFrontend.
What a qt_quick::Frontend runs with.
std::function< void(QQmlEngine &engine, QQuickWindow &window)> onEngine
Called once per run with the engine and the window, after both exist and before the backend is built:...
std::string title
The window's title.
ShellFactory mountShell
Mounts the shell when the source is ready; it must not be empty.
BundleTheme bundleTheme
Whether the bundle's theme is applied when the source opens. With Apply, a theme onEngine set that th...
ui::DevelopmentTools devTools
Development mode (spec 6 §21): with On, Ctrl+Shift+I in the window opens the inspector over the scree...
std::function< void(std::string const &widthClass)> onWidthClass
Called with the window's width class (widthClassOf) when the window first has a width and each time t...
Components * components
The restyle map and the custom components the backend uses; null uses none. Borrowed: it outlives the...
One frontend a binary was built with.
The backend contract: the retained widgets a mount drives, and the factory that makes them.
The frontend seam: main picks a frontend at runtime, and the frontend runs whatever an AppSource open...
std::function< std::optional< std::string >(std::string_view name)> EnvironmentReader
Reads an environment variable: its value, or nullopt when it is unset.
EnvironmentReader processEnvironment()
The process environment, read through std::getenv.