Registry 547 -> 562: XFrame monitor widgets + README + generator fix
Register the 15 new X* monitor widgets (includes, kWidgetNames,
kWidgetSection as Misc / X, factory cases 547-561, kWidgetCount
562); sections.py Misc / X assignment; regenerate
src/xframe_palette.h (562 entries, palette --check clean); 16x16
icons; README 547 -> 562 plus X* monitor-family section with
per-widget one-liners and example build/run commands.
Also fix a pre-existing seam-test failure (proven on clean main
9088092): the generator emitted .w.set_label() for the
Frame/GroupBox/Panel kinds, but TFrame / TGroupBox / TPanel only
have set_text — gate the GtkFrame-only setters on the mapped class
being GtkFrame so the other classes fall through to set_text.
make test (seam test) now passes: 562 mapped, generated project
builds.
No files matched your search
@@ -42,10 +42,40 @@ No Qt anywhere.
|
|||||||
- **Widget palette** — the full Tk palette mapped to GTK 3 (Window, Frame,
|
- **Widget palette** — the full Tk palette mapped to GTK 3 (Window, Frame,
|
||||||
Button, Label, Entry, CheckButton, RadioButton, ComboBox, ListBox, Menu,
|
Button, Label, Entry, CheckButton, RadioButton, ComboBox, ListBox, Menu,
|
||||||
Notebook, TreeView, and more), each with its own 16×16 icon.
|
Notebook, TreeView, and more), each with its own 16×16 icon.
|
||||||
- **547 XFrame widgets** — a second widget library of hand-drawn X11
|
- **562 XFrame widgets** — a second widget library of hand-drawn X11
|
||||||
widgets in 11 sections (Gtk*, T*, Ind*, Stock*, Inst*, plus XGraph and
|
widgets in 11 sections (Gtk*, T*, Ind*, Stock*, Inst*, plus XGraph and
|
||||||
XSpreadsheet), each with its own demo, all merged into the same IDE.
|
XSpreadsheet), each with its own demo, all merged into the same IDE.
|
||||||
- **XFrame-only palette** — 547 entries (all XFrame widgets) with
|
|
||||||
|
- **X\* monitor family (15 widgets)** — live system-monitor widgets in
|
||||||
|
the XFrame set (btop-style visuals), alongside XGraph and XSpreadsheet:
|
||||||
|
|
||||||
|
| Widget | What it shows |
|
||||||
|
| ------ | ------------- |
|
||||||
|
| `XHistoryGraph` | Scrolling multi-series time-series graph, 60 s window, cur/min/max/avg legend |
|
||||||
|
| `XCoreGrid` | Grid of mini history graphs, one per CPU core, label + current % each |
|
||||||
|
| `XNetGraph` | Dual up/down scrolling graph, current rates + running totals |
|
||||||
|
| `XTempHistory` | Temperature history with threshold line + over-temp colouring |
|
||||||
|
| `XUsageBar` | Horizontal gradient usage bar with label + % text |
|
||||||
|
| `XStackBar` | Stacked multi-segment bar (used/cached/buffers/free) with legend |
|
||||||
|
| `XVerticalBar` | Vertical bar meter with scale + peak-hold marker (click resets peak) |
|
||||||
|
| `XTachometer` | Round tachometer: needle, redline zone, digital readout, peak hold |
|
||||||
|
| `XArcGauge` | Semicircular arc gauge, coloured zones, big % in the middle |
|
||||||
|
| `XDonutGauge` | Circular progress ring with % centred |
|
||||||
|
| `XProcessList` | Live process table from `/proc`: sortable columns, in-cell CPU% bars, auto-refresh |
|
||||||
|
| `XLoadBadge` | Load-average badge (1/5/15 min), colour thresholds, uptime |
|
||||||
|
| `XMonitorButton` | A button that is a live monitor: process (by name), systemd unit, or TCP port |
|
||||||
|
| `XMonitorGrid` | Panel of `XMonitorButton`s in a labelled grid, one shared poll timer |
|
||||||
|
| `XSysBox` | Composite resource box: title + big number + history graph + usage bar |
|
||||||
|
|
||||||
|
Build and run any monitor widget demo from the repo root (needs X;
|
||||||
|
use Xvfb headless):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
g++ -std=c++17 -Iwidgets/components examples/XHistoryGraph.cpp -lX11 -o XHistoryGraph
|
||||||
|
xvfb-run -a ./XHistoryGraph
|
||||||
|
```
|
||||||
|
|
||||||
|
- **XFrame-only palette** — 562 entries (all XFrame widgets) with
|
||||||
16×16 icons; the embedded canvas places the real widget class for
|
16×16 icons; the embedded canvas places the real widget class for
|
||||||
any of them. A seam converter (`layout_to_lightgui.py`) turns an
|
any of them. A seam converter (`layout_to_lightgui.py`) turns an
|
||||||
XFrame layout file into a LightGUI project (`.fdj`, XFrame-only).
|
XFrame layout file into a LightGUI project (`.fdj`, XFrame-only).
|
||||||
@@ -171,7 +201,7 @@ There are **two launch points**, and they are not the same thing:
|
|||||||
|
|
||||||
| Command | What it is | What you get |
|
| Command | What it is | What you get |
|
||||||
| ------- | ---------- | ------------ |
|
| ------- | ---------- | ------------ |
|
||||||
| `./ide` | A launcher script (a small shell script, not a binary) | The **designer** (single process): designer window with the embedded XFrame canvas, the XFrame-only palette window (547 widgets), Object Inspector, Code view. This is the one to run for normal use. |
|
| `./ide` | A launcher script (a small shell script, not a binary) | The **designer** (single process): designer window with the embedded XFrame canvas, the XFrame-only palette window (562 widgets), Object Inspector, Code view. This is the one to run for normal use. |
|
||||||
| `./lightgui` | The compiled designer binary | The **designer alone**, run directly (same windows; `./ide` just builds first if asked). |
|
| `./lightgui` | The compiled designer binary | The **designer alone**, run directly (same windows; `./ide` just builds first if asked). |
|
||||||
|
|
||||||
`./ide` is a single-process launcher now (step 6): it builds first
|
`./ide` is a single-process launcher now (step 6): it builds first
|
||||||
@@ -179,7 +209,7 @@ only with `--build`, then execs `./lightgui`. The standalone XFrame
|
|||||||
palette/layout processes are gone — the canvas is embedded in the
|
palette/layout processes are gone — the canvas is embedded in the
|
||||||
designer and the palette is its own window inside the same process.
|
designer and the palette is its own window inside the same process.
|
||||||
|
|
||||||
`make` builds the `lightgui` designer and all 547 XFrame widget demos
|
`make` builds the `lightgui` designer and all 562 XFrame widget demos
|
||||||
(`make lightgui` builds just the designer, `make widgets` just the
|
(`make lightgui` builds just the designer, `make widgets` just the
|
||||||
demos). The designer is built from per-file `.o` compiles plus a link
|
demos). The designer is built from per-file `.o` compiles plus a link
|
||||||
step, driven by a plain Makefile that parallelises by default (it uses
|
step, driven by a plain Makefile that parallelises by default (it uses
|
||||||
@@ -240,8 +270,8 @@ make test
|
|||||||
./tests/code_window_tests.sh
|
./tests/code_window_tests.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The palette self-test covers all 547 XFrame entries; the debugger
|
The palette self-test covers all 562 XFrame entries; the debugger
|
||||||
suite is 46 checks; the seam test maps all 547 widgets and verifies
|
suite is 46 checks; the seam test maps all 562 widgets and verifies
|
||||||
the generated project builds.
|
the generated project builds.
|
||||||
|
|
||||||
## Layout of the repo
|
## Layout of the repo
|
||||||
@@ -268,7 +298,7 @@ the generated project builds.
|
|||||||
│ # layout window. See "Build and run" above.
|
│ # layout window. See "Build and run" above.
|
||||||
├── lightgui # the compiled designer binary (built by `make`);
|
├── lightgui # the compiled designer binary (built by `make`);
|
||||||
│ # the designer alone, without the XFrame windows
|
│ # the designer alone, without the XFrame windows
|
||||||
├── widgets/ # the 547 XFrame widgets: components, core,
|
├── widgets/ # the 562 XFrame widgets: components, core,
|
||||||
│ # common, palette, layout, tests, tools, icons
|
│ # common, palette, layout, tests, tools, icons
|
||||||
├── docs/ # IDE guide, widget reference, stock-market and
|
├── docs/ # IDE guide, widget reference, stock-market and
|
||||||
│ # instrumentation notes
|
│ # instrumentation notes
|
||||||
|
|||||||
@@ -715,7 +715,13 @@ static void emit_widget_props(std::ostringstream& o, const Widget& w,
|
|||||||
|
|
||||||
// Text / label first: the designer seeds label-ish props with the
|
// Text / label first: the designer seeds label-ish props with the
|
||||||
// widget name, so set_text(label) reproduces what the designer shows.
|
// widget name, so set_text(label) reproduces what the designer shows.
|
||||||
if (t == "Frame" || t == "GroupBox" || t == "Panel") {
|
// Frame/GroupBox/Panel kinds map to GtkFrame, which has set_label /
|
||||||
|
// set_label_xalign / set_inset / set_top_inset — but the same kinds
|
||||||
|
// also cover TFrame / TGroupBox / TPanel, which only have set_text.
|
||||||
|
// Emitting set_label for those breaks the generated build (seam
|
||||||
|
// test, Dec 5 2026), so gate the GtkFrame-only setters on the mapped
|
||||||
|
// class; the other classes fall through to set_text below.
|
||||||
|
if ((t == "Frame" || t == "GroupBox" || t == "Panel") && std::string(m.cls) == "GtkFrame") {
|
||||||
if (has("label"))
|
if (has("label"))
|
||||||
o << " " << var << ".w.set_label(\"" << esc_c(prop_or(w, "label", ""))
|
o << " " << var << ".w.set_label(\"" << esc_c(prop_or(w, "label", ""))
|
||||||
<< "\");\n";
|
<< "\");\n";
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
// GENERATED by widgets/tools/gen_xframe_palette_data.py — do not edit by hand.
|
// GENERATED by widgets/tools/gen_xframe_palette_data.py — do not edit by hand.
|
||||||
// The 547 XFrame widgets in their 11 section groups, in section order,
|
// The 562 XFrame widgets in their 11 section groups, in section order,
|
||||||
// for the combined IDE palette (src/main.cpp). `index` is the
|
// for the combined IDE palette (src/main.cpp). `index` is the
|
||||||
// widget's index in widgets/common/registry.h (kWidgetNames) — the same
|
// widget's index in widgets/common/registry.h (kWidgetNames) — the same
|
||||||
// index the palette -> layout selection file carries.
|
// index the palette -> layout selection file carries.
|
||||||
// Section counts: Windows & Dialogs 28, Containers & Layout 34, Buttons 24, Display 33, Text & Entry 28, Choosers 10, Views & Lists 17, Menus & Toolbars 16, Misc / X 4, Stock Market 287, Instrumentation 66.
|
// Section counts: Windows & Dialogs 28, Containers & Layout 34, Buttons 24, Display 33, Text & Entry 28, Choosers 10, Views & Lists 17, Menus & Toolbars 16, Misc / X 19, Stock Market 287, Instrumentation 66.
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
struct XFramePaletteEntry {
|
struct XFramePaletteEntry {
|
||||||
const char* name; // e.g. "GtkButton"
|
const char* name; // e.g. "GtkButton"
|
||||||
const char* section; // e.g. "Buttons"
|
const char* section; // e.g. "Buttons"
|
||||||
int index; // registry index, 0..546
|
int index; // registry index, 0..561
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* kXFrameSections[] = {
|
inline const char* kXFrameSections[] = {
|
||||||
@@ -222,6 +222,21 @@ inline const XFramePaletteEntry kXFramePalette[] = {
|
|||||||
{"TApplicationProperties", "Misc / X", 456},
|
{"TApplicationProperties", "Misc / X", 456},
|
||||||
{"XGraph", "Misc / X", 545},
|
{"XGraph", "Misc / X", 545},
|
||||||
{"XSpreadsheet", "Misc / X", 546},
|
{"XSpreadsheet", "Misc / X", 546},
|
||||||
|
{"XHistoryGraph", "Misc / X", 547},
|
||||||
|
{"XCoreGrid", "Misc / X", 548},
|
||||||
|
{"XNetGraph", "Misc / X", 549},
|
||||||
|
{"XTempHistory", "Misc / X", 550},
|
||||||
|
{"XUsageBar", "Misc / X", 551},
|
||||||
|
{"XStackBar", "Misc / X", 552},
|
||||||
|
{"XVerticalBar", "Misc / X", 553},
|
||||||
|
{"XTachometer", "Misc / X", 554},
|
||||||
|
{"XArcGauge", "Misc / X", 555},
|
||||||
|
{"XDonutGauge", "Misc / X", 556},
|
||||||
|
{"XProcessList", "Misc / X", 557},
|
||||||
|
{"XLoadBadge", "Misc / X", 558},
|
||||||
|
{"XMonitorButton", "Misc / X", 559},
|
||||||
|
{"XMonitorGrid", "Misc / X", 560},
|
||||||
|
{"XSysBox", "Misc / X", 561},
|
||||||
{"IndADX", "Stock Market", 102},
|
{"IndADX", "Stock Market", 102},
|
||||||
{"IndADXR", "Stock Market", 103},
|
{"IndADXR", "Stock Market", 103},
|
||||||
{"IndALMA", "Stock Market", 104},
|
{"IndALMA", "Stock Market", 104},
|
||||||
@@ -576,4 +591,4 @@ inline const XFramePaletteEntry kXFramePalette[] = {
|
|||||||
{"InstVerticalTankLevel", "Instrumentation", 416},
|
{"InstVerticalTankLevel", "Instrumentation", 416},
|
||||||
{"InstVuMeter", "Instrumentation", 417},
|
{"InstVuMeter", "Instrumentation", 417},
|
||||||
};
|
};
|
||||||
inline const int kXFramePaletteCount = 547;
|
inline const int kXFramePaletteCount = 562;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// GENERATED by tools/gen_registry.py — do not edit by hand.
|
// GENERATED by tools/gen_registry.py — do not edit by hand.
|
||||||
// Canonical widget list (sorted), section assignment, default sizes,
|
// Canonical widget list (sorted), section assignment, default sizes,
|
||||||
// and a type-erased factory over all 547 XFrame widget classes.
|
// and a type-erased factory over all 562 XFrame widget classes.
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -558,10 +558,25 @@
|
|||||||
#include "components/TValueListEditor/TValueListEditor.h"
|
#include "components/TValueListEditor/TValueListEditor.h"
|
||||||
#include "components/XGraph/XGraph.h"
|
#include "components/XGraph/XGraph.h"
|
||||||
#include "components/XSpreadsheet/XSpreadsheet.h"
|
#include "components/XSpreadsheet/XSpreadsheet.h"
|
||||||
|
#include "components/XHistoryGraph/XHistoryGraph.h"
|
||||||
|
#include "components/XCoreGrid/XCoreGrid.h"
|
||||||
|
#include "components/XNetGraph/XNetGraph.h"
|
||||||
|
#include "components/XTempHistory/XTempHistory.h"
|
||||||
|
#include "components/XUsageBar/XUsageBar.h"
|
||||||
|
#include "components/XStackBar/XStackBar.h"
|
||||||
|
#include "components/XVerticalBar/XVerticalBar.h"
|
||||||
|
#include "components/XTachometer/XTachometer.h"
|
||||||
|
#include "components/XArcGauge/XArcGauge.h"
|
||||||
|
#include "components/XDonutGauge/XDonutGauge.h"
|
||||||
|
#include "components/XProcessList/XProcessList.h"
|
||||||
|
#include "components/XLoadBadge/XLoadBadge.h"
|
||||||
|
#include "components/XMonitorButton/XMonitorButton.h"
|
||||||
|
#include "components/XMonitorGrid/XMonitorGrid.h"
|
||||||
|
#include "components/XSysBox/XSysBox.h"
|
||||||
|
|
||||||
namespace lg {
|
namespace lg {
|
||||||
|
|
||||||
inline const int kWidgetCount = 547;
|
inline const int kWidgetCount = 562;
|
||||||
inline const int kSectionCount = 11;
|
inline const int kSectionCount = 11;
|
||||||
|
|
||||||
inline const char* kSectionNames[kSectionCount] = {
|
inline const char* kSectionNames[kSectionCount] = {
|
||||||
@@ -1125,7 +1140,22 @@ inline const char* kWidgetNames[kWidgetCount] = {
|
|||||||
"TUpDown",
|
"TUpDown",
|
||||||
"TValueListEditor",
|
"TValueListEditor",
|
||||||
"XGraph",
|
"XGraph",
|
||||||
"XSpreadsheet"
|
"XSpreadsheet",
|
||||||
|
"XHistoryGraph",
|
||||||
|
"XCoreGrid",
|
||||||
|
"XNetGraph",
|
||||||
|
"XTempHistory",
|
||||||
|
"XUsageBar",
|
||||||
|
"XStackBar",
|
||||||
|
"XVerticalBar",
|
||||||
|
"XTachometer",
|
||||||
|
"XArcGauge",
|
||||||
|
"XDonutGauge",
|
||||||
|
"XProcessList",
|
||||||
|
"XLoadBadge",
|
||||||
|
"XMonitorButton",
|
||||||
|
"XMonitorGrid",
|
||||||
|
"XSysBox",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Section index (into kSectionNames) for each widget, same order as names.
|
// Section index (into kSectionNames) for each widget, same order as names.
|
||||||
@@ -1175,7 +1205,8 @@ inline const int kWidgetSection[kWidgetCount] = {
|
|||||||
1, 0, 0, 1, 0, 3, 1, 1, 7, 7, 0, 0,
|
1, 0, 0, 1, 0, 3, 1, 1, 7, 7, 0, 0,
|
||||||
3, 2, 6, 0, 0, 0, 1, 1, 0, 3, 6, 6,
|
3, 2, 6, 0, 0, 0, 1, 1, 0, 3, 6, 6,
|
||||||
2, 4, 1, 3, 3, 6, 1, 0, 3, 3, 2, 7,
|
2, 4, 1, 3, 3, 6, 1, 0, 3, 3, 2, 7,
|
||||||
3, 3, 6, 2, 4, 8, 8
|
3, 3, 6, 2, 4, 8, 8,
|
||||||
|
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Default placement size (w, h) per widget type.
|
// Default placement size (w, h) per widget type.
|
||||||
@@ -1188,7 +1219,7 @@ inline int index_of(const std::string& name) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// One interface over every widget class: all 547 share the same
|
// One interface over every widget class: all 562 share the same
|
||||||
// constructor signature and the same event-method signatures.
|
// constructor signature and the same event-method signatures.
|
||||||
struct IWidget {
|
struct IWidget {
|
||||||
virtual ~IWidget() {}
|
virtual ~IWidget() {}
|
||||||
@@ -4505,7 +4536,22 @@ inline std::unique_ptr<IWidget> create_widget(int type, Display* d, int s,
|
|||||||
case 543: return std::make_unique<Holder<TUpDown>>(d, s, win, gc, st, x, y, w, h);
|
case 543: return std::make_unique<Holder<TUpDown>>(d, s, win, gc, st, x, y, w, h);
|
||||||
case 544: return std::make_unique<Holder<TValueListEditor>>(d, s, win, gc, st, x, y, w, h);
|
case 544: return std::make_unique<Holder<TValueListEditor>>(d, s, win, gc, st, x, y, w, h);
|
||||||
case 545: return std::make_unique<Holder<XGraph>>(d, s, win, gc, st, x, y, w, h);
|
case 545: return std::make_unique<Holder<XGraph>>(d, s, win, gc, st, x, y, w, h);
|
||||||
case 546: return std::make_unique<Holder<XSpreadsheet>>(d, s, win, gc, st, x, y, w, h); default: return nullptr;
|
case 546: return std::make_unique<Holder<XSpreadsheet>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 547: return std::make_unique<Holder<XHistoryGraph>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 548: return std::make_unique<Holder<XCoreGrid>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 549: return std::make_unique<Holder<XNetGraph>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 550: return std::make_unique<Holder<XTempHistory>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 551: return std::make_unique<Holder<XUsageBar>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 552: return std::make_unique<Holder<XStackBar>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 553: return std::make_unique<Holder<XVerticalBar>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 554: return std::make_unique<Holder<XTachometer>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 555: return std::make_unique<Holder<XArcGauge>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 556: return std::make_unique<Holder<XDonutGauge>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 557: return std::make_unique<Holder<XProcessList>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 558: return std::make_unique<Holder<XLoadBadge>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 559: return std::make_unique<Holder<XMonitorButton>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 560: return std::make_unique<Holder<XMonitorGrid>>(d, s, win, gc, st, x, y, w, h);
|
||||||
|
case 561: return std::make_unique<Holder<XSysBox>>(d, s, win, gc, st, x, y, w, h); default: return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 894 B |
@@ -108,6 +108,7 @@ ASSIGNMENT = {
|
|||||||
],
|
],
|
||||||
"Misc / X": [
|
"Misc / X": [
|
||||||
"GtkEventBox", "TApplicationProperties", "XGraph", "XSpreadsheet",
|
"GtkEventBox", "TApplicationProperties", "XGraph", "XSpreadsheet",
|
||||||
|
"XHistoryGraph", "XCoreGrid", "XNetGraph", "XTempHistory", "XUsageBar", "XStackBar", "XVerticalBar", "XTachometer", "XArcGauge", "XDonutGauge", "XProcessList", "XLoadBadge", "XMonitorButton", "XMonitorGrid", "XSysBox",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||