AppBuilder
struct · ferroui-controls · v0.5.0
struct AppBuilder
Initializes platform-specific services for an Application.
The builder is a shared handle: the configuration methods return a clone of it so that calls can be chained, and the callbacks registered with it receive it back.
Members
setup_with_classic_desktop_lifetimesetup_with_classic_desktop_lifetime_withstart_with_classic_desktop_lifetimestart_with_classic_desktop_lifetime_withstart_with_classic_desktop_lifetime_and_shutdown_moderuntime_platform_services_initializerruntime_platform_services_nameinstanceapplication_typewindowing_subsystem_initializerwindowing_subsystem_namerendering_subsystem_initializerrendering_subsystem_nametext_shaping_subsystem_initializertext_shaping_subsystem_nameafter_setup_callbackafter_platform_services_setup_callbackconfigureconfigure_withafter_setupafter_application_setupafter_platform_services_setupstartsetup_without_startingsetup_with_lifetimeuse_windowing_subsystemuse_rendering_subsystemuse_text_shaping_subsystemuse_runtime_platform_subsystemuse_standard_runtime_platform_subsystemwithwith_funcconfigure_fontslog_to_tracelog_to_text_writerlog_to_delegatewith_system_font_source
setup_with_classic_desktop_lifetime
fn setup_with_classic_desktop_lifetime(self: &Self, args: &[String]) -> AppBuilder
Sets the application up with a classic desktop lifetime, but doesn't show the main window and doesn't run the application main loop.
args are the startup arguments.
setup_with_classic_desktop_lifetime_with
fn setup_with_classic_desktop_lifetime_with(self: &Self, args: &[String], lifetime_builder: impl Fn(&Rc<ClassicDesktopStyleApplicationLifetime>) -> ()) -> AppBuilder
setup_with_classic_desktop_lifetime
with a lifetime_builder that modifies the lifetime before the
application is set up. The builder receives the handle of the
lifetime so that it can keep it.
start_with_classic_desktop_lifetime
fn start_with_classic_desktop_lifetime(self: &Self, args: &[String]) -> i32
Starts the application with a classic desktop lifetime: sets the application up, shows the main window and runs the application main loop where the platform has one.
Returns what ClassicDesktopStyleApplicationLifetime::start
returns: the exit code once the main loop has ended or, on platforms
whose dispatcher does not support run loops, immediately after the
start-up, with the application left running (the application, the
lifetime and the windows are owned by the service locator, the class
handlers of the lifetime and the platform windows, not by the
caller).
start_with_classic_desktop_lifetime_with
fn start_with_classic_desktop_lifetime_with(self: &Self, args: &[String], lifetime_builder: impl Fn(&Rc<ClassicDesktopStyleApplicationLifetime>) -> ()) -> i32
start_with_classic_desktop_lifetime
with a lifetime_builder that modifies the lifetime before the
application is started.
start_with_classic_desktop_lifetime_and_shutdown_mode
fn start_with_classic_desktop_lifetime_and_shutdown_mode(self: &Self, args: &[String], shutdown_mode: ShutdownMode) -> i32
start_with_classic_desktop_lifetime
with the shutdown mode of the lifetime.
runtime_platform_services_initializer
fn runtime_platform_services_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
The method to call to initialize the runtime platform services (e. g. the asset loader).
runtime_platform_services_name
fn runtime_platform_services_name(self: &Self) -> Option<String>
The name of the currently selected runtime platform subsystem.
instance
fn instance(self: &Self) -> Option<Ref<Application>>
The Application instance being initialized.
application_type
fn application_type(self: &Self) -> Option<&'static TypeInfo>
The type of the instance (even if it's not created yet).
windowing_subsystem_initializer
fn windowing_subsystem_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
The method to call to initialize the windowing subsystem.
windowing_subsystem_name
fn windowing_subsystem_name(self: &Self) -> Option<String>
The name of the currently selected windowing subsystem.
rendering_subsystem_initializer
fn rendering_subsystem_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
The method to call to initialize the rendering subsystem.
rendering_subsystem_name
fn rendering_subsystem_name(self: &Self) -> Option<String>
The name of the currently selected rendering subsystem.
text_shaping_subsystem_initializer
fn text_shaping_subsystem_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
The method to call to initialize the text shaping subsystem.
text_shaping_subsystem_name
fn text_shaping_subsystem_name(self: &Self) -> Option<String>
The name of the currently selected text shaping subsystem.
after_setup_callback
fn after_setup_callback(self: &Self) -> Rc<dyn Fn(&AppBuilder) -> ()>
The method to call after the Application is set up: it calls the
callbacks registered with after_setup in
order.
after_platform_services_setup_callback
fn after_platform_services_setup_callback(self: &Self) -> Rc<dyn Fn(&AppBuilder) -> ()>
The method to call after the platform services are set up: it calls
the callbacks registered with
after_platform_services_setup
in order.
configure
fn configure<TApp: NewApplication>() -> AppBuilder
Begin configuring an Application.
TApp is the subclass of Application to configure.
configure_with
fn configure_with<TApp: ObjectType + Upcast<Application>>(app_factory: impl Fn() -> Ref<TApp> + 'static) -> AppBuilder
Begin configuring an Application created by app_factory.
app_factory is useful for passing of dependencies to TApp.
after_setup
fn after_setup(self: &Self, callback: impl Fn(&AppBuilder) -> () + 'static) -> AppBuilder
Registers a callback to call after the Application is set up.
after_application_setup
fn after_application_setup(self: &Self, callback: impl Fn(&AppBuilder) -> () + 'static) -> AppBuilder
Registers a callback to call after the Application is
initialized and before the callbacks of
after_setup. Commonly used by backends to
initialize their views.
after_platform_services_setup
fn after_platform_services_setup(self: &Self, callback: impl Fn(&AppBuilder) -> () + 'static) -> AppBuilder
Registers a callback to call after the platform services are set up
and before the Application is created.
start
fn start(self: &Self, main: impl FnOnce(&Ref<Application>, &[String]) -> (), args: &[String])
Sets up the application and calls main with it. What runs the
application (a lifetime, a platform loop, nothing) is up to main.
setup_without_starting
fn setup_without_starting(self: &Self) -> AppBuilder
Sets up the platform-specific services for the application, but does not run it.
setup_with_lifetime
fn setup_with_lifetime(self: &Self, lifetime: Rc<dyn IApplicationLifetime>) -> AppBuilder
Sets up the platform-specific services for the application and initializes it with a particular lifetime, but does not run it.
use_windowing_subsystem
fn use_windowing_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
Specifies a windowing subsystem to use.
initializer is the method to call to initialize the windowing
subsystem and name the name of the windowing subsystem.
use_rendering_subsystem
fn use_rendering_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
Specifies a rendering subsystem to use.
initializer is the method to call to initialize the rendering
subsystem and name the name of the rendering subsystem.
use_text_shaping_subsystem
fn use_text_shaping_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
Specifies a text shaping subsystem to use.
initializer is the method to call to initialize the text shaping
subsystem and name the name of the text shaping subsystem.
use_runtime_platform_subsystem
fn use_runtime_platform_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
Specifies a runtime platform subsystem to use.
initializer is the method to call to initialize the runtime
platform subsystem and name the name of the runtime platform
subsystem.
use_standard_runtime_platform_subsystem
fn use_standard_runtime_platform_subsystem(self: &Self) -> AppBuilder
Specifies a standard runtime platform subsystem to use.
with
fn with<T: ?Sized + 'static>(self: &Self, options: Rc<T>) -> AppBuilder
Configures platform-specific options: registers options as the
service of type T, which may be a trait object type.
with_func
fn with_func<T: ?Sized + 'static>(self: &Self, options: impl Fn() -> Rc<T> + 'static) -> AppBuilder
Configures platform-specific options: registers options as the
function that produces the service of type T on every lookup.
configure_fonts
fn configure_fonts(self: &Self, action: impl Fn(&Rc<FontManager>) -> () + 'static) -> AppBuilder
Registers an action that is executed with the current font manager.
log_to_trace
fn log_to_trace(self: &Self, level: LogEventLevel, areas: &[&str]) -> AppBuilder
Logs framework events to the diagnostic trace output of the process.
level is the minimum level to log (the reference default is
warning) and areas the areas to log; when empty every area is
logged. Valid values are listed in
LogArea.
log_to_text_writer
fn log_to_text_writer(self: &Self, writer: impl Write + Send + 'static, level: LogEventLevel, areas: &[&str]) -> AppBuilder
Logs framework events to a writer.
writer is the writer that is used for log events, one line per
event; level is the minimum level to log and areas the areas to
log; when empty every area is logged.
log_to_delegate
fn log_to_delegate(self: &Self, log_callback: impl Fn(&str) -> () + Send + Sync + 'static, level: LogEventLevel, areas: &[&str]) -> AppBuilder
Logs framework events to a custom callback.
log_callback is the callback that is used for log events, level
the minimum level to log and areas the areas to log; when empty
every area is logged.
with_system_font_source
fn with_system_font_source(self: &Self, font_source: url::Url) -> AppBuilder
Adds font_source to the system fonts once the application is set
up: the fonts of the source become available as if they were
installed in the system. The source is a file: URL of a font file or
of a directory of font files, or the URL of font assets (ferres:,
resm:).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedClassDefaultsErasedDestructorIntoEitherClone
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.