xonecas.io
8447
Co

conveyor / files

conveyor / crates / conveyor-app / src / lib.rs

887 bytes
1//! The conveyor app: it draws the user's widget library, starting from its `root` widget, and
2//! the building tool over it: hold Ctrl, click any widget, and say what it should become.
3mod app;
4mod client;
5mod form;
6mod inspect;
7mod reload;
8mod safe;
9#[path = "../../../templates/library/api.rs"]
10pub mod api;
11
12use rune::{App, AppSpec, WindowOptions};
13
14/// The state every widget handler gets (see the library's api.rs).
15pub type HostState = app::State;
16
17/// Changes with every build of this library: widgets built against another one can't load.
18pub const BUILD: &str = env!("CONVEYOR_BUILD");
19
20pub fn run() {
21    let spec = AppSpec { setup: Some(app::setup), poll: Some(app::poll), ..AppSpec::new("Conveyor", (1400.0, 900.0), app::init, app::view) };
22    App::new(spec).on_modifiers(app::on_modifiers).window_options(WindowOptions { borderless: true, ..Default::default() }).run();
23}