The canvas DrawingArea sat in the scrolled-window viewport with a
fixed 800x600 size request and never grew when the designer window
was resized, leaving the viewport background visible as a dark border
around it. A size-allocate handler on the viewport (the DrawingArea
parent) now resizes the canvas (and the project, which shares its
size) to the viewport allocation, deferred to an idle callback: the
size-allocate signal fires after the viewport has already allocated
its child for this pass, so resizing inside the handler would lag one
resize behind.
Verified geometrically under Xvfb/openbox: canvas X window tracks
the viewport exactly (1150x683 @ 1150x720, 1400x863 @ 1400x900,
900x563 @ 900x600).
Formatting fallout from running cargo fmt on the designer crate while
fixing clippy lints: line joins/splits in main.rs, palette_ui.rs,
selftest.rs and tests/seam.rs.
gen.rs: replace nested format! calls with named format args (output
byte-identical, fixtures still pass) and push_str(",") with push.
seam.rs: leading "+" in a doc comment parsed as a Markdown list
marker. canvas.rs: let-else rewritten with ?, and drop the genuinely
unneeded return in the set_visible branch of set_prop (the border
branch return stays: it skips the style-rebuild tail).
canvas_button_press called handle_at(&app.borrow(), ...) as the
if-let scrutinee and then borrow_mut() inside the body; the scrutinee
temporary Ref lives for the whole if-let, so pressing a resize handle
panicked (RefCell already borrowed) inside the GTK signal trampoline,
which cannot unwind — the designer aborted. Bind the hit first so the
borrow is released before borrow_mut(). Add a selftest phase that
drives the real press/motion/release handle-drag path.
The unified XFrame-native canvas lives inside the designer now, so the
standalone layout process, its file-based selection IPC and its
workspace membership are gone. The Flatpak launcher just starts the
designer; xframe-common no longer mentions the layout in its
description and activate_window is documented for its remaining use.
Rewrite the generator to emit XFrame code (transliteration of the C
generator): single main.cpp with lg::Holder<T> widgets, XFrame styles,
menubar and X event loop, plus CMakeLists/Makefile/README. GTK output
is gone: chart_template.rs, cmake.rs and embedded/ deleted. Fixtures
regenerated from the C gen_matrix (16 cases x 4 files) and byte-identical
to the C generator; all 16 compile warning-free under -Wall -Wextra
and run under Xvfb.
Embed the XFrame canvas in the designer: GtkDrawingArea
(double-buffered FALSE) drawn on with x11rb on its GDK-managed X
window (no socket/foreign window), porting the standalone layout
interaction — 16px handles, 8px hit pad, 450ms double-click checked
before drag, 8px drag threshold. Palette is XFrame-only (547);
palette clicks arm placement in-process, no selection file. .fdj
is XFrame-only: GTK widgets are dropped on load, never migrated.
Seam converter is identity mapping (layout name IS the .fdj type).
cargo check clean; SELFTEST PASS; palette selftest 547/547 PASS.
XGraph: grid_color (was 0xe1e1e1); get/set_series_color (series colour
was settable only at creation).
XSpreadsheet: background/grid/header_fill/active_fill/selection_fill
colours (were draw literals); get/set_row_height, get_frozen_rows/cols,
get_active_cell.
IndicatorWidget (widgets): background/grid/candle up/down/wicks
colours (were draw literals / name-derived palette); get_line_index
(read-only); get/set_line_color, get/set_param; view accessors
(set_y_range/set_auto_y/view_first/view_count/zoom_at/reset_view);
bars now go through Indicator::bar_rects so the colour override applies.
xframe_indicators::Indicator: set/get_line_color (palette-index
override; line_points/markers/bar_rects honour it) + get/set_param and
set_params (safe here: compute() re-derives lines from params on every
call, so no desync — the reason the C pass added no set_period).
Setters assign state only, never redraw.
Verified: cargo test -p xframe-widgets -p xframe-indicators -p
xframe-core green (incl. 7 new getter_setter_tests + 1 new
line_color_override_and_params); pixel hashes of all 547 widgets
identical to pre-change baseline.
The designer is going XFrame-only: widget_type is now the XFrame class
name (GtkButton, IndRSI, ...). The property/event tables are still
keyed by the legacy palette kind, so class_kind() maps each class back
to its kind (reverse of the C generator kXFrameMap); props_for /
events_for / no_events_note normalize through it. Classes with no kind
equivalent get a generic [text] table; non-class-like names stay empty.
Canvas keeps its explicitly empty table.
The fixtures are the C++ generator's output (tests/out/, 16 cases,
390 files). Regenerated after the C++ property/border fixes and the
//region marker change, so they carry the new items/adjustment/text/
cursor-visible/border output and the //region markers. The Rust
generator now matches them byte-for-byte.
Mirror of the C++ fixes (same defects existed in the Rust designer):
- ComboBox/Listbox: new editable items prop (pipe-separated, default
Item 1|Item 2|Item 3); the preview rebuilds from it (rebuild_combobox
/ rebuild_listbox in canvas.rs), the generator emits one
append_text / list_box_insert per item. active / selection-mode
unchanged.
- Scrollbar: editable lower/upper/step-increment/page-increment/
page-size; the preview reconfigures the adjustment, the generator
emits them. value/inverted unchanged; defaults preserve 0-100/1/10/10.
- Text: new text prop (same as Memo); preview and generator use it,
falling back to the widget name when empty.
- Memo: preview now uses the text prop (was hardcoded to the name);
added cursor-visible (same as Text).
- Border (GTK): border-width/border-color/border-radius in the common
prop set; preview (refresh_item_css) and generator (colour_lines)
emit border + border-radius CSS. Defaults (0/empty/0) preserve the
current appearance. The XFrame border is NOT wired here: the Rust
layout has no place-file channel (it reads the selection file
directly), so there is no per-widget border path to it; the GTK
border works.
- Generator region markers: // #region -> //region (and #endregion),
matching the C++ generator since the audit; the Rust generator had
never tracked that change, which the refreshed fixtures exposed.
Verified: cargo test --workspace under Xvfb, all suites ok,
including generator_matches_cpp_fixtures (390 files byte-for-byte).
- xframe-layout: resize handles 9px -> 16px drawn with a 32px grab target
(all 8, correct axes); poll_selection now raises/activates the layout
window (EWMH _NET_ACTIVE_WINDOW + focus) so a palette click places
instead of landing on the designer canvas
- xframe-common: X11::activate_window (raise + _NET_ACTIVE_WINDOW +
SetInputFocus)
- designer: Help -> About with git commit + build date baked in by
build.rs; menu bar moved from the main window into the code window
(Ctrl+E on the main window reopens it); code window is now a tabbed
multi-file editor (one tab per generated file + View -> Open File in
Code Tab, per-tab dirty indicator + Ctrl+S save)
flatpak-builder extracts the git source directly into the module build
dir (not a lightgui_rust/ subdirectory), so drop the cd lightgui_rust
and reference lightgui-icons/ as a subdirectory of the build dir.
Flatpak manifest (GNOME Platform 48, GTK 3, rust-stable SDK extension)
+ launcher, desktop file, metainfo and app icon. Builds the designer,
xframe-palette and xframe-layout with cargo --offline from the vendored
crates (flatpak/cargo-sources.json, generated from Cargo.lock with
flatpak-cargo-generator.py), installs them under /app/share/lightgui-rust/,
and launches the combined IDE. The XFrame icons come from the C repo
(second git source). build-flatpak.sh builds the Flatpak and a
single-file bundle.
- View -> Color Theme now opens the real picker from lightgui-support
(was a stub note); the designer depends on lightgui-support.
- Fifth built-in preset: Dracula (#282a36 bg, #ff79c6 keyword), same
colours as the C designer.
- New theme_ui module: Apply repaints the code view (the plain
TextView the designer actually uses) and the canvas; the canvas
follows the theme when the project has no window background
(project background still wins); the saved theme is applied to the
canvas at startup. Clearing the project background reveals the
theme background (bulk.rs).
- Theme tests updated to 5 built-ins with Dracula checks.
- Verified: cargo test --workspace 176 passed / 0 failed; all five
presets + a custom colour applied live under Xvfb and persisted
across a restart.
- xframe-palette: lock the 380 px width via WM_NORMAL_HINTS
(min == max width, height free) so a WM refuses horizontal
resizes but still allows vertical ones. New X11::set_fixed_width
helper in xframe-common.
- lightgui-support CodeView: put the Variables in scope pane under
a GtkPaned (top/bottom split, horizontal divider bar) so the user
can drag it up/down to resize the pane height; initial position
keeps the old ~140 px pane height. New
inspection_split_position / set_inspection_split_position
accessors.
- lightgui-support folding: recognise C++-style //region /
//endregion (and // region) as fold markers, alongside the
existing #region / // #region forms; markers inside strings and
unclosed regions still open no fold.
- Tests: 11 new theme_tests checks (slash-region folds, widget
fold collapse/expand, splitter position/structure).
Items 1 (palette->layout placement) and 2 (resize handles) were
verified working in Rust under Xvfb and needed no fix.
The designer code view was a read-only viewer (set_editable(false),
mirroring the C++ codeview). It is now editable with a visible cursor;
Ctrl+S (or View -> Save Code) writes the shown generated file back.
The view shows a generated header first, so saving writes only the
file body after the // ---- path ---- marker, anchored by a text mark
that tracks edits. The window title gains a dot while there are
unsaved edits. The code is generated, so the next Generate (or
reopening the window) overwrites hand edits; the save status message
says so. No merge-back into the designer model.
demo_bars now ports StockData.h exactly (same state update and
uniform draws, seed 42, 2026-01-01 timestamps), so the Rust bars
are identical to the C++ demo series. IndicatorWidget::new also
takes the per-widget facts the C++ mains/headers record, surveyed
from lightgui eb0b5fc:
- bar count: 120 for the 85 mains using make_seeded_series(120, 42),
250 otherwise;
- candle palette: muted (150,190,150)/(210,130,130) for the 60
pane_-template widgets, grey (180,180,180) bodies without wicks
for the 6 grey-overlay widgets, standard (0,150,0)/(200,30,30)
otherwise;
- no-def candles: only the 12 no-def widgets whose header draws
candles show them (38 panes show grid only); the one Overlay-def
widget with an if (false) candle block (IndLinearRegressionForecast)
shows none;
- screenshot end-state: wheel-up once (zoom 1.25, 200 of 250 bars)
for the 80 mains that do it.
Adds regression tests for the series values, bar counts, zoom and
candle styles.
generated.rs is transpiled C++ kept verbatim (casts, returns,
parens), so allow those clippy lints at module level — the
generator is gone from the repo, so the note says to keep the
allow on regeneration. generated.rs: 666 warnings -> 0.
Also fix a double-parens in the new stack-light code and allow
too_many_arguments on the new multi-arg instrument helpers.
Replace the one-size-fits-all dial+needle with per-kind draws ported
from the C++ Inst* components (lightgui eb0b5fc): 7/14/16-segment
displays (dim segments included), dial gauges with per-kind red-tick
fraction and unit, bar/flow/manometer/digital-readout meters, LEDs,
panel lamps, beacon, stack light, RGB LED, the eight tank/level
widgets, and the four needle gauges. Demo values mirror the C++
mains (inst_demo_level/value ported exactly; gauge seed 7 = 51.35,
matching the C++ AnalogGauge screenshot). Adds regression tests for
the demo hash, the LED clamp, and the segment maps.
ChartWidget and IndicatorWidget draw through an inner XGraph /
IndicatorWidget with its own state + PlotView, created at the
construction bounds. The Widget::set_bounds default only updated the
outer state, so after demo/layout called set_bounds(40,40,...) all
250 Indicator + 36 Chart widgets still drew at the top-left corner.
The runner masked it (whole-window draw metric + clicks landing
inside both rects); the pixel-diff crop exposed it (IndUpDownRatio
and IndUpDownVolumeRatio looked blank only because their 150x36
crop did not overlap the misplaced drawing at all).
Fix: Widget::set_bounds now calls a sync_bounds() hook (default
no-op); Chart/Indicator override it to propagate bounds to the
inner state + view. XGraph already synced its view; XSpreadsheet
draws from state only. Regression test
set_bounds_moves_widgets_to_their_rect places every widget at
(40,40) on a Canvas and asserts it paints inside its rect and
nothing at the origin (verified: fails without the fix).
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.
- Delete xframe-common::widget (StubWidget + duplicate Widget trait);
the one trait is now xframe-widgets::Widget.
- New xframe-common::target::CtxTarget: xframe_core::DrawTarget (and
FontSource) adapter over DrawCtx, so the real widgets draw into the
demo/layout windows. Text goes through DrawCtx::draw_text (PolyText8),
keeping the black-bars fix intact.
- xframe-core X11Target::draw_string: ImageText8 -> PolyText8 (same
black-bars fix; the live target still had the bug).
- xframe-demo / xframe-layout: create widgets via xframe_widgets::create,
core StyleManager with the exact C++ default/dark styles, fonts
resolved through the target; label text = registry kind (closest
available approximation of each C++ constructor default text).
- xframe-test-runner: doc note updated (real widgets under test now).
- Fix pre-existing clippy error in xframe-common ico test (0*16+5 -> 5).
- NOTE: do not run cargo fmt --all here: rustfmt inserts commas in the
archetype_impl! macro call sites and breaks the build (verified);
generated files are intentionally unformatted.
Widget trait + state machine (bounds, visible/enabled/focused/
pressed/hover, value/min/max, on_click, draw/button_press/release/
motion/key) with one implementation per archetype driven by
data/registry.json + data/props.json + data/events.json via
generator/gen_data.py (registry 547, props 35 types, events 27 types).
Outliers have their own modules: XGraph (graph.rs) and XSpreadsheet
(spreadsheet.rs, full formula engine). Indicator widgets hold one fdi
def from xframe-indicators (200 with a def, 50 without) and draw it as
a chart with the XGraph view model. The 547 .ico icons are copied as-is
under assets/icons/ (see PROVENANCE.md) and decoded by icons.rs.
xframe-core draw.rs: helpers now take &mut (impl DrawTarget + ?Sized)
so they accept &mut dyn DrawTarget (the Widget trait passes trait
objects); added a default put_image blit to the DrawTarget trait.
Tests: 23/23 pass (state machine, factory creates all 547, ICO decode
of all 547, XGraph view math, XSpreadsheet formulas, indicator
passthrough, props/events spot checks); warning-free.
DrawCtx::draw_text used ImageText8, which paints the text extent with
the GC background colour; this GC's background defaults to pixel 1
(near-black), so every label in the palette, demo and layout rendered
as a solid black bar. Switch to PolyText8 (transparent, glyphs only),
like C++ XDrawString. The PolyText8 items need a length byte, a DELTA
byte, then the string bytes; the first version omitted the delta and
ate each label's first character (long strings were BadLength-dropped
entirely). Verified visually: palette names/headers and demo labels
now render crisp and complete. Also: layout status bar em-dash renders
as 3 garbage Latin-1 glyphs under a core font, so use a hyphen.
The first full 547-widget run died at widget 224: its Xvfb was killed
out from under it (Connection refused) and every later widget failed
fast with 'no window; exited rc=1'. The runner now checks the server
before each widget (restarting its Xvfb + reconnecting when it died)
and, if the server dies mid-widget, restarts and retries that widget
once, so an environment failure can no longer masquerade as 300+
widget failures. Verified by killing Xvfb mid-run: 10/10 pass.
window_abs_geometry translated the parent-relative position instead of
the window origin, double-counting the window offset: for a demo window
at (100,100) every click/hover landed +100,+100 off, so small widgets
missed every click (only widgets large enough to still contain the
shifted point registered presses). Translate (0,0) instead.
Stub hover also never crossed the runner's >30 luminance threshold:
lightening the near-white fill moves luminance by only ~9. Draw a 2px
section-accent border while hovered (~50 luminance change, ~580px on a
GtkButton). Verified manually: GtkButton pressed diff 0 -> 4172px,
hover diff 0 -> 581px.
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.
- 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.
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.