cnmcdee cef7988a84 Phase 1: XFrame core + canvas + palette data + project model
- xframe/core.py: Widget base, 14 archetype draw classes (Cairo),
  registry over all 547 kinds; 13px handles, 8px grab pad, 450ms
  double-click, 8px drag threshold, 24x16 resize floor (C/Rust)
- xframe/canvas.py: CanvasState state machine (display-free, tested)
  + Gtk.DrawingArea shell; placement, selection, double-click
  handles, drag, handle resize, Delete/Escape, viewport tracking
- xframe/palette.py: generated from Rust registry_gen.rs, cross-checked
  vs C xframe_palette.h; 547 entries in 11 sections + 36 legacy
  model.h type keys as LEGACY_TYPES (583 total in the Rust data file)
- model.py: Project + .fdj save/load byte-compatible with the C writer
- app.py: main window with filterable palette list + canvas + status bar
- tests/: 62 stdlib unittest tests
2026-12-01 02:23:54 +00:00

LightGUI — Python port

A Python port of the LightGUI GUI designer: https://github.com/cnmcdee/lightgui (C++/GTK) and https://github.com/cnmcdee/lightgui_rust (Rust port).

Architecture (decided by the user)

  • IDE chrome in GTK via PyGObject (menus, palette, canvas frame, Inspector, code view, dialogs).
  • All widgets home-brewed XFrame in Python — the same architecture as the C and Rust designers: GTK is chrome only, the canvas is XFrame-native.
  • Generated code is Python using the Python XFrame widgets (the mirror of the C++ codegen).
  • Widget model follows the Rust port's archetype approach: a small set of archetype classes parameterised by a kind string, with data-driven property tables — not 547 separate widget classes. The C designer is the canonical reference for behaviour; the Rust port is the reference for structure.

Requirements

  • Python 3.10+
  • PyGObject (python3-gi, GTK 3)
  • pycairo (python3-cairo) — the XFrame widgets draw with Cairo
  • GTK 3.24

On Debian/Ubuntu/Parrot:

sudo apt install python3-gi python3-cairo gir1.2-gtk-3.0

Run

./ide

Layout

lightgui/
  __init__.py       version
  __main__.py       entry point
  app.py            Application, main window assembly (IDE chrome)
  model.py          project model: placed widgets, selection, .fdj place file
  theme.py          IDE theme (designer chrome only, not the generated app)
  preferences.py    preferences
  project_io.py     .fdj load/save
  props.py          property tables (generic set + per-widget), data-driven
  xframe/
    core.py         XFrame core: widget base, registry, draw dispatch
    canvas.py       canvas (Gtk.DrawingArea), placement, selection, handles
    palette.py      palette data (583 entries)
    archetypes.py   archetype widget classes (button, entry, label, ...)
    widgets.py      generic widget draw implementations
    drawings.py     shared drawing helpers (from C drawings.h)
    indicators.py   indicator drawing (from C indicators.h)
    stock.py        Stock widgets (37)
    instruments.py  Instrumentation widgets (66)
  inspector.py      Object Inspector window
  codeview.py       code view with gutter/folding
  generator.py      Python codegen
  debugger.py       pdb-based step debugger session
  debugger_ui.py    debugger UI
  build.py          run/build flow for Python apps (replaces CMake build)
  install_libs.py   Install Libraries flow (system-wide install, root prompt)

Status

Port in progress. See docs/architecture.md for the port plan and per-phase status.

S
Description
No description provided
Readme
2.4 MiB
0 Stars 1 Watchers 0 Forks
Languages
Python 99.9%