Commit Graph
83 Commits
Author SHA1 Message Date
Liu 038b378d9b fix(ui): avoid mbstowcs assertion in ui_print_tree on Windows
The %ls format in logger_error went through UCRT's wide-to-multibyte path, which triggered a debug assertion in mbstowcs.cpp under non-UTF-8 locales and also produced unreadable output when the console code page was GBK.

Switch the tree drawing to UTF-8 byte literals so the log path stays purely narrow, and temporarily set the console output code page to CP_UTF8 around the dump so the box-drawing characters render correctly.
2026-06-01 22:27:08 +08:00
Liu afa800dfaf build(xmake): fix package name, target naming and example install
- Remove per-lib set_project() calls that overrode the global lcui
  project name; xmake show now correctly reports the project as lcui.
- Move per-lib set_version() into the corresponding target() block so
  each sub-library keeps an independent version usable for standalone
  packaging.
- Add set_default(false) and set_group(examples) to all pandagl
  examples so they are no longer picked up by xmake package.
- Rename targets to use dashes for consistency:
    pandagl_cairo_example  -> pandagl-cairo-example
    preview_block_layout   -> preview-block-layout
    preview_flex_layout    -> preview-flex-layout
    preview_scrollbar      -> preview-scrollbar
    preview_widget_opacity -> preview-widget-opacity
- Bump yutil submodule to drop its set_project() call as well.
2026-06-01 22:27:07 +08:00
Liu 61f0aba32f refactor(pandagl): rename font API to align with typeface/glyph concepts
The previous naming conflated multiple levels of the font model:
pd_font_t actually owned a single typeface resource (FT_Face), while
pd_font_bitmap_t represented a per-glyph bitmap. The pd_font_library_*
prefix was redundant under the pd_font_ namespace and resulted in
verbose call sites (up to 34 chars).

Type renames
- pd_font_t          -> pd_font_face_t
- pd_font_bitmap_t   -> pd_glyph_bitmap_t
- font_engine_t      -> pd_font_engine_t
- struct tags updated to match the typedef names.

API renames (grouped by sub-object)
- Face lifecycle:    pd_font_create/destroy -> pd_font_face_create/destroy
- Face registry:     pd_font_library_add_font     -> pd_font_register
                     pd_font_library_get_font     -> pd_font_get
                     pd_font_library_get_font_id  -> pd_font_get_id
                     pd_font_library_query        -> pd_font_query
                     pd_font_library_load_file    -> pd_font_load_file
                     pd_font_library_get_font_path-> pd_font_find_path
                     pd_font_library_get_default_font -> pd_font_get_default
                     pd_font_library_set_default_font -> pd_font_set_default
                     pd_font_library_set_font_family_alias
                                                  -> pd_font_family_set_alias
                     pd_font_library_update_font_weight
                                                  -> pd_font_replace_weight
                     pd_font_library_update_font_style
                                                  -> pd_font_replace_style
- Parsing helpers:   pd_font_library_detect_weight -> pd_font_parse_weight
                     pd_font_library_detect_style  -> pd_font_parse_style
- Glyph rendering:   pd_font_library_render_bitmap -> pd_font_render_glyph
                     pd_canvas_mix_font_bitmap     -> pd_canvas_mix_glyph_bitmap
                     pd_font_bitmap_init/destroy   -> pd_glyph_bitmap_init/destroy
- Glyph cache:       pd_font_library_add_bitmap    -> pd_font_cache_add_bitmap
                     pd_font_library_get_bitmap    -> pd_font_cache_get_bitmap

pd_font_library_init/destroy are kept as the module lifecycle entry
points, matching the FT_Init_FreeType / FT_Done_FreeType convention.

All call sites in lib/pandagl, lib/ui, lib/ui-xml, src/, tests/ and
examples/ are updated accordingly.
2026-05-24 22:41:28 +08:00
Liu e873c47216 refactor(ui): change image event listener return types to bool 2026-03-31 21:20:28 +08:00
Liu ded5f84022 fix(ui): memory leak and division by zero error 2026-03-31 21:20:28 +08:00
Liu c4895a3efb fix(ui): cannot set css shorthand property 2026-03-31 21:20:28 +08:00
Liu 06a958eda4 fix(ui): clear implicit conversion warnings 2025-08-16 11:22:29 +08:00
Liu 1de2dfd62c fix: delay refresh window to use the latest size of widget 2025-04-16 00:16:38 +08:00
Liu 9510e2c2ef style: format code and delete unused files 2025-01-06 23:14:33 +08:00
Liu 940a0fc33a chore: update copyright 2025-01-05 23:29:56 +08:00
Liu 4ad7d8a4fb feat: font alias 2025-01-05 23:08:45 +08:00
Liu 24f3192b9a refactor: update LCUI's dependencies on ui-widgets and ui-router 2024-12-29 23:37:24 +08:00
Liu cfa605110e style: add BOM header 2024-12-23 00:02:48 +08:00
Liu 6851e9aef3 refactor: change type naming style 2024-12-22 23:14:13 +08:00
Liu 4f19df5c7a fix(ui): incorrect line-height calculation 2024-12-22 23:14:13 +08:00
Liu d1493e315d feat: new layout process 2024-12-22 23:14:13 +08:00
Liu 44ab3aeae6 feat(ui-widgets): add scrollarea 2024-12-07 13:30:31 +08:00
Liu bd1129f7b0 fix(ui): flex-basis was not recalculated during layout 2024-12-07 13:30:30 +08:00
Liu fcff153784 fix(ui): correct width calculation 2024-12-07 13:30:30 +08:00
Liu 9435396de5 feat(ui): add ui_widget_set_background_image_url() 2024-12-07 13:30:30 +08:00
Liu 1f35451526 feat(ui): add css background-clip property 2024-12-07 13:30:30 +08:00
Liu 0c9abbe15b fixup! feat(ui): improve the event and loading logic of image loader 2024-12-07 13:30:30 +08:00
Liu 20ae97a1a2 feat: lib/platform -> lib/ptk
BREAKING CHANGE: lib/platform -> lib/ptk, and the naming style of
libplatform has changed to have a `ptk_` prefix.
2024-12-07 13:30:29 +08:00
Liu 5efe7f3ae9 fix(ui): the class change of ancestor widgets did not trigger style refresh 2024-12-07 13:30:29 +08:00
Liu 375e03bd36 feat: replace custom bool type with bool type in stdbool.h 2024-12-07 13:30:28 +08:00
Liu 68a0f0d828 feat: DPI awareness 2024-09-19 00:06:05 +08:00
Liu e4b0eb4d8d feat: DPI awareness 2024-09-19 00:06:04 +08:00
Liu fe6efbdd8f feat: window fullscreen 2024-09-19 00:06:04 +08:00
Liu d3d36fa19d Revert "feat: replace decode_utf8 with mbstowcs"
This reverts commit 9e225e9d27.
2024-09-19 00:06:04 +08:00
Liu 16002e0846 fix(ui): the widgets created in the ready event handler aren't updated 2024-05-13 22:49:22 +08:00
Liu 9e225e9d27 feat: replace decode_utf8 with mbstowcs 2024-05-13 22:49:22 +08:00
Liu f8e32821a7 feat(ui): improve the event and loading logic of image loader 2024-05-13 22:49:22 +08:00
Liu 1534e4b1c3 feat(pandagl): update image reader to support reading one row of data 2024-05-13 22:49:22 +08:00
Liu a6dea4de1a fix(css): CONVER -> COVER 2024-05-13 22:49:22 +08:00
Liu d60ec9227d chore: update copyright year 2024-05-13 22:49:22 +08:00
Liu 26641aa0b3 fix(ui): window title mutation not applied 2024-05-13 22:49:21 +08:00
Liu 023b35e245 chore: add copyright header 2024-05-13 22:49:20 +08:00
Liu 5c8186faad refactor: clear compiler warnings 2024-05-13 22:49:19 +08:00
Liu 3d1531df3e fix(ui): correct the width calculation when max width is valid 2024-05-13 22:49:19 +08:00
Liu f8d3f17cb9 fix(ui): correct the calculation of % unit size within the block layout 2024-05-13 22:49:19 +08:00
Liu 02c306c685 fix(ui): request reflow after self size change 2024-05-13 22:49:18 +08:00
Liu 261ee1b993 fix(ui): some dirty rectangles are not collected 2024-05-13 22:49:18 +08:00
Liu d6f0f8e98f feat(ui): add css_load event 2024-05-13 22:49:18 +08:00
Liu 62ca908c81 style: centent -> content 2024-05-13 22:49:18 +08:00
Liu 6f745cb9f6 fix(ui): widget size not stable after style update 2024-05-13 22:49:18 +08:00
Liu 1552a71ff8 fix(ui): correct vertical-align related position calculation 2024-05-13 22:49:17 +08:00
Liu a7b36c51a0 refactor(ui): rename widget default prototype functions 2024-05-13 22:49:17 +08:00
Liu f2466c7d75 feat(ui): improve widget update process and related data structures 2024-05-13 22:49:17 +08:00
Liu 549f8077a6 fix(ui): correct widget box comparison and dirty rectangle collection 2024-05-13 22:49:17 +08:00
Liu 322f57fb7f fix(ui): correct flex item width compute 2024-05-13 22:49:16 +08:00