# mikke89/rmlui architecture

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

- Interactive diagram: https://gitdiagram.com/mikke89/rmlui
- Repository: https://github.com/mikke89/rmlui

## Overview

RmlUi is an embeddable C++ HTML/CSS-like UI library for games and applications. The principal workflow is application setup and input, document loading, element/style processing and layout, then generation of renderable geometry for the host renderer. The map also preserves documented capabilities such as data binding, controls, animation, templates, sprites, debugging, and optional Lua/SVG extensions. Several feature paths are documented but their implementation was not sampled; those links are shown as documented rather than inferred from code.

Main entry points: [`Source/Core/Context.cpp`](https://github.com/mikke89/rmlui/blob/master/Source/Core/Context.cpp) (UI Context), [`Source/Core/XMLParser.cpp`](https://github.com/mikke89/rmlui/blob/master/Source/Core/XMLParser.cpp) (Document Parser), [`Include/RmlUi/Core/Core.h`](https://github.com/mikke89/rmlui/blob/master/Include/RmlUi/Core/Core.h) (Core API), [`Source/Core/Element.cpp`](https://github.com/mikke89/rmlui/blob/master/Source/Core/Element.cpp) (Element DOM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["UI Runtime"]
  node_core_api["Core API<br/>[Core.h]"]
  node_context["UI Context<br/>[Context.cpp]"]
  node_controls["UI Controls"]
  node_animation["Animation"]
  node_events["Event System"]
end

subgraph group_documents["Documents And Layout"]
  node_document_parser["Document Parser<br/>[XMLParser.cpp]"]
  node_dom["Element DOM<br/>[Element.cpp]"]
  node_styles["Style System"]
  node_layout["Layout Engine<br/>[LayoutEngine.cpp]"]
  node_templates["Templates<br/>[Template.cpp]"]
  node_sprites["Sprite Sheets<br/>[Spritesheet.cpp]"]
end

subgraph group_render["Rendering And Platform"]
  node_render_manager["Render Manager<br/>[RenderManager.cpp]"]
  node_render_interface["Render Interface<br/>[RenderInterface.h]"]
  node_backend["Renderer Backend"]
  node_platform["Platform Backend"]
end

subgraph group_services["Fonts And Data"]
  node_data_binding["Data Binding<br/>[DataModel.cpp]"]
  node_font_api["Font Interface"]
  node_font_default["Default Font Engine"]
end

subgraph group_extensions["Extensions"]
  node_debugger["Visual Debugger"]
  node_lua["Lua Plugin"]
  node_svg["SVG Plugin"]
end

node_application(("Host Application"))
node_renderer_host(("Host Renderer"))

node_application -->|"calls API"| node_core_api
node_core_api -->|"creates context"| node_context
node_application -->|"sends input"| node_context
node_context -.->|"loads documents"| node_document_parser
node_document_parser -.->|"builds elements"| node_dom
node_dom -.->|"applies styles"| node_styles
node_styles -.->|"drives layout"| node_layout
node_layout -.->|"updates context"| node_context
node_application -->|"updates and renders"| node_context
node_context -->|"generates geometry"| node_render_manager
node_render_manager -->|"submits draws"| node_render_interface
node_render_interface -->|"implemented by"| node_backend
node_application -->|"draws output"| node_renderer_host
node_application -->|"provides input"| node_platform
node_context -.->|"hosts controls"| node_controls
node_context -.->|"advances animations"| node_animation
node_context -->|"synchronizes data"| node_data_binding
node_dom -->|"dispatches events"| node_events
node_document_parser -->|"uses templates"| node_templates
node_styles -->|"uses sprites"| node_sprites
node_core_api -->|"accepts font engine"| node_font_api
node_font_api -->|"default implementation"| node_font_default
node_context -->|"debugged by"| node_debugger
node_application -->|"extends through plugin"| node_lua
node_document_parser -.->|"supports SVG plugin"| node_svg

click node_core_api "https://github.com/mikke89/rmlui/blob/master/Include/RmlUi/Core/Core.h"
click node_context "https://github.com/mikke89/rmlui/blob/master/Source/Core/Context.cpp"
click node_document_parser "https://github.com/mikke89/rmlui/blob/master/Source/Core/XMLParser.cpp"
click node_dom "https://github.com/mikke89/rmlui/blob/master/Source/Core/Element.cpp"
click node_styles "https://github.com/mikke89/rmlui/blob/master/Source/Core/StyleSheetParser.cpp"
click node_layout "https://github.com/mikke89/rmlui/blob/master/Source/Core/Layout/LayoutEngine.cpp"
click node_controls "https://github.com/mikke89/rmlui/tree/master/Source/Core/Elements"
click node_animation "https://github.com/mikke89/rmlui/blob/master/Source/Core/ElementAnimation.cpp"
click node_data_binding "https://github.com/mikke89/rmlui/blob/master/Source/Core/DataModel.cpp"
click node_events "https://github.com/mikke89/rmlui/blob/master/Source/Core/EventDispatcher.cpp"
click node_templates "https://github.com/mikke89/rmlui/blob/master/Source/Core/Template.cpp"
click node_sprites "https://github.com/mikke89/rmlui/blob/master/Source/Core/Spritesheet.cpp"
click node_render_manager "https://github.com/mikke89/rmlui/blob/master/Source/Core/RenderManager.cpp"
click node_render_interface "https://github.com/mikke89/rmlui/blob/master/Include/RmlUi/Core/RenderInterface.h"
click node_backend "https://github.com/mikke89/rmlui/tree/master/Backends"
click node_platform "https://github.com/mikke89/rmlui/tree/master/Backends"
click node_font_api "https://github.com/mikke89/rmlui/blob/master/Include/RmlUi/Core/FontEngineInterface.h"
click node_font_default "https://github.com/mikke89/rmlui/blob/master/Source/Core/FontEngineDefault/FontEngineInterfaceDefault.cpp"
click node_debugger "https://github.com/mikke89/rmlui/tree/master/Source/Debugger"
click node_lua "https://github.com/mikke89/rmlui/tree/master/Source/Lua"
click node_svg "https://github.com/mikke89/rmlui/tree/master/Source/SVG"

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_core_api,node_context,node_controls,node_animation,node_events toneBlue
class node_document_parser,node_dom,node_styles,node_layout,node_templates,node_sprites toneAmber
class node_render_manager,node_render_interface,node_backend,node_platform toneMint
class node_data_binding,node_font_api,node_font_default toneRose
class node_debugger,node_lua,node_svg,node_application,node_renderer_host toneIndigo
```

## Components

### UI Runtime

- [Core API](https://github.com/mikke89/rmlui/blob/master/Include/RmlUi/Core/Core.h): `Include/RmlUi/Core/Core.h`
- [UI Context](https://github.com/mikke89/rmlui/blob/master/Source/Core/Context.cpp): `Source/Core/Context.cpp`
- [UI Controls](https://github.com/mikke89/rmlui/tree/master/Source/Core/Elements): `Source/Core/Elements`
- [Animation](https://github.com/mikke89/rmlui/blob/master/Source/Core/ElementAnimation.cpp): `Source/Core/ElementAnimation.cpp`
- [Event System](https://github.com/mikke89/rmlui/blob/master/Source/Core/EventDispatcher.cpp): `Source/Core/EventDispatcher.cpp`

### Documents And Layout

- [Document Parser](https://github.com/mikke89/rmlui/blob/master/Source/Core/XMLParser.cpp): `Source/Core/XMLParser.cpp`
- [Element DOM](https://github.com/mikke89/rmlui/blob/master/Source/Core/Element.cpp): `Source/Core/Element.cpp`
- [Style System](https://github.com/mikke89/rmlui/blob/master/Source/Core/StyleSheetParser.cpp): `Source/Core/StyleSheetParser.cpp`
- [Layout Engine](https://github.com/mikke89/rmlui/blob/master/Source/Core/Layout/LayoutEngine.cpp): `Source/Core/Layout/LayoutEngine.cpp`
- [Templates](https://github.com/mikke89/rmlui/blob/master/Source/Core/Template.cpp): `Source/Core/Template.cpp`
- [Sprite Sheets](https://github.com/mikke89/rmlui/blob/master/Source/Core/Spritesheet.cpp): `Source/Core/Spritesheet.cpp`

### Rendering And Platform

- [Render Manager](https://github.com/mikke89/rmlui/blob/master/Source/Core/RenderManager.cpp): `Source/Core/RenderManager.cpp`
- [Render Interface](https://github.com/mikke89/rmlui/blob/master/Include/RmlUi/Core/RenderInterface.h): `Include/RmlUi/Core/RenderInterface.h`
- [Renderer Backend](https://github.com/mikke89/rmlui/tree/master/Backends): `Backends`
- [Platform Backend](https://github.com/mikke89/rmlui/tree/master/Backends): `Backends`

### Fonts And Data

- [Data Binding](https://github.com/mikke89/rmlui/blob/master/Source/Core/DataModel.cpp): `Source/Core/DataModel.cpp`
- [Font Interface](https://github.com/mikke89/rmlui/blob/master/Include/RmlUi/Core/FontEngineInterface.h): `Include/RmlUi/Core/FontEngineInterface.h`
- [Default Font Engine](https://github.com/mikke89/rmlui/blob/master/Source/Core/FontEngineDefault/FontEngineInterfaceDefault.cpp): `Source/Core/FontEngineDefault/FontEngineInterfaceDefault.cpp`

### Extensions

- [Visual Debugger](https://github.com/mikke89/rmlui/tree/master/Source/Debugger): `Source/Debugger`
- [Lua Plugin](https://github.com/mikke89/rmlui/tree/master/Source/Lua): `Source/Lua`
- [SVG Plugin](https://github.com/mikke89/rmlui/tree/master/Source/SVG): `Source/SVG`

### Other components

- **Host Application**
- **Host Renderer**

## Connections

- Host Application → Core API: calls API
- Core API → UI Context: creates context
- Host Application → UI Context: sends input
- UI Context → Document Parser: loads documents
- Document Parser → Element DOM: builds elements
- Element DOM → Style System: applies styles
- Style System → Layout Engine: drives layout
- Layout Engine → UI Context: updates context
- Host Application → UI Context: updates and renders
- UI Context → Render Manager: generates geometry
- Render Manager → Render Interface: submits draws (evidence: `Source/Core/RenderManager.cpp`)
- Render Interface → Renderer Backend: implemented by
- Host Application → Host Renderer: draws output
- Host Application → Platform Backend: provides input
- UI Context → UI Controls: hosts controls
- UI Context → Animation: advances animations
- UI Context → Data Binding: synchronizes data
- Element DOM → Event System: dispatches events
- Document Parser → Templates: uses templates
- Style System → Sprite Sheets: uses sprites
- Core API → Font Interface: accepts font engine (evidence: `Include/RmlUi/Core/Core.h`)
- Font Interface → Default Font Engine: default implementation (evidence: `Source/Core/FontEngineDefault/FontEngineInterfaceDefault.cpp`)
- UI Context → Visual Debugger: debugged by
- Host Application → Lua Plugin: extends through plugin
- Document Parser → SVG Plugin: supports SVG plugin
