use blinc_layout::prelude::*;
use blinc_platform_fuchsia::FuchsiaPlatform;
use crate::error::{BlincError, Result};
use crate::windowed::WindowedContext;
pub struct FuchsiaApp;
impl FuchsiaApp {
#[cfg(target_os = "fuchsia")]
pub fn run<F, E>(mut ui_builder: F) -> Result<()>
where
F: FnMut(&mut WindowedContext) -> E + 'static,
E: ElementBuilder + 'static,
{
let _ = tracing_subscriber::fmt()
.with_max_level(tracing::Level::INFO)
.try_init();
tracing::info!("FuchsiaApp::run starting");
tracing::info!("Fuchsia platform support is currently a stub implementation");
tracing::info!("Full Fuchsia integration requires building within the Fuchsia tree");
tracing::info!("Would run UI with dimensions from Scenic view properties");
tracing::info!("Touch/mouse input would come from fuchsia.ui.pointer");
tracing::info!("Frame scheduling via Flatland.OnNextFrameBegin");
Ok(())
}
#[cfg(not(target_os = "fuchsia"))]
pub fn run<F, E>(_ui_builder: F) -> Result<()>
where
F: FnMut(&mut WindowedContext) -> E + 'static,
E: ElementBuilder + 'static,
{
Err(BlincError::PlatformUnsupported(
"Fuchsia apps can only run on Fuchsia OS".to_string(),
))
}
pub fn system_font_paths() -> &'static [&'static str] {
FuchsiaPlatform::system_font_paths()
}
}