Skip to content

Simulator

Runs an xpui app in a desktop window, so screens can be developed without hardware. Not a separate rendering backend: it is xpui-embedded-graphics over embedded-graphics-simulator's display, plus a window, an event pump and a keyboard mapping. The pixels are the ones a device would get — same backend, same components, same measurements.

Every document in this repository is listed in docs/README.md.

TOML
[dependencies]
xpui-simulator = { git = "https://github.com/XPUI-Framework/xpui-simulator", branch = "main" }
Rust
use xpui_simulator::{Board, Panel, Simulator};
fn main() {
// Your panel. `xpui-boards-pimoroni`, `-xteink` and `-seeed` carry
// ready-made ones.
let mine = Board::custom("my reader", 480, 800, false);
Simulator::new(Panel::of(mine))
.title("my reader")
.run(MainMenu::new());
}

cargo run -p xpui-gallery — the eight-board gallery this window was built around — lives in xpui-gallery, not here; this crate knows no device and no screen, and opens whatever board and screen it is handed. Nothing is on crates.io yet, which is why the dependency is a git URL.

SDL2, which embedded-graphics-simulator needs.

Shell
brew install sdl2 # macOS
sudo apt install libsdl2-dev # Debian/Ubuntu
Shell
./build-and-test.sh

The checks themselves are in xtask/ — this repository's own list, in Rust, holding nothing it does not run. There is no bare-metal lint here and there is no C++ stage: this crate opens a window, and runs on a desktop and nowhere else. ./build-and-test.sh fix formats in place first. How a change is reviewed is in docs/contributing.md.

Every arrow is a dependency in a Cargo.toml, and they all point inward toward xpui, which depends on nothing at all. That is the rule the organisation is arranged around: a backend can be written without the framework knowing it exists, and a firmware reaches whatever it needs directly rather than through whoever happens to sit above it.

xpuithe frameworkxpui-chromecomponentsxpui-boardseight devicesxpui-backendstwo backendsxpui-simulatora windowxpui-gallerythe appxpui-rp2040firmwarexpui-esp32firmwarexpui-cppa C++ hostxpui-devthe umbrella