10 Commits
Author SHA1 Message Date
Muse 9e6f882575 Regen data tables from lightgui e474894: kTypes 36->38, EventDef lazarus
- tools/extract_palette.py: kTypes expectation 36->38 (ToggleButton and
  CheckListBox added in C); palette total 598->600
- tools/extract_events.py: parse 6th EventDef field `lazarus` (Flag 10
  Lazarus Object Inspector name); scope table/dispatch parsing to
  events_for() (raw_events_for() has its own `raw` table, deliberately
  excluded); dispatch now tests the normalised key `t`, not `type`
- data/*.json regenerated via `make regen`: registry default sizes per
  the C rule (incl. the 15 monitor widgets' hand-written sizes),
  palette Misc/X order per C xframe_palette.h, props 37 types / 270
  props / 25 enum tables / 35 common props, events 29 types with
  lazarus names; indicators provenance head only
- crates/xframe-common: palette asserts 598->600, LightGUI 36->38
- crates/xframe-widgets: *_gen.rs regenerated; gen_data.py opt_f now
  emits float literals for Option<f64> lo/hi (pre-existing latent bug:
  running it on the old data also emitted Some(0)); stale eb0b5fc /
  547 / 9 / 35 / 27 counts updated to e474894 / 562 / 25 / 37 / 29

make check: all 5 tables OK. cargo build warning-free. cargo test
--workspace --no-fail-fast: all suites green except 5 pre-existing
environmental failures, verified identical on HEAD: lightgui-debug
console (37) + gtk (7) need /usr/bin/gdb (not installed on dallas),
lightgui-support font/theme need a display (gtk::init fails), and
lightgui-gen fixtures is stale vs the Task 4 event routing in gen.rs.
2026-12-05 19:20:00 +00:00
cnmcdee d507697ae8 tools/visreg: refresh 5 stale goldens, raise window-wait to 20s
First full run: 537 PASS, 9 FAIL, 1 SKIP (547 total).
Five RMSE failures were stale docs-sweep goldens (mid-draw
captures: chart data present, border/title/overlay lines missing)
— IndAdaptiveCyberCycle, IndCyberCycle, IndRegressionChannel,
IndRelativeVolatilityIndex, InstTankLevelAlarms. Each refreshed
golden is a settled render verified bit-stable across two
independent runs (RMSE 0). Four no-window failures were load
flakes under parallel execution; window-wait budget 10s -> 20s.
Confirmation re-run of all 9: 9 PASS, 0 FAIL, all 0.0000% RMSE.
2026-12-02 10:10:41 +00:00
cnmcdee 414cfe2a54 tools/visreg: visual regression harness for xframe-demo (547 widgets)
One command re-renders every widget exactly as the docs sweep did
(prebuilt target/debug/examples/<Name> under Xvfb 1280x1024x24,
captured with import -window, settled until two frames agree) and
diffs it against tools/visreg/golden/ with ImageMagick
compare -metric RMSE (default threshold 0.5%), writing a per-widget
report.csv/report.md/summary.txt to tools/visreg/report/.

Goldens are the Dec 2, 2026 docs-sweep screenshots from
/opt/lightgui-docs/rust_shots/. GtkCalendar golden was a mid-draw
capture artifact (fill only, no border/text) and is refreshed from a
settled render, verified pixel-identical (RMSE 0) to the docs pilot
screenshot. GtkInvisible is skipped by design (draws nothing).
2026-12-02 09:37:47 +00:00
cnmcdee a98d24d495 Phase 4: generator emits Stock/Instrumentation props (lightgui-gen)
Mirrors the C generator: a generic Phase 4 loop driven by PHASE4_CAPS
(caps_rs mode of tools/gen_phase4_props.py) emits one setter call per
Inspector-table prop the widget actually has, with the arg form from
the table kind (set_value(double) for gauges, set_value("...") for Seg
displays). Pairs are emitted together (minimum/maximum -> set_range,
y-min/y-max -> set_y_range, set_anchors3 when all six anchor
components are present, else one set_anchor per complete anchor). The
StockChart branch keeps only the NOTE for data-file/indicators/
drawings/compare-files/scale-mode; its up/down colours now come from
the generic loop. The common background prop falls back to
set_bg_color for Stock/Inst classes that have it (PHASE4_BG_COLOR,
bg_rs mode).
2026-11-30 15:01:38 +00:00
cnmcdee 8bbc094c62 Phase 4: float literals in generated Rust tables (const-context fix)
In a const context an integer literal does not infer as f64 (E0308),
so the generator emits float literals (100000.0) for PropDef::r lo/hi
via a new fmt_f64 helper, and the combined StockChart table is a named
const (STOCK_CHART_PROPS) -- an inline &[...] of const-fn calls is not
promotable to &'static (E0515). tools/gen_phase4_props.py gains
fmt_f64 (rust mode only; the C++ mode keeps integer bounds).
2026-11-30 14:48:33 +00:00
cnmcdee 786f1dd428 Phase 4: Stock/Instrumentation Inspector tables (lightgui-core)
Per-widget PropDef tables for all 103 Stock (37) + Instrumentation (66)
classes, generated by tools/gen_phase4_props.py (rust mode) from the C++
widget headers -- the same source as the C tables, so both designers show
the same property set with the same defaults. Each table is the Phase 1
generic set (via common_props) plus the widget's own colours, levels and
params (text first, then colours, then numerics/bools).

StockCandlestickChart resolves to the combined StockChart table: the legacy
8 data/indicator props with the widget's real up/down defaults
rgb(0,150,0)/rgb(200,30,30) (the legacy rgb(0,200,0)/rgb(220,0,0) did not
match the widget) plus the candlestick custom props (text, grid-color,
axis-width/height, view-first/count, auto-y, y-min/y-max) -- 17 total.

Also adds PropDef::n / PropDef::r const-fn constructors used by the
generated tables, and a phase4_stock_inst_tables test (counts + spot
checks across families).
2026-11-30 14:42:58 +00:00
Muse aa019fa3bc GtkInvisible: draw nothing, ignore input (matches C++)
The C++ GtkInvisible::draw() intentionally does nothing, not even a
design-time glyph, and all its event handlers return false. The Rust
DisplayWidget drew its 16x16 icon + label text for it, so the layout
script test CHECKDRAW BLANK-EXPECTED failed (67 non-white px in a
10x10 rect). Special-case kind == Invisible in draw/press/release/key.
Found by the layout script test after the real-widget swap.
2026-11-29 07:30:16 +00:00
cnmcdee 8178513e4e Extract indicator catalog (250) from src/indicators.h
data/indicators.json: the catalog only - name, formula family (the
defs_* group), plot kind, style, kPalette colour index, default
parameters, and the C++ compute-function name. Formulas are NOT
ported here; the function name lets the later pure-function port
find each formula in the header.

Groups: averages 32, bands 28, momentum 52, volume 20, volatility
43, patterns 66, final 9 = 250. Every referenced function verified
defined in the header (246 distinct fns; 4 shared), all names unique,
all defaults numeric-or-empty, all colour indices inside the
14-entry kPalette. The 3 extra v.push_back hits a naive grep finds
are pivot-point code inside a formula body, not registry entries.
2026-11-29 05:46:20 +00:00
cnmcdee f5b24ee484 Extract palette, property and event tables from lightgui sources
- data/palette.json: 583 entries (36 LightGUI types from src/model.h
  kTypes + 547 XFrame entries from src/xframe_palette.h), each XFrame
  entry cross-checked against the registry (name set, index, section).
- data/props.json: 6 PropKinds, 9 enum value tables, 35 per-type
  tables (99 props) + common props from src/props.h; lo/hi clamping
  ranges preserved exactly. Canvas has no table by design.
- data/events.json: 10 EventKinds, 27 per-type tables (32 events),
  9 no-events notes from src/events.h. Coverage verified against all
  36 kTypes keys.

Correction to the survey: EventKind has 10 variants, not 11 as
PORTING_PLAN.md states (Simple, SwitchPage, RowActivated, RowSelected,
BufferChanged, DeleteEvent, Draw, ItemClicked, ItemActivate,
CellChanged). The extractors record what the header defines.
2026-11-29 05:46:11 +00:00
cnmcdee fb152b6e39 Extract widget registry (547 widgets) from lightgui sources
Data, not hand-written code: tools/extract_registry.py reads
widgets/common/registry.h and cross-checks it three ways - the
on-disk widgets/components/ dirs, widgets/tools/sections.py, and the
default_size() rule from gen_registry.py - failing on any drift.

Re-derived counts (lightgui eb0b5fc): 547 widgets, 11 sections;
families Gtk 102, Ind 250, Inst 66, Stock 37, T 90, X 2.
The survey Stock 38 / Inst 67 counted the shared non-widget
headers StockData.h / InstData.h; XGraph/XSpreadsheet form a sixth
family X (2) the survey family table omitted.

Includes the extraction harness: tools/common.py, extract_all.py,
check.py (make check re-derives tables from the C++ sources and
fails on drift), tools/README.md, and the top-level Makefile.
2026-11-29 05:46:02 +00:00