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.
Using it
Section titled “Using it”[dependencies]xpui-simulator = { git = "https://github.com/XPUI-Framework/xpui-simulator", branch = "main" }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.
Requirements
Section titled “Requirements”SDL2, which embedded-graphics-simulator needs.
brew install sdl2 # macOSsudo apt install libsdl2-dev # Debian/UbuntuChecking it
Section titled “Checking it”./build-and-test.shThe 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.
Where it sits
Section titled “Where it sits”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.