# ayub-kokabi/segah architecture

> Architecture diagram of the GitHub repository ayub-kokabi/segah, 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/ayub-kokabi/segah
- Repository: https://github.com/ayub-kokabi/segah

## Overview

Segah is a Windows taskbar calendar popover. Its main workflow is to locate taskbar clocks, assemble local and time.ir calendar data, then show dates and occasions on hover; users can open event links or an About card. The graph also preserves the installer and the shared rendering layer. Some application wiring is only visible through declarations and the source index, so those relationships are marked unverified rather than asserted as calls.

Main entry points: [`src/clock_app.cpp`](https://github.com/ayub-kokabi/segah/blob/main/src/clock_app.cpp) (Clock app), [`src/ui/tooltip_window.cpp`](https://github.com/ayub-kokabi/segah/blob/main/src/ui/tooltip_window.cpp) (Date popover), [`src/calendar/native_calendar.cpp`](https://github.com/ayub-kokabi/segah/blob/main/src/calendar/native_calendar.cpp) (Local calendar content), [`src/setup/main.cpp`](https://github.com/ayub-kokabi/segah/blob/main/src/setup/main.cpp) (Setup entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App orchestration"]
  node_entry["App entry<br/>[main.cpp]"]
  node_clockapp["Clock app<br/>[clock_app.cpp]"]
  node_messages["App messages<br/>[app_messages.hpp]"]
  node_locator["Clock locator"]
  node_tray["Tray icon<br/>[tray_icon.cpp]"]
end

subgraph group_calendar["Calendar data"]
  node_calendarservice["Calendar service"]
  node_jalali["Date conversion<br/>[jalali.cpp]"]
  node_nativecalendar["Local calendar content"]
end

subgraph group_presentation["Cards and rendering"]
  node_tooltip["Date popover<br/>[tooltip_window.cpp]"]
  node_about["About card<br/>[about_window.cpp]"]
  node_graphics["Shared graphics device"]
  node_surface["Composition surface"]
  node_paint["Direct2D painting<br/>[d2d_paint.cpp]"]
  node_motion["Card motion<br/>[card_motion.cpp]"]
end

subgraph group_setup["Install and removal"]
  node_setupentry["Setup entry<br/>[main.cpp]"]
  node_installer["Install and uninstall<br/>[install.cpp]"]
  node_splash["Setup splash<br/>[splash.cpp]"]
end

node_user(("Windows user"))
node_windows["Windows taskbar"]
node_timeir["time.ir"]
node_browser["Default browser"]

node_user -->|"hovers over"| node_windows
node_windows -.->|"clock interaction"| node_clockapp
node_entry -.->|"starts"| node_clockapp
node_clockapp -.->|"finds clocks"| node_locator
node_clockapp -.->|"requests dates"| node_calendarservice
node_clockapp -.->|"builds popover data"| node_nativecalendar
node_clockapp -.->|"shows popover"| node_tooltip
node_clockapp -.->|"opens About"| node_about
node_clockapp -.->|"uses tray controls"| node_tray
node_calendarservice -->|"fetches calendar"| node_timeir
node_calendarservice -.->|"provides snapshot"| node_nativecalendar
node_nativecalendar -->|"converts dates"| node_jalali
node_jalali -->|"returns dates"| node_nativecalendar
node_nativecalendar -.->|"provides content"| node_tooltip
node_tooltip -.->|"renders with"| node_graphics
node_about -.->|"renders with"| node_graphics
node_tooltip -->|"binds surface"| node_surface
node_tooltip -->|"attaches motion"| node_motion
node_tooltip -->|"opens event links"| node_browser
node_about -.->|"opens links"| node_browser
node_setupentry -->|"runs install"| node_installer
node_setupentry -->|"shows progress"| node_splash
node_setupentry -->|"launches after install"| node_clockapp

click node_entry "https://github.com/ayub-kokabi/segah/blob/main/src/main.cpp"
click node_clockapp "https://github.com/ayub-kokabi/segah/blob/main/src/clock_app.cpp"
click node_messages "https://github.com/ayub-kokabi/segah/blob/main/src/app_messages.hpp"
click node_locator "https://github.com/ayub-kokabi/segah/blob/main/src/taskbar/taskbar_clock_locator.cpp"
click node_tray "https://github.com/ayub-kokabi/segah/blob/main/src/taskbar/tray_icon.cpp"
click node_calendarservice "https://github.com/ayub-kokabi/segah/blob/main/src/calendar/calendar_service.cpp"
click node_jalali "https://github.com/ayub-kokabi/segah/blob/main/src/calendar/jalali.cpp"
click node_nativecalendar "https://github.com/ayub-kokabi/segah/blob/main/src/calendar/native_calendar.cpp"
click node_tooltip "https://github.com/ayub-kokabi/segah/blob/main/src/ui/tooltip_window.cpp"
click node_about "https://github.com/ayub-kokabi/segah/blob/main/src/ui/about_window.cpp"
click node_graphics "https://github.com/ayub-kokabi/segah/blob/main/src/graphics/graphics_device.cpp"
click node_surface "https://github.com/ayub-kokabi/segah/blob/main/src/graphics/composition_surface.cpp"
click node_paint "https://github.com/ayub-kokabi/segah/blob/main/src/graphics/d2d_paint.cpp"
click node_motion "https://github.com/ayub-kokabi/segah/blob/main/src/graphics/card_motion.cpp"
click node_setupentry "https://github.com/ayub-kokabi/segah/blob/main/src/setup/main.cpp"
click node_installer "https://github.com/ayub-kokabi/segah/blob/main/src/setup/install.cpp"
click node_splash "https://github.com/ayub-kokabi/segah/blob/main/src/setup/splash.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_entry,node_clockapp,node_messages,node_locator,node_tray,node_user,node_browser toneBlue
class node_calendarservice,node_jalali,node_nativecalendar toneAmber
class node_tooltip,node_about,node_graphics,node_surface,node_paint,node_motion toneMint
class node_setupentry,node_installer,node_splash,node_windows toneRose
class node_timeir toneIndigo
```

## Components

### App orchestration

- [App entry](https://github.com/ayub-kokabi/segah/blob/main/src/main.cpp): `src/main.cpp`
- [Clock app](https://github.com/ayub-kokabi/segah/blob/main/src/clock_app.cpp): `src/clock_app.cpp`
- [App messages](https://github.com/ayub-kokabi/segah/blob/main/src/app_messages.hpp): `src/app_messages.hpp`
- [Clock locator](https://github.com/ayub-kokabi/segah/blob/main/src/taskbar/taskbar_clock_locator.cpp): `src/taskbar/taskbar_clock_locator.cpp`
- [Tray icon](https://github.com/ayub-kokabi/segah/blob/main/src/taskbar/tray_icon.cpp): `src/taskbar/tray_icon.cpp`

### Calendar data

- [Calendar service](https://github.com/ayub-kokabi/segah/blob/main/src/calendar/calendar_service.cpp): `src/calendar/calendar_service.cpp`
- [Date conversion](https://github.com/ayub-kokabi/segah/blob/main/src/calendar/jalali.cpp): `src/calendar/jalali.cpp`
- [Local calendar content](https://github.com/ayub-kokabi/segah/blob/main/src/calendar/native_calendar.cpp): `src/calendar/native_calendar.cpp`

### Cards and rendering

- [Date popover](https://github.com/ayub-kokabi/segah/blob/main/src/ui/tooltip_window.cpp): `src/ui/tooltip_window.cpp`
- [About card](https://github.com/ayub-kokabi/segah/blob/main/src/ui/about_window.cpp): `src/ui/about_window.cpp`
- [Shared graphics device](https://github.com/ayub-kokabi/segah/blob/main/src/graphics/graphics_device.cpp): `src/graphics/graphics_device.cpp`
- [Composition surface](https://github.com/ayub-kokabi/segah/blob/main/src/graphics/composition_surface.cpp): `src/graphics/composition_surface.cpp`
- [Direct2D painting](https://github.com/ayub-kokabi/segah/blob/main/src/graphics/d2d_paint.cpp): `src/graphics/d2d_paint.cpp`
- [Card motion](https://github.com/ayub-kokabi/segah/blob/main/src/graphics/card_motion.cpp): `src/graphics/card_motion.cpp`

### Install and removal

- [Setup entry](https://github.com/ayub-kokabi/segah/blob/main/src/setup/main.cpp): `src/setup/main.cpp`
- [Install and uninstall](https://github.com/ayub-kokabi/segah/blob/main/src/setup/install.cpp): `src/setup/install.cpp`
- [Setup splash](https://github.com/ayub-kokabi/segah/blob/main/src/setup/splash.cpp): `src/setup/splash.cpp`

### Other components

- **Windows user**
- **Windows taskbar**
- **time.ir**
- **Default browser**

## Connections

- Windows user → Windows taskbar: hovers over (evidence: `README.md`)
- Windows taskbar → Clock app: clock interaction
- App entry → Clock app: starts
- Clock app → Clock locator: finds clocks
- Clock app → Calendar service: requests dates
- Clock app → Local calendar content: builds popover data
- Clock app → Date popover: shows popover
- Clock app → About card: opens About
- Clock app → Tray icon: uses tray controls
- Calendar service → time.ir: fetches calendar
- Calendar service → Local calendar content: provides snapshot
- Local calendar content → Date conversion: converts dates (evidence: `src/calendar/native_calendar.cpp`)
- Date conversion → Local calendar content: returns dates (evidence: `src/calendar/native_calendar.cpp`)
- Local calendar content → Date popover: provides content
- Date popover → Shared graphics device: renders with
- About card → Shared graphics device: renders with
- Date popover → Composition surface: binds surface (evidence: `src/ui/tooltip_window.cpp`)
- Date popover → Card motion: attaches motion (evidence: `src/ui/tooltip_window.cpp`)
- Date popover → Default browser: opens event links (evidence: `src/ui/tooltip_window.cpp`)
- About card → Default browser: opens links
- Setup entry → Install and uninstall: runs install (evidence: `src/setup/main.cpp`)
- Setup entry → Setup splash: shows progress (evidence: `src/setup/main.cpp`)
- Setup entry → Clock app: launches after install (evidence: `src/setup/main.cpp`)
