Thin Windows entry, preview shell, and platform legacy state

This commit is contained in:
2026-06-17 00:42:50 +02:00
parent 9b1e593477
commit 5fdc9a9dd6
17 changed files with 368 additions and 216 deletions

View File

@@ -1,7 +1,7 @@
# PanoPainter Modernization Roadmap
Status: live
Last updated: 2026-06-16
Last updated: 2026-06-17
This roadmap is now architecture-first.
The active execution queue lives in `docs/modernization/tasks.md`.
@@ -80,18 +80,34 @@ What is still carrying too much live ownership:
Current hotspot files:
- `src/canvas.cpp`: 17 lines
- `src/app_layout.cpp`: 125 lines
- `src/app_layout.cpp`: 109 lines
- `src/canvas_modes.cpp`: 1 line
- `src/node.cpp`: 12 lines
- `src/main.cpp`: 87 lines
- `src/main.cpp`: 10 lines
- `src/node_panel_brush.cpp`: 2 lines
- `src/node_stroke_preview.cpp`: 160 lines
- `src/node_canvas.cpp`: 85 lines
- `src/node_stroke_preview.cpp`: 76 lines
- `src/node_canvas.cpp`: 69 lines
- `src/app.cpp`: 94 lines
- `src/app_dialogs.cpp`: 95 lines
Latest slice:
- The live Windows entry shell now routes through
`run_main_application(...)` in
`src/platform_windows/windows_runtime_shell.*`, leaving `src/main.cpp` as a
minimal entry wrapper around `main(...)` and `WinMain(...)`.
- Retained legacy storage-path state now lives in
`src/platform_legacy/legacy_platform_state.*` instead of staying inline in
`src/platform_legacy/legacy_platform_services.cpp`, which trims another
process-global platform-state pocket out of the legacy platform shell.
- The remaining `NodeStrokePreview` clone-init, stroke-frame planning,
mix-pass adapter wiring, sample-pass adapter wiring, and immediate-draw
request construction now route through
`src/legacy_node_stroke_preview_runtime_services.*`,
`src/legacy_node_stroke_preview_draw_services.*`, and
`src/legacy_node_stroke_preview_sample_services.*`, leaving
`src/node_stroke_preview.cpp` as a thinner live adapter.
- `NodeCanvas::handle_event()` now routes through
`handle_legacy_node_canvas_event(...)` in
`src/legacy_canvas_tool_services.*`, leaving `src/node_canvas.cpp` as a much

View File

@@ -1,7 +1,7 @@
# Modernization Task Tracker
Status: live
Last updated: 2026-06-16
Last updated: 2026-06-17
This file now tracks only active architecture work.
Completed, blocked, and superseded task history moved to
@@ -36,10 +36,10 @@ Completed, blocked, and superseded task history moved to
- `pp_legacy_paint_document`: 7 files, about 5709 lines
- `pp_legacy_app`: 20 files, about 4368 lines
- `pp_legacy_ui_core`: 20 files, about 3770 lines
- The biggest single-file choke points are still `src/canvas_modes.cpp`,
`src/node.cpp`,
`src/main.cpp`, `src/node_panel_brush.cpp`, `src/node_stroke_preview.cpp`,
`src/node_canvas.cpp`, `src/app.cpp`, and `src/app_dialogs.cpp`.
- The biggest remaining single-file pressure is no longer the old entrypoint
shell files; it now sits mostly in retained legacy service layers behind
`src/node_stroke_preview.cpp`, `src/app.cpp`, `src/app_dialogs.cpp`, and the
extracted canvas/platform containment files.
- The platform boundary is not finished:
- `pp_platform_api` still compiles Apple implementation files
- `platform_apple` no longer reaches `App::I` directly, and Linux FPS title
@@ -391,6 +391,13 @@ Current slice:
render-target validation, viewport/clear-color save-restore, and immediate
runtime request assembly out of the live node file and leaves
`src/node_stroke_preview.cpp` at 160 lines.
- `NodeStrokePreview` clone-finalize setup, stroke-frame planning, mix-pass
adapter wiring, sample-pass adapter wiring, and the remaining
immediate-draw request construction now also route through
`src/legacy_node_stroke_preview_runtime_services.*`,
`src/legacy_node_stroke_preview_draw_services.*`, and
`src/legacy_node_stroke_preview_sample_services.*`, which leaves
`src/node_stroke_preview.cpp` at 76 lines.
- `CanvasModeGrid` plus `ActionModeGrid` undo/redo now also live in
`src/legacy_canvas_mode_helpers.cpp` instead of staying inline in
`src/canvas_modes.cpp`, which leaves the live canvas-modes file as a
@@ -759,6 +766,9 @@ Current slice:
loop, and shutdown cleanup now also lives in
`src/platform_windows/windows_runtime_shell.*` instead of `src/main.cpp`,
which reduces the entry TU to a much smaller composition root
- the remaining Windows app shell in `main(...)` now also routes through
`run_main_application(...)` in `src/platform_windows/windows_runtime_shell.*`,
which reduces `src/main.cpp` to a minimal `main`/`WinMain` wrapper
- prepared-file background work now runs through an `AppRuntime`-owned worker
queue instead of a retained static worker in `src/app_events.cpp`
- canvas async import/export/save/open background work now also runs through an
@@ -1115,6 +1125,9 @@ Current slice:
- retained GLFW window hooks and the non-Linux fallback storage-path return now
also route through retained local state helpers instead of reading `App::I`
directly in those method bodies
- retained storage-path state now also lives in
`src/platform_legacy/legacy_platform_state.*` instead of staying inline in
`src/platform_legacy/legacy_platform_services.cpp`
- retained Apple callback injection and broader `platform_legacy` singleton
reach are still open
- The remaining Win32 shell wrappers for close, async lock/swap,