pub struct AppSettings {Show 25 fields
pub window_title: String,
pub application_id: Option<String>,
pub capabilities: Capabilities<'static>,
pub window_icon: Option<ImageBitmap>,
pub initial_width: u32,
pub initial_height: u32,
pub initial_size_explicit: bool,
pub primary_wraps_content: bool,
pub web_fill_viewport: bool,
pub web_accessibility_on_start: bool,
pub custom_cursor_size: CustomCursorSize,
pub fonts: Option<&'static [&'static [u8]]>,
pub font_registry: SoftwareTextFontRegistry,
pub android_system_fonts: bool,
pub android_gpu_backend: AndroidGpuBackend,
pub log_tag: Option<String>,
pub process_start: Option<fn()>,
pub android_overlay_window: Option<AndroidOverlayWindowOptions>,
pub headless: bool,
pub developer_inspector: Option<bool>,
pub gpu_requirements: GpuRequirements,
pub dev_options: DevOptions,
pub frame_pacing_mode: FramePacingMode,
pub frame_pacing_explicit: bool,
pub record_to: Option<PathBuf>,
/* private fields */
}Expand description
Configuration for application settings.
Fields§
§window_title: StringWindow title (desktop) / app name (mobile)
application_id: Option<String>The id every framework-owned storage path is scoped by.
Android and iOS take it from what the platform packaged; a desktop or web build states it here. Left unset, the desktop backend derives one from the executable name, which is right for a development build and wrong for a shipped one.
capabilities: Capabilities<'static>What this application declared it asks of a device.
The same declaration the platform builds read, so a service can answer on every platform without each one keeping its own list.
window_icon: Option<ImageBitmap>Desktop only: the picture every window the application opens carries.
Windows shows it in the title bar, the taskbar and the task switcher, and Linux desktops show it in their panels and switchers. macOS, Android, iOS and the web take the application’s icon from what the platform packaged and ignore this field.
initial_width: u32Initial window width in logical pixels.
initial_height: u32Initial window height in logical pixels.
initial_size_explicit: boolWhether the initial size was explicitly supplied by the app.
primary_wraps_content: boolDesktop only: keep the primary window the size of what it lays out.
web_fill_viewport: boolWeb only: give the canvas the full browser viewport instead of the box the host page lays it out in.
The default leaves the canvas box to the page’s own stylesheet, so a canvas nested in a phone frame, a card or any clipping container keeps the size that container gives it. An app that owns the whole page opts in here and the canvas fills the dynamic viewport, tracking the browser window as it resizes; other platforms ignore this field.
web_accessibility_on_start: boolWeb only: build the accessibility mirror from the first frame.
By default a web app builds no semantics and no mirror. The page holds one button, “Enable accessibility”, that a screen reader finds first, and the mirror is built when a reader presses it, as Flutter’s web engine does. An app whose readers should not have to press it sets this, at the cost of the mirror on every page load; other platforms ignore this field.
custom_cursor_size: CustomCursorSizeDesktop and web: how big an app’s own cursor images appear when the person has enlarged the system pointer.
Left at CustomCursorSize::FollowSystem, they grow with it, as the
standard cursors do. An app whose cursors are pixel art drawn at an exact
size can ask for CustomCursorSize::AsDrawn instead; on the web the
page then draws such a cursor itself, since a browser leaves the size
of a CSS cursor to the system.
fonts: Option<&'static [&'static [u8]]>Fonts loaded for text rendering (ordered: primary first, fallbacks last).
font_registry: SoftwareTextFontRegistryApp-supplied font families, already read and parsed.
This is where fonts that are not compiled into the binary live: files on
disk, platform system fonts, APK assets. Faces registered here carry the
FontFamily an app names them by, so a TextStyle asking for that
family resolves to them for both measurement and drawing.
android_system_fonts: boolWhether to register the platform’s generic families on Android (default: false).
android_gpu_backend: AndroidGpuBackendGraphics API selected for the Android WGPU renderer.
log_tag: Option<String>The tag this application’s log lines carry.
Android routes every log line through one tag, and adb logcat -s <tag> is how anyone reads them; an application that wants its own name
there had to initialise the platform logger itself, before the framework
did, and hope the ordering held. Naming it here removes both the
platform call and the race. Unset, lines carry Cranpose.
process_start: Option<fn()>Runs once per process, before the first composition and whether or
not a window ever opens. See AppLauncher::with_process_start.
android_overlay_window: Option<AndroidOverlayWindowOptions>Optional Android overlay surface configuration.
headless: boolRun in headless mode (window hidden, for robot testing)
When enabled, the window is created but not shown. This allows robot tests to run in parallel without cluttering the screen and enables CI environments without a display server.
developer_inspector: Option<bool>Override the developer inspector default. Unset enables it in debug builds; installing a robot driver defaults it to disabled unless explicitly set.
gpu_requirements: GpuRequirementsWhat code that renders with Cranpose’s device needs from it beyond Cranpose’s own requests. The desktop window, the web page and embedded views ask for it.
dev_options: DevOptionsDevelopment options for debugging and performance monitoring
frame_pacing_mode: FramePacingModeInitial desktop frame pacing mode.
frame_pacing_explicit: boolWhether the app chose a frame pacing mode explicitly. Installing a robot test driver lifts the vsync cap only when this is false.
record_to: Option<PathBuf>Optional path to record input events to (for generating robot tests)
Implementations§
Source§impl AppSettings
impl AppSettings
Sourcepub fn start_process(&self)
pub fn start_process(&self)
Runs process_start, at most once per process.
Every platform entry point calls it once its services are in place; a host that drives Cranpose itself calls it at the same point.
Sourcepub fn resolve_font_set(&self) -> SoftwareTextFontSet
pub fn resolve_font_set(&self) -> SoftwareTextFontSet
The font set every platform entry point hands its renderer.
One definition so the platforms cannot drift, and so the measurer and
the rasterizer are built from the same faces: app-registered families
first, then the static with_fonts() slices as unnamed fallbacks. A
launcher the app gave no fonts serves the embedded default face.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppSettings
impl !UnwindSafe for AppSettings
impl Freeze for AppSettings
impl Send for AppSettings
impl Sync for AppSettings
impl Unpin for AppSettings
impl UnsafeUnpin for AppSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.