40 lines
1.4 KiB
Rust
40 lines
1.4 KiB
Rust
//! Application composition root. Directory modules own implementation; these
|
|
//! crate-private aliases keep existing internal paths stable during reorganization.
|
|
mod bridge;
|
|
mod model;
|
|
mod render;
|
|
mod runtime;
|
|
mod shell;
|
|
|
|
pub(crate) use bridge::ui_bridge;
|
|
pub(crate) use model::{
|
|
binding, block, document, mount, object_list, presentation, protocols, snapshot, window,
|
|
};
|
|
pub(crate) use render::{
|
|
display_list, geometry, layout, native_visual, scene, scroll, software_renderer, source_hit,
|
|
source_layout, source_paint, text,
|
|
};
|
|
pub(crate) use runtime::{
|
|
api, endor_host, endor_script, event_dispatch, events, io_tasks, tasks, vm_sequence,
|
|
};
|
|
#[cfg(target_os = "macos")]
|
|
pub(crate) use shell::native_chrome;
|
|
pub(crate) use shell::{activity, app, clipboard, developer_tools, sources, system_ui, tabs};
|
|
|
|
use std::sync::{Arc, RwLock};
|
|
|
|
use anyhow::Result;
|
|
use app::{AppEvent, TesseraApp};
|
|
use document::NamespaceState;
|
|
use winit::event_loop::{ControlFlow, EventLoop};
|
|
|
|
fn main() -> Result<()> {
|
|
let event_loop = EventLoop::<AppEvent>::with_user_event().build()?;
|
|
event_loop.set_control_flow(ControlFlow::Wait);
|
|
let namespace = Arc::new(RwLock::new(NamespaceState::default()));
|
|
let (activity, control) = api::start(namespace.clone(), event_loop.create_proxy())?;
|
|
let mut app = TesseraApp::new(namespace, activity, event_loop.create_proxy(), control)?;
|
|
event_loop.run_app(&mut app)?;
|
|
app.exit_result()
|
|
}
|