# xiaojoo/wallpaper architecture

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

- Interactive diagram: https://gitdiagram.com/xiaojoo/wallpaper
- Repository: https://github.com/xiaojoo/wallpaper

## Overview

Wallpaper is a Windows live-wallpaper engine with a separate settings application. The main workflow is to load configuration and wallpaper packages, assign them to monitors, render them as desktop wallpaper, and accept runtime control commands; the settings app can control the renderer and display a live preview. The graph combines sampled source references with README-documented capabilities. Some implementation paths, especially the settings UI and several renderer subsystems, were not sampled, so those relationships are included only where documented.

Main entry points: [`Engine/App/Application.cpp`](https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/Application.cpp) (Renderer application), [`Wallpaper/main.cpp`](https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/main.cpp) (Settings application), [`Engine/Packages/WallpaperManager.cpp`](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/WallpaperManager.cpp) (Config and catalog), [`Engine/Desktop/DesktopWindow.cpp`](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Desktop/DesktopWindow.cpp) (Monitor windows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Applications and control"]
  node_renderer_entry["Renderer entry<br/>[main.cpp]"]
  node_application["Renderer application<br/>[Application.cpp]"]
  node_ipc["IPC commands<br/>[IPCServer.hpp]"]
  node_tray["Renderer tray<br/>[Tray.cpp]"]
end

subgraph group_wallpapers["Wallpaper selection"]
  node_config["Config and catalog"]
  node_packages["Wallpaper packages"]
  node_instances["Wallpaper instances"]
  node_thumbnails["Package thumbnails<br/>[Thumbnailer.cpp]"]
  node_config_store["Config file"]
end

subgraph group_rendering["Desktop rendering"]
  node_monitors["Monitor discovery<br/>[MonitorManager.cpp]"]
  node_desktop_host["Desktop host<br/>[WorkerW.cpp]"]
  node_desktop_windows["Monitor windows<br/>[DesktopWindow.cpp]"]
  node_device["D3D11 device<br/>[D3D11Device.cpp]"]
  node_renderer["D3D11 renderer<br/>[D3D11Renderer.cpp]"]
  node_video["FFmpeg playback<br/>[FFmpegPlayer.cpp]"]
  node_particles["GPU particles<br/>[ParticleSystem.cpp]"]
  node_pacing["Frame pacing<br/>[FPSController.cpp]"]
  node_power["Power adaptation<br/>[PowerManager.cpp]"]
end

subgraph group_settings["Settings and preview"]
  node_settings_app["Settings application<br/>[main.cpp]"]
  node_bridge["Renderer bridge<br/>[Bridge.cpp]"]
  node_preview_stream["Shared preview stream<br/>[PreviewStream.hpp]"]
  node_live_preview["Live preview view<br/>[LivePreview.cpp]"]
  node_settings_tray["Settings tray menu<br/>[TrayMenu.cpp]"]
end

node_user(("User"))
node_settings_user(("Settings user"))
node_desktop["Windows desktop"]
node_pipe["Named pipe"]

node_user -->|"launches"| node_renderer_entry
node_renderer_entry -->|"starts"| node_application
node_user -->|"sends commands"| node_ipc
node_ipc -->|"uses"| node_pipe
node_application -->|"handles commands"| node_ipc
node_application -->|"loads settings"| node_config
node_config -->|"reads and writes"| node_config_store
node_config -->|"scans catalog"| node_packages
node_application -->|"refreshes"| node_monitors
node_application -->|"attaches desktop"| node_desktop_host
node_application -->|"creates monitor windows"| node_desktop_windows
node_desktop_windows -->|"uses host"| node_desktop_host
node_application -->|"selects and draws"| node_instances
node_instances -.->|"loads package"| node_packages
node_application -->|"renders frames"| node_renderer
node_renderer -->|"uses device"| node_device
node_application -->|"initializes"| node_device
node_application -->|"paces slots"| node_pacing
node_application -->|"applies power decisions"| node_power
node_application -->|"plays video packages"| node_video
node_application -.->|"draws particle wallpapers"| node_particles
node_application -->|"builds thumbnails"| node_thumbnails
node_application -.->|"provides controls"| node_tray
node_settings_user -->|"uses"| node_settings_app
node_settings_app -->|"controls renderer"| node_bridge
node_bridge -->|"sends commands"| node_pipe
node_application -->|"publishes frames"| node_preview_stream
node_bridge -.->|"opens preview"| node_preview_stream
node_live_preview -->|"reads frames"| node_preview_stream
node_settings_app -->|"shows preview"| node_live_preview
node_settings_app -.->|"provides controls"| node_settings_tray
node_desktop_windows -.->|"presents wallpaper"| node_desktop

click node_renderer_entry "https://github.com/xiaojoo/wallpaper/blob/main/main.cpp"
click node_application "https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/Application.cpp"
click node_ipc "https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/IPCServer.hpp"
click node_tray "https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/Tray.cpp"
click node_config "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/WallpaperManager.cpp"
click node_packages "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/WallpaperPackage.cpp"
click node_instances "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/WallpaperInstance.cpp"
click node_thumbnails "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/Thumbnailer.cpp"
click node_monitors "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Desktop/MonitorManager.cpp"
click node_desktop_host "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Desktop/WorkerW.cpp"
click node_desktop_windows "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Desktop/DesktopWindow.cpp"
click node_device "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/D3D11Device.cpp"
click node_renderer "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/D3D11Renderer.cpp"
click node_video "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/FFmpegPlayer.cpp"
click node_particles "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/ParticleSystem.cpp"
click node_pacing "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Performance/FPSController.cpp"
click node_power "https://github.com/xiaojoo/wallpaper/blob/main/Engine/Performance/PowerManager.cpp"
click node_settings_app "https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/main.cpp"
click node_bridge "https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/Bridge.cpp"
click node_preview_stream "https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/PreviewStream.hpp"
click node_live_preview "https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/LivePreview.cpp"
click node_settings_tray "https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/TrayMenu.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_renderer_entry,node_application,node_ipc,node_tray,node_user,node_settings_user toneBlue
class node_config,node_packages,node_instances,node_thumbnails,node_config_store toneAmber
class node_monitors,node_desktop_host,node_desktop_windows,node_device,node_renderer,node_video,node_particles,node_pacing,node_power toneMint
class node_settings_app,node_bridge,node_preview_stream,node_live_preview,node_settings_tray toneRose
class node_desktop,node_pipe toneIndigo
```

## Components

### Applications and control

- [Renderer entry](https://github.com/xiaojoo/wallpaper/blob/main/main.cpp): `main.cpp`
- [Renderer application](https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/Application.cpp): `Engine/App/Application.cpp`
- [IPC commands](https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/IPCServer.hpp): `Engine/App/IPCServer.hpp`
- [Renderer tray](https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/Tray.cpp): `Engine/App/Tray.cpp`

### Wallpaper selection

- [Config and catalog](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/WallpaperManager.cpp): `Engine/Packages/WallpaperManager.cpp`
- [Wallpaper packages](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/WallpaperPackage.cpp): `Engine/Packages/WallpaperPackage.cpp`
- [Wallpaper instances](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/WallpaperInstance.cpp): `Engine/Packages/WallpaperInstance.cpp`
- [Package thumbnails](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Packages/Thumbnailer.cpp): `Engine/Packages/Thumbnailer.cpp`
- **Config file**

### Desktop rendering

- [Monitor discovery](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Desktop/MonitorManager.cpp): `Engine/Desktop/MonitorManager.cpp`
- [Desktop host](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Desktop/WorkerW.cpp): `Engine/Desktop/WorkerW.cpp`
- [Monitor windows](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Desktop/DesktopWindow.cpp): `Engine/Desktop/DesktopWindow.cpp`
- [D3D11 device](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/D3D11Device.cpp): `Engine/Graphics/D3D11Device.cpp`
- [D3D11 renderer](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/D3D11Renderer.cpp): `Engine/Graphics/D3D11Renderer.cpp`
- [FFmpeg playback](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/FFmpegPlayer.cpp): `Engine/Graphics/FFmpegPlayer.cpp`
- [GPU particles](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Graphics/ParticleSystem.cpp): `Engine/Graphics/ParticleSystem.cpp`
- [Frame pacing](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Performance/FPSController.cpp): `Engine/Performance/FPSController.cpp`
- [Power adaptation](https://github.com/xiaojoo/wallpaper/blob/main/Engine/Performance/PowerManager.cpp): `Engine/Performance/PowerManager.cpp`

### Settings and preview

- [Settings application](https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/main.cpp): `Wallpaper/main.cpp`
- [Renderer bridge](https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/Bridge.cpp): `Wallpaper/Bridge.cpp`
- [Shared preview stream](https://github.com/xiaojoo/wallpaper/blob/main/Engine/App/PreviewStream.hpp): `Engine/App/PreviewStream.hpp`
- [Live preview view](https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/LivePreview.cpp): `Wallpaper/LivePreview.cpp`
- [Settings tray menu](https://github.com/xiaojoo/wallpaper/blob/main/Wallpaper/TrayMenu.cpp): `Wallpaper/TrayMenu.cpp`

### Other components

- **User**
- **Settings user**
- **Windows desktop**
- **Named pipe**

## Connections

- User → Renderer entry: launches
- Renderer entry → Renderer application: starts (evidence: `main.cpp`)
- User → IPC commands: sends commands
- IPC commands → Named pipe: uses
- Renderer application → IPC commands: handles commands (evidence: `Engine/App/Application.cpp`)
- Renderer application → Config and catalog: loads settings
- Config and catalog → Config file: reads and writes (evidence: `Engine/Packages/WallpaperManager.cpp`)
- Config and catalog → Wallpaper packages: scans catalog (evidence: `Engine/Packages/WallpaperManager.cpp`)
- Renderer application → Monitor discovery: refreshes (evidence: `Engine/App/Application.cpp`)
- Renderer application → Desktop host: attaches desktop
- Renderer application → Monitor windows: creates monitor windows (evidence: `Engine/App/Application.cpp`)
- Monitor windows → Desktop host: uses host
- Renderer application → Wallpaper instances: selects and draws
- Wallpaper instances → Wallpaper packages: loads package
- Renderer application → D3D11 renderer: renders frames (evidence: `Engine/App/Application.cpp`)
- D3D11 renderer → D3D11 device: uses device
- Renderer application → D3D11 device: initializes (evidence: `Engine/App/Application.cpp`)
- Renderer application → Frame pacing: paces slots
- Renderer application → Power adaptation: applies power decisions
- Renderer application → FFmpeg playback: plays video packages (evidence: `Engine/App/Application.cpp`)
- Renderer application → GPU particles: draws particle wallpapers
- Renderer application → Package thumbnails: builds thumbnails
- Renderer application → Renderer tray: provides controls
- Settings user → Settings application: uses
- Settings application → Renderer bridge: controls renderer (evidence: `Wallpaper/main.cpp`)
- Renderer bridge → Named pipe: sends commands
- Renderer application → Shared preview stream: publishes frames (evidence: `Engine/App/Application.cpp`)
- Renderer bridge → Shared preview stream: opens preview
- Live preview view → Shared preview stream: reads frames
- Settings application → Live preview view: shows preview (evidence: `Wallpaper/main.cpp`)
- Settings application → Settings tray menu: provides controls
- Monitor windows → Windows desktop: presents wallpaper
