# lorenzck/ontopreplica architecture

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

- Interactive diagram: https://gitdiagram.com/lorenzck/ontopreplica
- Repository: https://github.com/lorenzck/ontopreplica

## Overview

##### Main Components

a. Core Application Layer:
- Main Form Component (handles the primary UI and window management)
- Window Cloning Engine (DWM Thumbnail handling)
- Message Pump System (for Windows messages processing)
- Platform Support Layer (for different Windows versions)

b. Feature Modules:
- Region Management System
- Window Seeking System
- Switch System
- Update System
- Startup Options Handler

c. Native Integration Layer:
- Windows API Interfaces
- Shell Integration
- DWM Integration

**[User Interface Layer]**

- Main Form
- Side Panels
- Thumbnail Panel

**[Core Services Layer]**

- Window Management
- Message Pump System
- Platform Support

**[Feature Modules Layer]**

- Region Management
- Window Seeking
- Group Switching
- Updates

**[Native Integration Layer]**

- Windows API
- Shell Integration
- DWM Services

##### Key Relationships to Highlight

- How the MessagePumpManager orchestrates communication between components
- Relationship between WindowSeekers and the main window cloning functionality
- Demonstrate how Platform Support determines feature availability based on Windows version
- Interaction between Native Integration Layer and upper layers

##### Implementation Details

- How the WindowSeekers system finds and tracks windows
- Relationship between the main form and its child forms
- Startup options system and its command-line interface
- How the update system integrates with the main application

##### External Dependencies

- .NET Framework 4.7
- Windows DWM
- Windows Shell

- Line styles
- Component types
- Interaction patterns
- Platform-specific features

This will help other developers understand how the various components work together to provide the window cloning and management functionality.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef feature fill:#e67e22,stroke:#d35400,color:white
    classDef native fill:#95a5a6,stroke:#7f8c8d,color:white
    
    %% UI Layer
    subgraph UI
        MainForm["Main Form"]
        SidePanels["Side Panels"]
        ThumbnailPanel["Thumbnail Panel"]
    end
    
    %% Core Services Layer
    subgraph CoreServices
        WindowMgmt["Window Management"]
        MessagePump["Message Pump System"]
        PlatformSupport["Platform Support"]
    end
    
    %% Feature Modules Layer
    subgraph Features
        RegionMgmt["Region Management"]
        WindowSeeking["Window Seeking"]
        GroupSwitch["Group Switch"]
        Updates["Update System"]
        StartupOpt["Startup Options"]
    end
    
    %% Native Integration Layer
    subgraph Native
        WinAPI["Windows API"]
        ShellInteg["Shell Integration"]
        DWMServices["DWM Services"]
    end
    
    %% Relationships
    MainForm --> MessagePump
    MainForm --> WindowMgmt
    ThumbnailPanel --> WindowMgmt
    WindowMgmt --> DWMServices
    MessagePump --> WinAPI
    PlatformSupport --> WinAPI
    RegionMgmt --> WindowMgmt
    WindowSeeking --> WindowMgmt
    GroupSwitch --> MessagePump
    ShellInteg --> WinAPI
    
    %% Click Events
    click MainForm "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/MainForm.cs"
    click ThumbnailPanel "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/ThumbnailPanel.cs"
    click MessagePump "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/MessagePumpManager.cs"
    click PlatformSupport "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/PlatformSupport.cs"
    click RegionMgmt "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/StoredRegion.cs"
    click WindowSeeking "https://github.com/LorenzCK/OnTopReplica/tree/master/src/OnTopReplica/WindowSeekers"
    click GroupSwitch "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/MessagePumpProcessors/GroupSwitchManager.cs"
    click Updates "https://github.com/LorenzCK/OnTopReplica/tree/master/src/OnTopReplica/Update"
    click WinAPI "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/Native/WindowMethods.cs"
    click ShellInteg "https://github.com/LorenzCK/OnTopReplica/blob/master/src/OnTopReplica/Shell.cs"
    click StartupOpt "https://github.com/LorenzCK/OnTopReplica/tree/master/src/OnTopReplica/StartupOptions"
    
    %% Styling
    class MainForm,SidePanels,ThumbnailPanel ui
    class WindowMgmt,MessagePump,PlatformSupport core
    class RegionMgmt,WindowSeeking,GroupSwitch,Updates,StartupOpt feature
    class WinAPI,ShellInteg,DWMServices native
    
    %% Legend
    subgraph Legend
        UI_L["UI Components"]:::ui
        Core_L["Core Services"]:::core
        Feature_L["Feature Modules"]:::feature
        Native_L["Native Integration"]:::native
    end
```
