70 Commits
Author SHA1 Message Date
Liu ced0bd2a52 ci: attach example archives to release assets 2026-11-22 22:14:30 +08:00
Liu cd987b81d0 chore(release): add npm version lifecycle script
- sync versions.json, xmake descriptors, generated headers and the CI TARGET_* values from the version npm just wrote
- generate the commit summary into CHANGELOG.md; human-readable notes are written manually on the Releases page
- drop CHANGELOG.zh-cn.md and the automatic release-notes step
- preserve CRLF in sync-versions so --check passes on Windows
2026-11-22 21:59:12 +08:00
Liu f0577b64ba ci: update GitHub Actions to Node 24 runtimes 2026-11-22 21:02:56 +08:00
Liu 2c4958b427 feat(doc-viewer): show repository icons, star counts and version badge
- add monochrome GitHub and Gitee assets with light/dark CSS backgrounds
- replace the GitHub text link with icon links for both repositories
- fetch and cache repository star counts at build time and render them
  beside the icons when available
- abbreviate counts of 1000 or more as `Nk` and separate the navbar
  actions with vertical dividers
- move the version number from the navbar to a badge below the Home title
- harden the star script for cold checkouts: root-relative paths, request
  timeouts, cache fallbacks and CI coverage
2026-11-21 20:53:30 +08:00
Liu 5eb230e877 ci: run library test targets in separate steps 2026-11-21 15:42:48 +08:00
Liu 464eed1402 build: centralize package versions and standardize on C11
versions.json is now the single source of truth; scripts/sync-versions.mjs keeps xmake descriptors, tracked version headers and package.json in sync. Sub-library versions are aligned with the published 1.0.0 packages. C11 is set at the project level, and _GNU_SOURCE is defined on POSIX so strict C11 still exposes clock_gettime, strdup and recursive pthread mutexes.
2026-11-19 22:03:59 +08:00
Liu c4b9000d36 build: make static library merging opt-in
Keep the sub-library archives separate by default so add_deps() can export each library's own links for tests and development builds. The merge-archive option restores the self-contained lcui library for release/Debian builds, and CI enables it only after tests pass. yutil-tests also needs C11 for its u8 string literals.
2026-11-19 01:26:36 +08:00
Liu 75d26f05d0 test: move doc-viewer layout tests into the doc-viewer project
These layout tests need the generated global.css.h and the doc-viewer home-grid component, so they do not belong in the core lcui-tests binary. Move them to examples/doc-viewer/tests, keep their fixture with the tests, and generate the doc-viewer sources before running xmake test so a fresh checkout has global.css.h.
2026-11-19 01:19:59 +08:00
Liu 57272be8d1 ci(release): point the release glob at the binary archives 2026-11-15 23:40:45 +08:00
Liu 7278a9ad71 ci(release): publish lcui binary archives as release assets 2026-11-15 23:40:45 +08:00
CopilotandLiu 437d93d34e docs: add native doc-viewer and widget documentation (#324)
- Add examples/doc-viewer, an LCUI-based documentation viewer with an
  MDX compiler pipeline that converts source MDX files into C/TSX
  page components rendered by lcui build.
- Add zh-CN and en documentation for 5 widgets (anchor, button,
  scrollarea, text, text-input), each with C/TSX/XML example variants
  and widget-fields data.
- Add handbook and overview documentation.

Co-authored-by: Liu <lc-soft@live.cn>
2026-08-05 22:42:19 +08:00
Liu 7f9f52b904 chore: update copyright and email 2026-08-05 22:42:16 +08:00
Liu db5ab3dc36 ci: improve format check reliability
- Use project-local clang-format from node_modules/.bin instead of system
  PATH to avoid version mismatches between CI and development environments
- Print clang-format version and binary path in CI logs for debugging
- Add format:check script to package.json so `npm run format:check` works
- Add `needs: format` to build job so formatting failures block the build
  and don't waste CI resources
2026-08-05 22:42:15 +08:00
Liu 4dbd60875c ci: use clang-format-node for consistent formatting 2026-08-05 22:42:13 +08:00
Liu a55c60da24 ci: avoid duplicate builds on PR branch push 2026-08-05 22:41:28 +08:00
Liu 9040684246 ci: add pre-commit formatting via lint-staged and clang-format 2026-08-05 22:41:22 +08:00
Liu bcd87fbc74 ci: remove yutil tests 2026-08-05 22:41:17 +08:00
Liu 03e7849296 ci: add xvfb and codecov-action 2026-08-05 22:41:16 +08:00
Liu a56361db75 ci: cache xmake packages and bump action versions
Add actions/cache step covering xmake package and repository directories on both Linux and Windows runners. Cache key is keyed by runner OS, build mode (coverage on Linux, release on Windows) and the hashes of root and examples xmake-requires.lock so coverage and release artifacts do not pollute each other and examples deps share the same cache.

Bump actions/checkout to v4 with submodules: recursive (replacing the manual submodule update step), upload-artifact to v4 and download-artifact to v4.
2026-08-05 22:41:15 +08:00
Liu 75dbca815d test: reorganize test suite with xmake test integration
Restructure the test infrastructure with these changes:

* Extend libctest with ctest_suite_t, ctest_parse_args, ctest_run_suites and CTEST_MAIN macro to standardize test entry points; support --grep / --grep= / --list / --interactive flags; add ctest-tests for self-tests.

* Regroup tests by lib boundary: sink unit tests into lib/<name>/tests/ with <lib>_<topic> entry function names, move fixtures into lib/<name>/tests/fixtures/, rename top-level tests/cases/ to tests/integration/ for cross-lib integration tests.

* Add tests/scenes/ for reusable widget tree builders shared by integration cases and visual preview binaries; add tests/previews/ with 4 diagnostic binaries (flex_layout, block_layout, widget_opacity, scrollbar).

* Rewrite all describe/equal description strings using 'should ...' style or noun topic names; drop redundant lcui_quit/lcui_main calls from integration cases.

* Integrate xmake test via add_tests(\default\) and a shared tests.runnable rule defined in the root xmake.lua; the rule wraps the test binary with drmemory (Windows) or valgrind (Linux) when option memcheck=y.

* Drop the lcui-tests aggregation: lcui-tests now contains only integration cases and scenes, not the union of lib tests. Use xmake test to run everything across libs.

* Fix .clang-format: InsertNewlineAtEndOfFile -> InsertNewlineAtEOF (correct key for clang-format 16+).

* Update AGENTS.md with the new test layout, naming rules, description style and run commands.

* Update CI to use xmake test and xmake f --memcheck=y instead of per-lib runs.
2026-08-05 22:41:12 +08:00
Liu aa3326b448 ci: update configure step 2025-04-16 00:16:30 +08:00
Liu c4d03a72b3 docs: update FUNDING.yml 2025-04-02 23:07:37 +08:00
Liu c73659e2c0 ci(github): remove invalid cache config 2024-12-29 23:37:24 +08:00
Liu 24f3192b9a refactor: update LCUI's dependencies on ui-widgets and ui-router 2024-12-29 23:37:24 +08:00
Liu 5a4f39252b ci(github): update installation command for linux 2024-12-22 23:16:50 +08:00
Liu 8e06b4eb05 ci(github): update xmake cache 2024-12-22 23:14:13 +08:00
Liu bae24f5060 build: update requires 2024-12-07 13:30:29 +08:00
Liu 2e59a841c4 ci(github): update ccpp.yml
ci(github): update build script

ci(github): update build options for examples

ci(github): update steps
2024-12-07 13:30:28 +08:00
Liu 099a53b4b4 ci(github): update artifact name 2024-05-13 22:49:23 +08:00
Liu 0547e7f7ca ci(github): actions/cache@v4 2024-05-13 22:49:23 +08:00
Liu f5bdb3f8b0 build: ignore example build failure 2024-05-13 22:49:21 +08:00
Liu ac1bf60adb build: do not default to building test programs 2024-05-13 22:49:21 +08:00
Liu d683955090 build: do not default to building test programs 2024-05-13 22:49:20 +08:00
Liu 5c8186faad refactor: clear compiler warnings 2024-05-13 22:49:19 +08:00
Liu 27db5aeede feat: add i18n library 2023-06-03 17:52:22 +08:00
Liu ac10451453 ci(github): update artifact config 2023-05-20 23:45:47 +08:00
Liu c2930907cb feat: add libui-router 2023-05-03 17:49:51 +08:00
Liu 9ad372595a docs(examples): add fabric example to show how to use cairo 2023-04-30 16:55:36 +08:00
Liu f5d0d120a2 refactor: update header files and xmake.lua 2023-04-30 00:31:47 +08:00
Liu 98632bdfca feat: merge libimage, libtext and libfont into pandagl 2023-04-01 22:36:08 +08:00
Liu e533853908 feat: update css library
feat(css): add css value definition parser

refactor(css): change the parameter types of css_parse_* functions

refactor(css): migrate to new data types

refactor(css): migrate to new data types (2)

refactor(css): migrate to new data types (3)

test: add valdef test

feat(css): add css_valdef_parser_finish()

refactor(css): split css_library.c

refactor(css): css_data_type.c -> css_data_types.c

fix(css): the parsing error message of sign is not truncated

fix(css): correct initialization of data type library

fix(css): error message should not be empty

feat(css): add css_valdef_to_string()

feat(css): add double bar combinator

feat(css): add double ampersand combinator

feat(css): add curly braces multiplier

feat(css): add brackets combinator parser

docs: update css value matcher section

feat(css): add question mark multiplier

test(css): add test for brackets combinator

docs(css): update libcss_css_value.md

docs: update directory structure

refactor: numberic -> numeric

refactor(css): delete style property parser

refactor: migrate to css property API

docs(css): add css value converter section

feat(css): add css_computed_style_t

refactor(css): rename `css_style` associated identifiers

feat(css): add css_cascade_style()

refactor(css): change type of css_value_matcher_t::value

refactor(css): update args of css_register_property()

refactor(css): move css_computed_style_t

feat(css): update opacity property

feat(css): update z-index property

feat(css): update display property

feat(css): update pointer-events property

feat(css): update flex-wrap property

feat(css): update flex-direction property

feat(css): update flex-grow property

feat(css): update flex-shrink property

feat(css): update align-items property

feat(css): update justify-content property

feat(css): update position property

feat(css): update box-sizing property

feat(css): update align-content property

feat(css): update white-space property

feat(css): update content property

feat(css): update text-align property

feat(css): automatically register new keywords

feat(css): update font-style property

feat(css): update visibility property

feat(css): update border-*-style property

refactor: update css_unit_t definition

feat(css): update border-*-*-radius properties

refactor(css): delete CSS_PERCENTAGE_VALUE

refactor(css): css_cascade_length() -> css_cascade_length_auto()

refactor(css): update enum definitions

feat(css): update border-*-width properties

feat(css): update border-*-color properties

feat(css): add css_array_value_get_length()

feat(css): add border-width shorthand property

feat(css): add border-style shorthand property

feat(css): add border-radius shorthand property

feat(css): add border-color shorthand property

feat(css): add border shorthand property

feat(css): add margin shorthand property

feat(css): add padding shorthand property

feat(css): update size related properties

feat(css): update top, right, bottom, left properties

feat(css): update flex-basis property

feat(css): update line-height property

feat(css): update color property

refactor(css): add css_cascade_bg_border_color()

refactor(css): bits -> keyword_bits

refactor(css): flag -> keyword

refactor(css): update css_color_value_t definition

feat(css): add CSS_COLOR_TRANSPARENT

refactor(css): remove transparent keyword

feat(css): update font-size property

feat(css): update font-family property

feat(css): update background shorthand property

feat(css): update vertical-align property

feat(css): update box-shadow property

feat(css): update the computing of the box-shadow property

 feat(css): update the computing of the background property

feat(css): update the computing of the border property

refactor(css): keyword_bits -> type_bits

refactor(css): enum css_*_e -> uint8_t

feat(css): add absolute size computing

feat(css): add absolute padding computing

feat(css): add absolute margin computing

style(css): format code

feat(css): add top, right, bottom, and left absolute value computing

feat(css): add flex-basis absolute value computing

refactor(ui): replace data type of computed style

feat(ui): update widget background style computing

feat(ui): update widget box-shadow style computing

feat(ui): update widget border style computing

feat(ui): update widget box computing

feat(ui): use tabindex instead of focusable

feat(css): remove focusable property

feat(css): update font-weight property

fix(css): clear compile errors

refactor(ui): adapt to new computed style data structure

refactor(ui): delete ui_widget_box_model_t

fix: clear some compiler warnings

refactor(ui): ui_font_style.c -> ui_text_style.c

feat(ui): remove unnecessary helper functions

fix: clear some compiler warnings

fix(font): correct bitmap cache access

fix(css): correct the key assignment of keywords

fix(css): some memory access errors

fix: missing NULL at the end of font names

fix: clear gcc errors

refactor: clear gcc warnings

fix(css): array subscript is above array bounds

fix(css): incorrect property name memory allocation

fix(css): style parser memory leak

fix(css): prop->valdef memory leak

refactor(css): logger_debug -> DEBUG_MSG

refactor(ui-builder): clear warnings

fix(css): css_properties.list memory leak

fix(css): css_style_link_group_create() memory leak

fix(css): incorrect keyword storage

test(css): correct color_value comparison

test: clear compiler errors

fix(css): correct the return value of css_register_keyword()

fix(css): correct integer type value parsing

chore(css): _DEBUG -> DEBUG

feat(css): add string value parsing

fix(css): correct font-family initial value

test(css): add test_css_computed.c

fix(css): value read error in css_cascade_background()

fix(css): add some missing properties

feat(css): add flex shorthand property

build: update rundir of lcui-css-test

fix(css): font-family parsing error

feat(css): style array value to string

chore(vscode): add compileCommands

fix(css): string value parsing error

fix(css): correct content property initial value

fix(css): the parsed style data is not stored correctly

fix(css): correct cascading of some properties

fix(css): percentage value parsing inccorect

fix(css): <length> should not contain <percentage>

fix(css): css_array_value_duplicate() did not copy the last value

feat(css): add visible keyword

feat(css): cascade each property in order

refactor(css): add style_decl.c

refactor(css): use css_style_decl_t instead of css_style_t

fix(css): incorrect number of resolved values

refactor(css): add css_style.c

feat(css): parse shorthand properties in the parsing phase

refactor(css): add background property parser

refactor(css): add border property parser

refactor(css): css_select_style_decl -> css_find_style_store

refactor(css): add css_select_style_with_cache()

refactor(css): add margin property parser

refactor(css): add padding property parser

refactor(css): add flex property parser

fix(ui): incorrect widget style cascading order

refactor(css): const css_propdef_t* -> css_propdef_t*

refactor(css): update arguments of shorthand property parser

fix(css): incorrect value parsing of shorthand property

fix(css): unexpected truncation while parsing color value

fix(css): correct value matching and style computing

fix(ui): correct css style operation

fix(platform): crash when closing window

refactor(css): delete file prefix

refactor(css): delete style.c

refactor(css): clear compiler warnings

refactor: update directory structure and build configuration

feat(css): add dump functions

fix(css): correct valdef parser cursor operation

fix(css): correct the definition of margin and padding

fix(css): correct flex property parsing and definition

refactor(ui): adjust the use of calculated styles in the layout engine

chore: tests/helloword -> examples/hello

fix(ui): some bugs in block layout

fix(css): correct flex property definition

refactor(ui): simplify the naming of widget style and layout diff API

refactor(ui): update reflow trigger rules

refactor(ui): ui_widget_auto_reflow -> ui_widget_reflow

feat(ui): allow multiple observers to connect to the same widget

refactor(ui): simplify widget update process

refactor(ui): adjust row processing in block layout

refactor(ui): adjust the data structure used in the flexbox layout

fix(ui): correct flex layout algorithm

build: update config
2023-04-01 22:36:07 +08:00
Liu 58d7f0364b ci(github): add CI_ENV 2023-04-01 22:34:36 +08:00
YDYKand李梓豪 b46306ddea refactor(util): add yutil library (#264)
* add yutil

* add yutil to util.h

* remove util file that same as yutil's

* replace the old header file like '#include <LCUI/util/*>' with yutil's head file

* Replace the old UTIL module associated data structures and function call code

* change timer

* Replace the old UTIL module associated data structures and function call code

* fix

* fix compilation problems(RGB to YUTIL_TEST_RGB)

* turn some useless changes back to origin

* change YUTIL_TEST_RGB back to RGB and add  lcui-util/xmake.lua include

* update github action

* update github action

* update github action

* change new yutil func name

* update xmake and change way to include yutil

* update include to <yutil.h>

* update list_for_each to for(list_each())

* fix

* add graph.h to test_*

* add #include <LCUI/graph.h>

* update yutil

* change timer func name and update submodule

* update submodules

* test strncpy

* turn useless code back origin

* fix lose RGB issue

* fix yutil charset

* update yutil

* update yutil

* add yutil_test instead of lcui-util test

* change timer func name style

Co-authored-by: 李梓豪 <yidianyiko@foxmail.com>
2023-04-01 22:34:33 +08:00
Liu 99e100ebba ci(github): delete unnecessary command 2023-04-01 22:34:32 +08:00
Liu 173511b034 ci(github): update the script in the package step 2023-04-01 22:34:31 +08:00
Liu 0cfc03bb4d ci(github): remove the build step for the test program 2023-04-01 22:34:30 +08:00
Liu d002abe398 ci(github): update build script 2023-04-01 22:34:29 +08:00
Liu 526260662e ci(github): update build job steps 2023-04-01 22:34:29 +08:00
Liu a6058aab35 ci(github): update steps 2023-04-01 22:32:21 +08:00
Liu dc48cc895d ci(github): add test coverage report 2021-05-30 00:01:29 +08:00