# paxy484/paxcurses architecture

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

- Interactive diagram: https://gitdiagram.com/paxy484/paxcurses
- Repository: https://github.com/paxy484/paxcurses

## Overview

PaxCurses is a compact curses-compatible library. Applications use its ncurses-like API to manage windows, draw text, handle input, and refresh terminal views; it also provides pads, wide-character drawing, and dynamic scrollback. The excerpts show core window, rendering, and input behavior, while the README documents Win32, DOS, and POSIX support. Several features share one implementation file, so nodes represent runtime responsibilities rather than separate modules.

Main entry points: [`paxcurses.c`](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c) (Window Canvas), [`paxcurses.h`](https://github.com/paxy484/paxcurses/blob/main/paxcurses.h) (Curses API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Public Interface"]
  node_api["Curses API<br/>[paxcurses.h]"]
end

subgraph group_windows["Window and Canvas"]
  node_engine["Screen Lifecycle<br/>[paxcurses.c]"]
  node_canvas["Window Canvas<br/>[paxcurses.c]"]
  node_scrollback["Scrollback<br/>[paxcurses.c]"]
  node_pads["Pads<br/>[paxcurses.c]"]
  node_drawing["Text and Attributes<br/>[paxcurses.c]"]
end

subgraph group_terminal["Terminal I/O"]
  node_refresh["Viewport Rendering<br/>[paxcurses.c]"]
  node_input["Keyboard Input<br/>[paxcurses.c]"]
  node_terminal_io["Terminal I/O"]
end

node_application(("Application"))

node_application -->|"calls"| node_api
node_api -->|"exposes"| node_engine
node_engine -->|"configures"| node_terminal_io
node_drawing -->|"writes cells"| node_canvas
node_scrollback -->|"resizes buffer"| node_canvas
node_pads -->|"allocates buffer"| node_canvas
node_refresh -->|"reads cells"| node_canvas
node_refresh -->|"renders to"| node_terminal_io
node_input -->|"reads keys"| node_terminal_io

click node_api "https://github.com/paxy484/paxcurses/blob/main/paxcurses.h"
click node_engine "https://github.com/paxy484/paxcurses/blob/main/paxcurses.c"
click node_canvas "https://github.com/paxy484/paxcurses/blob/main/paxcurses.c"
click node_scrollback "https://github.com/paxy484/paxcurses/blob/main/paxcurses.c"
click node_pads "https://github.com/paxy484/paxcurses/blob/main/paxcurses.c"
click node_drawing "https://github.com/paxy484/paxcurses/blob/main/paxcurses.c"
click node_refresh "https://github.com/paxy484/paxcurses/blob/main/paxcurses.c"
click node_input "https://github.com/paxy484/paxcurses/blob/main/paxcurses.c"

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_api toneBlue
class node_engine,node_canvas,node_scrollback,node_pads,node_drawing toneAmber
class node_refresh,node_input,node_terminal_io toneMint
class node_application toneIndigo
```

## Components

### Public Interface

- [Curses API](https://github.com/paxy484/paxcurses/blob/main/paxcurses.h): `paxcurses.h`

### Window and Canvas

- [Screen Lifecycle](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c): `paxcurses.c`
- [Window Canvas](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c): `paxcurses.c`
- [Scrollback](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c): `paxcurses.c`
- [Pads](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c): `paxcurses.c`
- [Text and Attributes](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c): `paxcurses.c`

### Terminal I/O

- [Viewport Rendering](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c): `paxcurses.c`
- [Keyboard Input](https://github.com/paxy484/paxcurses/blob/main/paxcurses.c): `paxcurses.c`
- **Terminal I/O**

### Other components

- **Application**

## Connections

- Application → Curses API: calls (evidence: `README.md`)
- Curses API → Screen Lifecycle: exposes (evidence: `paxcurses.h`)
- Screen Lifecycle → Terminal I/O: configures (evidence: `paxcurses.c`)
- Text and Attributes → Window Canvas: writes cells (evidence: `paxcurses.c`)
- Scrollback → Window Canvas: resizes buffer (evidence: `paxcurses.c`)
- Pads → Window Canvas: allocates buffer (evidence: `paxcurses.c`)
- Viewport Rendering → Window Canvas: reads cells (evidence: `paxcurses.c`)
- Viewport Rendering → Terminal I/O: renders to (evidence: `paxcurses.c`)
- Keyboard Input → Terminal I/O: reads keys (evidence: `paxcurses.c`)
