Krolyxon
Commit 88ae7ba

Branches

Tags

Refs →

bench51cratesbench51-guisrcmain.rs

57 lines · 1.4 KB · Rust

1// No console window behind the app on Windows release builds.
2#![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")]
3
4mod app;
5mod chrome;
6mod editor;
7mod icons;
8mod layout;
9mod modals;
10mod panes;
11mod state;
12mod theme;
13mod widgets;
14
15use std::path::PathBuf;
16use std::sync::Arc;
17
18use clap::Parser;
19use eframe::egui;
20
21/// Keil µVision-style desktop IDE for the Intel 8051, built on bench51.
22#[derive(Parser, Debug)]
23#[command(version, about)]
24struct Args {
25 /// Assembly sources (.asm, .a51) or Intel HEX files (.hex, .ihx) to open.
26 files: Vec<PathBuf>,
27
28 /// Oscillator frequency in MHz, used to show elapsed time.
29 #[arg(long)]
30 clock: Option<f64>,
31
32 /// Colour theme, overriding the saved choice.
33 #[arg(long, value_enum)]
34 theme: Option<state::ThemePref>,
35}
36
37fn main() -> eframe::Result {
38 let args = Args::parse();
39 let options = eframe::NativeOptions {
40 viewport: egui::ViewportBuilder::default()
41 .with_title("bench51")
42 .with_app_id("bench51-gui")
43 .with_inner_size([1440.0, 900.0])
44 .with_min_inner_size([960.0, 600.0])
45 .with_icon(Arc::new(icons::app_icon())),
46 ..Default::default()
47 };
48 eframe::run_native(
49 "bench51-gui",
50 options,
51 Box::new(move |cc| {
52 Ok(Box::new(app::GuiApp::new(
53 cc, args.files, args.clock, args.theme,
54 )))
55 }),
56 )
57}