How dalihub/dali-ui works
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: internal Foundation Core · public-api Foundation API · autogen Generated Glue · visuals Visual Pipeline
Components 24
dali-ui-foundation
Core UI framework library with public API, integration glue, and internal runtime subsystems.
- Foundation API · Stable public headers for views, visuals, layout, text, input, and config.
dali-ui-foundation/public-api - Foundation Glue · API-to-implementation bridge layer and subsystem managers.
dali-ui-foundation/integration-api - Foundation Core · Behavior, state, render logic, and subsystem implementations.
dali-ui-foundation/internal - View Model · View state, visual data, renderers, accessibility, and state handlers.
dali-ui-foundation/internal/views - Visual Pipeline · Control visuals, shader factories, visual factory cache, and visual geometry setup.
dali-ui-foundation/internal/visuals - Shader Assets · Generated and authored shader sources used by visuals and render effects.
dali-ui-foundation/internal/graphics/shaders - Text Engine · Text model, controller, shaping, segmentation, bidi, markup, layout, and rendering.
dali-ui-foundation/internal/text - Text Visualizer · Specialized rendering path for text-heavy controls and performance-sensitive layouts.
dali-ui-foundation/internal/text/text-visualizer - Layout Engine · Public layout APIs and internal managers for absolute, flex, grid, stack, and scroll layouts.
dali-ui-foundation/internal/layouts - Image Loading · Sync/async loading, URLs, decode tasks, and texture preparation.
dali-ui-foundation/internal/image-loader - Texture Cache · Texture caching, upload observation, and async texture management.
dali-ui-foundation/internal/texture-manager - Focus & Input · Input events, focus navigation, key policy, selection, selectable and drag-drop behavior.
dali-ui-foundation/internal/focus-manager - Theme & Scale · 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 · Public component-facing headers and declarations.
dali-ui-components/public-api - Components Glue · Adapts component APIs to internal implementation objects.
dali-ui-components/integration-api - Component Impl · Internal component behavior and control implementation.
dali-ui-components/internal
Validation
Automated tests, manual tests, and sample applications.
- Samples · Framework demonstrations and integration examples for controls, layout, text, visuals, and web view.
samples - Manual Tests · Interactive scenarios for feature verification.
manual-tests - Automated Tests · Mocked platform and graphics test harnesses with coverage and verification tooling.
automated-tests
Build & Release
Build, packaging, docs, and generated-code tooling.
- Generated Glue · Autogenerated bridges/specs and helper generation assets between public and internal layers.
scripts/autogen - Build & Packaging · CMake, Tizen packaging, spec files, CI workflows, and release assets.
build - Docs & Wiki · Repository documentation, layout diagrams, and wiki content.
docs
External DALi
Runtime dependencies below this repository.
- dali-core · Lower-level DALi rendering and scene-graph runtime dependency.
- dali-adaptor · Platform/adaptor runtime dependency beneath the UI framework.
Connections 28
- 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.