17 Commits
Author SHA1 Message Date
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 e4d8c985c6 C6: wrap the Inspector props grid in a GtkScrolledWindow
The Inspector window had no scrolled window: props_grid sat directly
in props_box, so every row below the window bottom edge was built but
unreachable -- no scrolling was possible at all. Phase 1 added ~15
rows to the common set (constraints, margins, autosize, tag, anchors,
align), so the lower half of the generic set and the Events section
were invisible and uneditable. The grid now lives in a vertically
scrolling window (verified live: tag, anchor-top/left/right/bottom,
align and Events all reachable).
2026-11-30 08:16:32 +00:00
cnmcdee c31b4b6a8b Step 5: cut .fdj to XFrame-only, drop the GTK palette (547 XFrame entries)
Palette is XFrame-only: the 36 GTK widgets are gone from designer.ui
and main.cpp (547 entries from xframe_palette.h). .fdj holds only
XFrame widgets; on load a GTK/unknown type is skipped with a clear
message, never migrated. snapshot/load now go through the embedded
XFrame canvas; the GTK Item machinery stays only as selftest
scaffolding (legacy_gtk_snapshot) until it is removed in a follow-up.
Selftest phases 3-8 rewritten for the step-4 XFrame generator (4
files, lg::Holder markers, file-level + XFrame round-trips, GTK skip
rule, bad-file rejection). Palette/converter tests updated to 547;
xframe_palette.h regenerated (one stale comment line). Docs updated.
Also: selftest cleans scratch generation dirs first, and the cleanup
call assigns its return value (void cast does not silence
-Wunused-result for system() on this toolchain).
2026-11-30 00:42:10 +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 adda0c7e3b Object Inspector is its own top-level window; fix -Wunused-result warnings
props_box moves out of main_window into a new top-level inspector_window
(LightGUI - Object Inspector, 300x700); the canvas now fills the main
window. Mirrors the palette-window pattern: show/hide, delete-event hides,
View -> Object Inspector toggles, startup cascade parks it right of the
palette (main -> palette -> inspector -> code). Canvas no longer shares
space with the inspector, and the inspector no longer shares space with
the layout window: 6 distinct top-level windows, verified under Xvfb.
Also capture return values of fscanf/system/write (4 pre-existing
-Wunused-result warnings); designer rebuilds with 0 warnings.
2026-11-29 04:49:46 +00:00
cnmcdee 800883b024 Rename FDesigner/cfree to LightGUI (binary lightgui, all docs) 2026-11-29 03:35:48 +00:00
Muse e280653c45 Merge branch palette-window: widget palette in its own top-level window, tight Lazarus-style grid
Integration of round 3: code-window (f30b285) + palette-window.
Conflict in src/main.cpp startup block resolved additively: both the
code window (open_code_view + 200 ms debugger poll) and the palette
window (tight CSS + park beside design window) open at startup.
ui/designer.ui merged cleanly (both top-level windows + both View
menu items). Build: make clean && make, 0 warnings.
2026-11-25 14:33:07 -05:00
Muse 8f00f9096b Palette window: widget palette in its own top-level window, tight Lazarus-style grid
- Move the palette out of main_paned into a new top-level GtkWindow
  (palette_window, title FDesigner — Widgets), opened with the designer
  and parked beside the design window (left if room, else right).
- Plain top-level window, never transient/modal; delete-event hides it
  instead of destroying it, View -> Widget Palette (check item) toggles
  it back, state stays in sync.
- Tight Lazarus-style packing: palette_box is now a 2-column GtkGrid
  (row/column spacing 2, 2px margins), buttons compact via USER-priority
  CSS (min-height 20px, 1px vertical padding); all 36 buttons + 5
  section labels render, all 24 grid rows fit without scrolling.
- New tests/palette_window_tests.sh (16 checks: separate windows,
  not transient, beside-main placement, palette clicks place widgets,
  WM_DELETE hide + app survives, View-menu reopen, clean log).

Tests (VPS, Xvfb): make 0 warnings; matrix 21/0 (re-run; first run 20/1
on the known flaky chart-pro-render pixel check, no code change);
debugger console 37/37 + GTK 7/7; widget 5/5 (+40/40 markers);
font ALL PASS; theme ALL PASS; event 6/6 + runtime 41/41;
cmake probe 31/31 + script 4/4; self-test 29 PASS;
palette_window_tests 16/16.
2026-11-25 14:30:41 -05:00
Muse 4c998e7888 Code window: separate top-level window, red paused line, automatic variable inspection
- The code view is now its own top-level window (FDesigner — Code),
  opened together with the designer at startup; View -> Code View
  toggles it. Closing hides it (app keeps running); reopening
  restores it with fresh content.
- Automatic variable inspection pane at the bottom of the code
  window: on every debugger stop it shows the current scope
  (function — file:line (reason)) and the frame locals
  (name/type/value) from the SAME shared GdbSession (200 ms poll
  in main; no second gdb). While running it shows a running state
  and never presents stale values; on exit it shows the exit code.
  On stop the stopped file is loaded into the code view if needed
  and any fold hiding the paused line is unfolded.
- Paused line: solid red (#c00000) full-line background with white
  text, plus a white gutter arrow — Lazarus-style execution-point
  marking (ahaExecutionPoint: full-line background + gutter arrow,
  distinct from the red-dot breakpoint marker), adapted to the
  user-requested red. The paused tag outranks the current-line tag
  and syntax tags; it clears on resume and moves on step.
- Debugger window: F5 Continue / F10 Step Over / F11 Step Into
  shortcuts (tooltips already promised them); new accessors for the
  code-window poll (poll_events, session_state, stop_seq,
  last_stop, locals, refresh_on_stop) and a debugger_autorun test
  hook; GdbSession gains a stop_seq() accessor.
- Tests: tests/code_window_tests.sh drives the real app under Xvfb
  (separate window, stop + locals in two scopes, red-band pixels,
  step moves the band, resume clears it, running state, gutter
  click stages/removes a breakpoint in the backend, close/reopen)
  plus self-test checks for the paused tag colours/priority and the
  inspection API. FDESIGNER_DEBUG_TARGET/BREAK and
  FDESIGNER_CODEWIN_DUMP hooks support it.
2026-11-25 14:12:54 -05:00
Muse 5e116660a0 Merge color-themes (ad0cd68): themes + code view gutter and folding 2026-11-25 12:16:06 -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 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 7828ced3d6 Add Lazarus-style custom widgets: Memo, GroupBox, Panel, Image, Shape, Notebook, ScrollBox, Splitter, StatusBar, ToolBar, MenuBar, SpinEdit, TrackBar, ProgressBar, DateTimePicker, ColorBox, ListView, TreeView, StringGrid, Plot
Twenty Lazarus-palette widgets, each placeable from the palette
(grouped sections), selectable/draggable/deletable, with a per-type
property table in props.h and a standalone generated class:
Memo (GtkTextView), GroupBox/Panel (GtkFrame), Image (GtkImage),
Shape (cairo drawing area), Notebook (GtkNotebook), ScrollBox
(GtkScrolledWindow), Splitter (GtkPaned), StatusBar (GtkStatusbar),
ToolBar (GtkToolbar), MenuBar (GtkMenuBar), SpinEdit (GtkSpinButton),
TrackBar (GtkScale), ProgressBar, DateTimePicker (GtkCalendar+entry),
ColorBox (GtkColorButton), ListView/TreeView (GtkTreeView),
StringGrid (GtkTreeView+ListStore), Plot (cairo sine wave).
Self-test Phase 7 + tests/widget_tests.sh cover place/edit/drag/
delete/generate/compile/run and .fdj round-trip per widget.
2026-11-25 03:49:56 -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