Commit Graph
200 Commits
Author SHA1 Message Date
waozi 2514568dd9 Add TimePicker for picking a time of day
TimePicker shows a time as 24-hour HH:MM, or a placeholder while no time
is chosen, and opens an hour and a minute column at the current value. A
tap, a finger drag or fling, or the mouse wheel picks and scrolls; Down
opens it, the arrow keys step a column and wrap within it, Left and Right
switch columns, and Enter or Escape closes it. Optional Now and Done
buttons set the current time and close the popup. The time changes as it
is picked, so closing never loses a choice, and the popup stays on screen,
opening above the field when there is no room below. The picker takes the
dropdown's look from every style, light or dark, and portable apps can draw
it through the widget host.

Dropdowns now follow Kryon's light and dark system palettes; a dark palette
left their field and menu light before.

`make -C examples time-picker` builds a window that shows the picker in
each of its states.
2026-10-13 14:38:03 -03:00
waozi 2e7c4e1e93 Take every queued event in each desktop poll
SDL_PollEvent stops at the marker its last pump left at the end of the
queue. When the host woke while another thread was still pushing input,
that marker landed between the pushes, so PollDesktop returned the key
and left the text and click for the next frame. CI's desktop wait test
failed this way. PollDesktop now pumps once and takes every queued event.
The test now covers a marker between two pushes, which fails without this
change.

The desktop examples link the libraries the desktop host now uses and
generate only what their main reaches, as projects do; they had stopped
linking.
2026-10-11 13:21:55 -03:00
waozi 5dfe1c6717 Describe Kryon as fully on Ziran in its docs and site
Build instructions install the ziran command and use the toolchain locked
in ziran.lock instead of a ../ziran sibling checkout. Downstream apps pick up
Kryon changes through ziran.lock. Terminal owns OSC 52 and bracketed paste.
The website no longer calls the migration underway, and its status page
lists the Android host, Zib desktop apps and opt-in DOM CSS layout.

The obsolete files (shell.nix, .ini themes, old site images, the duplicate
API redirect) were removed in 827eae3d, which picked up these staged
deletions.
2026-10-11 10:12:56 -03:00
waozi 84ba2f3045 Add the Liberation Mono pixmap font, Plan 9 text measure oracle and pixmap blend tests 2026-10-10 19:10:13 -03:00
waozi f00dbb2d4f Restore preview themes and fix the test toolchain harnesses 2026-10-01 13:39:56 -03:00
waozi b9ba4a864b Draw text in Kryon's font on every host
The desktop and libdraw hosts never chose a font, so Cairo drew text in the
system's default sans (Noto Sans here), while raylib and the browser hosts
used Kryon's Liberation Sans and the pixmap host bitmap glyphs. Text
differed in face, width, and line breaks from host to host.

- The Cairo hosts load assets/fonts/LiberationSans-Regular.ttf through
  FreeType (KRYON_FONT_PATH, which `kryon run` sets, else the system's
  copy, else fontconfig by name) and lay glyphs out at their unhinted widths
  with gray anti-aliasing, as a browser does.
- The pixmap host rasterizes Liberation Sans outlines itself: contours with
  implied on-curve points, quadratics flattened in 1/256 pixel, non-zero
  winding coverage from five sub-scanlines with exact spans, all integer.
  It places every glyph where Cairo does, and every Ziran target still
  prints the same bytes. tools/outline_font.zi, run as Python, extracts the
  outlines of 207 Latin glyphs (`make pixmap-font`); Terminus is gone.

libdraw finds plan9port without a fixed sibling path: the installed one
$PLAN9 names, or, when a project adds plan9port as a source package, one
Kryon builds once in its build directory; without either it says how to
add it. The kryon tool now builds its Ziran toolchain only when it is
missing, as ziran builds a pinned one, instead of remaking it on every run.
2026-09-30 15:30:25 -03:00
waozi a63545f44d Remove obsolete Kryon runtime and migration archives 2026-09-27 10:36:49 -03:00
waozi 923e2c092d Use Ziran standard math and vector modules directly 2026-09-27 01:08:11 -03:00
waozi ae9e21f9cc Repair desktop example imports and generated output cleanup 2026-09-27 00:36:28 -03:00
waozi 42d009a607 Add desktop project host and persistent terminal UI 2026-09-25 15:32:43 -03:00
waozi af0ee22a5f Use explicit enum scopes with current Ziran and disambiguate text module 2026-09-25 12:30:21 -03:00
waozi 813a9b6b4b Complete current Ziran widget library migration and tests 2026-09-25 02:40:09 -03:00
waozi 6be0bb2582 Replace SDL Cairo desktop example host with Ziran 2026-09-24 17:25:50 -03:00
waozi 43ca4917c0 Move headless hello host to Ziran source 2026-09-24 16:55:48 -03:00
waozi 20f5e34891 Keep cursor and frame pacing decisions entirely in Ziran 2026-09-24 16:28:52 -03:00
waozi a6fed2c577 Revert "Prove native Kryon linking with desktop image and button parity"
This reverts commit 00fdb1e4ad.
2026-09-24 16:18:00 -03:00
waozi 00fdb1e4ad Prove native Kryon linking with desktop image and button parity 2026-09-24 15:57:59 -03:00
waozi de48ba4860 Render asset-backed PNG images in desktop proof host 2026-09-24 15:45:12 -03:00
waozi 618fe643e2 Bind reusable pointer input and prove desktop bundle rendering 2026-09-24 15:33:17 -03:00
waozi b581577b1c Complete Kryon migration to current Ziran syntax and host queue 2026-09-24 14:43:35 -03:00
waozi 39b3d90cad Run Kryon tests with the selected Ziran toolchain 2026-09-24 12:10:18 -03:00
waozi e10462dc0f Delete legacy header-based Kryon path 2026-09-24 01:06:16 -03:00
waozi 37361e6f3a Exercise persistent Ziran widget input in SVG example 2026-09-23 21:45:38 -03:00
waozi e5e5702d9c Add runnable Ziran widget bundle example 2026-09-23 21:12:39 -03:00
waozi 500b9b71b7 Move Kryon UI source into Ziran library layout 2026-09-22 23:34:43 -03:00
waozi 254dabbdd4 Declare the text host in its props header
Move the ten Text* size macros and the twenty-six font calls into
runtime/text_props.kry — constants emit as the same #define macros and Font
arrives through kryon_compat, so the tracked ui_text_props.generated.h carries
the public ABI and include/ui_text.h is deleted. runtime/button.kry, the C
host, kryon.h, ui_text_layout.h, tests, and the font example include the props
header directly.

The handwritten go/kryon/runtime.go Text* constants are removed in favor of the
generated ones; table_host.go types its fallbackFont as int32 explicitly.

Gates: generated-runtime-parity-test, fast-test, k2c/k2cpp/k2go-syntax-test,
go-runtime-test, examples-syntax-test, and the refreshed public-API snapshot
pass.
2026-09-21 01:33:50 -03:00
waozi 0a65540031 Migrate retained UI to .kry and fix the native C boundary
Move app shell, frame, locale, node, screen routes, theme state, and window
policy ownership into src/ui/*.kry, delete the replaced src/core owners, and
make generated public ABI the type source for capability and retained-node
records.

- runtime/capability_props.kry and runtime/node_props.kry generate the public
  capability and node type headers; handwritten headers keep only the C-only
  declarations (function-pointer typedefs, unions, host functions).
- k2c/k2cpp: terminate a same-line case body and map fixed-width casts
  (i32/i64/u8/f32/...) to their C types.
- locale.c matches the generated LocaleParseEntries argument order;
  locale_policy.kry keeps its return type on the signature line.
- ui_window.c renames the X11 dlopen shim symbols off the downstream app prefix.
- Refresh the canonical surface doc, public API snapshot, and test gates.

Verified: runtime parity (C+Go), k2c/k2cpp/k2go syntax, go runtime,
public-api-names, canonical-surface, kryon-boundary, public-api-snapshot,
laws, fast-test, smart-test.
2026-09-20 22:45:56 -03:00
waozi 4b7c4e84f0 Release v0.2.0: Kry UI runtime authored in .kry
Widget, layout, interaction, style, and UI-tree logic is now authored in
the Kry (.kry) UI language and compiled into the native C and Go runtimes,
replacing the hand-written C widget implementation. The remaining C is
platform and raster backends (X11 window, font rasterization, paint command
execution, surface/image caches, test helpers).

- Clipboard OSC52/paste callbacks are host-provided write functions instead
  of raw function-pointer typedefs, unblocking Go runtime generation.
- AccessibilityNode and Accelerator types are generated from .kry.
- Generated-runtime parity test passes for both C and Go.
2026-09-20 19:36:28 -03:00
waozi 2a209d2091 Add RenderTextGlyph and drop preview text paths
Carries the staged tree cleanup (preview canvas/host/io/layers, kry_settings,
helper scripts, probe examples) plus RenderTextGlyph: one-glyph atlas draw on
the active text font stack for fixed-cell surfaces such as terminal grids.
2026-09-20 17:50:53 -03:00
waozi 2afc6e7987 Remove stale web scope output and update canonical fixtures 2026-09-14 17:42:47 -03:00
waozi 101d7c42fd Attach material style pack to all examples 2026-09-14 17:20:51 -03:00
waozi 95241bc213 Use named props in basic widget examples 2026-09-14 02:35:53 -03:00
waozi 23f113aa93 Keep generated widget catalog on clean surface 2026-09-14 02:34:55 -03:00
waozi f76aeff0af Fix generated runtime parity drift 2026-09-14 00:04:11 -03:00
waozi d4b368ced1 Generate scene node kinds from kry props 2026-09-13 22:20:38 -03:00
waozi 0cf9659139 Type button arrow direction in kry props 2026-09-13 21:50:24 -03:00
waozi 1d8a32c665 Canonicalize plot mode in kry runtime 2026-09-13 21:36:50 -03:00
waozi e8ee61b724 Rename embedded-only build macro 2026-09-13 17:36:13 -03:00
waozi 5d554a8a00 Use button foreground for image tint 2026-09-13 06:20:41 -03:00
waozi 8e5c5eb020 Remove button image background prop 2026-09-13 06:17:38 -03:00
waozi 00ff02377b Move image tint to KSS 2026-09-13 06:08:14 -03:00
waozi f9ec974863 Remove text color prop 2026-09-13 05:54:54 -03:00
waozi 55695cdb5b Remove text font prop 2026-09-13 05:45:24 -03:00
waozi af3b3a9208 Remove text letter spacing prop 2026-09-13 05:38:50 -03:00
waozi 172c049467 Move text area line gap to KSS 2026-09-13 05:27:25 -03:00
waozi 3e0220b2d8 Move page spacing to KSS 2026-09-13 05:12:17 -03:00
waozi 80841c5f16 Move Text typeface selection to KSS 2026-09-13 04:57:29 -03:00
waozi 24588a1679 Move text input and tab styling to KSS 2026-09-13 04:35:48 -03:00
waozi 567be704ef Move tab bar font styling to KSS 2026-09-13 04:27:01 -03:00
waozi eb5fb7c827 Clean numeric policy helper names 2026-09-13 04:15:26 -03:00