docs: add input-and-placement OpenSpec change and update AGENTS.md

Plan input handling and pattern placement before Game of Life mechanics:
keyboard bindings config, mouse placement with preview/rotation,
HiDPI scaling, and cell grid. Update AGENTS.md project notes.
This commit is contained in:
2026-11-08 14:30:09 +01:00
parent 403bcbbfdf
commit 5e7abfb56b
12 changed files with 436 additions and 40 deletions
+13 -40
View File
@@ -1,49 +1,22 @@
# wlgol
Simple Wayland Game of Life in C11. Draws directly into a shared-memory buffer (no OpenGL/Vulkan).
Wayland Game of Life in C11; renders into a shared-memory buffer (no GL/Vulkan).
- Build definition: `CMakeLists.txt`
- Generated code: `xdg-shell.xml` is vendored; `wayland-scanner` produces `xdg-shell.h` and `xdg-shell.c` inside `build/`
- Source layout: `wlgol.c` is the entry point; `tkeyboard.c`, `tpointer.c`, `hashtable.c` are modules; headers live in `include/`; tests live in `tests/`
## Build & test
## Dependencies
- Configure: `cmake -G Ninja -B build`
- Build: `cmake --build ./build`
- Tests: `ctest --test-dir build` (single target `Hashtable`); or run `./build/test_hashtable`
- Run app: `./build/wlgol` (requires a running Wayland compositor; not runnable headless)
Needs `cmake`, `ninja`, `pkg-config`, `wayland-scanner`, plus the runtime libraries `wayland-client`, `wayland-cursor`, and `xkbcommon`.
Dependencies: `cmake`, `ninja`, `pkg-config`, `wayland-scanner`; libraries `wayland-client`, `wayland-cursor`, `xkbcommon`.
## Common commands
## Generated code
Configure (from repo root):
- `xdg-shell.h` / `xdg-shell.c` are generated by `wayland-scanner` from the vendored `xdg-shell.xml` into `build/include/` and `build/`. Do not edit them; rebuild to regenerate. `CMakeLists.txt` lists the generated `.c` in `SOURCES` and the `.h` as a source to force generation.
- `compile_commands.json` at the repo root is a symlink to `build/compile_commands.json`; configure first.
```bash
cmake -G Ninja -B build
```
Build:
```bash
cmake --build ./build
```
Run tests:
```bash
ctest --test-dir build
```
Run a single test directly:
```bash
./build/test_hashtable
```
Run the program (requires a running Wayland compositor):
```bash
./build/wlgol
```
## Notes
- `compile_commands.json` is generated automatically in the build directory because `CMAKE_EXPORT_COMPILE_COMMANDS` is set in `CMakeLists.txt`.
- The project currently has one CTest target named `Hashtable`.
## Code notes
- Hashtable: `hashtable_new(size)` requires `size > 0` (used as a modulo). `hashtable_destroy` frees keys/entries but not values (caller owns values). `hashtable_set` returns the previous value or `NULL`, indistinguishable from "key absent".
- Entry point is `wlgol.c`; modules `tkeyboard.c`, `tpointer.c`, `hashtable.c`; headers in `include/`.