audio_decode_vorbis adds Ogg Vorbis to audio_mixer by import, streamed at
the stream's own rate through audio/vorbis, which audio ce5837f8 adds over a
pinned stb_vorbis; Kryon now pins that audio commit. make builds the audio
package's libziran_vorbis.a for the programs that link it.
tests/desktop_audio_vorbis_test.zi checks the mixer's frames against
audio/vorbis's own decode of the package's fixtures, a 22.05 kHz stream's
length at 48 kHz, and a Vorbis clip through Kryon's asset audio.
A ZX build of kryon/app shows its window through zx_window: five host
capabilities (open, next event, clear, present, close) and the bundle's
own loop until the window closes. window.zi's bundle is window, app and
zx_window, with no frame, font or text code. The desktop zx player binds
those capabilities to desktop_window, now split into the same SDL steps,
and runs the bundle's main as native code with no engine fallback, so
`ziran run window.zx` opens one 320x160 "Window" in the empty frame's
colour and exits 0 when it closes.
make zx-window-test checks that on a private Xvfb; make
pay-per-import-test checks the bundle's exact modules and host
capabilities and its checked program.
A zx bundle's kryon/bitmap_image now asks its player to create, update and
release the picture (kryon build defines KRYON_ZX for zx profiles), and the
desktop zx player keeps it in its own bitmap store for the session it runs,
so its raster draws it like any other image. Before, a bundle's runtime
texture was unknown to the player and the frame failed.
audio_decode_mp3 adds MP3 and MPEG Layer I and II audio to audio_mixer by
import, streamed at the stream's own rate through audio/mp3, which audio
5ea3f6f1 adds over a pinned dr_mp3; Kryon now pins that audio commit. make
builds the audio package's libziran_mp3.a for the programs that link it.
A stream's last frame now plays before it finishes.
tests/desktop_audio_mp3_test.zi checks the mixer's frames against
audio/mp3's own decode of the package's fixtures, a 44.1 kHz stream's
length at 48 kHz, and an MP3 asset through Kryon's asset audio.
audio_mixer mixes sounds decoded whole, music decoded while it plays and
PCM streams into 48 kHz float32 stereo, with gain, pitch, loops, pause and
a tap on every mixed block. audio_sink_sdl plays it from SDL2's audio
thread; audio_decode_opus (streamed through audio/opus) and audio_decode_wav
add formats by import; media_audio_desktop runs kryon/media_audio on it.
tests/desktop_audio_test.zi renders into its own buffer and plays through
SDL's disk driver, with no audio device.
The Linux desktop host routes each SDL event to the window it names and
reports the sideways wheel. New optional modules, each linked only by the
programs that import it: desktop_keyboard (held, pressed, repeated and
released keys), desktop_window_state (minimize, maximize, restore, raise,
always on top, monitor bounds and display scale), desktop_secondary_window
(more windows with their own Cairo surface, presenter and events, with the
raylib_secondary_window calls), and cairo_assets (embedded pictures decoded
from memory), cairo_typefaces (typeface_source on Pango and fontconfig) and
cairo_render_scale. tests/desktop_windows_test.zi drives them on a private
Xvfb with XTest input.
The desktop rasterizer loads, decodes and smooth-copies file pictures once
a program first asks a picture's size, which every widget that draws one
does first, so vector icons and managed pixels draw without decoders,
threads or asset paths. LanczosSnap is geometry's RectangleSnap, so a
texture draw no longer reaches the Lanczos cache.
A button reaches file pictures and atlas icons through the new
image_lookup. kryon/image is now image_files, which re-exports the Image
widget (image) and fills the pictures; kryon/icon fills the atlas. Library
code imports image itself, so importing a picture-capable widget registers
nothing. Navigation, copy and confirm buttons and the widget host fill the
lookup where they draw, as they reached pictures before. Props modules that
only name Image.Props import image_props, now also exported; unused image
imports are gone.
The frame and the accessibility host reach text requests and editor focus
through text_editing, which text_request and text_input_platform fill, and
the frame samples scrolls through scroll_sampling, which scroll_device
fills.
Desktop examples (C files, C bytes, executable), before -> after:
button 96, 1 411 582, 448 264 -> 70, 980 794, 342 016
text 95, 1 445 077, 462 504 -> 71, 1 020 207, 356 472
textfield 107, 1 580 157, 514 496 -> 84, 1 166 840, 409 840
make pay-per-import-test checks button and textfield; tests whose programs
no longer reach pictures lose their picture bindings and stubs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
kryon/app imports each platform's window (desktop_window, the new
page_window) and frame loop (frames_desktop, frames_web) as separate
modules. A program that only calls App.Show now checks seven modules on
Linux instead of ten: no session, geometry, desktop runtime or frame host.
desktop_window takes the SDL event from the new sdl_event module rather
than the whole desktop runtime, and the frame loops import app_types by
name so an unrun loop leaves no stub in the checked program.
make pay-per-import-test checks window.zi's exact checked program.
A node hidden with SetVisible still casts its shadow when SetShadows enables
it; shadow maps no longer skip nodes the camera doesn't show.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
App.Show(window) on the desktop no longer runs the frame loop: a new
desktop_window module opens the SDL window, waits for its events, clears
and presents it, and closes it. examples/window.zi now reaches only the
program, kryon/app, the desktop app host, that loop, the SDL presenter and
C strings; its executable is 17 KB instead of 118 KB (265 KB before this
work), with none of the desktop runtime, raster, sessions, input or
accessibility. The window still opens centered, titled, resizable, in the
empty frame's colour, redraws when exposed or resized and exits 0 when
closed or terminated.
make pay-per-import-test now checks that the window carries none of the
frame loop, desktop runtime, raster, accessibility, session or input
modules either.
Nothing is imported by default. App.Show(window) shows a window without
frames; examples/window.zi uses it and now compiles to 23 C files and
133 KB instead of 62 and 546 KB, with a 118 KB executable instead of 265 KB.
Hosts that run frames (App.Run(window, Draw) and the frame host
desktop_run) call TreeFrameUse() to register the widget tree's frame driver
(tree_frame, through frame_driver): input routing, begin and end of the
frame, cursor shapes, scrolling, gamepad navigation and the test driver's
hooks. The call, not an import, brings it: a module initializer in the tree
would have turned existing import cycles into fatal startup cycles and made
hostless test builds keep every program export.
Accessibility is split. The window keeps the AT-SPI connection and the
application object; widget roles, states and nodes live in
accessibility_tree_linux, which the same hosts register with
AccessibilityTreeUse().
The test driver is in a build only when KRYON_TEST_DRIVER is defined;
desktop_runtime then connects it through test_driver_frame (exported for
other native hosts), and a window started for a test without it stops and
says how to build it. App.Run passes the window's title straight to the
window. input_delivery, frame_input_provider and gamepad_navigation move to
src/ui, InputDeliveryTake to input_take. desktop_loop and test_driver_frame
are exported. The ZX player imports cursor_picture again, so its guests'
picture cursors decode.
make pay-per-import-test builds the window, hello, box and image examples
and checks which modules their generated C carries.
The desktop loop called the image decoders (through cursor pictures), the
Lanczos cache and its worker threads, video and the Kryon font every frame,
so every desktop program carried them. Now each part registers itself the
first time it is used: the rasterizer's picture cache and smooth copies when
a frame draws a picture, the font and shaped layouts with the first text,
and video as a named picture source (raster_picture) when it opens. Picture
cursors decode through kryon/cursor again (cursor_picture and the
CursorPictureHost capability, with no-op exports in the hosts without
picture cursors). A widget host no longer imports the decoder; the
application that embeds it imports kryon/cursor.
examples/window.zi now generates 39 C files and 344 KB instead of 62 and
546 KB, and its executable is 179 KB instead of 265 KB. Native desktop
project builds also link X11 explicitly (from the ATR integration lane).
Scenes made of painted pictures ignore scene lights, so a time of day had
no way to reach them. Scene.grade tints and desaturates every material not
marked ungraded, and lights it with up to four lamps and a beam through an
elliptical opening such as a round window. The CPU and GPU renderers share
its preparation (PrepareGrade) and agree within the GPU test's tolerance.
kryon/daylight gives the sun's path for any local hour, the grade for that
hour (exactly neutral while the sun is high), warm sun or cool moonlight
through a window, lamps from dusk to dawn, and a storybook sky drawn by one
material shader: a horizon-to-zenith gradient, the sun's glow and disc, two
drifting cloud layers and twinkling stars from tileable noise made in code.
TextPixels shapes a string exactly as the window draws it and returns a
straight-RGBA picture: Pango on Cairo for desktop builds, the page canvas
on the web. Hosts use it to paint text into textures, such as a sign that
turns with its door.
The test driver gains a capture command: `capture path=` asks the host for
its next finished frame as a PNG, and DriverCapture sends it from a test.
The desktop host writes the raster it shows (RasterWritePNG); a host that
cannot capture answers "this host does not capture frames" instead of
leaving the test waiting. Hosts capture through TestDriverCapturePath and
TestDriverCaptured. The driver client test covers both answers.
On the web (OS == .WEB) image_pixels decodes with the browser's codecs
through PageImageDecode, so a canvas build no longer links raylib's image
transforms, and scene_gpu links no EGL or GL: its probe reports the GPU
unavailable and SceneGpuRenderOrCPU draws with RenderScene. Jungle's
website builds and draws its 3D rooms this way.
- GPU scene renderer: moved, turned or scaled nodes re-send only their own
triangles instead of rebuilding the scene; per-node matrices are reused;
FreezeGeometry skips geometry comparisons; lights carry projected
textures (LightCookie) in the CPU and GLES renderers.
- One ordered per-session key and text delivery path across Desktop,
Canvas and Raylib.
- Context-menu rows show accelerator labels and checked state.
- Bundle apps keep extracted assets that already match instead of
rewriting and syncing all of them on every open.
- Image and PDF export modules, hosted box tests, brand assets, plans,
and the ZX changelog entry.
SystemPrimaryText, SystemPrimaryAvailable and SystemPrimarySet read and set
the X11/Wayland PRIMARY selection through the host. The SDL desktop and
Linux Raylib hosts implement it with SDL's primary selection; the Android,
Canvas, pixmap, terminal and bundle hosts report it unavailable instead of
aliasing the ordinary clipboard. Terminal uses it for selections,
middle-click, Shift+Insert and Paste Selection.
RaylibInputPoll took modifiers only from keys still down or just released,
so a Control press released again within the same poll was lost and a
scripted Control+C reached the app as a plain C. Modifier presses from the
pressed-key queue now apply to the keys after them. raylib_window_test
covers the tap.
Native Linux apps can drag data out to other applications with the optional
kryon/DragSourceLinux module, an XDND version 5 drag source on its own X
connection. It starts while the toolkit keeps its implicit button grab, so
the toolkit still sees the release; it follows the pointer, finds the
top-level XDND window under it (honouring XdndProxy and skipping its own
shaped drag icon), sends Enter, Position, Leave and Drop, answers
XdndStatus, serves the XdndSelection data including TARGETS, and reports
when the pointer is over one of the process's own windows so the app can
handle internal drops. The suggested action follows GTK's modifiers.
tests/drag_source_linux_test.py drops onto an independent python-xlib XDND
target on a private Xvfb from source and saved IR (make
drag-source-linux-test, already part of make test).
GtkStyleIndicatorRaster and GtkPainter kinds 9 to 11 draw the theme's own
check box, radio option and submenu arrow with gtk_render_check,
gtk_render_option and gtk_render_arrow, so native menus show check, radio
and submenu rows as GTK draws them.
No project used the dom profile, and it added a second browser host to
maintain beside Canvas. This removes dom_host, dom_tree, dom_paint, dom_run
and dom_app_run, the dom profile in the project tool, docs/dom.md, and the
DOM tests and their three make targets.
The shared browser code loses its DOM branches: page_events no longer tells
a DOM host about presses, blur and document layout, page_core and
page_texture drop the native DOM flag and the img decode kept for it, and
CanvasAppMainLoop takes no argument. The web template builds a Canvas2D
page. The cursor and rotated text tests cover the Canvas profile only.
Reaching the cursor picture decoder through a CursorPictureHost capability
broke the Go backend check, which refuses a host call reachable from global
startup, and four tests whose hosts link the hosted-widget host without
providing it. The desktop host decodes cursor pictures directly again, and
cursor_picture, cursor_api and the host stubs are gone. The image decoders
therefore stay in every desktop program; an empty window is 62 C files and
545 KB. The test driver and text reductions are unchanged.
Ziran's WebAssembly tier runs only s64 -> s64 host capabilities and no longer
hands other bundles to the VM, so the ZX Canvas player and hosted apps failed
to start in a page. bundle_player and hosted_app select the portable VM on the
web with InstantiateBundlePortable. zx-services-test, zx-hosted-test and
zx-canvas-test pass again.
Sixteen targets in make test, and video-test outside it, only reran one
tests/ziran_*_test.sh that the behavior test runner already runs. They are
removed, leaving 70 targets; make test-focus TEST=NAME runs one script, and
push-check runs the pixmap GPU script that way. The runner clears XAUTHORITY,
the session bus, the session manager and GDK_DISPLAY as those targets did.
The test driver is test code, yet every program carried it because the hosts
call it each frame. kryon/test_driver now passes the platform's input through
unchanged, and the driver itself, test_driver_engine, is compiled in only when
a build defines KRYON_TEST_DRIVER: --define KRYON_TEST_DRIVER on a direct
build, or the variable set in the environment of kryon build, which keeps a
stamp per setting so toggling it rebuilds. A program built without the driver
and started with the variable set stops at once and says how to build it.
The desktop host decoded cursor pictures directly, which kept PNG, WebP and
AVIF decoding in every desktop program. The decoder is now reached through a
procedure that cursor_picture registers from its initializer, using the new
CursorPictureHost host capability. kryon/cursor, which applications import,
and the hosted-widget host import cursor_picture; the cursor module the hosts
import does not, so hostless and custom-host builds need nothing new. Kryon's
hosts export the capability.
An empty window generates 43 C files and 370 KB instead of 62 and 627 KB, and
its executable is 196 KB instead of 296 KB. The program entry test asserts
that the decoders and the driver stay out, and that a build made for a test
gets the driver.
A project whose entry module declares main, such as examples/window.zi, is a
program. The project tool now generates a host that only calls that main, so
kryon build gives a desktop executable or a Canvas page from the same file. A
portable zx profile needs a Frame entry and is refused with that reason.
Browser builds pass --target=c --target-os web --target-cpu wasm32 when they
save IR. The Canvas host is selected by OS == .WEB, and untargeted IR is
portable, so with only PLATFORM_WEB defined every canvas, DOM and raylib-web
project and the ZX canvas player failed on unresolved Canvas functions. The
frame-input and password Canvas tests name the target the same way.
Kryon's manifest names the desktop host's system libraries in [package]
links, so ziran build --project --target=c --exe links a program in this
checkout without caller LDLIBS. The examples Makefile drops its pkg-config
link flags and its own compile of the desktop examples.
Committed at the owner's request while the work continues.
- Detect unchanged GTK painter surfaces by exact byte comparison, clear
and copy them in bulk, and reuse resolved GTK style metrics and CSS
layers within a style generation.
- Present desktop frames before publishing accessibility changes.
- Context menu widget, keyboard and canvas input updates with tests.
Restructure maintained components into per-widget source folders, add the
portable scene GPU renderer with GLSL shaders, hosted widget aggregates,
GTK theming and multi-target clipboard support, rebuild the guide with
theming guidance, and move the toolchain to the Ziran revision without
module root limits so the eighty component roots resolve everywhere.
The native provider now decodes Ogg Opus through the audio package on
Windows too (audio f5eed1e). MinGW hosts link -lopus -lssp -lm, since the
package's libopus keeps its stack protector. The renderer-raylib artifact
builds the package's static libopus for Linux, Windows and Android, so
artifact consumers that use media_audio_raylib link without a system copy.
The Windows artifact sets CMAKE_SYSTEM_PROCESSOR, which dav1d's cross build
now requires, and the artifact test pins Kryon's locked toolchain. The Opus
test gains --windows: a MinGW cross build run under a private Wine prefix.
The Raylib provider now chooses its decoder by content: an Ogg page whose
first packet is OpusHead decodes through the audio package on Linux and
Android, streamed in two 2048-frame blocks refilled by Status and the owner
tick. Other bytes, including Vorbis Ogg, stay on Raylib; macOS and Windows
return Unsupported for Ogg Opus and the browser keeps decoding it itself.
Play starts the stream before filling it, since PlayAudioStream discards
queued blocks. Linux links -lopus -lm, and the Android build compiles the
package's static opus target. The Opus tests now run the production
provider, including on an Android device with null audio.
Bitmap images and their store update in place on desktop, pixmap and web
renderers. Native Opus asset transport and a raylib audio sink join the
media audio host. Export the image and SVG shape modules for apps, and
read the shot profile's picture from standard output only so build
diagnostics on standard error never mix into it.
Add Card elevation and consistent widget states, retained TextArea selection,
and rounded image rendering. Integrate published image-codec, WebP and AVIF
packages across native hosts and renderer artifacts with project-aware builds.
Modernize Kryon Labs around visual GUI apps and modules, with real previews,
honest availability, and rebuilt interactive editor and widget gallery assets.
Bound private browser test lifecycles and verify source, saved IR, native,
portable, browser, Windows and Android paths with the published compiler.
CursorSetPointing sets the cursor shown where a click does something:
clickable widgets and painted targets an app hit-tests itself and marks
with CursorHover while it builds the frame. The mark commits with the
tree, so retained or cancelled frames keep it and the cursor changes only
when the hovered target does. PressProps.cursor lets a press the app
refines with its own hit test name the arrow off its painted shape, on
desktop, Canvas and DOM, without changing presses, touch or keys.
Cursor requests now persist until the next deliberate change instead of
lasting one frame, and CursorSetDefault gives every session an
application cursor that replaces the default, clickable and disabled
shapes. Desktop caches decoded cursors, sets the system cursor only when
the resolved cursor changes, keeps it across focus and leave, and gives
X11 premultiplied pixels so soft edges show no light fringe. Canvas and
DOM build one density-aware CSS cursor and apply it only on change.