One command rebuilds every examples Widget.cpp, re-renders it under
Xvfb, and diffs the screenshot against its golden with ImageMagick
RMSE (0.5 pct threshold):
tools/visreg/run.sh (also: make visreg)
Reuses the cdoc docs sweep render path (same g++ flags, same
Widget - XFrame demo window capture with the root-capture fallback).
Goldens vendored from /opt/lightgui-docs/shots (Dec 2, 2026). Report goes
to tools/visreg/report/report.txt (plus report.tsv and shots/); exit code
is 0 only when every gated widget passes.
Two deliberate behaviours, both documented in tools/visreg/README.md:
- failed shots are retried 3x (transient XOpenDisplay flakes; the docs
sweep needed a retry pass for the same four widgets)
- TTimeEdit, TDateEdit and TCalendar render the wall clock, so they are
reported SKIP (RMSE recorded, not gated) instead of FAIL
Baseline full run (Dec 2, 2026, HEAD beec92b): 544 PASS, 3 SKIP, 0 FAIL;
max RMSE among PASS 0.0000 pct (every passing widget pixel-identical).
Adds Tools > Install Libraries: builds the designer as the user, 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, widget headers to /usr/local/include/lightgui,
designer UI + 547 palette icons to /usr/local/share/lightgui, and a
desktop entry + icon to the app menu. Headers are header-only, so no
shared libraries and no ldconfig step. The installed binary now finds
its UI and palette icons under /usr/local/share/lightgui, so it runs
from anywhere without the checkout. Install output is shown in the
scrollable log dialog.
Widgets are header-only (common/ + core/ + components/, 1100
headers), so make install copies them to
PREFIX/include/lightgui (default /usr/local/include/lightgui).
The generator now emits that as the default WIDGETS_DIR /
LIGHTGUI_WIDGETS_DIR instead of the hardcoded /opt/lightgui/widgets;
the -DLIGHTGUI_WIDGETS_DIR / make WIDGETS_DIR override still works.
Verified: make install puts 1100 headers in place; a generated
project builds with -I/usr/local/include/lightgui only and its
Makefile/CMakeLists contain no /opt/lightgui reference.
ide just launches ./lightgui (builds only with --build via plain make;
the redundant cmake re-build is gone). Delete widgets/layout/ (the
standalone layout executable) and drop it from widgets/CMakeLists.txt.
The file-based IPC header widgets/common/ipc.h is KEPT: it is still
referenced by widgets/palette/main_palette.cpp, which is now dead code
(ide no longer launches the palette process) but was not authorized
for deletion in this step.
Embed the XFrame canvas in the designer window: a GtkDrawingArea
(double-buffered FALSE) in the GtkFixed canvas area, with the pure-X11
core (xframe_canvas_core) drawing placed widgets on its X window and
the DrawingArea GTK signals (draw, button-press/release, motion,
key-press) driving place/move/resize/delete/select. Palette selection
is wired in-process (no selection/place files); the core owns the
Placed vector and exposes accessors for later save/codegen steps.
Ports the standalone layout interaction (16px handles, 8px hit pad,
450ms double-click rule, Delete/BackSpace/Escape) without modifying
widgets/layout/main_layout.cpp.
The canvas is deliberately NOT a GtkSocket + raw X child window: that
design rendered and interacted correctly but killed the whole app with
an untrapped XInputExtension BadWindow error (GDK X error handler
calls _exit(1)) whenever another toplevel (e.g. the code window) was
closed. Bisected against the parent binary (survives) and a socket
with no child (survives); removing the foreign GdkWindow, setting the
event mask with raw XSelectInput, and forwarding all canvas events to
gtk_main_do_event did not fix it, and without a foreign window GDK
drops canvas events entirely. A GtkDrawingArea keeps the canvas a
normal GDK-managed window (verified with /tmp/proto_da.c). Also fixes
a latent -Wmaybe-uninitialized in GtkInfoBar.h (bx/by/bw/bh).
- Compile each src/*.cpp to its own .o (pattern rule) then link, so
the designer build parallelises under -j.
- MAKEFLAGS += -j$(NPROC) makes parallelism the default: plain make /
make lightgui / make all use all 8 cores with no -j to remember.
- SRCS := $(wildcard src/*.cpp) so a .cpp added later is compiled as
its own .o automatically, with no Makefile edit.
- widgets target clears MAKEFLAGS for its submake to avoid the
-j forced in submake jobserver warning (cmake still gets -j).
- clean now also removes the .o files. Same flags, same
-DLIGHTGUI_GIT_HASH, same binary name and targets.
- Verified: clean make lightgui 36s (was 83s single-core), max 8
concurrent cc1plus, SELFTEST PASS, dummy new.cpp picked up
automatically, full make clean, widgets target still works.
- XFrame placement: layout raises+activates itself via EWMH
(_NET_ACTIVE_WINDOW + XRaiseWindow + XSetInputFocus) on every new
palette selection, and the designer forwards a canvas click to the
layout via a place-request file (/tmp/lightgui-place.txt,
$LIGHTGUI_PLACE) when an XFrame widget is selected, so placement
works even when the click lands on the designer canvas. Verified
under openbox (real WM): selection raises the layout, place file
centres the widget on the click.
- Resize handles: 16px drawn (was 12px), 32x32 grab target (8px hit
pad around each handle centre). All 8 handles verified by real
mouse drags under openbox: SE corner resizes both axes exactly,
N edge height-only, W edge width-only; handles drawn last
(foreground) so they are always on top.
- Help -> About: GtkAboutDialog with the git commit hash baked in
at build time (Makefile -DLIGHTGUI_GIT_HASH) and the build date.
- Menu bar moved out of the main designer window into the LightGUI
Code window (reparented from root_box at startup); the layout
window is now just the layout manager. Ctrl+E on the main window
toggles the Code window back in when it is hidden.
- Tabbed multi-file editor in the Code window: GtkNotebook, one
codeview per tab, File -> Open File in Code... opens a file in a
new tab, per-tab dirty flag / Ctrl+S save / close button (asks
before dropping unsaved edits), Variables pane + splitter and
//region folding kept per tab. Debugger opens the stopped file in
its own tab instead of overwriting the current one; refresh shows
generated code in its own tab and never clobbers a hand-opened file.
- tests/code_window_tests.sh: reopen check now uses Ctrl+E.
Color themes (src/theme.h/.cpp): four built-ins (Light, Dark, Monokai,
Solarized Dark) colouring keywords, types, strings, comments, numbers,
preprocessor lines, background/foreground and the current line. View ->
Color Theme... opens the picker (built-in combo + per-role colour
buttons); the choice persists to ~/.config/fdesigner/theme.conf
(FDESIGNER_THEME_CONF overrides). Deliberately separate from the
font-settings branch settings.conf so the two merge cleanly.
Code view (src/codeview.h/.cpp): View -> Code View shows the generated
C++ with a gutter (line numbers, red-dot breakpoints, [-]/[+] fold
toggles) and themed highlighting. Gutter clicks toggle breakpoints
through the real debugger backend (debugger_toggle_breakpoint() in
debugger_ui, new GdbSession::remove_staged_breakpoint() for the
not-yet-live case) and persist to debugger_bps.conf.
Folding covers #region/#endregion, every matched-brace span
(functions, if/else, loops, classes, structs, namespaces,
initializers), multi-line /* */ comments and #if...#endif blocks,
nested in all directions. Braces in strings/chars/raw strings/comments
are ignored; unbalanced input fails gracefully (extra } ignored,
unclosed {/region/#if at EOF produces no fold). Folded lines hide via
an invisible tag (proven to collapse to zero height), so file line
numbers stay exact.
Tests: tests/theme_tests.sh (harness 57 checks) + self-test Phase 8 +
xdotool smoke tests for the code view window and theme dialog.
Clean build, zero warnings; matrix 21/0; debugger 31/31 + 5/5;
widget 40/40 + 5/5.
- src/events.h (new): natural GTK signal per widget type for all 36
types (27 with signals, 9 with an explicit no-events note); kinds
cover simple, switch-page, row-activated, row-selected, text-buffer,
delete-event, draw, per-item toolbar/menu, and spreadsheet cells.
- Generator emits a stub handler + g_signal_connect for every
connected signal (Widget.signals); Shape/Plot/StockChart draw stays
wired exactly once. Stubs print an EVENT trace line under
FDESIGNER_EVENT_TRACE (test harness only).
- Designer: Events section in the property pane — one check button
per signal, builtin draw shown as always-connected, no-event types
show the reason. Connections persist in .fdj as "signals".
- Self-test Phase 8: UI check-button toggle, all-signal generation
checks, .fdj round-trip.
- tests/event_handler_tests.sh/.cpp + event_handler_runtime.cpp:
36/36 generation markers, warning-free generated build, 41/41
runtime triggers under Xvfb.
Interface font + code/text-view font picked with GtkFontButton
widgets, persisted to ~/.config/fdesigner/settings.conf (font=,
code_font=, Pango descriptions; FDESIGNER_SETTINGS_CONF overrides
the path for tests), applied live at startup and on Apply via
screen-wide CSS providers (interface font) and a textview CSS rule
(code font, so Text/Memo views use it). Sizes clamp to 6-48 pt;
empty/invalid values fall back to defaults.
New: src/preferences.h/.cpp, tests/font_tests.{cpp,sh} (20-check
harness + self-test + Preferences dialog smoke/Apply test).
Wired: Edit menu + mi_preferences in ui/designer.ui, menu hook,
startup apply, FDESIGNER_OPEN_PREFERENCES test hook and a font
block in the self-test (src/main.cpp); Makefile build line;
DESIGN.md section.
- Generator emits CMakeLists.txt alongside Makefile (cmake_minimum_required
3.10, project(<Class> CXX), C++17, PkgConfig gtk+-3.0, explicit source
list, add_executable(app ...), GTK include/link wiring); exe named app
to match the Makefile target.
- New src/cmake_build.h/.cpp: cmake_lists_text, cmake_build_project
(configure + build, captured output), cmake_project_exists,
CMakeSettings persisted to ~/.config/fdesigner/cmake.conf
(FDESIGNER_CMAKE_CONF override for tests).
- Designer File menu: Build with CMake... (last generated project, or
pick a folder), Open CMake Project... (any dir with a CMakeLists.txt),
CMake Settings...; Generate now offers Build with CMake (the default
build path for generated projects) and reports the log + exe path.
- Self-test gains a CMake phase (settings round-trip, CMakeLists.txt
markers, real console build, broken-file failure, cmake build of the
generated GTK project); file count 4+2N -> 5+2N.
- New tests/cmake_tests.sh + tests/cmake_probe.cpp (31 checks); matrix
and widget test harnesses link cmake_build.cpp; tests/out/ gitignored.
- DESIGN.md: CMake handling section.