# aidan729/nice-plug-slint architecture

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

- Interactive diagram: https://gitdiagram.com/aidan729/nice-plug-slint
- Repository: https://github.com/aidan729/nice-plug-slint

## Overview

nice-plug-slint adapts a Slint component to a nice-plug editor using a baseview window and FemtoVG/OpenGL rendering. The principal workflow is: a plugin supplies persisted editor state and a component factory; opening the editor creates a baseview window and Slint component; setup registers UI-to-plugin callbacks, while the per-frame handler can push plugin values back to the UI. The adapter also forwards input and handles resizing. The graph reflects the sampled excerpts and README; unsampled implementation details are omitted.

Main entry points: [`src/lib.rs`](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs) (Slint Editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor_api["Editor API"]
  node_editor["Slint Editor<br/>[lib.rs]"]
  node_editor_state["Editor State<br/>[lib.rs]"]
  node_component_factory["Component Factory<br/>[lib.rs]"]
  node_component["Slint Component"]
end

subgraph group_window_render["Window And Rendering"]
  node_baseview["Baseview Window<br/>[lib.rs]"]
  node_platform["Slint Platform Bridge<br/>[lib.rs]"]
  node_adapter["Window Adapter<br/>[lib.rs]"]
  node_gl_interface["OpenGL Interface<br/>[lib.rs]"]
  node_renderer["FemtoVG Renderer<br/>[lib.rs]"]
end

subgraph group_events_state["Events And State"]
  node_handler["Window Handler<br/>[lib.rs]"]
  node_setup["Setup Callback<br/>[lib.rs]"]
  node_frame_callback["Frame Callback<br/>[lib.rs]"]
  node_input_bridge["Input Bridge<br/>[lib.rs]"]
end

node_plugin(("Plugin Host"))
node_plugin_params["Plugin Parameters"]
node_gui_context["GUI Context"]

node_plugin -->|"creates editor"| node_editor
node_plugin -->|"persists state"| node_editor_state
node_editor -->|"opens window"| node_baseview
node_editor -->|"stores factory"| node_component_factory
node_baseview -->|"installs platform"| node_platform
node_platform -->|"creates adapter"| node_adapter
node_editor -->|"sets current adapter"| node_adapter
node_component_factory -->|"creates component"| node_component
node_adapter -->|"provides rendering"| node_renderer
node_baseview -->|"supplies GL context"| node_gl_interface
node_gl_interface -->|"loads OpenGL"| node_renderer
node_baseview -->|"receives input"| node_input_bridge
node_input_bridge -->|"dispatches events"| node_adapter
node_editor -->|"provides callbacks"| node_handler
node_handler -->|"runs on open"| node_setup
node_handler -->|"runs each frame"| node_frame_callback
node_setup -->|"registers callbacks"| node_component
node_setup -->|"updates parameters"| node_plugin_params
node_frame_callback -->|"pushes values"| node_component
node_frame_callback -->|"reads values"| node_plugin_params
node_handler -->|"exposes context"| node_gui_context
node_handler -->|"queues resize"| node_editor_state

click node_editor "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_editor_state "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_component_factory "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_baseview "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_platform "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_adapter "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_gl_interface "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_renderer "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_handler "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_setup "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_frame_callback "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"
click node_input_bridge "https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs"

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_editor,node_editor_state,node_component_factory,node_component,node_gui_context toneBlue
class node_baseview,node_platform,node_adapter,node_gl_interface,node_renderer toneAmber
class node_handler,node_setup,node_frame_callback,node_input_bridge toneMint
class node_plugin,node_plugin_params toneIndigo
```

## Components

### Editor API

- [Slint Editor](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [Editor State](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [Component Factory](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- **Slint Component**

### Window And Rendering

- [Baseview Window](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [Slint Platform Bridge](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [Window Adapter](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [OpenGL Interface](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [FemtoVG Renderer](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`

### Events And State

- [Window Handler](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [Setup Callback](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [Frame Callback](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`
- [Input Bridge](https://github.com/aidan729/nice-plug-slint/blob/master/src/lib.rs): `src/lib.rs`

### Other components

- **Plugin Host**
- **Plugin Parameters**
- **GUI Context**

## Connections

- Plugin Host → Slint Editor: creates editor (evidence: `README.md`)
- Plugin Host → Editor State: persists state (evidence: `README.md`)
- Slint Editor → Baseview Window: opens window (evidence: `src/lib.rs`)
- Slint Editor → Component Factory: stores factory (evidence: `src/lib.rs`)
- Baseview Window → Slint Platform Bridge: installs platform (evidence: `src/lib.rs`)
- Slint Platform Bridge → Window Adapter: creates adapter (evidence: `src/lib.rs`)
- Slint Editor → Window Adapter: sets current adapter (evidence: `src/lib.rs`)
- Component Factory → Slint Component: creates component (evidence: `src/lib.rs`)
- Window Adapter → FemtoVG Renderer: provides rendering (evidence: `src/lib.rs`)
- Baseview Window → OpenGL Interface: supplies GL context (evidence: `src/lib.rs`)
- OpenGL Interface → FemtoVG Renderer: loads OpenGL (evidence: `src/lib.rs`)
- Baseview Window → Input Bridge: receives input (evidence: `src/lib.rs`)
- Input Bridge → Window Adapter: dispatches events (evidence: `src/lib.rs`)
- Slint Editor → Window Handler: provides callbacks (evidence: `README.md`)
- Window Handler → Setup Callback: runs on open (evidence: `README.md`)
- Window Handler → Frame Callback: runs each frame (evidence: `README.md`)
- Setup Callback → Slint Component: registers callbacks (evidence: `README.md`)
- Setup Callback → Plugin Parameters: updates parameters (evidence: `README.md`)
- Frame Callback → Slint Component: pushes values (evidence: `README.md`)
- Frame Callback → Plugin Parameters: reads values (evidence: `README.md`)
- Window Handler → GUI Context: exposes context (evidence: `src/lib.rs`)
- Window Handler → Editor State: queues resize (evidence: `src/lib.rs`)
