Commit Graph
5 Commits
Author SHA1 Message Date
waozi 3461b49b86 Let a page's canvas show what is behind it
A #canvas carrying data-transparent gets no background: the empty window
and each Kryon frame clear to alpha 0 with clearRect, so the editor
preview shows its theme wherever a program draws nothing. Widgets draw
over it as usual. Pages without the attribute stay opaque.

The program-entry test checks window.zi's page and examples/hello.zi
both ways.
2026-11-16 02:20:00 -03:00
waozi 797d7317c3 Decode cursor pictures in the host again, run browser bundles on the VM, drop duplicate test targets
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.
2026-11-14 02:39:12 -03:00
waozi c80e022fe8 Leave the test driver and the image decoders out of programs that do not use them
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.
2026-11-14 01:58:44 -03:00
waozi fdedbdc392 Keep the Unicode tables out of programs that cannot edit text
text_request checked the cut points of a platform's text request with
std/grapheme, and accessibility can send such a request, so every desktop
program carried 134 KB of grapheme tables. The check now goes through a
procedure that text_boundary registers from its initializer. The text field
and text area import text_boundary, so only programs that can edit text
include the tables. Without an editing widget nothing could take a request,
and TextRequestSend refuses it.

An empty window generates 121 KB less C and its executable shrinks from
346 KB to 296 KB. The program entry test asserts the tables stay out. The
Android text editor test, which sends requests without a widget, imports
text_boundary.

The Canvas frame snapshot test binds the app's Frame to the ProjectFrame
capability its host calls, which the link was missing.
2026-11-14 01:05:35 -03:00
waozi 718572978d Build kryon/app programs with the project tool and name the web target
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.
2026-11-13 21:10:18 -03:00