479 Commits
Author SHA1 Message Date
waozi 7f4fbe70f4 Keep Markdown source intact while folding technical ranges 2026-11-27 04:59:41 -03:00
waozi e643adc4b2 Migrate gallery scenes to layout containers and document CSS completion 2026-11-26 10:23:29 -03:00
waozi bb9434f6c5 Add reusable Markdown image references for embedded editors 2026-11-25 21:24:07 -03:00
waozi b59623b410 Split the API reference into topic files
docs/API.md becomes a short index and its sections move verbatim into widget-package, control, motion, style, GTK theme, image, application, hosted-widget, host, game, audio, persistence, scene-rendering, painting and model references. The AVIF compression section joins BACKENDS.md and the renderer benchmark joins PERFORMANCE.md. The runnable HTML example leaves HTML_TO_KRYON.md for HTML_EXAMPLES.md, and cross links point at the new files. Every fact moves and nothing is dropped; the uncommitted Hosted widgets heading and SceneResizeOpaqueInto paragraph another lane left in API.md are kept. No stale claims were removed because every kept symbol still exists in the tree.
2026-11-22 14:56:25 -03:00
waozi eead9ee1c6 Add miniature workspace pager and centered panel bands 2026-11-22 06:40:46 -03:00
waozi 440ba6c79d Share Sweet window chrome and compact dark panel tokens 2026-11-22 05:59:49 -03:00
waozi a3b307b9ee Run approved nested ZX apps in linked hosted shells
Bind child services per instance and keep each child frame in its own widget scope. Cover scoped layout, unknown imports, stale handles and trap cleanup in the native ZX fixture.
2026-11-22 05:04:24 -03:00
waozi 102790f4bf Separate hosted surface scheduling from composition
Let hosted consumers schedule cheap state checks without rebuilding unchanged frames, and lend retained packed RGB rows directly to synchronous presenters. Keep 32-row batches and verify full, row and packed consumers across input, resize, timing and failed-present recovery.

Local tests: native/ZX surface render and hosted consumer suites; push-check with the verified toolchain and isolated fixture registry.
2026-11-22 04:58:36 -03:00
waozi a66edf1980 Support linked desktop ZX app hosts 2026-11-22 01:58:15 -03:00
waozi 8f73f909f0 Add optional Android GLES frame presentation 2026-11-21 21:28:34 -03:00
waozi cf78475a09 Add PDF image pixels and wrapped text measurement 2026-11-21 17:46:40 -03:00
waozi facaace350 Add responsive native dashboard layout 2026-11-21 16:59:53 -03:00
waozi 361fb0197f Prevent clicks after pointer drags and X11 foreign grabs 2026-11-21 16:20:26 -03:00
waozi 72ee9cce52 Support wheel input and portable GTK style records 2026-11-21 04:16:16 -03:00
waozi b764139c3c Share Kryon window chrome and retain portable Surface damage 2026-11-21 03:50:51 -03:00
waozi b107847a78 Make retained layouts easier to style, animate and preview 2026-11-20 12:13:01 -03:00
waozi 9ea1567980 Add opt-in native stylesheet and layout motion 2026-11-20 01:48:13 -03:00
waozi da94e6ad6d Add modular Kryon motion and restore native ZX parity 2026-11-20 00:59:58 -03:00
waozi 35fc05cbb7 Make native UI authoring easier with CSS, DOM widgets and previews 2026-11-19 22:05:49 -03:00
waozi 788f0151f7 Add hosted ZX software surfaces for Kryon apps
Reuse the Kryon frame, input and pixmap paths behind four typed surface bindings.
Verify the guest bundle in Ziran and the installed TaijiOS emulator.
2026-11-19 16:05:21 -03:00
waozi d2e537cc94 Keep animated image meshes and Android startup responsive 2026-11-19 02:03:27 -03:00
waozi a77c82bf0c Reuse linked scene shaders across room switches
Keep a bounded set of recent material programs and match their owned shader instructions across separately prepared scenes. Keep borrowed lookup pointers inside the frame and evict unused programs by last use.
2026-11-19 01:10:57 -03:00
waozi e2212c43dc Read opaque PowerVR scenes from their resolved framebuffer
Retain the resolved target in each asynchronous transfer slot until its fence signals. Skip the straight-alpha conversion draw for opaque ARMv7 PowerVR output and profile program setup, texture upload, GPU completion, pixel transfer and image publication.
2026-11-19 00:47:20 -03:00
waozi b14f4e5db1 Keep Android floating windows rendering during activity pause 2026-11-19 00:28:22 -03:00
waozi b6f35a7408 Document Android's linked picture codecs
Android decodes PNG, WebP and AVIF in process with the linked codecs; other
formats use the activity's decodeBundleImage bridge, and
`make android-pictures-device-test` checks both on the USB Moto.
2026-11-18 14:22:39 -03:00
waozi ac6c8f47b8 Add VRM 0.x avatars: humanoid map, expressions, lookAt and spring bones
scene_vrm reads the VRM extension of a .vrm/.glb loaded through scene_gltf:
the humanoid bone map, blend shape expressions (blink and the rest) set as
morph weights, Bone lookAt through its range curves, and VRM 0.x spring
bones with sphere colliders. Springs follow UniVRM's VRMSpringBone (Verlet
inertia less drag, stiffness back to rest, gravity, length kept, pushed out
of colliders), step at a fixed 60 Hz in the world placed by VrmSetFrame so
whole-body motion swings the hair, and settle at rest after a seek. Node
positions come from the instance TRS, so one GltfUpdateScene a frame is
enough.

make scene-gltf-test also runs the VRM checks from source and saved IR
against a small fixture: bone map, expressions, lookAt curves, gravity,
colliders, stability at uneven frame steps while the body moves, settling.
2026-11-18 13:10:37 -03:00
waozi 0ad6f6cf07 Load glTF 2.0 models into scene meshes and skins
Read .gltf and .glb documents in Ziran: buffers, bounds-checked accessors
for every component type with normalized integers and sparse overrides,
triangle primitives with the standard vertex attributes and morph
targets, node hierarchies, skins and LINEAR, STEP and CUBICSPLINE
animations. Materials keep PBR factors, texture info, alpha modes and
PNG or JPEG images from URIs, data: URIs or bufferViews.

The scene adapter creates one indexed mesh per primitive and a SceneSkin
per skinned primitive, samples animations into node poses and morph
weights, and can switch to dual-quaternion skinning. Malformed files
report a diagnostic instead of crashing.

Tests cover the small fixtures, every interpolation mode, sparse and
normalized accessors, malformed files, and a headless GLES render of an
animated two-bone skin against a committed reference. The Khronos sample
models committed here are CC-BY-4.0 or CC0-1.0 with their attribution.
2026-11-18 11:33:54 -03:00
waozi e74f080498 Benchmark and accelerate Kryon shader workloads 2026-11-18 02:43:52 -03:00
waozi 1ed9695e52 Keep full GPU shadow filtering without hardware PCF
Use nearest depth textures and interpolate the comparison results in the material shader when the hardware probe fails. Exercise CPU parity and shadow rendering with both paths.
2026-11-18 01:37:05 -03:00
waozi 4b79d97615 Retain smooth indexed scene geometry on GLES
Upload only changed vertex streams during deformation and keep material texture uploads on their assigned sampler units.
2026-11-18 01:33:24 -03:00
waozi 9c8240a73f Give terminal-style desktop apps the services they used raylib for
The SDL2/Cairo desktop host gains what kryonlabs/terminal and Harmony's
terminal need to leave kryon/Raylib:

- kryon/desktop_activity: DesktopWaitForActivity(descriptors, ms) sleeps
  until a program descriptor such as a PTY is readable, window input is
  queued, or the time ends, leaving queued input for PollDesktop. Windows,
  web and Android report DesktopActivityUnsupported.
- OpenDesktopWindow(width, height, title, options) with resizable,
  undecorated, topmost and always-run windows; OpenDesktopTitled stays the
  resizable window.
- DesktopFrameRate(fps) paces the frame clock, 0 drawing without waiting;
  a stable screen never settles faster than the configured rate.
- DesktopExitKey(key), PollMiddlePointer(), DesktopSetFullscreen,
  DesktopToggleFullscreen, DesktopFullscreen and DesktopPrepareGlyphs.

tests/ziran_desktop_host_gaps_test.sh covers each on a private Xvfb, from
source and saved IR.
2026-11-17 22:29:37 -03:00
waoziandClaude Opus 5.5 4923381c88 Load the pictures an Android app ships from its APK on first use
Android Frame apps draw through Pixmap, which found only pictures already
registered, so every file picture showed "Missing image". Pixmap now asks
an optional picture source the first time it measures or draws an
unregistered path, once per missing path until invalidation or host
cleanup. pixmap_assets_android registers a source that reads the APK asset
through AAssetManager and decodes it, and the Frame host imports it, as
desktop Cairo loads pictures on first use.

Tests: the Android image services test covers lazy loading, caching, the
single lookup per missing path, retry after invalidation and cleanup. A
new device suite decodes a framework PNG through Android's real
AssetManager inside its VM and compares it with an independent decode;
tests/android_vm_device_test.py now runs it and the typeface suite. Frame
host tests link the codecs that apps link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 17:23:44 -03:00
waozi da7f5755b1 Write assets given as bytes to temporary files on Windows
Fonts registered from bytes and pictures from a program's asset reader
became Linux in-memory files opened through /proc/self/fd, which MinGW
cannot link. cairo_assets now takes its files from asset_files_linux
(memfd, as before) or asset_files_windows, which writes each asset to a
file of its own in the user's temporary folder by an ASCII path and
removes it when it is closed or when the program exits.

windows_desktop_test.py runs a new Wine program, linked with -lws2_32,
that draws text in a font given as bytes, decodes a picture given as
bytes, calls Winsock's connect beside the image decoders, and leaves no
temporary files behind.

Local tests: the whole Windows desktop suite passes under Wine on a
private display, and the Linux desktop windows test still reads
embedded pictures and fonts from in-memory files.
2026-11-17 17:11:38 -03:00
waozi bda9e9d9a2 Add skinned scene surfaces and a portable watercolor material
kryon/scene_skin gives scenes indexed surfaces with four-influence
skinning that always deforms from bind data. kryon/watercolor samples real
paper and pigment bitmaps with soft light and a Fresnel rim, and its
finishing pass adds brush regions, paper grain, pigment pooling and pencil
contours while keeping alpha exact. Both run on the CPU renderer and the
translated GLES path. Desktop LoadImagePixels accepts an optional host path
resolver so bundled assets decode like disk images.
2026-11-17 16:49:39 -03:00
waozi 34f26c2523 Fix scene GPU linking for Android API 21
Use Android's default EGL display and preserve its current context without
importing desktop GLX or newer EGL platform entry points. Link EGL and GLESv3
through the shared Android CMake helper.

Add strict API21 NativeActivity link coverage for both ARM ABIs, rejecting
GLX/newer EGL symbols and requiring the real Android/EGL entry points.
Document the Android generation and link requirements.

Local tests: both-ABI NativeActivity links passed; build-queue -- make push-check
passed, including desktop host, gamepad, text-hook and pixmap GPU coverage.
2026-11-17 15:27:32 -03:00
waozi 455c364e76 Export the image placement rules apart from file pictures
kryon/image brings file pictures since 15c3a22e, so a program that
imports it links a host's ImageWidth and ImageHeight. Jungle's story
layout test uses only ImageFitBounds and ImagePreviewSource and no
longer linked. Export image_behavior for code that needs only the rules.

Local tests: a package consumer using kryon/image_behavior links and runs
without a host; the same program with kryon/image reproduces the
undefined ImageWidth and ImageHeight.
2026-11-17 14:46:23 -03:00
waoziandClaude Opus 5.5 e05146b3ba Host Android apps that run their own frame loop
kryon/android_runtime keeps NativeActivity lifecycle and input in the host
while the application's main owns its loop, widgets and pacing:
PollAndroidHost, BeginAndroidFrame and EndAndroidFrame present Pixmap's
device-pixel damage. The host calls the application's C main by symbol, so
generated C never declares main with Ziran's argument types. Pixmap's
RasterSetTransform and RasterPointFromPixels share one camera for painting
and input.

kryon/pixmap_assets_android decodes owned PNG, WebP and AVIF pictures on
first use, and kryon/pixmap_typefaces_android shapes text with Android Paint
and Canvas through the ordinary typeface_source capabilities.

The renderer-desktop artifact also builds Android ARMv7 and AArch64 codec
archives and the shared AVIF bridge, pinned to AVIF 2611e727.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 13:30:41 -03:00
waozi 0a86415bff Apply a followed palette to the active theme too
SystemPaletteApply installs a system palette as style rules and as the
active theme's colours, so code that draws from CurrentPalette() matches
the host as well as styled widgets. SystemPaletteUpdate applies a palette
only when it changed; SystemPaletteFollow in SystemThemeHostLinux and in
the portable SystemThemeHost feeds it each frame, so ZX apps such as
Harmony's Telegram follow a host's theme change with one call.

The parent-theme test checks CurrentPalette() after a followed change.
2026-11-17 11:43:53 -03:00
waozi 13ff9478a3 Expand a host's palette into a full theme palette
SystemTheme.SystemPaletteColors(palette) builds a complete theme Palette
from a system palette such as the one Harmony gives an embedded app: its
background, surface, text, accent and border, and surfaces, text levels,
borders, selection and controls mixed from them, so an app that draws
from a theme palette matches its host completely.

The parent-theme test checks the expanded palette after a host change.
2026-11-17 11:29:23 -03:00
waozi 81e337a6e0 Let embedded apps follow their host's theme with one call
SystemThemeHostLinux.SystemPaletteFollow() installs the current palette,
the host's while an app is embedded, the first time and again whenever
the host changes it, and returns true when it installed. An app that calls
it once per frame follows a theme change in Harmony's Sessions window
without colour code of its own.

The parent-theme test gains a follow scenario: one install, none while
unchanged, and one after each host change. Both theme tests now link libm,
which the style sheet code needs.
2026-11-17 11:17:35 -03:00
waozi a4817c9907 Use core Ziran audio for desktop and Android media playback
Use the platform-selected asynchronous std audio sink and core mixer,
remove the six moved Kryon audio modules and exports, and select their
published compiler and optional Opus package pins. Add actual Moto UI
PCM source/saved validation and retain deterministic device-failure tests.

Local tests: desktop PCM/MP3/Vorbis, Windows Wine host and audio,
Moto source/saved UI PCM, ziran check and push-check passed. The full
shared-tree test stopped at the separately owned Canvas program-entry
title/boot test; this commit has no program-entry or title changes.
2026-11-17 11:06:45 -03:00
waozi a814f67710 Document and test headless image dimension bindings 2026-11-17 00:36:25 -03:00
waozi 028d42cb15 Provide native frame snapshots and desktop image services
Add exact/folder/all picture cache invalidation, shared oriented preview
pixels, and owned previous-frame snapshots for desktop and NativeActivity.
Keep alpha and row orientation through Image transitions, including negative
camera origins. Capture desktop frames after presentation and preserve Android
pixels until the route finishes composing. Web returns an invalid snapshot.

Local tests cover source/saved desktop and Android pixels, Windows/Wine
snapshots, native image previews, Canvas browser/Wasm, Android NDK host links,
frame transition behavior, bitmap ownership, and push-check.

Known upstream gap: published Ziran ebd19223 rejects the portable bitmap Image
test in PixmapGpuCorners with assembly.gap.machine-copy. Reproduced unchanged
on origin/master 216c190c: function 300, block 5978, instruction 27407.
The native C control passes. See plans/2026-11-16-remove-raylib.md.
2026-11-16 22:36:04 -03:00
waozi 216c190c43 Document only current Kryon APIs and website pages
Remove raylib paths, obsolete import and preview guidance, migration prose,
and orphaned documents/pages. Align widget imports, native ZX windows and
host contracts with the current implementation, and enforce current site routes.
2026-11-16 21:43:18 -03:00
waozi 0f5c68e162 Let Escape dismiss modals independently of outside clicks
Keep outside releases blocked by default while allowing Escape to close the top modal. Preserve dismiss_disabled as the explicit override for both routes, including through the portable widget host.
2026-11-16 21:40:47 -03:00
waozi 9052a642a0 Apply desktop camera offsets to Cairo painting and pixel snapping 2026-11-16 21:03:44 -03:00
waozi 66a11957b4 Use native desktop and Android hosts for window runtime 2026-11-16 20:50:54 -03:00
waozi 0c6f138e31 Show a program's ZX window in the browser through the canvas player
A program entry (one that declares main) was refused in any profile but
codegen c99, so window.zi's ZX could not run in a page. A codegen = "zx"
profile now bundles the program's own main with portable IR, which
kryon/app gives the zx_window window; no generated program host is made.

In the page the ZX canvas player runs such a bundle through
window_page_player.zi: it binds zx_window's five capabilities to the page's
canvas with page_core, as page_window does for a C program, lowers the
bundle to Wasm in the page and runs main until the page closes. Each wait
for an event sleeps, which yields to the page, so the program's own loop
never blocks it. zx_window_bundle.zi holds the capability check both
players use. The editor's Wasm platform opens window.zi this way, and its
browser test checks that the page's canvas is cleared to the frame colour.
2026-11-16 19:47:52 -03:00
waozi f10e551f6c Ship the desktop window as a host library zx2native links
window.zi's bundle asks its host for five zx_window capabilities. The
desktop zx player binds them in-process for `ziran run`, but a native
executable from zx2native had no host to call, so the editor's Native
Assembly and Binary stopped at assembly.gap.machine-host.

zx_window_host.zi exports the five capabilities with the C ABI the C
target gives zx_window's declarations, over the same desktop_window SDL
window. `make zx-window-host` builds build/lib/libkryon-desktop.so from it
alone, and `make install-user` installs it to ~/.local/lib/kryon and
registers ~/.local/share/ziran/hosts/kryon-desktop.library, so zx2native
links window.zx into a Linux executable that opens its 320x160 "Window"
in the empty frame's colour and exits 0 when it closes.

zx_window_test runs both routes on a private Xvfb, the player through
`ziran run` and the executable directly, and checks that with no library
registered zx2native stops at the gap naming ZxWindowOpenHost.
2026-11-16 19:47:52 -03:00
waozi 77184e46c5 Export shared Markdown preview and editor
Expose byte-preserving Markdown formatting and TextArea composition as optional
package imports for Breeze Diary. Wire native and portable editor behavior
coverage into make test and test-focus, and document the public surface.

Signed-off-by: Waozi <[email protected]>
2026-11-16 16:38:49 -03:00