# aristocratos/btop4win architecture

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

- Interactive diagram: https://gitdiagram.com/aristocratos/btop4win
- Repository: https://github.com/aristocratos/btop4win

## Overview

btop4win is a Windows terminal system monitor. Its main workflow gathers system and process data, renders resource panels, and responds to keyboard and mouse input; users can also inspect and manage processes and services and configure themes, presets, and display options. The graph includes the documented monitoring and interaction capabilities, plus shared data and terminal utilities. Some feature modules are represented by their known enclosing source files; unsampled implementation details and links are omitted rather than inferred.

Main entry points: [`src/btop.cpp`](https://github.com/aristocratos/btop4win/blob/master/src/btop.cpp) (Application loop), [`src/btop_collect.cpp`](https://github.com/aristocratos/btop4win/blob/master/src/btop_collect.cpp) (System data collection), [`src/btop_draw.cpp`](https://github.com/aristocratos/btop4win/blob/master/src/btop_draw.cpp) (Resource panel drawing), [`src/btop_input.cpp`](https://github.com/aristocratos/btop4win/blob/master/src/btop_input.cpp) (Keyboard and mouse input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Monitor runtime"]
  node_app["Application loop<br/>[btop.cpp]"]
  node_runner["Collection and render runner<br/>[btop.cpp]"]
  node_collect["System data collection<br/>[btop_collect.cpp]"]
  node_processes["Processes and services<br/>[btop_collect.cpp]"]
end

subgraph group_interaction["Input and settings"]
  node_config["Configuration<br/>[btop_config.cpp]"]
  node_input["Keyboard and mouse input<br/>[btop_input.cpp]"]
  node_menu["Menus and options<br/>[btop_menu.cpp]"]
end

subgraph group_presentation["Terminal presentation"]
  node_drawing["Resource panel drawing<br/>[btop_draw.cpp]"]
  node_theme["Theme loading<br/>[btop_theme.cpp]"]
  node_themes["Theme files"]
end

subgraph group_shared["Shared utilities"]
  node_shared_state["Shared monitor state<br/>[btop_shared.hpp]"]
  node_tools["Windows and text utilities<br/>[btop_tools.cpp]"]
  node_hash["Robin Hood hash map<br/>[robin_hood.h]"]
  node_width["Unicode width tables<br/>[widechar_width.hpp]"]
end

node_user(("Monitor user"))
node_terminal["Windows terminal"]

node_user -->|"starts and uses"| node_app
node_app -->|"renders interface"| node_terminal
node_app -->|"polls input"| node_input
node_app -->|"dispatches input"| node_menu
node_app -->|"starts and stops"| node_runner
node_runner -->|"collects stats"| node_collect
node_runner -->|"draws panels"| node_drawing
node_collect -.->|"gathers process data"| node_processes
node_user -->|"selects and manages"| node_processes
node_input -->|"changes options"| node_config
node_input -->|"controls selection"| node_processes
node_menu -->|"sets options"| node_config
node_config -.->|"selects theme"| node_theme
node_theme -.->|"loads theme data"| node_themes
node_drawing -.->|"uses colors"| node_theme
node_drawing -.->|"measures Unicode"| node_width
node_collect -.->|"uses shared types"| node_shared_state
node_drawing -.->|"uses shared types"| node_shared_state
node_tools -.->|"configures terminal"| node_terminal
node_collect -.->|"uses containers"| node_hash

click node_app "https://github.com/aristocratos/btop4win/blob/master/src/btop.cpp"
click node_runner "https://github.com/aristocratos/btop4win/blob/master/src/btop.cpp"
click node_collect "https://github.com/aristocratos/btop4win/blob/master/src/btop_collect.cpp"
click node_processes "https://github.com/aristocratos/btop4win/blob/master/src/btop_collect.cpp"
click node_config "https://github.com/aristocratos/btop4win/blob/master/src/btop_config.cpp"
click node_input "https://github.com/aristocratos/btop4win/blob/master/src/btop_input.cpp"
click node_menu "https://github.com/aristocratos/btop4win/blob/master/src/btop_menu.cpp"
click node_drawing "https://github.com/aristocratos/btop4win/blob/master/src/btop_draw.cpp"
click node_theme "https://github.com/aristocratos/btop4win/blob/master/src/btop_theme.cpp"
click node_themes "https://github.com/aristocratos/btop4win/tree/master/themes"
click node_shared_state "https://github.com/aristocratos/btop4win/blob/master/src/btop_shared.hpp"
click node_tools "https://github.com/aristocratos/btop4win/blob/master/src/btop_tools.cpp"
click node_hash "https://github.com/aristocratos/btop4win/blob/master/include/robin_hood.h"
click node_width "https://github.com/aristocratos/btop4win/blob/master/include/widechar_width.hpp"

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_app,node_runner,node_collect,node_processes,node_user toneBlue
class node_config,node_input,node_menu toneAmber
class node_drawing,node_theme,node_themes toneMint
class node_shared_state,node_tools,node_hash,node_width toneRose
class node_terminal toneIndigo
```

## Components

### Monitor runtime

- [Application loop](https://github.com/aristocratos/btop4win/blob/master/src/btop.cpp): `src/btop.cpp`
- [Collection and render runner](https://github.com/aristocratos/btop4win/blob/master/src/btop.cpp): `src/btop.cpp`
- [System data collection](https://github.com/aristocratos/btop4win/blob/master/src/btop_collect.cpp): `src/btop_collect.cpp`
- [Processes and services](https://github.com/aristocratos/btop4win/blob/master/src/btop_collect.cpp): `src/btop_collect.cpp`

### Input and settings

- [Configuration](https://github.com/aristocratos/btop4win/blob/master/src/btop_config.cpp): `src/btop_config.cpp`
- [Keyboard and mouse input](https://github.com/aristocratos/btop4win/blob/master/src/btop_input.cpp): `src/btop_input.cpp`
- [Menus and options](https://github.com/aristocratos/btop4win/blob/master/src/btop_menu.cpp): `src/btop_menu.cpp`

### Terminal presentation

- [Resource panel drawing](https://github.com/aristocratos/btop4win/blob/master/src/btop_draw.cpp): `src/btop_draw.cpp`
- [Theme loading](https://github.com/aristocratos/btop4win/blob/master/src/btop_theme.cpp): `src/btop_theme.cpp`
- [Theme files](https://github.com/aristocratos/btop4win/tree/master/themes): `themes`

### Shared utilities

- [Shared monitor state](https://github.com/aristocratos/btop4win/blob/master/src/btop_shared.hpp): `src/btop_shared.hpp`
- [Windows and text utilities](https://github.com/aristocratos/btop4win/blob/master/src/btop_tools.cpp): `src/btop_tools.cpp`
- [Robin Hood hash map](https://github.com/aristocratos/btop4win/blob/master/include/robin_hood.h): `include/robin_hood.h`
- [Unicode width tables](https://github.com/aristocratos/btop4win/blob/master/include/widechar_width.hpp): `include/widechar_width.hpp`

### Other components

- **Monitor user**
- **Windows terminal**

## Connections

- Monitor user → Application loop: starts and uses (evidence: `README.md`)
- Application loop → Windows terminal: renders interface (evidence: `src/btop.cpp`)
- Application loop → Keyboard and mouse input: polls input (evidence: `src/btop.cpp`)
- Application loop → Menus and options: dispatches input (evidence: `src/btop.cpp`)
- Application loop → Collection and render runner: starts and stops (evidence: `src/btop.cpp`)
- Collection and render runner → System data collection: collects stats (evidence: `src/btop.cpp`)
- Collection and render runner → Resource panel drawing: draws panels (evidence: `src/btop.cpp`)
- System data collection → Processes and services: gathers process data (evidence: `src/btop_collect.cpp`)
- Monitor user → Processes and services: selects and manages (evidence: `README.md`)
- Keyboard and mouse input → Configuration: changes options (evidence: `src/btop_input.cpp`)
- Keyboard and mouse input → Processes and services: controls selection (evidence: `src/btop_input.cpp`)
- Menus and options → Configuration: sets options (evidence: `src/btop_menu.cpp`)
- Configuration → Theme loading: selects theme
- Theme loading → Theme files: loads theme data
- Resource panel drawing → Theme loading: uses colors
- Resource panel drawing → Unicode width tables: measures Unicode
- System data collection → Shared monitor state: uses shared types
- Resource panel drawing → Shared monitor state: uses shared types
- Windows and text utilities → Windows terminal: configures terminal
- System data collection → Robin Hood hash map: uses containers
