# snippetsh/dontgocat architecture

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

- Interactive diagram: https://gitdiagram.com/snippetsh/dontgocat
- Repository: https://github.com/snippetsh/dontgocat

## Overview

DontGoCat is a Qt desktop-pet application: it scans the desktop, spawns a sprite cat, and runs a timed loop that updates its behavior and renders it. The central domain stages are desktop-surface discovery, route planning and locomotion, and interactive cat behavior; separate branches handle tray-based quit protection, sound, and activity statistics. The README is brief, so feature details come primarily from source comments and declarations. Some internal calls are not shown; uncertain connections are omitted rather than inferred.

Main entry points: [`src/module/CatApp.cpp`](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatApp.cpp) (App coordinator), [`src/module/TrayController.cpp`](https://github.com/snippetsh/dontgocat/blob/master/src/module/TrayController.cpp) (Tray controller), [`src/module/Locomotion.cpp`](https://github.com/snippetsh/dontgocat/blob/master/src/module/Locomotion.cpp) (Cat locomotion), [`src/module/CatBrain.cpp`](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatBrain.cpp) (Behavior brain)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_main["Application entry<br/>[main.cpp]"]
  node_app["App coordinator<br/>[CatApp.cpp]"]
end

subgraph group_world["Desktop world"]
  node_scanner["Desktop scanner<br/>[DesktopScanner.cpp]"]
  node_surface["Surface model<br/>[Surface.hpp]"]
  node_planner["Route planner<br/>[PathPlanner.cpp]"]
end

subgraph group_cat["Cat behavior"]
  node_locomotion["Cat locomotion<br/>[Locomotion.cpp]"]
  node_brain["Behavior brain<br/>[CatBrain.cpp]"]
end

subgraph group_interaction["User interaction"]
  node_mouse["Mouse watcher<br/>[MouseWatcher.cpp]"]
  node_tray["Tray controller<br/>[TrayController.cpp]"]
  node_popup["Settings and quit popup<br/>[QuitPopup.cpp]"]
  node_quitguard["Quit guard<br/>[QuitGuard.cpp]"]
  node_autostart["Auto-start<br/>[AutoStart.cpp]"]
end

subgraph group_support["Presentation and state"]
  node_config["Runtime settings<br/>[Config.hpp]"]
  node_sprite["Cat sprite<br/>[CatSprite.cpp]"]
  node_animation["Animation<br/>[CatAnim.cpp]"]
  node_overlay["Cat overlay<br/>[CatOverlay.cpp]"]
  node_widget["Cat widget<br/>[CatWidget.cpp]"]
  node_voice["Cat voice<br/>[CatVoice.cpp]"]
  node_stats["Activity statistics<br/>[CatStats.cpp]"]
end

node_user(("Desktop user"))
node_os(("Desktop OS"))

node_user -->|"launches"| node_main
node_main -->|"starts"| node_app
node_app -->|"scans desktop"| node_scanner
node_scanner -->|"builds snapshot"| node_surface
node_app -->|"ticks behavior"| node_brain
node_app -->|"updates movement"| node_locomotion
node_app -->|"coordinates routes"| node_planner
node_app -->|"tracks pointer"| node_mouse
node_app -->|"coordinates tray"| node_tray
node_app -->|"renders cat"| node_overlay
node_app -->|"controls sound"| node_voice
node_app -->|"updates statistics"| node_stats
node_brain -->|"commands movement"| node_locomotion
node_brain -->|"uses pointer state"| node_mouse
node_brain -.->|"plans routes"| node_planner
node_planner -->|"applies route steps"| node_locomotion
node_locomotion -->|"uses attachments"| node_surface
node_locomotion -->|"plays frames"| node_animation
node_animation -->|"supplies poses"| node_sprite
node_overlay -.->|"displays cat"| node_widget
node_app -.->|"renders frames"| node_sprite
node_user -->|"uses tray"| node_tray
node_tray -->|"opens and configures"| node_popup
node_tray -->|"checks quit attempts"| node_quitguard
node_tray -->|"sets auto-start"| node_autostart
node_popup -->|"shows statistics"| node_stats
node_os -.->|"provides desktop state"| node_scanner
node_app -->|"reads settings"| node_config

click node_main "https://github.com/snippetsh/dontgocat/blob/master/src/app/main.cpp"
click node_app "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatApp.cpp"
click node_config "https://github.com/snippetsh/dontgocat/blob/master/src/include/Config.hpp"
click node_scanner "https://github.com/snippetsh/dontgocat/blob/master/src/module/DesktopScanner.cpp"
click node_surface "https://github.com/snippetsh/dontgocat/blob/master/src/include/Surface.hpp"
click node_planner "https://github.com/snippetsh/dontgocat/blob/master/src/module/PathPlanner.cpp"
click node_locomotion "https://github.com/snippetsh/dontgocat/blob/master/src/module/Locomotion.cpp"
click node_brain "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatBrain.cpp"
click node_mouse "https://github.com/snippetsh/dontgocat/blob/master/src/module/MouseWatcher.cpp"
click node_sprite "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatSprite.cpp"
click node_animation "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatAnim.cpp"
click node_overlay "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatOverlay.cpp"
click node_widget "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatWidget.cpp"
click node_tray "https://github.com/snippetsh/dontgocat/blob/master/src/module/TrayController.cpp"
click node_popup "https://github.com/snippetsh/dontgocat/blob/master/src/module/QuitPopup.cpp"
click node_quitguard "https://github.com/snippetsh/dontgocat/blob/master/src/module/QuitGuard.cpp"
click node_autostart "https://github.com/snippetsh/dontgocat/blob/master/src/module/AutoStart.cpp"
click node_voice "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatVoice.cpp"
click node_stats "https://github.com/snippetsh/dontgocat/blob/master/src/module/CatStats.cpp"

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_main,node_app,node_user toneBlue
class node_scanner,node_surface,node_planner toneAmber
class node_locomotion,node_brain toneMint
class node_mouse,node_tray,node_popup,node_quitguard,node_autostart toneRose
class node_config,node_sprite,node_animation,node_overlay,node_widget,node_voice,node_stats,node_os toneIndigo
```

## Components

### App runtime

- [Application entry](https://github.com/snippetsh/dontgocat/blob/master/src/app/main.cpp): `src/app/main.cpp`
- [App coordinator](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatApp.cpp): `src/module/CatApp.cpp`

### Desktop world

- [Desktop scanner](https://github.com/snippetsh/dontgocat/blob/master/src/module/DesktopScanner.cpp): `src/module/DesktopScanner.cpp`
- [Surface model](https://github.com/snippetsh/dontgocat/blob/master/src/include/Surface.hpp): `src/include/Surface.hpp`
- [Route planner](https://github.com/snippetsh/dontgocat/blob/master/src/module/PathPlanner.cpp): `src/module/PathPlanner.cpp`

### Cat behavior

- [Cat locomotion](https://github.com/snippetsh/dontgocat/blob/master/src/module/Locomotion.cpp): `src/module/Locomotion.cpp`
- [Behavior brain](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatBrain.cpp): `src/module/CatBrain.cpp`

### User interaction

- [Mouse watcher](https://github.com/snippetsh/dontgocat/blob/master/src/module/MouseWatcher.cpp): `src/module/MouseWatcher.cpp`
- [Tray controller](https://github.com/snippetsh/dontgocat/blob/master/src/module/TrayController.cpp): `src/module/TrayController.cpp`
- [Settings and quit popup](https://github.com/snippetsh/dontgocat/blob/master/src/module/QuitPopup.cpp): `src/module/QuitPopup.cpp`
- [Quit guard](https://github.com/snippetsh/dontgocat/blob/master/src/module/QuitGuard.cpp): `src/module/QuitGuard.cpp`
- [Auto-start](https://github.com/snippetsh/dontgocat/blob/master/src/module/AutoStart.cpp): `src/module/AutoStart.cpp`

### Presentation and state

- [Runtime settings](https://github.com/snippetsh/dontgocat/blob/master/src/include/Config.hpp): `src/include/Config.hpp`
- [Cat sprite](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatSprite.cpp): `src/module/CatSprite.cpp`
- [Animation](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatAnim.cpp): `src/module/CatAnim.cpp`
- [Cat overlay](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatOverlay.cpp): `src/module/CatOverlay.cpp`
- [Cat widget](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatWidget.cpp): `src/module/CatWidget.cpp`
- [Cat voice](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatVoice.cpp): `src/module/CatVoice.cpp`
- [Activity statistics](https://github.com/snippetsh/dontgocat/blob/master/src/module/CatStats.cpp): `src/module/CatStats.cpp`

### Other components

- **Desktop user**
- **Desktop OS**

## Connections

- Desktop user → Application entry: launches (evidence: `src/app/main.cpp`)
- Application entry → App coordinator: starts (evidence: `src/app/main.cpp`)
- App coordinator → Desktop scanner: scans desktop
- Desktop scanner → Surface model: builds snapshot
- App coordinator → Behavior brain: ticks behavior
- App coordinator → Cat locomotion: updates movement
- App coordinator → Route planner: coordinates routes
- App coordinator → Mouse watcher: tracks pointer
- App coordinator → Tray controller: coordinates tray
- App coordinator → Cat overlay: renders cat
- App coordinator → Cat voice: controls sound
- App coordinator → Activity statistics: updates statistics
- Behavior brain → Cat locomotion: commands movement (evidence: `src/module/CatBrain.cpp`)
- Behavior brain → Mouse watcher: uses pointer state (evidence: `src/module/CatBrain.cpp`)
- Behavior brain → Route planner: plans routes
- Route planner → Cat locomotion: applies route steps
- Cat locomotion → Surface model: uses attachments
- Cat locomotion → Animation: plays frames
- Animation → Cat sprite: supplies poses
- Cat overlay → Cat widget: displays cat
- App coordinator → Cat sprite: renders frames
- Desktop user → Tray controller: uses tray
- Tray controller → Settings and quit popup: opens and configures (evidence: `src/module/TrayController.cpp`)
- Tray controller → Quit guard: checks quit attempts
- Tray controller → Auto-start: sets auto-start (evidence: `src/module/TrayController.cpp`)
- Settings and quit popup → Activity statistics: shows statistics
- Desktop OS → Desktop scanner: provides desktop state
- App coordinator → Runtime settings: reads settings (evidence: `src/module/CatApp.cpp`)
