9 Commits
Author SHA1 Message Date
Liu 3270d8f34f fix(examples): make the fabric demo DPI-aware and fit the window
Run the simulation in a fixed 800x600 world and map it into the widget with an object-fit: contain viewport, so rendering and mouse hit testing share one transform. Derive the draw scale from the canvas buffer and content box because the global scale read in the timer callback does not match the buffer DPI. Let the canvas fill the window instead of a fixed size and keep the fabric world unchanged on resize.
2026-11-22 20:11:23 +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 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 6851e9aef3 refactor: change type naming style 2024-12-22 23:14:13 +08:00
Liu bdd7cb5f75 feat: merge libtimer into libptk
BREAKING CHANGE: lcui_set_timeout -> ptk_set_timeout, lcui_set_interval -> ptk_set_interval
2024-12-07 13:30:29 +08:00
Liu b49da7e4fc build: set cairo as optional 2024-05-13 22:49:21 +08:00
Liu 53ec550701 docs(examples): simplify fabric example code 2023-06-03 18:06:33 +08:00
Liu 80afffa60a feat(ui): remove uncommon parameter of ui_widget_on() 2023-05-20 23:06:13 +08:00
Liu 9ad372595a docs(examples): add fabric example to show how to use cairo 2023-04-30 16:55:36 +08:00