# dalihub/dali-ui architecture

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

- Interactive diagram: https://gitdiagram.com/dalihub/dali-ui
- Repository: https://github.com/dalihub/dali-ui

## Overview

1. **Repository purpose**
   - This is a C++ UI framework for Tizen, split into two libraries:
     - **dali-ui-foundation**: the core UI infrastructure and foundational controls.
     - **dali-ui-components**: a thinner higher-level component layer that depends on foundation.
   - The repo is not an app; it is a framework plus samples, tests, docs, and packaging/build assets.

2. **Top-level layering**
   - The architecture is intentionally layered:
     - **Public API** exposes stable headers for application use.
     - **Integration API** adapts those APIs to internal implementation objects.
     - **Internal** contains the actual behavior, state machines, render logic, and subsystems.
   - The public layer is large, but most runtime behavior lives in `internal/`, with autogenerated bridge/spec files connecting the layers.

3. **Foundation as the central subsystem**
   - `dali-ui-foundation` is the main engine: it provides core abstractions for views, visuals, layouts, text, image loading, focus, theming, scaling, state management, and input/event handling.
   - This is the layer that most samples and tests exercise directly.
   - `dali-ui-components` is comparatively small in this tree and mainly demonstrates how higher-level controls would sit on top of foundation.

4. **Control/view model boundary**
   - Core UI objects such as `View`, `Label`, `ImageView`, `InputField`, `ScrollView`, `WebView`, `AnimatedImageView`, and `LottieAnimationView` are split into:
     - public-facing declarations,
     - integration implementations,
     - internal data/model/render helpers.
   - The internal `views/` subtree holds view state, renderers, visual data, accessibility data, and state handlers, which act as the bridge between user-facing controls and rendering/layout subsystems.

5. **Rendering and visual pipeline**
   - Visual rendering is a major subsystem under `internal/visuals/` and `internal/graphics/`.
   - Each visual type has its own implementation family: image, text, color, gradient, primitive, mesh, npatch, svg, wireframe, arc, border, animated image, animated vector image.
   - Visuals depend on shader factories and generated shader sources, so the pipeline is: control/configuration -> visual object -> shader/texture/geometry setup -> DALi graphics backend.

6. **Text subsystem is deeply specialized**
   - Text handling is one of the richest parts of the repository.
   - It includes:
     - text model/controller/view separation,
     - shaping, segmentation, bidi support, markup processing,
     - atlas-based glyph rendering,
     - async text loading and text visualizer logic,
     - input-field-specific editing, selection, cursor, and placeholder behavior.
   - A separate `text-visualizer` subtree suggests an optimized rendering path for text-heavy controls and performance-sensitive layouts.

7. **Layout subsystem**
   - Layout is modeled as both public APIs and internal managers/params.
   - Supported layout families include **absolute**, **flex**, **grid**, and **stack** layouts, plus scroll-view layout management.
   - The flow is: public layout object/params -> internal layout manager/params -> view constraints and measurement -> final view geometry.
   - The repo also contains standalone and example apps demonstrating these layout behaviors.

8. **Image loading and texture management**
   - Image content is handled through sync and async loaders, URL utilities, texture manager/cache layers, and upload observers.
   - This subsystem is used by image-based visuals and controls, and it separates:
     - source identification,
     - loading/decode task management,
     - texture caching and upload,
     - render-time consumption by visuals.
   - Animated image and SVG paths have their own task/cache machinery because they are not simple static textures.

9. **Input, focus, and interaction**
   - Interaction is organized around input events, traits, focus management, selectable behavior, and drag/drop detection.
   - There are clear boundaries between:
     - input event capture,
     - focus navigation and key input policy,
     - trait-driven behavior on views,
     - higher-level interactive controls.
   - This is important for diagramming because interaction is not centralized in one controller; it is distributed across view/trait/focus modules.

10. **Theme, config, and scaling**
   - UI appearance and environment behavior are managed by config/theme/color/scale subsystems.
   - Notable pieces include UI config manager, theme manager, color manager/cache, scale manager, and default theme loader.
   - These subsystems influence visual construction, layout decisions, and runtime appearance without being tied to a specific control.

11. **Autogenerated and generated assets**
   - The repo relies heavily on generated code:
     - `*.autogen.*` API bridges/specs,
     - script-generated animation/spec chaining code,
     - generated shader headers/sources.
   - This means architecture diagrams should show an explicit “generated glue” boundary between public declarations and internal runtime code, and another between shader sources and rendering code.

12. **Testing and validation architecture**
   - There are three distinct validation paths:
     - **automated-tests**: C++ test harnesses with mocked platform/graphics objects and coverage tooling.
     - **manual-tests**: interactive scenarios for feature verification.
     - **samples**: runnable demonstrations and integration examples.
   - Automated tests depend on a substantial test utility layer that simulates application lifecycle, graphics abstraction, gestures, rendering surfaces, and platform behavior.

13. **Build, packaging, and release flow**
   - The repo supports both local CMake builds and Tizen/GBS packaging.
   - Samples have their own manifests/specs/packages, which suggests the framework is meant to ship with runnable Tizen apps and not just libraries.
   - CI workflows and packaging scripts indicate separate release lanes for library builds, docs, tests, and Tizen releases.

14. **External/runtime dependencies**
   - The framework is built to sit on top of **dali-core** and **dali-adaptor**, which are external runtime dependencies and should be shown beneath this repo in any architecture diagram.
   - dali-ui primarily adds UI abstraction, controls, and rendering logic on top of that lower-level DALi stack.

Main entry points: [`dali-ui-foundation/internal`](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal) (Foundation Core), [`dali-ui-foundation/public-api`](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/public-api) (Foundation API), [`scripts/autogen`](https://github.com/dalihub/dali-ui/tree/devel/scripts/autogen) (Generated Glue), [`dali-ui-foundation/internal/visuals`](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/visuals) (Visual Pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["dali-ui-foundation"]
  node_foundation_public["Foundation API<br/>public API"]
  node_foundation_integration["Foundation Glue<br/>integration"]
  node_foundation_internal["Foundation Core<br/>internal runtime"]
  node_views["View Model<br/>view subsystem"]
  node_visuals["Visual Pipeline<br/>render subsystem"]
  node_graphics_shaders["Shader Assets<br/>generated graphics"]
  node_text["Text Engine<br/>text subsystem"]
  node_text_visualizer["Text Visualizer<br/>optimized text path"]
  node_layouts["Layout Engine<br/>layout subsystem"]
  node_image_loader["Image Loading<br/>image subsystem"]
  node_texture_manager["Texture Cache<br/>texture subsystem"]
  node_focus_input["Focus & Input<br/>interaction subsystem"]
  node_theme_config["Theme & Scale<br/>environment subsystem"]
end

subgraph group_components["dali-ui-components"]
  node_components_public["Components API<br/>public API"]
  node_components_integration["Components Glue<br/>integration"]
  node_components_internal["Component Impl<br/>internal runtime"]
end

subgraph group_quality["Validation"]
  node_samples["Samples<br/>runnable examples"]
  node_manual_tests["Manual Tests<br/>interactive validation"]
  node_automated_tests["Automated Tests<br/>C++ test suite"]
end

subgraph group_tooling["Build & Release"]
  node_builder_assets["Generated Glue<br/>generated code"]
  node_build_packaging["Build & Packaging<br/>build system"]
  node_docs["Docs & Wiki<br/>documentation"]
end

subgraph group_external["External DALi"]
  node_dali_core[("dali-core<br/>external runtime")]
  node_dali_adaptor[("dali-adaptor<br/>external runtime")]
end

node_components_public -->|"declare"| node_components_integration
node_components_integration -->|"implement"| node_components_internal
node_components_public -->|"depends on"| node_foundation_public
node_foundation_public -->|"bridge"| node_foundation_integration
node_foundation_integration -->|"dispatch"| node_foundation_internal
node_foundation_internal -->|"orchestrates"| node_views
node_views -->|"renders via"| node_visuals
node_visuals -->|"uses"| node_graphics_shaders
node_visuals -->|"consumes"| node_texture_manager
node_foundation_internal -->|"contains"| node_text
node_text -->|"optimizes"| node_text_visualizer
node_foundation_internal -->|"measures"| node_layouts
node_foundation_internal -->|"loads"| node_image_loader
node_image_loader -->|"uploads to"| node_texture_manager
node_foundation_internal -->|"routes"| node_focus_input
node_foundation_internal -->|"configures"| node_theme_config
node_builder_assets -->|"generates"| node_foundation_public
node_builder_assets -->|"generates"| node_foundation_integration
node_builder_assets -->|"generates"| node_graphics_shaders
node_automated_tests -->|"exercises"| node_foundation_public
node_automated_tests -->|"mocks"| node_foundation_internal
node_manual_tests -->|"verifies"| node_foundation_public
node_samples -->|"demonstrates"| node_foundation_public
node_build_packaging -->|"packages"| node_components_public
node_build_packaging -->|"packages"| node_foundation_public
node_docs -.->|"documents"| node_layouts
node_foundation_internal -->|"depends on"| node_dali_core
node_foundation_internal -->|"depends on"| node_dali_adaptor

click node_components_public "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-components/public-api"
click node_components_integration "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-components/integration-api"
click node_components_internal "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-components/internal"
click node_foundation_public "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/public-api"
click node_foundation_integration "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/integration-api"
click node_foundation_internal "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal"
click node_views "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/views"
click node_visuals "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/visuals"
click node_graphics_shaders "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/graphics/shaders"
click node_text "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/text"
click node_text_visualizer "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/text/text-visualizer"
click node_layouts "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/layouts"
click node_image_loader "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/image-loader"
click node_texture_manager "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/texture-manager"
click node_focus_input "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/focus-manager"
click node_theme_config "https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal"
click node_builder_assets "https://github.com/dalihub/dali-ui/tree/devel/scripts/autogen"
click node_samples "https://github.com/dalihub/dali-ui/tree/devel/samples"
click node_manual_tests "https://github.com/dalihub/dali-ui/tree/devel/manual-tests"
click node_automated_tests "https://github.com/dalihub/dali-ui/tree/devel/automated-tests"
click node_build_packaging "https://github.com/dalihub/dali-ui/tree/devel/build"
click node_docs "https://github.com/dalihub/dali-ui/tree/devel/docs"

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_foundation_public,node_foundation_integration,node_foundation_internal,node_views,node_visuals,node_graphics_shaders,node_text,node_text_visualizer,node_layouts,node_image_loader,node_texture_manager,node_focus_input,node_theme_config toneBlue
class node_components_public,node_components_integration,node_components_internal toneAmber
class node_samples,node_manual_tests,node_automated_tests toneMint
class node_builder_assets,node_build_packaging,node_docs toneRose
class node_dali_core,node_dali_adaptor toneIndigo
```

## Components

### dali-ui-foundation

Core UI framework library with public API, integration glue, and internal runtime subsystems.

- [Foundation API](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/public-api): public API · Stable public headers for views, visuals, layout, text, input, and config. · `dali-ui-foundation/public-api`
- [Foundation Glue](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/integration-api): integration · API-to-implementation bridge layer and subsystem managers. · `dali-ui-foundation/integration-api`
- [Foundation Core](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal): internal runtime · Behavior, state, render logic, and subsystem implementations. · `dali-ui-foundation/internal`
- [View Model](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/views): view subsystem · View state, visual data, renderers, accessibility, and state handlers. · `dali-ui-foundation/internal/views`
- [Visual Pipeline](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/visuals): render subsystem · Control visuals, shader factories, visual factory cache, and visual geometry setup. · `dali-ui-foundation/internal/visuals`
- [Shader Assets](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/graphics/shaders): generated graphics · Generated and authored shader sources used by visuals and render effects. · `dali-ui-foundation/internal/graphics/shaders`
- [Text Engine](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/text): text subsystem · Text model, controller, shaping, segmentation, bidi, markup, layout, and rendering. · `dali-ui-foundation/internal/text`
- [Text Visualizer](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/text/text-visualizer): optimized text path · Specialized rendering path for text-heavy controls and performance-sensitive layouts. · `dali-ui-foundation/internal/text/text-visualizer`
- [Layout Engine](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/layouts): layout subsystem · Public layout APIs and internal managers for absolute, flex, grid, stack, and scroll layouts. · `dali-ui-foundation/internal/layouts`
- [Image Loading](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/image-loader): image subsystem · Sync/async loading, URLs, decode tasks, and texture preparation. · `dali-ui-foundation/internal/image-loader`
- [Texture Cache](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/texture-manager): texture subsystem · Texture caching, upload observation, and async texture management. · `dali-ui-foundation/internal/texture-manager`
- [Focus & Input](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal/focus-manager): interaction subsystem · Input events, focus navigation, key policy, selection, selectable and drag-drop behavior. · `dali-ui-foundation/internal/focus-manager`
- [Theme & Scale](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-foundation/internal): environment subsystem · UI config, theme, color, and scale managers that influence appearance and layout. · `dali-ui-foundation/internal`

### dali-ui-components

Thin higher-level component layer built on top of foundation.

- [Components API](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-components/public-api): public API · Public component-facing headers and declarations. · `dali-ui-components/public-api`
- [Components Glue](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-components/integration-api): integration · Adapts component APIs to internal implementation objects. · `dali-ui-components/integration-api`
- [Component Impl](https://github.com/dalihub/dali-ui/tree/devel/dali-ui-components/internal): internal runtime · Internal component behavior and control implementation. · `dali-ui-components/internal`

### Validation

Automated tests, manual tests, and sample applications.

- [Samples](https://github.com/dalihub/dali-ui/tree/devel/samples): runnable examples · Framework demonstrations and integration examples for controls, layout, text, visuals, and web view. · `samples`
- [Manual Tests](https://github.com/dalihub/dali-ui/tree/devel/manual-tests): interactive validation · Interactive scenarios for feature verification. · `manual-tests`
- [Automated Tests](https://github.com/dalihub/dali-ui/tree/devel/automated-tests): C++ test suite · Mocked platform and graphics test harnesses with coverage and verification tooling. · `automated-tests`

### Build & Release

Build, packaging, docs, and generated-code tooling.

- [Generated Glue](https://github.com/dalihub/dali-ui/tree/devel/scripts/autogen): generated code · Autogenerated bridges/specs and helper generation assets between public and internal layers. · `scripts/autogen`
- [Build & Packaging](https://github.com/dalihub/dali-ui/tree/devel/build): build system · CMake, Tizen packaging, spec files, CI workflows, and release assets. · `build`
- [Docs & Wiki](https://github.com/dalihub/dali-ui/tree/devel/docs): documentation · Repository documentation, layout diagrams, and wiki content. · `docs`

### External DALi

Runtime dependencies below this repository.

- **dali-core**: external runtime · Lower-level DALi rendering and scene-graph runtime dependency.
- **dali-adaptor**: external runtime · Platform/adaptor runtime dependency beneath the UI framework.

## Connections

- Components API → Components Glue: declare · Public component APIs are bridged to integration objects.
- Components Glue → Component Impl: implement · Integration glue delegates to internal component behavior.
- Components API → Foundation API: depends on · Higher-level components build on foundation public APIs.
- Foundation API → Foundation Glue: bridge · Public APIs connect through generated and handwritten bridge layers.
- Foundation Glue → Foundation Core: dispatch · Integration layer forwards to internal runtime subsystems.
- Foundation Core → View Model: orchestrates · Core runtime manages view state and render/data boundaries.
- View Model → Visual Pipeline: renders via · View models assemble and constrain visuals.
- Visual Pipeline → Shader Assets: uses · Visuals rely on shader sources and generated shader headers.
- Visual Pipeline → Texture Cache: consumes · Image and animated visuals consume cached textures.
- Foundation Core → Text Engine: contains · Text control behavior and rendering live in the text subsystem.
- Text Engine → Text Visualizer: optimizes · Text visualizer provides a specialized high-performance rendering path.
- Foundation Core → Layout Engine: measures · Layout managers compute view geometry and constraints.
- Foundation Core → Image Loading: loads · Foundation resolves image sources and decode tasks.
- Image Loading → Texture Cache: uploads to · Loaded image content is prepared for texture caching and upload.
- Foundation Core → Focus & Input: routes · Input, focus, and selection behavior are distributed across interaction modules.
- Foundation Core → Theme & Scale: configures · Theme, color, config, and scale influence runtime appearance.
- Generated Glue → Foundation API: generates · Autogenerated API bridges and specs feed the public layer.
- Generated Glue → Foundation Glue: generates · Generated glue links public declarations to implementation objects.
- Generated Glue → Shader Assets: generates · Shader source generation produces render-time assets.
- Automated Tests → Foundation API: exercises · Automated tests validate the public API surface and behavior.
- Automated Tests → Foundation Core: mocks · Test utilities simulate platform, graphics, and lifecycle behavior.
- Manual Tests → Foundation API: verifies · Manual scenarios exercise framework features end to end.
- Samples → Foundation API: demonstrates · Samples show intended use of public APIs and integration patterns.
- Build & Packaging → Components API: packages · Build and packaging flow produces the component library artifacts.
- Build & Packaging → Foundation API: packages · Build and packaging flow produces the foundation library artifacts.
- Docs & Wiki → Layout Engine: documents · Repository docs capture architecture and layout behavior.
- Foundation Core → dali-core: depends on · Framework runtime sits on top of DALi core.
- Foundation Core → dali-adaptor: depends on · Framework runtime uses the DALi adaptor/platform layer.
