2026-01-07 20:42:28 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2026-01-07 20:22:49 +01:00
|
|
|
// src/main.rs
|
2026-01-19 19:42:54 +01:00
|
|
|
//
|
|
|
|
|
// Application entry point.
|
2026-01-07 20:22:49 +01:00
|
|
|
|
Complete Clean Architecture migration
Phase 1-7: Full migration from src/app/ to Clean Architecture
BREAKING CHANGES:
- Removed src/app/ (old TEA-style implementation)
- Removed src/constant.rs (constants now local to modules)
- Removed deprecated canvas_to_image_coords functions
NEW STRUCTURE:
- src/ui/ - UI Layer (COSMIC interface)
- src/application/ - Application Layer (DocumentManager, Commands)
- src/domain/ - Domain Layer (Document types, Operations)
- src/infrastructure/ - Infrastructure Layer (Loaders, Cache, System)
FEATURES:
- DocumentManager as Single Source of Truth
- Command Pattern for all operations
- Model caching for render data (performance)
- Sync mechanism between DocumentManager and UI Model
- Wallpaper support (COSMIC, KDE, GNOME, feh)
- Thumbnail cache with disk persistence
IMPROVEMENTS:
- Warnings: 62 → 43 (-31%)
- Deprecated warnings: 2 → 0 (-100%)
- Code removed: src/app/ (~2000 lines), constant.rs, deprecated functions
- Better Locality of Reference (constants local to modules)
- Clean separation of concerns
- No circular dependencies
DOCUMENTATION:
- Updated AGENTS.md (100% migration status)
- Updated README.md (architecture section)
- Updated Workflow.md
- Added Migration-Plan.md with full completion summary
TESTS:
- All 41 tests passing
- Build successful (0 errors, 43 warnings)
- Release build verified
Migration Status: ✅ 100% Complete
2026-02-03 08:43:21 +01:00
|
|
|
mod ui;
|
|
|
|
|
mod application;
|
|
|
|
|
mod domain;
|
|
|
|
|
mod infrastructure;
|
|
|
|
|
|
2026-01-07 20:22:49 +01:00
|
|
|
mod config;
|
|
|
|
|
mod i18n;
|
|
|
|
|
|
|
|
|
|
use anyhow::Result;
|
|
|
|
|
use clap::Parser;
|
|
|
|
|
use cosmic::app::Settings;
|
Complete Clean Architecture migration
Phase 1-7: Full migration from src/app/ to Clean Architecture
BREAKING CHANGES:
- Removed src/app/ (old TEA-style implementation)
- Removed src/constant.rs (constants now local to modules)
- Removed deprecated canvas_to_image_coords functions
NEW STRUCTURE:
- src/ui/ - UI Layer (COSMIC interface)
- src/application/ - Application Layer (DocumentManager, Commands)
- src/domain/ - Domain Layer (Document types, Operations)
- src/infrastructure/ - Infrastructure Layer (Loaders, Cache, System)
FEATURES:
- DocumentManager as Single Source of Truth
- Command Pattern for all operations
- Model caching for render data (performance)
- Sync mechanism between DocumentManager and UI Model
- Wallpaper support (COSMIC, KDE, GNOME, feh)
- Thumbnail cache with disk persistence
IMPROVEMENTS:
- Warnings: 62 → 43 (-31%)
- Deprecated warnings: 2 → 0 (-100%)
- Code removed: src/app/ (~2000 lines), constant.rs, deprecated functions
- Better Locality of Reference (constants local to modules)
- Clean separation of concerns
- No circular dependencies
DOCUMENTATION:
- Updated AGENTS.md (100% migration status)
- Updated README.md (architecture section)
- Updated Workflow.md
- Added Migration-Plan.md with full completion summary
TESTS:
- All 41 tests passing
- Build successful (0 errors, 43 warnings)
- Release build verified
Migration Status: ✅ 100% Complete
2026-02-03 08:43:21 +01:00
|
|
|
use crate::ui::NoctuaApp;
|
2026-01-07 20:22:49 +01:00
|
|
|
|
|
|
|
|
#[derive(Parser, Debug, Clone)]
|
|
|
|
|
#[command(version, about)]
|
|
|
|
|
pub struct Args {
|
|
|
|
|
/// File to open on startup
|
|
|
|
|
#[arg(value_name = "FILE")]
|
|
|
|
|
pub file: Option<std::path::PathBuf>,
|
|
|
|
|
|
|
|
|
|
/// UI language (e.g. "en", "de")
|
|
|
|
|
#[arg(short, long, default_value = "en")]
|
|
|
|
|
pub language: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() -> Result<()> {
|
|
|
|
|
// Get the system's preferred languages.
|
|
|
|
|
let requested_languages = i18n_embed::DesktopLanguageRequester::requested_languages();
|
|
|
|
|
|
|
|
|
|
// Enable localizations to be applied.
|
|
|
|
|
i18n::init(&requested_languages);
|
|
|
|
|
|
|
|
|
|
env_logger::init();
|
|
|
|
|
let args = Args::parse();
|
|
|
|
|
|
Complete Clean Architecture migration
Phase 1-7: Full migration from src/app/ to Clean Architecture
BREAKING CHANGES:
- Removed src/app/ (old TEA-style implementation)
- Removed src/constant.rs (constants now local to modules)
- Removed deprecated canvas_to_image_coords functions
NEW STRUCTURE:
- src/ui/ - UI Layer (COSMIC interface)
- src/application/ - Application Layer (DocumentManager, Commands)
- src/domain/ - Domain Layer (Document types, Operations)
- src/infrastructure/ - Infrastructure Layer (Loaders, Cache, System)
FEATURES:
- DocumentManager as Single Source of Truth
- Command Pattern for all operations
- Model caching for render data (performance)
- Sync mechanism between DocumentManager and UI Model
- Wallpaper support (COSMIC, KDE, GNOME, feh)
- Thumbnail cache with disk persistence
IMPROVEMENTS:
- Warnings: 62 → 43 (-31%)
- Deprecated warnings: 2 → 0 (-100%)
- Code removed: src/app/ (~2000 lines), constant.rs, deprecated functions
- Better Locality of Reference (constants local to modules)
- Clean separation of concerns
- No circular dependencies
DOCUMENTATION:
- Updated AGENTS.md (100% migration status)
- Updated README.md (architecture section)
- Updated Workflow.md
- Added Migration-Plan.md with full completion summary
TESTS:
- All 41 tests passing
- Build successful (0 errors, 43 warnings)
- Release build verified
Migration Status: ✅ 100% Complete
2026-02-03 08:43:21 +01:00
|
|
|
cosmic::app::run::<NoctuaApp>(Settings::default(), ui::app::Flags::Args(args))
|
2026-01-07 20:22:49 +01:00
|
|
|
.map_err(|e| anyhow::anyhow!(e))
|
|
|
|
|
}
|