Skip to content

codehz/ConstUI

Repository files navigation

ConstUI

专为嵌入式与静态资源受限场景设计的 C++23 header-only GUI 库

ConstUI 的核心思路是:

  • 零动态分配优先
  • 零类型擦除
  • 零虚函数
  • 通过声明式 DSL 组合布局、控件和状态绑定

当前实现基于 静态类型 Widget 树 + token 属性 DSL + 版本号驱动的 subject 同步 + 轻量 dirty region 局部刷新

当前渲染层已支持:

  • 整帧后缓冲渲染(rendering::UIRenderer
  • tile-based 分块渲染(rendering::TiledUIRenderer
  • 帧稳定 dirty / invalidation 提交语义
  • 面向嵌入式 DMA / SPI / I80 场景的局部 ScreenBlit 提交模型

构建

cmake -B build
cmake --build build

开发期推荐直接使用 preset,一次启用 examples、tests 与 SDL3:

cmake --preset dev
cmake --build --preset dev
ctest --preset dev

文档

详细文档请参阅 docs/ 目录。

  • 架构说明见 docs/architecture.md,其中包含当前代码实现中的核心类型、dirty 系统和渲染链路
  • 状态绑定入口见 docs/state-binding.md
  • 当前推荐语法:prop = valueprop = subject(只读)、prop <=> subject(双向)
  • match_state() 支持按需收集状态,并允许用户自定义状态 tag

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors