From 3b6e626c8fc12727c7c6e3bfc825ceadc417f39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 3 Jun 2026 20:35:24 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20DESIGN=20=E2=80=94=20Frontend=20interfa?= =?UTF-8?q?ce=20+=20frontend=5Fmain,=20app/=20ops,=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reflect the new shared frontends layer (frontend.hpp / frontend_main) in the Architecture section and layout tree, and list the verify/connect/load app ops alongside export. Co-Authored-By: Claude Opus 4.8 --- DESIGN.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index db33e52..afe33b1 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -61,10 +61,15 @@ src/ import_base.hpp / import_{mentor,altium,ods}.{hpp,cpp} / ods_writer.{hpp,cpp} app/ -- application operations (UI-independent use cases) export.{hpp,cpp} export_connections(System*, path, format) -> ExportResult + verify.{hpp,cpp} verify(System*) -> VerifyReport (the 7 verify passes) + connect.{hpp,cpp} connect_parts(System*, m1,p1, m2,p2) -> ConnectResult + load.{hpp,cpp} load_module(System*, name, path, ImportType) -> LoadResult frontends/ -- one directory per GUI/TUI engine; each links essim_core + frontend.hpp -- abstract Frontend interface (BootDispatch/Dump*/Run) + frontend_main.{hpp,cpp} -- frontend_main(argc,argv,Frontend&): argv + boot/batch/run tui/ -- FTXUI shell (builds libessim_tui + the `essim` binary) CMakeLists.txt fetches FTXUI; builds essim_tui + essim - main.cpp entry point (CLI flags -> Tui) + main.cpp entry point: construct Tui, call frontend_main tui.{hpp,cpp} class Tui (state + Run() + screen-mode event dispatch) tui_helpers.{hpp,cpp} ToLower, NaturalLess, RenderHelpPanel shell.cpp Print, Submit, Dispatch, Source / ProcessNextSourceLine @@ -93,8 +98,15 @@ The hard rule: **`src/core/` never depends on a frontend** — no `#include inside its lambda. The TUI command is now a thin wrapper — resolve args/dialog → call the core op → render the result.) - **Frontends** (`frontends//`) — thin: map UI events to core calls and - render results. Add one by creating `src/frontends//CMakeLists.txt` (build - `essim_` linking `essim_core`, produce the `essim` binary) and configuring + render results. Each implements the **`Frontend`** interface + (`frontends/frontend.hpp`: `BootDispatch`, `DumpCommandsMd`, `DumpOutput`, + `Run`). The process entry is shared and frontend-agnostic: + `frontend_main(argc, argv, Frontend&)` (`frontends/frontend_main.cpp`, built + into the toolkit-free `essim_frontend` lib) parses the CLI flags and drives the + boot → batch/run flow through the interface; a frontend's `main()` is just + *construct the concrete Frontend, call `frontend_main`*. Add one by creating + `src/frontends//CMakeLists.txt` (build `essim_` linking `essim_core`, + produce the `essim` binary linking `essim_frontend`) and configuring `-DESSIM_FRONTEND=`. Because the core links no toolkit, the suite links `essim_core` directly and