# timthedevguy/bghudappkit architecture

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

- Interactive diagram: https://gitdiagram.com/timthedevguy/bghudappkit
- Repository: https://github.com/timthedevguy/bghudappkit

## Overview

##### Main Components

a) Core Framework Layer:
- BGTheme System (Base theme infrastructure)
- Theme Manager (Singleton pattern)
- Common Utilities (BGHUDCommon, BGHUDGeometry)

b) UI Components Layer:
- Basic Controls (Button, Label, View)
- Input Controls (TextField, SearchField, SecureTextField)
- Complex Controls (TableView, OutlineView)
- Selection Controls (ComboBox, PopUpButton, Segmented)
- Indicator Controls (ProgressIndicator, Slider, Stepper)

c) Interface Builder Integration:
- IBPlugin Component
- Design-time Preview Support

**┌─────────────────────────────────────────────┐**
- Application Layer               │
- ┘
- ↓ ↑
**┌─────────────────────────────────────────────┐**
- BGHUDAppKit Framework             │
- ┬──────────────┬───────────┤
- Theme System   │ UI Controls  │ IB Plugin │
- ┌──────────┐   │ ┌──────────┐ │          │
- BGTheme   │   │ │Basic     │ │          │
- Manager   │   │ │Controls  │ │          │
- ┘   │ └──────────┘ │          │
- ┌──────────┐   │ ┌──────────┐ │          │
- Gradient  │   │ │Container │ │          │
- Theme     │   │ │Controls  │ │          │
- ┘   │ └──────────┘ │          │
- ┴──────────────┴───────────┘
- ↓ ↑
**┌─────────────────────────────────────────────┐**
- Cocoa Framework               │
- ┘

##### Important Relationships

- Theme inheritance hierarchy:
- BGTheme (base) → BGGradientTheme
- Relationship to BGThemeManager

- Control hierarchy:
- Controls by type (input, container, etc.)
- Inheritance from standard NSControl classes
- Theme application flow

##### Implementation Details

- That all drawing is done using native Cocoa drawing functions
- Resolution Independence support
- Framework embedding process in host applications
- OS version compatibility (10.5+)

##### Deployment Aspects

- Framework packaging structure
- Optional components (Resources directory)
- Integration points with host applications

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef application fill:#f9f,stroke:#333,stroke-width:2px
    classDef framework fill:#ddf,stroke:#333,stroke-width:2px
    classDef theme fill:#bbf,stroke:#333,stroke-width:2px
    classDef controls fill:#bfb,stroke:#333,stroke-width:2px
    classDef cocoa fill:#ddd,stroke:#333,stroke-width:2px

    %% Main Layers
    subgraph AppLayer["Application Layer"]
        App[Application]:::application
    end

    subgraph Framework["BGHUDAppKit Framework"]
        %% Theme System
        subgraph ThemeSystem["Theme System"]
            ThemeManager["Theme Manager"]
            BaseTheme["Base Theme"]
            GradientTheme["Gradient Theme"]
            CommonUtils["Common Utilities"]
        end

        %% UI Controls
        subgraph Controls["UI Controls"]
            subgraph BasicControls["Basic Controls"]
                View["View"]
                Label["Label"]
            end

            subgraph InputControls["Input Controls"]
                TextField["TextField"]
                SearchField["SearchField"]
                SecureField["SecureTextField"]
            end

            subgraph ContainerControls["Container Controls"]
                Box["Box"]
                ScrollView["ScrollView"]
                TabView["TabView"]
            end

            subgraph ComplexControls["Complex Controls"]
                TableView["TableView"]
                OutlineView["OutlineView"]
            end

            subgraph SelectionControls["Selection Controls"]
                ComboBox["ComboBox"]
                PopUpButton["PopUpButton"]
                Segmented["Segmented"]
            end

            subgraph IndicatorControls["Indicator Controls"]
                Progress["ProgressIndicator"]
                Slider["Slider"]
                Stepper["Stepper"]
            end
        end

        %% IB Integration
        IBPlugin["Interface Builder Plugin"]
    end

    subgraph CocoaLayer["Cocoa Framework"]
        Cocoa[Cocoa Base Classes]:::cocoa
    end

    %% Relationships
    App --> Framework
    Framework --> Cocoa
    ThemeManager --> BaseTheme
    BaseTheme --> GradientTheme
    Controls --> ThemeSystem
    IBPlugin --> Controls

    %% Click Events
    click ThemeManager "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGThemeManager.h"
    click BaseTheme "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGTheme.h"
    click GradientTheme "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGGradientTheme.h"
    click CommonUtils "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDCommon.h"
    click View "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDView.h"
    click Label "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDLabel.h"
    click TextField "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDTextFieldCell.h"
    click SearchField "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDSearchFieldCell.h"
    click SecureField "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDSecureTextFieldCell.h"
    click Box "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDBox.h"
    click ScrollView "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDScrollView.h"
    click TabView "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDTabView.h"
    click TableView "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDTableView.h"
    click OutlineView "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDOutlineView.h"
    click ComboBox "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDComboBoxCell.h"
    click PopUpButton "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDPopUpButtonCell.h"
    click Segmented "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDSegmentedCell.h"
    click Progress "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDProgressIndicator.h"
    click Slider "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDSliderCell.h"
    click Stepper "https://github.com/timthedevguy/BGHUDAppKit/blob/Without-Plugin/Framework/BGHUDStepperCell.h"

    %% Legend
    subgraph Legend["Legend"]
        L1[Application Layer]:::application
        L2[Framework Components]:::framework
        L3[Theme System]:::theme
        L4[UI Controls]:::controls
        L5[Cocoa Base]:::cocoa
    end
```
