2.3 KiB
2.3 KiB
LightGUI Python port — architecture notes
Sources
- C designer (canonical behaviour): /opt/lightgui, https://github.com/cnmcdee/lightgui
- Rust designer (structural reference): /opt/lightgui_rust, https://github.com/cnmcdee/lightgui_rust
- Property model: /root/lightgui-inspector-properties.md on the server (Lazarus RTTI audit; generic set + per-widget custom props + 13 §4 flag decisions)
Key design decisions
- Widget model = Rust archetypes, not C's 547 headers. A small set of archetype
classes parameterised by
kind, with data-driven property tables. The C property tables live insrc/props.handtools/gen_phase4_props.py; the Rust tables incrates/lightgui-core/src/props.rs(4239 lines) andcrates/xframe-indicators/src/generated.rs. The Python tables should be generated or transcribed from those, not re-invented. - Canvas: Gtk.DrawingArea + Cairo. XFrame widgets draw themselves with Cairo; the canvas handles placement, selection, handles (13px), drag, and double-click.
- Generated apps are Python scripts using the Python XFrame widgets. There is no
CMake build for them: the Build/Run flow runs
python3on the generated script (syntax check + run), and the build console shows that output. - Debugger: the C debugger is GDB/MI over C++ apps. The Python equivalent drives
pdbin a subprocess over the generated Python script, mirroring the session architecture (breakpoints, step in/out/over, watch, call stack). - Setters are state-only; the host redraws (same convention as C/Rust).
- Theme is for the layout designer only. The generated app has its own properties.
Phase plan
- Skeleton + environment (this commit) — repo on
main, runs under Xvfb. - XFrame core + canvas + palette data.
- Generic widgets (archetypes) + property tables + live-apply plumbing.
- Inspector + properties + font picker + bulk parameter.
- Code view (gutter/folding) + codegen + project I/O (.fdj) + build/run.
- Debugger (pdb session + UI) + Install Libraries.
- Stock (37) + Instrumentation (66) widgets + property tables.
- Tests + verification + README + screenshots.
Phases are verified live under Xvfb with screenshots before the next starts. Each phase commits + pushes its piece as it lands (remote HEAD == local HEAD).