2fb47520b3
feat(debug-logger): add DebugSignalLogger plugin for event logging and inspection feat(plugins): introduce built-in plugins module and integrate debug logger feat(plugin-integration): create integration layer for mapping Iced Messages to CoreEvents feat(plugin-registry): establish PluginRegistry for managing plugins and event dispatching
74 lines
1.7 KiB
Rust
74 lines
1.7 KiB
Rust
//! HCIE Iced GUI — entry point.
|
|
//!
|
|
//! Launches the Iced application with the HCIE image editor.
|
|
|
|
mod ai_chat;
|
|
mod ai_script;
|
|
mod app;
|
|
mod brush_import;
|
|
mod canvas;
|
|
mod cli;
|
|
mod color_picker;
|
|
mod dialogs;
|
|
mod dock;
|
|
mod i18n;
|
|
mod io;
|
|
mod panels;
|
|
mod plugins;
|
|
mod raster;
|
|
mod screenshot;
|
|
mod script;
|
|
mod selection;
|
|
mod settings;
|
|
mod shape_sync;
|
|
mod sidebar;
|
|
mod theme;
|
|
mod vector_edit;
|
|
mod viewer;
|
|
mod widgets;
|
|
|
|
use app::HcieIcedApp;
|
|
|
|
fn main() {
|
|
let _ = env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info"))
|
|
.try_init();
|
|
|
|
log::info!("Starting HCIE Iced GUI");
|
|
|
|
let args = match cli::parse_args(std::env::args().skip(1)) {
|
|
Ok(args) => args,
|
|
Err(error) => {
|
|
eprintln!("{error}\n\n{}", cli::help_text());
|
|
std::process::exit(2);
|
|
}
|
|
};
|
|
if args.help {
|
|
println!("{}", cli::help_text());
|
|
return;
|
|
}
|
|
|
|
// Start tablet evdev listener
|
|
let tablet_state = std::sync::Arc::new(std::sync::Mutex::new(io::tablet::TabletState::new()));
|
|
io::tablet::start_evdev_listener(tablet_state.clone());
|
|
|
|
let load_path = args.load_path;
|
|
let screenshot = args.screenshot;
|
|
if let Err(error) = iced::application(
|
|
"HCIE — Iced Edition",
|
|
HcieIcedApp::update,
|
|
HcieIcedApp::view,
|
|
)
|
|
.subscription(HcieIcedApp::subscription)
|
|
.theme(HcieIcedApp::theme)
|
|
.window_size((1280.0, 800.0))
|
|
.decorations(false)
|
|
.run_with(move || {
|
|
let (mut app, init_task) = HcieIcedApp::new(load_path, screenshot);
|
|
app.tablet_state = tablet_state;
|
|
(app, init_task)
|
|
}) {
|
|
eprintln!("failed to run HCIE Iced GUI: {error}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|