46 lines
1.2 KiB
Rust
46 lines
1.2 KiB
Rust
//! A native editor for the JSON Canvas file format (<https://jsoncanvas.org>).
|
|
//!
|
|
//! Usage: `jsoncanvas-desktop [FILE.canvas]`
|
|
|
|
// Do not pop up a console window next to the app on Windows release builds.
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
mod app;
|
|
mod document;
|
|
mod geometry;
|
|
mod inspector;
|
|
mod markdown;
|
|
mod model;
|
|
mod nodes;
|
|
mod theme;
|
|
mod view;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
fn main() -> eframe::Result {
|
|
let mut args = std::env::args_os().skip(1);
|
|
let open = match args.next() {
|
|
Some(arg) if arg == "--help" || arg == "-h" => {
|
|
println!("Usage: jsoncanvas-desktop [FILE.canvas]");
|
|
return Ok(());
|
|
}
|
|
Some(arg) => Some(PathBuf::from(arg)),
|
|
None => None,
|
|
};
|
|
|
|
let options = eframe::NativeOptions {
|
|
viewport: eframe::egui::ViewportBuilder::default()
|
|
.with_title("JSON Canvas Editor")
|
|
.with_inner_size([1280.0, 820.0])
|
|
.with_min_inner_size([640.0, 420.0])
|
|
.with_app_id("jsoncanvas-desktop"),
|
|
..Default::default()
|
|
};
|
|
|
|
eframe::run_native(
|
|
"JSON Canvas Editor",
|
|
options,
|
|
Box::new(|cc| Ok(Box::new(app::App::new(cc, open)))),
|
|
)
|
|
}
|