34 Commits
Author SHA1 Message Date
Liu 7c72628f23 fix(ui-server): apply window resize before the first frame
ui_server_on_window_resize() required INITIALIZED, but the doc-viewer tests resize a window before ui_server_update transitions PENDING to INITIALIZED, especially under Xvfb, so the resize was ignored. Update the widget whenever a connection exists.
2026-11-21 13:46:27 +08:00
Liu 093a6a1e35 feat: add explicit window lifecycle and per-window event routing
- add the window API and lifecycle design specs
- lcui_init no longer creates a window; settings loading is explicit
- add lcui_window_* create/bind/geometry/state/show/close api
- replace display modes with window options and quit-on-last-window
- add per-window event scopes and window-based pointer/keyboard routing
- keep pending updates for widgets appended during a frame
- migrate examples, tests, previews and internals docs
- remove default-scope focus and mouseover getters
2026-11-16 00:03:50 +08:00
Liu 7ecac3ae2b refactor(ui-server): merge ui-cursor into ui-server
- move cursor.c and ui_cursor.h into libui-server
- remove the libui-cursor target and package
- drop the unused ui.h and yutil dependencies
- declare libcss explicitly for ui-server
2026-11-08 00:20:28 +08:00
Liu 708611a727 feat(ui-server): sync system cursor with hovered widget style
Expose ui_get_mouseover() and, at the end of ui_server_update(), resolve
the first non-auto cursor up the hover ancestor chain (emulating CSS
inheritance), then apply it to the owning window. Runs after style
recomputation so :hover and dynamic changes take effect in the same
frame; resets to auto when the hovered widget is destroyed.
2026-10-17 21:16:47 +08:00
Liu 3801fdc10f refactor(yutil): rename public APIs and migrate timer to ptk
- charset module renamed to encoding (decode/encode kept)
- time: get_time_ms → y_gettime, sleep_ms → y_sleep
- time: delete get_time_us, get_time_delta, sleep_s
- string: strdup2 → y_strdup, wcsdup2 → y_wcsdup
- string: strtolower → y_strlower, strtrim → y_strtrim
- string: wcstrim → y_wcstrim, strhash → y_strhash
- string: strreplace → y_strreplace, strsplit → y_strsplit
- string: delete wcsreplace, cmdsplit
- math: delete y_iround, y_pow2
- timer module migrated from yutil to ptk as internal timer_scheduler
- WinMain simplified to use __argc/__argv instead of cmdsplit

BREAKING CHANGE: all renamed yutil public APIs require downstream
  to update function names. Deleted APIs require code changes:
  - get_time_us: use y_gettime() for ms timestamps
  - get_time_delta: use y_gettime() - start instead
  - sleep_s: use y_sleep(ms) with millisecond argument
  - wcsreplace: no replacement, had zero callers
  - cmdsplit: WinMain now uses __argc/__argv from CRT
  - timer_list_*: migrated to ptk timer_scheduler_*;
    ptk_reset_timer still available for external use
2026-08-05 22:42:26 +08:00
Liu 6cd01b468e chore: update copyright comment 2026-08-05 22:42:22 +08:00
Liu 7f9f52b904 chore: update copyright and email 2026-08-05 22:42:16 +08:00
Liu 4bb0d51cd5 feat(settings): schema-driven serialization and window state persistence
- Per-window state with [window.<id>] sections in settings.ini
- Settings module split into rendering and window_state subsystems
- Schema-driven (de)serialization with DEFINE_SETTING_INT/BOOL_FIELD macros
- Listener-based change notification via deserialize/serialize callbacks
- Integration tests for get/set, validation, and bind/restore lifecycle
2026-08-05 22:42:14 +08:00
Liu 9fd4bdb89f fix(ptk): ui_server should not bypass platform window destruction flow 2026-08-05 22:42:13 +08:00
Liu 2d17001076 chore: remove unused debug log 2026-08-05 22:41:32 +08:00
Liu 7952ff2508 fix(ui-server): correct inverted strcmp for update_visible flag
The visible property check was missing '== 0', so any non-visible property change incorrectly set update_visible to true, while actual visible mutations were ignored. This caused the window to never receive ptk_window_show on Windows.
2026-08-05 22:41:25 +08:00
Liu ae9b228f48 fix(ptk): incorrect window minmaxinfo 2025-04-30 18:54:20 +08:00
Liu 1de2dfd62c fix: delay refresh window to use the latest size of widget 2025-04-16 00:16:38 +08:00
Liu 940a0fc33a chore: update copyright 2025-01-05 23:29:56 +08:00
Liu 24f3192b9a refactor: update LCUI's dependencies on ui-widgets and ui-router 2024-12-29 23:37:24 +08:00
Liu 6851e9aef3 refactor: change type naming style 2024-12-22 23:14:13 +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 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 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 b23be50c1b fix(ui-server): UNINITIALIZED READ 2024-05-13 22:49:18 +08:00
Liu 80afffa60a feat(ui): remove uncommon parameter of ui_widget_on() 2023-05-20 23:06:13 +08:00
Liu 9c4f0e9391 refactor: RGB() -> pd_rgb() 2023-05-03 21:49:46 +08:00
Liu f5d0d120a2 refactor: update header files and xmake.lua 2023-04-30 00:31:47 +08:00
Liu d4ea54a78a refactor: remove some dependencies of libui 2023-04-01 22:36:10 +08:00
Liu cc5dfe4690 refactor: remove the dependency of libcss on LCUI 2023-04-01 22:36:09 +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 9b7bf239f2 refactor: redesign the graphics library API (#281)
* refactor: redesign PandaGL library

* refactor: update rect and canvas API

* refactor(pandagl): renames the line drawing function

* refactor(pandagl): replace pd_painter_t with pd_context_t

* fixup! refactor: update rect and canvas API

* test(pandagl): add tests

* fixup! refactor: update rect and canvas API

* fixup! refactor: update rect and canvas API

* fixup! refactor: update rect and canvas API

* fixup! refactor: update rect and canvas API
2023-04-01 22:35:29 +08:00
Liu 7ea167efc5 refactor: redesign CSS Library API 2023-04-01 22:35:26 +08:00
Liu 90f595ea20 refactor: redesign platform and ui libraries
feat: redesign the ui library

fixup! feat: redesign the app library

feat: add the ui-server library

fixup! feat: redesign the ui library

fixup! feat: redesign the app library

fixup! feat: redesign the ui library

fixup! feat: redesign the app library

fixup! feat: redesign the app library

feat(ui): add mutation observer

fixup! feat: add the ui-server library

fixup! feat(ui): add mutation observer

feat: migrate to new app and ui libraries

refactor: rename LCUI_Build.h and remove some macros related to malloc

build: copy lib/yutil/include/yutil/*.h into the include/LCUI/util

refactor: lib/app -> lib/platform

refactor: clear compilation errors in Linux

fix: conditional jump depends on uninitialised value

fix(platform): incorrect Linux app driver

feat(platform): add --use-linux-input-event option

fix(platform): correct app driver and data types

fix: test_settings failed

fix: test errors and memcheck errors

fix: undefined reference to 'WinMain'

fix(platform): the error message is not formatted correctly

fix(platform): the mouse position in the mouse event is incorrect

fix(platform): incorrect window size

fix(util): undefined reference to 'logger_log'

refactor: remove the dependency of fontlibrary.h on graph.h

fix: freetype.dll not found

fix(ui): the wheel event was not dispatched correctly

fix(ui-server): the window in the minmaxinfo event is not required

fix: the widget is not connected to the window

fix(ui): mutation observer connection node incorrect

refactor(css): update LCUI_StyleListNode structure

refactor(ui): LCUI_WSTATE_* -> UI_WIDGET_STATE_*

fix: the root widget must have a fixed size for the layout to be correct

fix(ui): root widget did not trigger the ready event

fix(ui): mutation observer not working

fix(ui-server): widget mutation handler is not working

fix: the UI is not redrawn when resizing the window

fix(platform): APP_EVENT_QUIT not working

fix(platform): Incorrect peekmessage usage

test: use the event functions provided by the libui

docs: add README.md for some libraries

feat(ui): add ui logger

fix(ui-server):  `wnd_mutation` is uninitialized

fix(platform): fb app engine not work

build: fix xmake file matching warning

test: update scroll bar test code

build: use system libxml2

build: delete unneeded openMP rules

refactor(platform): remove tick thread

refactor(ui): clear compilation warnings

fix: memory leak bug

test: fix compilation errors

build: add "headers" target

refactor: LCUI_USER -> APP_EVENT_USER

fix: ui image event was not processed

refactor: delete steptimer.h

test: update requires

fix(platform): incorrect window size

refactor: simplify window creation in ui display mode switching

fix(platform): window position not updated

feat(ui-server): set the initial position of the window to center

feat(platform): add APP_EVENT_VISIBILITY_CHANGE

fix(ui-server): the window content is not completely drawn

fix(platform): windows cannot be maximized and minimized

refactor(ui): change image loader API to public

fix: the window size is incorrect in fullscreen mode

refactor(ui): move some types into ui.h
2023-04-01 22:34:36 +08:00