18 Commits
Author SHA1 Message Date
cnmcdee 7d7fa6cfbc Add visual regression harness for all 547 widgets (tools/visreg)
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).
2026-12-02 09:38:06 +00:00
cnmcdee 6568b6f882 Add Install Libraries: system-wide install from a Tools menu item
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.
2026-12-01 01:38:54 +00:00
cnmcdee 780853bdf2 make install + generator references installed headers
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.
2026-11-30 03:29:52 +00:00
cnmcdee e4dda4da5f Step 6: simplify ide to a single process, delete the layout process
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.
2026-11-30 00:42:16 +00:00
cnmcdee 54e31d9c45 Step 1: unified XFrame-native canvas (GtkDrawingArea) in the designer
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).
2026-11-29 23:11:52 +00:00
cnmcdee 3f319d5a55 Makefile: parallel build by default, wildcard sources
- 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.
2026-11-29 19:54:09 +00:00
cnmcdee 75470266f3 XFrame placement, 16px handles, About, menu to Code window, tabbed editor
- 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.
2026-11-29 17:51:24 +00:00
cnmcdee 77a5edfe2c Merge expanded widget set: 547 XFrame widgets, combined palette (583), layout, docs 2026-11-29 03:38:35 +00:00
cnmcdee 800883b024 Rename FDesigner/cfree to LightGUI (binary lightgui, all docs) 2026-11-29 03:35:48 +00:00
Muse 5e116660a0 Merge color-themes (ad0cd68): themes + code view gutter and folding 2026-11-25 12:16:06 -05:00
Muse 23425a4dfd Merge event-handlers (0492137): signal table, Events pane, generated stubs 2026-11-25 12:13:38 -05:00
Muse 2f9d08dd03 Merge cmake (cd5f07f): CMakeLists.txt generation, build with CMake 2026-11-25 12:13:17 -05:00
Muse ad0cd68bf5 Add color themes + code view with gutter and folding
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.
2026-11-25 12:11:44 -05:00
Muse 0492137214 Event handlers on all widgets: signal table, Events pane, generated stubs, tests
- 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.
2026-11-25 11:54:50 -05:00
Muse 9d1e99ed88 Add global font settings (Edit -> Preferences...)
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.
2026-11-25 07:03:49 -05:00
root cd5f07f619 CMake handling: generate CMakeLists.txt, build with CMake from the designer, open/build existing CMake projects
- 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.
2026-11-25 06:59:14 -05:00
Muse 671293e68f Add GDB stepping debugger with breakpoints, variable inspection, settings
Separate debugger window (Debug menu) driving real gdb over the MI
protocol: breakpoints (file:line / function, enable/disable/list,
persisted), step over/into/out, continue/run/stop/kill/restart,
locals + watch expressions + stack frames, target stdout/stderr pane.
Settings button and Debug > Debugger sub-menu (gdb path, break on
main, stop on entry, pretty-print) persisted to
~/.config/fdesigner/debugger.conf. Tests: tests/debugger_tests.sh —
31 console + 5 GTK headless cases plus a GUI smoke test, all passing.
2026-11-25 03:29:12 -05:00
Muse 9c94d93ae5 Import FDesigner C++/GTK3 designer with StockChart Pro
GUI designer (C++/GTK3, Glade .ui, code generator) plus indicator/drawing
libraries, chart tests and test matrix.
2026-11-25 02:35:23 -05:00