# aragajaga/panitent architecture

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

- Interactive diagram: https://gitdiagram.com/aragajaga/panitent
- Repository: https://github.com/aragajaga/panitent

## Overview

Panit.ent is a discontinued Windows graphics editor. Its apparent user workflow is to open or resume a workspace, arrange dockable panels and floating documents, then edit a canvas with drawing tools. The tree also shows rendering, color, palette, history, recovery, and sharing subsystems, though their full workflows are not documented in the excerpts. The strongest visible call evidence concerns layout application and floating-document session capture/restore; other relationships are omitted rather than inferred from filenames or imports.

Main entry points: [`src/dock/layout/windowlayoutmanager.c`](https://github.com/aragajaga/panitent/blob/master/src/dock/layout/windowlayoutmanager.c) (Layout manager), [`src/dock/floating/floatingdocumentsessionpersist.c`](https://github.com/aragajaga/panitent/blob/master/src/dock/floating/floatingdocumentsessionpersist.c) (Floating sessions), [`src/tools/rectangletool.c`](https://github.com/aragajaga/panitent/blob/master/src/tools/rectangletool.c) (Drawing tools), [`src/dock/host/dockhost.h`](https://github.com/aragajaga/panitent/blob/master/src/dock/host/dockhost.h) (Dock host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_application["Windows application<br/>[application.c]"]
  node_app_core["Editor application<br/>[panitentapp.h]"]
end

subgraph group_editing["Graphics editing"]
  node_document["Document model<br/>[document.h]"]
  node_canvas["Canvas view<br/>[canvas.c]"]
  node_viewport["Viewport<br/>[viewport.h]"]
  node_drawing_tools["Drawing tools<br/>[rectangletool.c]"]
  node_shape_engine["Shape engine<br/>[shapecontext.c]"]
end

subgraph group_docking["Docking and layouts"]
  node_dock_host["Dock host<br/>[dockhost.h]"]
  node_dock_drag["Dock dragging<br/>[dockhostdrag.c]"]
  node_layout_manager["Layout manager"]
  node_dock_model["Dock model<br/>[dockmodel.h]"]
  node_layout_catalog["Layout catalog"]
  node_floating_windows["Floating windows"]
end

subgraph group_persistence["Documents and persistence"]
  node_doc_sessions["Workspace sessions"]
  node_floating_sessions["Floating sessions"]
  node_recovery["Document recovery<br/>[documentrecovery.h]"]
end

subgraph group_integrations["Supporting capabilities"]
  node_sharing["Activity sharing"]
  node_sharing_client["Sharing clients"]
end

node_user(("Editor user"))

node_user -.->|"starts editor"| node_application
node_application -.->|"runs"| node_app_core
node_layout_manager -->|"sets layout"| node_dock_host
node_layout_manager -->|"rearranges"| node_dock_host
node_layout_manager -->|"validates model"| node_dock_model
node_layout_manager -->|"loads catalog"| node_layout_catalog
node_dock_drag -->|"undocks to"| node_floating_windows
node_dock_drag -->|"hit-tests"| node_dock_host
node_floating_sessions -->|"captures sessions"| node_doc_sessions
node_floating_sessions -->|"restores sessions"| node_doc_sessions
node_floating_sessions -->|"uses recovery paths"| node_recovery
node_floating_sessions -->|"restores workspaces"| node_floating_windows
node_sharing -->|"dispatches status"| node_sharing_client
node_drawing_tools -->|"uses document"| node_document
node_drawing_tools -->|"uses viewport"| node_viewport
node_drawing_tools -->|"uses shape context"| node_shape_engine

click node_application "https://github.com/aragajaga/panitent/blob/master/src/win32/application.c"
click node_app_core "https://github.com/aragajaga/panitent/blob/master/src/panitentapp.h"
click node_document "https://github.com/aragajaga/panitent/blob/master/src/document.h"
click node_canvas "https://github.com/aragajaga/panitent/blob/master/src/canvas.c"
click node_viewport "https://github.com/aragajaga/panitent/blob/master/src/viewport.h"
click node_drawing_tools "https://github.com/aragajaga/panitent/blob/master/src/tools/rectangletool.c"
click node_shape_engine "https://github.com/aragajaga/panitent/blob/master/src/grimstroke/shapecontext.c"
click node_dock_host "https://github.com/aragajaga/panitent/blob/master/src/dock/host/dockhost.h"
click node_dock_drag "https://github.com/aragajaga/panitent/blob/master/src/dock/host/dockhostdrag.c"
click node_layout_manager "https://github.com/aragajaga/panitent/blob/master/src/dock/layout/windowlayoutmanager.c"
click node_dock_model "https://github.com/aragajaga/panitent/blob/master/src/dock/model/dockmodel.h"
click node_layout_catalog "https://github.com/aragajaga/panitent/blob/master/src/dock/layout/windowlayoutcatalog.h"
click node_floating_windows "https://github.com/aragajaga/panitent/blob/master/src/dock/floating/floatingwindowcontainer.h"
click node_doc_sessions "https://github.com/aragajaga/panitent/blob/master/src/documentsessionworkspace.h"
click node_floating_sessions "https://github.com/aragajaga/panitent/blob/master/src/dock/floating/floatingdocumentsessionpersist.c"
click node_recovery "https://github.com/aragajaga/panitent/blob/master/src/documentrecovery.h"
click node_sharing "https://github.com/aragajaga/panitent/blob/master/src/sharing/activitysharingmanager.c"
click node_sharing_client "https://github.com/aragajaga/panitent/blob/master/src/sharing/activitysharingclient.h"

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_application,node_app_core,node_user toneBlue
class node_document,node_canvas,node_viewport,node_drawing_tools,node_shape_engine toneAmber
class node_dock_host,node_dock_drag,node_layout_manager,node_dock_model,node_layout_catalog,node_floating_windows toneMint
class node_doc_sessions,node_floating_sessions,node_recovery toneRose
class node_sharing,node_sharing_client toneIndigo
```

## Components

### Application shell

- [Windows application](https://github.com/aragajaga/panitent/blob/master/src/win32/application.c): `src/win32/application.c`
- [Editor application](https://github.com/aragajaga/panitent/blob/master/src/panitentapp.h): `src/panitentapp.h`

### Graphics editing

- [Document model](https://github.com/aragajaga/panitent/blob/master/src/document.h): `src/document.h`
- [Canvas view](https://github.com/aragajaga/panitent/blob/master/src/canvas.c): `src/canvas.c`
- [Viewport](https://github.com/aragajaga/panitent/blob/master/src/viewport.h): `src/viewport.h`
- [Drawing tools](https://github.com/aragajaga/panitent/blob/master/src/tools/rectangletool.c): `src/tools/rectangletool.c`
- [Shape engine](https://github.com/aragajaga/panitent/blob/master/src/grimstroke/shapecontext.c): `src/grimstroke/shapecontext.c`

### Docking and layouts

- [Dock host](https://github.com/aragajaga/panitent/blob/master/src/dock/host/dockhost.h): `src/dock/host/dockhost.h`
- [Dock dragging](https://github.com/aragajaga/panitent/blob/master/src/dock/host/dockhostdrag.c): `src/dock/host/dockhostdrag.c`
- [Layout manager](https://github.com/aragajaga/panitent/blob/master/src/dock/layout/windowlayoutmanager.c): `src/dock/layout/windowlayoutmanager.c`
- [Dock model](https://github.com/aragajaga/panitent/blob/master/src/dock/model/dockmodel.h): `src/dock/model/dockmodel.h`
- [Layout catalog](https://github.com/aragajaga/panitent/blob/master/src/dock/layout/windowlayoutcatalog.h): `src/dock/layout/windowlayoutcatalog.h`
- [Floating windows](https://github.com/aragajaga/panitent/blob/master/src/dock/floating/floatingwindowcontainer.h): `src/dock/floating/floatingwindowcontainer.h`

### Documents and persistence

- [Workspace sessions](https://github.com/aragajaga/panitent/blob/master/src/documentsessionworkspace.h): `src/documentsessionworkspace.h`
- [Floating sessions](https://github.com/aragajaga/panitent/blob/master/src/dock/floating/floatingdocumentsessionpersist.c): `src/dock/floating/floatingdocumentsessionpersist.c`
- [Document recovery](https://github.com/aragajaga/panitent/blob/master/src/documentrecovery.h): `src/documentrecovery.h`

### Supporting capabilities

- [Activity sharing](https://github.com/aragajaga/panitent/blob/master/src/sharing/activitysharingmanager.c): `src/sharing/activitysharingmanager.c`
- [Sharing clients](https://github.com/aragajaga/panitent/blob/master/src/sharing/activitysharingclient.h): `src/sharing/activitysharingclient.h`

### Other components

- **Editor user**

## Connections

- Editor user → Windows application: starts editor
- Windows application → Editor application: runs
- Layout manager → Dock host: sets layout (evidence: `src/dock/layout/windowlayoutmanager.c`)
- Layout manager → Dock host: rearranges (evidence: `src/dock/layout/windowlayoutmanager.c`)
- Layout manager → Dock model: validates model (evidence: `src/dock/layout/windowlayoutmanager.c`)
- Layout manager → Layout catalog: loads catalog (evidence: `src/dock/layout/windowlayoutmanager.c`)
- Dock dragging → Floating windows: undocks to (evidence: `src/dock/host/dockhostdrag.c`)
- Dock dragging → Dock host: hit-tests (evidence: `src/dock/host/dockhostdrag.c`)
- Floating sessions → Workspace sessions: captures sessions (evidence: `src/dock/floating/floatingdocumentsessionpersist.c`)
- Floating sessions → Workspace sessions: restores sessions (evidence: `src/dock/floating/floatingdocumentsessionpersist.c`)
- Floating sessions → Document recovery: uses recovery paths (evidence: `src/dock/floating/floatingdocumentsessionpersist.c`)
- Floating sessions → Floating windows: restores workspaces (evidence: `src/dock/floating/floatingdocumentsessionpersist.c`)
- Activity sharing → Sharing clients: dispatches status (evidence: `src/sharing/activitysharingmanager.c`)
- Drawing tools → Document model: uses document (evidence: `src/tools/rectangletool.c`)
- Drawing tools → Viewport: uses viewport (evidence: `src/tools/rectangletool.c`)
- Drawing tools → Shape engine: uses shape context (evidence: `src/tools/rectangletool.c`)
