# wazzaps/fingerpaint architecture

> Architecture diagram of the GitHub repository wazzaps/fingerpaint, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wazzaps/fingerpaint
- Repository: https://github.com/wazzaps/fingerpaint

## Overview

FingerPaint is a small Linux touchpad drawing utility. The user draws on a Tk canvas; touchpad events are normalized into strokes, rendered both on screen and into a PNG, then written to a file or stdout. The README documents X11 and GNOME Wayland support and key/click completion. The implementation is concentrated in one file; the excerpt omits some wiring, so uncertain control-flow links are left out.

Main entry points: [`fingerpaint/fingerpaint.py`](https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py) (Drawing canvas)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_touchpad["Touchpad"]
node_discovery["Device discovery<br/>[fingerpaint.py]"]
node_sampling["Event sampling<br/>[fingerpaint.py]"]
node_canvas["Drawing canvas<br/>[fingerpaint.py]"]
node_png["PNG output<br/>[fingerpaint.py]"]
node_session["Session support<br/>[fingerpaint.py]"]
node_destination(("Output destination"))

node_user -->|"draws on"| node_touchpad
node_discovery -->|"opens device"| node_touchpad
node_sampling -->|"reads events"| node_touchpad
node_user -->|"finishes with key or click"| node_canvas
node_canvas -->|"renders strokes"| node_png
node_png -->|"writes PNG"| node_destination
node_session -.->|"supports X11 and Wayland"| node_touchpad

click node_discovery "https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py"
click node_sampling "https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py"
click node_canvas "https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py"
click node_png "https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py"
click node_session "https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_touchpad,node_destination toneIndigo
class node_discovery,node_sampling,node_canvas,node_png,node_session toneTeal
```

## Components

### Other components

- **User**
- **Touchpad**
- [Device discovery](https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py): `fingerpaint/fingerpaint.py`
- [Event sampling](https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py): `fingerpaint/fingerpaint.py`
- [Drawing canvas](https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py): `fingerpaint/fingerpaint.py`
- [PNG output](https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py): `fingerpaint/fingerpaint.py`
- [Session support](https://github.com/wazzaps/fingerpaint/blob/master/fingerpaint/fingerpaint.py): `fingerpaint/fingerpaint.py`
- **Output destination**

## Connections

- User → Touchpad: draws on (evidence: `README.md`)
- Device discovery → Touchpad: opens device (evidence: `fingerpaint/fingerpaint.py`)
- Event sampling → Touchpad: reads events (evidence: `fingerpaint/fingerpaint.py`)
- User → Drawing canvas: finishes with key or click (evidence: `README.md`)
- Drawing canvas → PNG output: renders strokes (evidence: `fingerpaint/fingerpaint.py`)
- PNG output → Output destination: writes PNG (evidence: `fingerpaint/fingerpaint.py`)
- Session support → Touchpad: supports X11 and Wayland (evidence: `README.md`)
