AGT

Version

0.1.0-dev

License

Apache-2.0

C++ header

#include <agt.hpp>

Website

agt.aximcode.com

Repo

github.com/aximcode/agt

Build

axl-c++ hello.cpp libagt.a -o hello.efi

AGT — AximCode GUI Toolkit

C++ widget toolkit for pre-boot UEFI applications. Provides windows, dialogs, controls, menus, layout containers, and a message-driven event model suitable for vendor diagnostic tools, service applications, and BMC local UIs.

Architecturally inspired by the FOX Toolkit: parent-child ownership tree, static-map message dispatch, layout managers composed by nesting. C++ from the ground up — no GObject runtime, no std::shared_ptr, no reference counting.

Status: pre-1.0, actively developed. Widget set covers frames, labels, buttons, checkboxes, radio buttons, sliders, progress bars, and VBox / HBox layout containers; rendering is double-buffered with anti-aliased TTF text; the AgtWindow event router handles hit-testing, hover transitions, and mouse capture for drag widgets. See docs/AGT-Design.md for the canonical design + roadmap.

Build

Requires axl-sdk installed (with C++ support) — either system-wide via the .deb/.rpm package or from a local checkout via AXL_SDK_SRC=path/to/axl-sdk.

# Against an installed SDK (axl-sdk-cpp.deb / axl-sdk-cpp.rpm):
make                          # x64
make ARCH=aa64

# Against a local axl-sdk checkout (rebuilds SDK first):
AXL_SDK_SRC=../axl-sdk make
AXL_SDK_SRC=../axl-sdk make ARCH=aa64

Output: build/<arch>/libagt.a plus build/<arch>/*.efi demo binaries (hello, label-demo, layout-demo, controls-demo, widgets-demo).

Run

# Via axl-sdk's run-qemu.sh helper:
../axl-sdk/scripts/run-qemu.sh --arch X64 build/x64/hello.efi

Each demo runs the event loop for a few seconds with auto-exit so it’s safe to invoke from a regression harness; consumer apps opt into manual quit via AgtApp::quit() from a widget command handler.

Test

AXL_SDK_SRC=../axl-sdk make test           # unit suite (both arches)
AXL_SDK_SRC=../axl-sdk make test-visual    # pixel-diff regression

Unit tests live under test/unit/ and run via a single agt-test.efi binary per arch; the visual harness boots each demo under QEMU, screenshots the framebuffer, and diffs against test/expected/*.png.

Architecture (in one paragraph)

AGT calls the axl-sdk C library directly from C++ code — no intervening wrapper layer. extern "C" declarations in axl-sdk headers make C++ → C calls zero-ceremony; AXL_AUTOPTR(Type) (a GCC cleanup-attribute macro that g++ supports natively) gives RAII for owned C handles.

The widget hierarchy:

AgtObject              parent pointer + child list + virtual dtor
  └─ AgtWidget         bounding rect + dirty flag + virtual draw/handle_event
       ├─ AgtWindow    top-level + back buffer + presents via axl-gfx
       ├─ AgtFrame     bg + border (line / raised / sunken / rounded) + padding
       │   ├─ AgtLabel       single-line text caption (TTF via axl_ttf_default)
       │   │   └─ AgtButton  state machine + click contract + SEL_COMMAND
       │   │       ├─ AgtCheckBox     binary toggle with square indicator
       │   │       └─ AgtRadioButton  mutual-exclusion with circle indicator
       │   ├─ AgtProgressBar  value-fill display (horizontal / vertical)
       │   ├─ AgtSlider       draggable thumb, emits SEL_COMMAND on change
       │   ├─ AgtVBox         vertical layout container
       │   └─ AgtHBox         horizontal layout container
       └─ ... future: dialogs, menus, edit fields, scroll panels ...

AgtApp wraps AxlLoop for the event-loop pump; the widget tree dispatches input through a static-map mechanism modeled on FOX’s FXMAPFUNC (compile-time tables, no runtime registration, no allocation in the dispatch path).

License

Apache-2.0. See LICENSE and NOTICE.