# philosoph228/libnatsu architecture

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

- Interactive diagram: https://gitdiagram.com/philosoph228/libnatsu
- Repository: https://github.com/philosoph228/libnatsu

## Overview

This is a small C++ wrapper library for Win32 windows and common controls. An application includes `Win32.hpp`, creates or attaches a `Window`-derived wrapper, and uses its methods to manage window messages, control state, and optional dynamic layout. The tree also exposes image-list, utility, and DLL-loading helpers, plus a standalone GDI leak tracker. No README or implementation excerpts establish the details of unsampled control internals, so their links to Win32 are shown only where their wrapper role is evident.

Main entry points: [`Win32.hpp`](https://github.com/philosoph228/libnatsu/blob/master/Win32.hpp) (Public Include), [`Window.hpp`](https://github.com/philosoph228/libnatsu/blob/master/Window.hpp) (Window), [`ComboBox.hpp`](https://github.com/philosoph228/libnatsu/blob/master/ComboBox.hpp) (Combo Box), [`Dialog.hpp`](https://github.com/philosoph228/libnatsu/blob/master/Dialog.hpp) (Dialog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Window Core"]
  node_api["Public Include<br/>[Win32.hpp]"]
  node_base["Win32 Base<br/>[Base.hpp]"]
  node_window["Window<br/>[Window.hpp]"]
  node_windowmap["Window Map<br/>[WindowMap.hpp]"]
  node_layout["Dynamic Layout<br/>[DynamicLayout.hpp]"]
end

subgraph group_controls["Controls"]
  node_combobox["Combo Box<br/>[ComboBox.hpp]"]
  node_dialog["Dialog<br/>[Dialog.hpp]"]
  node_edit["Edit<br/>[Edit.hpp]"]
  node_listbox["List Box<br/>[ListBox.hpp]"]
  node_listview["List View<br/>[ListView.hpp]"]
  node_toolbar["Toolbar<br/>[Toolbar.hpp]"]
  node_treeview["Tree View<br/>[TreeView.hpp]"]
end

subgraph group_helpers["Runtime Helpers"]
  node_imagelist["Image List<br/>[ImageList.hpp]"]
  node_util["Utilities<br/>[Util.hpp]"]
  node_dll["Dynamic DLL<br/>[DynamicDLL.hpp]"]
  node_tracker["GDI Tracker<br/>[GDILeakTracker.hpp]"]
end

node_app(("Application"))
node_winapi["Win32 API"]
node_osdll["Loaded DLL"]

node_app -->|"includes"| node_api
node_api -->|"includes"| node_base
node_api -->|"includes"| node_window
node_api -->|"includes"| node_windowmap
node_api -->|"includes"| node_layout
node_api -->|"includes"| node_combobox
node_api -->|"includes"| node_dialog
node_api -->|"includes"| node_edit
node_api -->|"includes"| node_listbox
node_api -->|"includes"| node_listview
node_api -->|"includes"| node_toolbar
node_api -->|"includes"| node_treeview
node_api -->|"includes"| node_imagelist
node_api -->|"includes"| node_util
node_api -->|"includes"| node_dll
node_window -->|"manages"| node_layout
node_combobox -->|"extends"| node_window
node_dialog -->|"extends"| node_window
node_edit -->|"extends"| node_window
node_listbox -->|"extends"| node_window
node_listview -->|"extends"| node_window
node_toolbar -->|"extends"| node_window
node_treeview -->|"extends"| node_window
node_window -->|"dispatches"| node_winapi
node_combobox -->|"sends messages"| node_winapi
node_dialog -->|"uses"| node_winapi
node_listbox -->|"sends messages"| node_winapi
node_listview -->|"uses"| node_winapi
node_toolbar -->|"sends messages"| node_winapi
node_treeview -->|"uses"| node_winapi
node_imagelist -->|"calls"| node_winapi
node_util -->|"uses"| node_winapi
node_dll -->|"loads and resolves"| node_osdll
node_tracker -->|"wraps GDI calls"| node_winapi

click node_api "https://github.com/philosoph228/libnatsu/blob/master/Win32.hpp"
click node_base "https://github.com/philosoph228/libnatsu/blob/master/Base.hpp"
click node_window "https://github.com/philosoph228/libnatsu/blob/master/Window.hpp"
click node_windowmap "https://github.com/philosoph228/libnatsu/blob/master/WindowMap.hpp"
click node_layout "https://github.com/philosoph228/libnatsu/blob/master/DynamicLayout.hpp"
click node_combobox "https://github.com/philosoph228/libnatsu/blob/master/ComboBox.hpp"
click node_dialog "https://github.com/philosoph228/libnatsu/blob/master/Dialog.hpp"
click node_edit "https://github.com/philosoph228/libnatsu/blob/master/Edit.hpp"
click node_listbox "https://github.com/philosoph228/libnatsu/blob/master/ListBox.hpp"
click node_listview "https://github.com/philosoph228/libnatsu/blob/master/ListView.hpp"
click node_toolbar "https://github.com/philosoph228/libnatsu/blob/master/Toolbar.hpp"
click node_treeview "https://github.com/philosoph228/libnatsu/blob/master/TreeView.hpp"
click node_imagelist "https://github.com/philosoph228/libnatsu/blob/master/ImageList.hpp"
click node_util "https://github.com/philosoph228/libnatsu/blob/master/Util.hpp"
click node_dll "https://github.com/philosoph228/libnatsu/blob/master/DynamicDLL.hpp"
click node_tracker "https://github.com/philosoph228/libnatsu/blob/master/GDILeakTracker.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_api,node_base,node_window,node_windowmap,node_layout toneBlue
class node_combobox,node_dialog,node_edit,node_listbox,node_listview,node_toolbar,node_treeview toneAmber
class node_imagelist,node_util,node_dll,node_tracker,node_winapi toneMint
class node_app,node_osdll toneIndigo
```

## Components

### Window Core

- [Public Include](https://github.com/philosoph228/libnatsu/blob/master/Win32.hpp): `Win32.hpp`
- [Win32 Base](https://github.com/philosoph228/libnatsu/blob/master/Base.hpp): `Base.hpp`
- [Window](https://github.com/philosoph228/libnatsu/blob/master/Window.hpp): `Window.hpp`
- [Window Map](https://github.com/philosoph228/libnatsu/blob/master/WindowMap.hpp): `WindowMap.hpp`
- [Dynamic Layout](https://github.com/philosoph228/libnatsu/blob/master/DynamicLayout.hpp): `DynamicLayout.hpp`

### Controls

- [Combo Box](https://github.com/philosoph228/libnatsu/blob/master/ComboBox.hpp): `ComboBox.hpp`
- [Dialog](https://github.com/philosoph228/libnatsu/blob/master/Dialog.hpp): `Dialog.hpp`
- [Edit](https://github.com/philosoph228/libnatsu/blob/master/Edit.hpp): `Edit.hpp`
- [List Box](https://github.com/philosoph228/libnatsu/blob/master/ListBox.hpp): `ListBox.hpp`
- [List View](https://github.com/philosoph228/libnatsu/blob/master/ListView.hpp): `ListView.hpp`
- [Toolbar](https://github.com/philosoph228/libnatsu/blob/master/Toolbar.hpp): `Toolbar.hpp`
- [Tree View](https://github.com/philosoph228/libnatsu/blob/master/TreeView.hpp): `TreeView.hpp`

### Runtime Helpers

- [Image List](https://github.com/philosoph228/libnatsu/blob/master/ImageList.hpp): `ImageList.hpp`
- [Utilities](https://github.com/philosoph228/libnatsu/blob/master/Util.hpp): `Util.hpp`
- [Dynamic DLL](https://github.com/philosoph228/libnatsu/blob/master/DynamicDLL.hpp): `DynamicDLL.hpp`
- [GDI Tracker](https://github.com/philosoph228/libnatsu/blob/master/GDILeakTracker.hpp): `GDILeakTracker.hpp`

### Other components

- **Application**
- **Win32 API**
- **Loaded DLL**

## Connections

- Application → Public Include: includes
- Public Include → Win32 Base: includes
- Public Include → Window: includes
- Public Include → Window Map: includes
- Public Include → Dynamic Layout: includes
- Public Include → Combo Box: includes
- Public Include → Dialog: includes
- Public Include → Edit: includes
- Public Include → List Box: includes
- Public Include → List View: includes
- Public Include → Toolbar: includes
- Public Include → Tree View: includes
- Public Include → Image List: includes
- Public Include → Utilities: includes
- Public Include → Dynamic DLL: includes
- Window → Dynamic Layout: manages
- Combo Box → Window: extends
- Dialog → Window: extends
- Edit → Window: extends
- List Box → Window: extends
- List View → Window: extends
- Toolbar → Window: extends
- Tree View → Window: extends
- Window → Win32 API: dispatches
- Combo Box → Win32 API: sends messages
- Dialog → Win32 API: uses
- List Box → Win32 API: sends messages
- List View → Win32 API: uses
- Toolbar → Win32 API: sends messages
- Tree View → Win32 API: uses
- Image List → Win32 API: calls
- Utilities → Win32 API: uses
- Dynamic DLL → Loaded DLL: loads and resolves
- GDI Tracker → Win32 API: wraps GDI calls
