Files
DS4Server/src/main.rs
2026-07-27 21:16:10 +02:00

67 lines
1.8 KiB
Rust

mod a2ui;
mod a2ui_validation;
mod agent;
mod app;
mod compaction;
mod config;
mod database;
mod dev_brain;
mod engine;
mod metrics;
mod model;
#[cfg(target_os = "macos")]
mod native_edit;
#[cfg(target_os = "macos")]
mod native_media;
#[cfg(target_os = "macos")]
mod native_menu;
#[cfg(target_os = "macos")]
mod runtime;
mod schema;
#[cfg(target_os = "macos")]
mod server;
mod settings;
use app::{App, Message, app_icon, app_theme};
use iced::{Size, window};
fn main() -> iced::Result {
if std::env::args().nth(1).as_deref() == Some("validate-a2ui") {
if let Err(error) = a2ui_validation::run(std::env::args().skip(2)) {
eprintln!("A2UI validation failed: {error}");
std::process::exit(1);
}
return Ok(());
}
#[cfg(target_os = "macos")]
if let Err(error) = engine::configure_metal_sources() {
eprintln!("DS4Server: {error}");
}
iced::daemon(
|| {
let (main_window, open) = window::open(window::Settings {
size: Size::new(1120.0, 720.0),
min_size: Some(Size::new(760.0, 480.0)),
icon: Some(app_icon()),
exit_on_close_request: false,
// The title bar is ours: content runs to the top edge and the
// native traffic lights float over it.
#[cfg(target_os = "macos")]
platform_specific: window::settings::PlatformSpecific {
title_hidden: true,
titlebar_transparent: true,
fullsize_content_view: true,
},
..Default::default()
});
(App::load(main_window), open.map(Message::WindowOpened))
},
App::update,
App::view,
)
.title(App::title)
.subscription(App::subscription)
.theme(app_theme())
.run()
}