Rust port of the Task Manager clone: TPageControl body panel with
two GtkButton tabs (ContainerWidget draws no tab strip, so the tabs
are registry buttons routed by the app). Processes tab is a live
XProcessList from /proc (sortable PID/NAME/CPU%/MEM, top 12 by CPU,
refreshes every 2 s). Performance tab is XHistoryGraph (60 s CPU +
memory), XCoreGrid (per-core), XUsageBar (Memory), XStackBar
(memory breakdown) and XNetGraph (live /proc/net/dev rates). Data
sampled every 500 ms; repaint every 2 s (text helpers measure with
query_text_extents, one server round trip per call, so a 500 ms
repaint would never catch up).
Also fixes two XProcessList rendering bugs the app exposed: the PID
column (52px) was too narrow for 7-digit PIDs (PID text touched the
NAME text) -> 64px in both draw and hit-test; the sort indicator
used U+25BC/U+25B2, which have no glyph in the fixed core font and
rendered as garbage bytes -> ASCII v/^ like the C++ widget.
- 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.
- XArcGauge: face fill was a full white circle; now the top
half-disc only (was painting a white half-disc over the widget
background below the diameter line).
- XNetGraph: status split into two lines (one line overflowed a
320px widget).
- XTempHistory: threshold label left-aligned; right-aligning
under-measures the degree glyph and clipped at the border.
- xframe-palette: tolerate the 15 monitor icons as pending (same
carve-out as the xframe-common ico test) so the palette stays
usable until the C icons land; palette selftest passes.
- 15 screenshots in crates/xframe-demo/shots/ (Xvfb :108), all
non-blank per PIL check and visually verified.
Reuse the stock-chart CSV parser (same format, same sample file):
IndicatorWidget::populate_from_csv / Widget::load_csv_data replace
the demo bars and the lines recompute from the loaded series at draw
time, so no per-kind wiring was needed. Adds csv::bars_from_rows +
date_to_epoch_nanos (Bar::time is nanoseconds; this also makes the
four pivot widgets compute real lines instead of all-NaN). Demo
series stays as fallback (reset_to_demo, loaded_from_csv flag).
Tests: 9 new (all-250 load + recompute + headless draw, pivot fix,
bad-CSV keeps demo bars); full workspace suite clean except the
pre-existing lightgui-gen fixture failure. Screenshots: 250/250
CSV-loaded renders under Xvfb differ from demo goldens (RMSE
0.0060-0.0661). Docs: docs/indicators-csv.md; rustdoc Ind* pages
updated.
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.
(c) step_out() in main() degraded to Continue instead of failing
with "finish not meaningful in the outermost frame."
(d) Stop on a GUI app in gtk_main: enable mi-async in spawn_gdb and
fall back through MI interrupt, SIGINT and SIGSTOP to the inferior
pid; kill_target() also tells gdb to drop a stopped inferior it never
reported dead (console kill), or -file-exec-and-symbols fails with
"Couldnt get registers".
(e) New restart_or_start(): same target+args restarts, otherwise kills
the stopped inferior and starts the new target (Run must honour the
Target field).
(f) Breakpoints gain a temporary flag: break-on-main bps are skipped
on re-apply, never saved, and never added twice.
Tests: step_out_in_main_degrades_to_continue,
break_on_main_no_duplicate_on_second_start,
break_on_main_no_duplicate_after_load, restart_or_start_switches_target,
gtk_interrupt_running_app (new gtkspin target); lib.rs documents all 8
bugs and the Rust port stance on each. (a)(b)(g)(h) are UI bugs and
there is no debugger UI in the Rust designer yet.
- New csv.rs: parse_ohlcv_csv (date,open,high,low,close[,volume],
header optional, errors name the line) + derived series (VWAP, OBV,
accumulation/distribution, money flow, Heikin-Ashi, Renko, volume
profile).
- XGraph: load_*_csv loaders (candles, OHLC bars, close line, indexed
closes, VWAP over candles, OBV, A/D, money flow, Heikin-Ashi, Renko,
volume bars/candles/profile), add_ohlc_csv + add_ratio_line /
add_spread_line for two-symbol compare, clear_data, SeriesKind::Bars
(volume bars from the zero line; y range forced to contain 0).
- ChartWidget::populate_from_csv picks the series per kind; the 14
drawing/annotation kinds reject CSV with an error. Widget trait gains
load_csv_data (default: rejects); XGraph loads candles.
- xframe-demo: run_widget_with_csv + --csv flag; csv-chart-shots
example renders all 23 kinds headlessly and diffs vs the blank
template; 30-row sample CSV in examples/data/.
- docs/stock-charts-csv.md: audit (no template data ships inside the
widget), CSV spec, per-kind table, worked examples, limits. Also
corrects the stale gen.rs comment about a seeded preview series.
- 13 new tests in csv_tests.rs (parser, derived math, per-kind
population, clear/populate, ratio/spread, headless renders).
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).
Generated examples/<WidgetName>.rs (547 files): each is a minimal
complete program calling xframe_demo::run_widget(name) — the same code
path as the xframe-demo binary. cargo check --examples passes for all
547; the 5 pilot examples were built, run under Xvfb and screenshotted.
Extract run_widget() from main.rs into src/lib.rs; the binary is now a
thin argv wrapper and each examples/<WidgetName>.rs is a minimal complete
program calling run_widget(name). Pilot: GtkButton, GtkLabel, GtkEntry,
GtkCalendar, InstPressureGauge (built, run under Xvfb, screenshotted).
Same pressed/focused routing as the C generator: generated event loop tracks pressed_widget (set on a handled ButtonPress) and focused_widget (click-to-focus). ButtonRelease goes to the pressed widget even if the pointer moved off it; MotionNotify goes to the pressed widget while a press is held (drag), otherwise to the topmost widget under the pointer; KeyPress goes to the focused widget only. ButtonPress hit-testing, Expose, ConfigureNotify and ClientMessage unchanged. Verified live under Xvfb on hot_chicago: the Rust designer generates main.cpp with the new loop. The generated loop is line-for-line the same one proven live in C with an instrumented 4-widget app (keys only to the focused entry, hover only to the widget under the pointer, drag/release only to the pressed button). The Rust designer canvas does NOT share this loop (it already targets release/motion/keys by selection/hit-test), so it is unchanged.
27 widgets (18 dialogs, 2 calendars, 3 views, 4 choosers) get larger defaults, applied in the xframe-common build.rs (designer placement) and gen_data.py (widget factory). Verified live under Xvfb on hot_chicago: placed sizes now e.g. GtkAboutDialog 520x260, TPageSetupDialog 320x400, TColorDialog 520x300. Two residual internal-layout collisions (TFindDialog Direction/Find Next, GtkFileChooserDialog Name/path) are draw-code issues, not placement size.
Task 1: placing a widget now disarms placement mode — the next canvas
click places nothing until another palette widget is selected. Escape
(canvas or palette window) and clicking the selected palette entry
again also cancel an armed placement. Previously sel_type persisted
across placements, so every click placed another fresh widget.
Task 2: placing a widget refreshes the Code window at once
(Lazarus-style) via refresh_code_view() after place_widget(), so the
generated code shows the new widget without pressing Generate.
Verified live under Xvfb (9/9 in r-place-verify.sh): place-once,
Escape-cancel, toggle-cancel, re-arm, code sync, clean app log.
The property editors in the grid sat at their natural width while
the Bulk parameter fields below filled the panel. Set hexpand on the
control in add_row so the control column takes the extra width, like
the Bulk fields. Entries, spins, combos and the entry+Pick boxes all
stretch; the label column stays narrow.
The font-name entry gets a Pick button (same pattern as the Color
Pick button) that opens a font chooser listing the available system
fonts. Choosing one sets font-name to the picked family; setting the
entry text fires the existing changed handler, so the pick
live-applies exactly like typing the name. Only the family is stored
(size/bold/italic stay separate properties). The dialog is hidden,
not closed, after run() (close() leaves it mapped in this gtk-rs
build).
Adds Tools > Install Libraries: builds the designer as the user
(cargo build -p lightgui-designer), then installs system-wide as root
(pkexec when present, else a GTK password dialog feeding sudo -S).
Installs the designer binary to /usr/local/bin/lightgui-designer,
widget headers to /usr/local/include/lightgui (from the sibling C
repo, passed as LIGHTGUI_SRC since pkexec strips env), palette icons
to /usr/local/share/lightgui/icons, and a desktop entry + icon to the
app menu. Headers are header-only, so no shared libraries and no
ldconfig step. The .ui is embedded in the binary, so no UI file is
installed. Install output is shown in the scrollable log dialog.
Dialogs are hidden (not closed) after run(), and Enter in the
password entry submits via its activate signal.
The Rust designer had no CMake build UI at all: File -> Build with
CMake, Open CMake Project and CMake Settings all just posted an
unowned_note (CMake build lives in lightgui-support). Wire the first
two to lightgui-support now, mirroring the C++ designer:
- show_build_result(): modal 700x420 dialog with the full build log
in a read-only monospace TextView. The log area is packed expanding
(pack_start expand=true) so it fills the dialog instead of sitting
at its ~2-line natural height at the top — the C console bug, fixed
here by construction. Long lines wrap; the view starts scrolled to
the end of the log (idle callback, so the scroll happens after
allocation and lands on the true last line).
- cmake_build_dir(): error dialog when there is no CMakeLists.txt,
otherwise configure + build with the saved settings and show the
result dialog.
- on_cmake_build(): rebuilds the last generated project, or asks for
a folder when there is none yet.
- on_cmake_open(): choose any CMakeLists.txt folder and build it.
- App.last_cmake_dir records the last generated/opened project
(set by Generate too), mirroring C++ g_last_generated_dir.
CMake Settings… stays an unowned note: no settings dialog, out of
scope for this change.
Cases 02, 03, 14, 15, 16: the StockChart up/down colours are now
emitted by the generic Phase 4 loop with the widget's real defaults
rgb(0,150,0)/rgb(200,30,30) (the legacy rgb(0,200,0)/rgb(220,0,0) did
not match the widget), in table order, together with the rest of the
candlestick custom props (grid-color, auto-y, axis-w/h, view-first/
count, y-range). Case 03 also gains set_text("Test value") -- the
combined 17-prop StockChart table now carries a text prop.
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).
A Phase 4 block before the generic branches routes a Stock/Inst
widget's own table props through the named dispatch (pairs together
from the model: y-min/y-max -> set_y_range, anchor-N-bar/price ->
set_anchor, grid-rows/cols -> set_grid_size; singletons by table kind;
Str "value" -> set_value_str so Seg displays are not parsed as f64).
minimum/maximum, Double "value" and "position" are deliberately not
intercepted -- the existing set_range / set_value / set_position
branches already apply them. Props the archetype does not implement
stay model-only (the model holds them; the generator emits them).
Widget trait gains set_named_color/double/int/bool/string, set_y_range,
set_anchor and set_value_str (default: false = model-only). XGraph gains
axis/line/up/down/candle/annotation/text colours + line_width (per-kind
table defaults); the y-labels use axis_color and Line series use
line_width. InstrumentWidget gains brightness (C lamp factor
0.08+0.92*b/100 plumbed into draw_led/draw_panel_lamp/draw_beacon,
per-tier into draw_stack_light, channels+lens into draw_rgb_led),
decimal_places (LedDigits formatting) and stack tier brightness, plus
the full colour/level/on dispatch (lens/lit/dim routed per kind).
ChartWidget gains anchors + overlay colour and dispatches colours into
the XGraph (and any series present), view/axis props into the PlotView,
y-range and anchors. Toggle/Button dispatch "on" (checked / latched).
Props with no Rust counterpart (alarm bands, flash-rate/phase, switch
line-widths/positions, per-indicator colours, symbol/labels, etc.)
return false and stay model-only; the generator still emits them.
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).
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).
Mirror of C5: a wildcard XLFD pattern can match a two-byte font
first (e.g. a JIS fixed font at size 16, which has no misc twin) and
XDrawString with 1-byte Latin text draws nothing with such a font.
The designer now lists every match per candidate pattern (new
X11::list_fonts) and takes the first single-byte font (new
X11::font_is_single_byte, min_byte1 == max_byte1 == 0); the emitted
lightgui_pick_font helper gets the identical fix. Fixture
03_all_props regenerated from the C generator.
03_all_props, 04_enum_values and 05_menus main.cpp now carry the
Phase 1 generator output (font picker + autosize helpers, anchor
lambda, new setter calls, enabled/visible, model-only notes).
02_all_types is byte-identical; 14/15/16 differ only in the
data-file path (generation directory), so their fixtures are
unchanged. cargo test -p lightgui-gen -p lightgui-designer
-p lightgui-core: all green.
Anchors/effective_anchors, lightgui_pick_font + conditional
<cctype>, apply_autosize helper, per-widget font into
emit_widget_styles, Entry password/show-password, Listbox
selection-mode 3 -> set_multi_select, Menubutton direction,
Scrollbar lower/page-increment, Text cursor-visible,
enabled/visible via the IWidget virtuals, the model-only NOTE
comment, the apply_anchors resize lambda (with (void) guards for
unused sizes) called from ConfigureNotify, and an apply_autosize
call per autosize widget. New props emit only when non-default.
Fixtures regenerated from the C generator in the next commit.
refresh_item_style now reads the font-name/size/bold/italic props
and picks the first loadable XLFD from the candidate chain (probed
here, font id cached in a new CanvasBackend font_ids map).
redraw_canvas installs each item's style font into the GC before
drawing it (resolve_font fills metrics on first use; the cached
font id is rebound on later redraws) -- this also fixes the
pre-existing bug where a widget with a custom background/border
drew no label text at all. apply_prop gains enabled (alias
sensitive), items, lower/upper (via set_range), page-increment,
page-size, step-increment, password, show-password, direction,
cursor-visible, selection-mode (3 -> multi-select), font-* (via
refresh_item_style), constraint clamping and AutoSize
(apply_autosize: longest line + 16, (ascent+descent)*lines + 8,
clamped to constraints and 24x16). resize_item clamps to the
min/max constraints.
Mirror of the C props.h set in common_props(): enabled, visible,
font-name/size/bold/italic/underline/strikeout, hint, show-hint,
cursor, tab-order, tab-stop, min/max-width/height, margin-*/around,
autosize, tag, anchor-top/left/right/bottom and align
(None|Top|Bottom|Left|Right|Client, ALIGN_VALUES). Entry table:
visibility replaced by password + show-password.
The reported symptom (a blank line after every line of generated
source) was investigated Nov 29, 2026 and does NOT reproduce in the
current generator: all 16 gen_matrix cases measure a
blank-after-content ratio of 0.01-0.06 (section separators only),
while double-spaced output scores ~1.0. This test pins the clean
output so a regression fails loudly: it generates all 16 cases and
asserts every main.cpp has a blank-after-content ratio < 0.20.
Verified: passes on clean output; the same ratio function fails a
double-spaced file at 0.99 (checked via the C guard script).
Mirror of the C fix: the Rust generator emits the same XFrame C++
code, so it now defaults WIDGETS_DIR / LIGHTGUI_WIDGETS_DIR to
/usr/local/include/lightgui instead of the hardcoded
/opt/lightgui/widgets. Added a make install target (installs the
1100 header-only widget headers from the C repo,
$(LIGHTGUI_SRC)/widgets, to PREFIX/include/lightgui).
Fixtures regenerated from the fixed C++ gen_matrix output
(all 16 cases: Makefile/CMakeLists.txt/README.md now reference the
installed location; main.cpp unchanged). Fixture test passes.