docs: README + DESIGN for the wx frontend and essim_add_frontend

Document the wxWidgets GUI frontend (wx dependency + -DESSIM_FRONTEND=wx in
README; layout tree + architecture note in DESIGN) and the factored
essim_add_frontend() per-frontend CMake helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 21:03:06 +02:00
parent 4803d7d01c
commit 76807b0307
2 changed files with 22 additions and 6 deletions

View File

@@ -78,6 +78,12 @@ src/
commands_export.cpp thin wrapper over app::export_connections commands_export.cpp thin wrapper over app::export_connections
screen_*.cpp dashboard, connect, settype, explore, analyze, help, main screen_*.cpp dashboard, connect, settype, explore, analyze, help, main
(console), palette, file dialog, error/confirm, sigtype modal (console), palette, file dialog, error/confirm, sigtype modal
wx/ -- wxWidgets GUI (builds libessim_wx + the `essim` binary)
CMakeLists.txt find_package(wxWidgets) + essim_add_frontend(wx ...)
main.cpp entry point: construct WxFrontend, call frontend_main
wx_frontend.{hpp,cpp} WxFrontend : Frontend (owns System; boots wx in Run())
wx_frame.{hpp,cpp} EssimFrame: menu/tree/overview/log over core + app::*
cmake/EssimFrontend.cmake -- essim_add_frontend(name LIBS ...) per-frontend wiring
tests/ -- core tests (link essim_core) tests/ -- core tests (link essim_core)
tui/ -- frontend tests (link essim_tui) tui/ -- frontend tests (link essim_tui)
doc/ , test/ -- docs; sample netlists + system.essim bring-up script doc/ , test/ -- docs; sample netlists + system.essim bring-up script
@@ -104,10 +110,13 @@ The hard rule: **`src/core/` never depends on a frontend** — no `#include
`frontend_main(argc, argv, Frontend&)` (`frontends/frontend_main.cpp`, built `frontend_main(argc, argv, Frontend&)` (`frontends/frontend_main.cpp`, built
into the toolkit-free `essim_frontend` lib) parses the CLI flags and drives the 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 boot → batch/run flow through the interface; a frontend's `main()` is just
*construct the concrete Frontend, call `frontend_main`*. Add one by creating *construct the concrete Frontend, call `frontend_main`*. Two frontends ship
`src/frontends/<name>/CMakeLists.txt` (build `essim_<name>` linking `essim_core`, today: **tui** (FTXUI, default) and **wx** (a wxWidgets GUI, menu-driven over
produce the `essim` binary linking `essim_frontend`) and configuring `app::*`). Add another by creating `src/frontends/<name>/CMakeLists.txt` — its
`-DESSIM_FRONTEND=<name>`. toolkit setup (FetchContent / find_package) plus one call to
`essim_add_frontend(<name> LIBS …)` (the shared helper in
`cmake/EssimFrontend.cmake` that builds `essim_<name>` + the `essim` binary) —
and configuring `-DESSIM_FRONTEND=<name>`.
Because the core links no toolkit, the suite links `essim_core` directly and Because the core links no toolkit, the suite links `essim_core` directly and
`-DESSIM_FRONTEND=none` builds + tests the whole core with FTXUI never fetched. `-DESSIM_FRONTEND=none` builds + tests the whole core with FTXUI never fetched.

View File

@@ -51,10 +51,17 @@ Step-by-step walkthroughs for both the batch and TUI workflows are in
- Fetched automatically via `FetchContent` (nothing to install): **FTXUI** - Fetched automatically via `FetchContent` (nothing to install): **FTXUI**
v6.1.9 — only when building the **tui** frontend — and **doctest** v2.4.11 v6.1.9 — only when building the **tui** frontend — and **doctest** v2.4.11
for the tests. for the tests.
- **wxWidgets** (≥ 3.2) — only for the **wx** GUI frontend
(`-DESSIM_FRONTEND=wx`). Install the development package:
- Debian/Ubuntu — `sudo apt install libwxgtk3.2-dev`
- Arch — `sudo pacman -S wxwidgets-gtk3`
- Fedora — `sudo dnf install wxGTK-devel`
- Optional, only for the `doc` target: **doxygen** and **python3**. - Optional, only for the `doc` target: **doxygen** and **python3**.
libzip, pugixml and libbsdl are the **core** dependencies; FTXUI belongs to the libzip, pugixml and libbsdl are the **core** dependencies; each frontend pulls
tui frontend, so a `-DESSIM_FRONTEND=none` build needs none of it. its own toolkit (FTXUI for tui, wxWidgets for wx), so a `-DESSIM_FRONTEND=none`
build needs neither. Pick a GUI/TUI with `-DESSIM_FRONTEND=tui|wx` (default
`tui`).
## Tests ## Tests