morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
frontend.hpp File Reference

morph::qt_quick::Frontend: a morph application in a Qt Quick window. More...

#include <cstdint>
#include <expected>
#include <functional>
#include <memory>
#include <string>
#include <string_view>
#include "../attributes.hpp"
#include "../ui/backend.hpp"
#include "../ui/dev_tools.hpp"
#include "../ui/frontend.hpp"

Go to the source code of this file.

Classes

struct  morph::qt_quick::FrontendConfig
 What a qt_quick::Frontend runs with. More...
class  morph::qt_quick::Frontend
 Runs a morph application in a Qt Quick window, on the calling thread. More...

Typedefs

using morph::qt_quick::ShellFactory
 Mounts the application's shell for what the source delivered, on the window's widgets.

Enumerations

enum class  morph::qt_quick::BundleTheme : std::uint8_t { Apply , Ignore }
 Whether the bundle's theme is applied when the source opens. More...

Functions

bool morph::qt_quick::usableHere (ui::EnvironmentReader const &env=ui::processEnvironment())
 Whether a Qt Quick window can be shown here: on macOS, Windows and WebAssembly always; elsewhere when DISPLAY, WAYLAND_DISPLAY or QT_QPA_PLATFORM is set and not empty.
ui::FrontendOption morph::qt_quick::frontendOption (int &argc, char **argv, FrontendConfig config)
 The Qt Quick frontend's entry for ui::selectFrontend.

Detailed Description

morph::qt_quick::Frontend: a morph application in a Qt Quick window.

Specified in docs/spec/qt_quick/frontend.md.

Definition in file frontend.hpp.

Typedef Documentation

◆ ShellFactory

Initial value:
std::function<std::unique_ptr<ui::MountedShell>(
ui::AppContext& context, ui::IViewBackend& backend, std::expected<ui::Bundle, ui::ConnectError> opened)>
What a frontend lends the source it opens and the screens it mounts.
Definition frontend.hpp:50
Makes widgets. Each factory appends the new widget to parent, or makes a root when it is null,...
Definition backend.hpp:810

Mounts the application's shell for what the source delivered, on the window's widgets.

ui::ShellFactory with the backend the shell's views mount on, since ui::AppContext names no renderer. Called once, on the owner.

Definition at line 32 of file frontend.hpp.

Enumeration Type Documentation

◆ BundleTheme

enum class morph::qt_quick::BundleTheme : std::uint8_t
strong

Whether the bundle's theme is applied when the source opens.

Enumerator
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.

Definition at line 36 of file frontend.hpp.

Function Documentation

◆ usableHere()

bool morph::qt_quick::usableHere ( ui::EnvironmentReader const & env = ui::processEnvironment())
nodiscard

Whether a Qt Quick window can be shown here: on macOS, Windows and WebAssembly always; elsewhere when DISPLAY, WAYLAND_DISPLAY or QT_QPA_PLATFORM is set and not empty.

Parameters
envReads the environment.
Returns
True when it can.

◆ frontendOption()

ui::FrontendOption morph::qt_quick::frontendOption ( int & argc,
char ** argv,
FrontendConfig config )
nodiscard

The Qt Quick frontend's entry for ui::selectFrontend.

Parameters
argcThe argument count, kept by reference for the QGuiApplication a run makes.
argvThe arguments.
configHanded to every Frontend the option makes.
Returns
An option named "qt", usable as usableHere says.