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.
This commit is contained in:
1 parent
0f5c68e162
commit
216c190c43
46 files changed
+203
-647
No files matched your search
@@ -138,8 +138,6 @@ jobs:
|
||||
- name: Check static site assets
|
||||
run: |
|
||||
test -f docs/site/index.html
|
||||
test -f docs/site/demo.html
|
||||
test -f docs/site/assets/widgets.html
|
||||
test -f docs/site/runtime/playground-runtime.js
|
||||
test -f docs/site/runtime/playground-runtime.wasm
|
||||
test -f docs/site/demo-theme.js
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Kryon
|
||||
|
||||
Documentation for Kryon 0.4.0 and Unreleased changes on master.
|
||||
|
||||
Linux desktop and portable hosts can decode local videos with synchronized audio
|
||||
using the optional GStreamer service exported as `kryon/Video` and
|
||||
`kryon/VideoLinux`. Display the returned frame with `Image.Draw(Image.Props)`.
|
||||
@@ -11,8 +13,7 @@ replay and lease revocation with a silent audio sink and no display access.
|
||||
Kryon is a UI library written in Ziran. Its source lives under `src/ui/` and
|
||||
imports Ziran modules normally. The Ziran compiler, `.zir` representation, and
|
||||
`.zx` bundle format belong to the separate
|
||||
[Ziran](https://github.com/ziranlang/ziran) repository. Kryon has no
|
||||
`.kry` runtime or language compiler.
|
||||
[Ziran](https://github.com/ziranlang/ziran) repository.
|
||||
|
||||
## Build
|
||||
|
||||
@@ -47,15 +48,14 @@ depend on Kryon: [Plot](https://github.com/kryonlabs/plot),
|
||||
in `ziran.toml`); see [writing a widget package](docs/API.md#widget-packages).
|
||||
|
||||
Style sheets are the separate [CSS](https://github.com/kryonlabs/css)
|
||||
package: it parses and formats a subset of CSS, installs the rules, and ships
|
||||
the classic, lightfield, and material style packs. Kryon keeps the rule table and
|
||||
package: it parses and formats a subset of CSS, installs the rules. Kryon keeps the rule table and
|
||||
style resolution, so an app that builds its rules in code needs no parser.
|
||||
|
||||
The optional [Game2D](https://github.com/kryonlabs/game2d) Ziran package owns
|
||||
the raylib game API. Kryon keeps its geometry, drawing values, UI primitives,
|
||||
and raylib UI host. Kryon exports `geometry` and `drawing_props` so Game2D can
|
||||
share their types without pulling in widget modules. The raylib game adapter
|
||||
uses a C ABI and does not support native Go.
|
||||
Kryon exports `geometry` and `drawing_props` for programs that need drawing
|
||||
values without importing widgets. Imports and use determine what a program
|
||||
carries. `App.Show(window)` carries only the window, events and presentation;
|
||||
`App.Run(window, Draw)` also brings the frame loop. Portable ZX windows run
|
||||
through the native desktop provider by default. See the [API](docs/API.md).
|
||||
|
||||
`make test` builds the test host and runs the Ziran source, saved-IR, and
|
||||
portable bundle tests with four concurrent jobs. Set `TEST_JOBS=1` to run them
|
||||
@@ -70,7 +70,7 @@ See [composition input](docs/COMPOSITION_INPUT.md) for the checked IME event
|
||||
contract and host queue lifetime.
|
||||
See [cursor input](docs/CURSOR.md) for the checked cursor decision and platform
|
||||
effect contract.
|
||||
See [style picker](docs/STYLE_PICKER.md) for caller-owned pack selection.
|
||||
See [theming](docs/THEMING.md) for palette and style customization.
|
||||
See [zoom](docs/ZOOM.md) for Ctrl and mouse-wheel zoom of a whole application.
|
||||
See [clipboard state](docs/CLIPBOARD.md) for the portable clipboard value and
|
||||
host effect contract.
|
||||
@@ -86,8 +86,8 @@ file launches with `ziran run app.zx` after installing the desktop provider. See
|
||||
|
||||
## Website and widget gallery
|
||||
|
||||
`make site` rebuilds the initial Canvas demo, the browser compiler and preview
|
||||
host, and the widget gallery into `docs/site/`. Emscripten is required; activate
|
||||
`make site` packages the Canvas website, browser compiler, preview host and
|
||||
widget gallery into `docs/site/`. Emscripten is required; activate
|
||||
emsdk or set `EMCC`. `make site-gallery` builds only the gallery, and
|
||||
`make site-gallery-test` prepares editable examples and exercises the gallery in
|
||||
a private Chromium/Xvfb session.
|
||||
@@ -97,9 +97,8 @@ Its core scenes are shared by the desktop, web and review hosts. Examples are
|
||||
grouped by installed module and category, including core UI and 2D drawing.
|
||||
Optional package integrations are registered only while their dependencies
|
||||
are declared. Each selected example includes editable Ziran source and a live
|
||||
preview, using the same compiler and editor as `demo.html`. Plot and DataViews
|
||||
supply the additional charts, tree and Kanban; TableView's entry identifies its
|
||||
current API-only status. `make site` generates the scene metadata and editable
|
||||
preview, using the browser compiler and the gallery editor. Plot and DataViews
|
||||
supply charts, tree, Kanban and an interactive TableView. `make site` generates the scene metadata and editable
|
||||
snippets directly from these examples. The Pages workflow builds and tests the
|
||||
full website from fixed source revisions before publishing.
|
||||
|
||||
@@ -107,12 +106,10 @@ full website from fixed source revisions before publishing.
|
||||
|
||||
The [feature matrix](docs/FEATURE_MATRIX.md) records package and host coverage.
|
||||
The Canvas2D browser host is covered by private headless Chromium, WebAudio,
|
||||
and Wasm tests. The [open-work plan](plan/README.md) lists
|
||||
the remaining platform-accessibility work.
|
||||
and Wasm tests. See [accessibility](docs/ACCESSIBILITY.md) for platform coverage.
|
||||
|
||||
Kryon commits land upstream first. Applications then update their
|
||||
`ziran.lock` with Ziran's package commands; an app that still vendors Kryon
|
||||
moves only its clean `vendor/kryon` submodule pointer. This repository's tests
|
||||
`ziran.lock` with Ziran's package commands. This repository's tests
|
||||
verify Kryon itself, not every downstream application build.
|
||||
|
||||
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the library boundary and
|
||||
@@ -123,3 +120,13 @@ for language and portable runtime gaps.
|
||||
`kryon/breadcrumb` serves `Breadcrumb.Draw` for keyed label navigation, with measured
|
||||
ancestors and an accessible, virtualized overflow menu. Applications own
|
||||
selection, focus and navigation; see [the API](docs/API.md#breadcrumbs).
|
||||
|
||||
## Documentation
|
||||
|
||||
- [API reference and widget packages](docs/API.md)
|
||||
- [Architecture](docs/ARCHITECTURE.md) and [repository boundaries](docs/BOUNDARIES.md)
|
||||
- [Projects](docs/PROJECTS.md), [hosts](docs/BACKENDS.md) and [Canvas](docs/canvas.md)
|
||||
- [Feature matrix](docs/FEATURE_MATRIX.md) and [widget verification](docs/WIDGET_CONFORMANCE.md)
|
||||
- [Input components](docs/INPUT_COMPONENTS.md), [overlays](docs/OVERLAYS.md) and [compact navigation](docs/navigation.md)
|
||||
- [Component loading](docs/COMPONENTS.md), [window focus](docs/window-focus.md) and [accessibility](docs/ACCESSIBILITY.md)
|
||||
- [Raster workers](docs/THREADING.md) and [performance measurements](docs/PERFORMANCE.md)
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
The Kryon static package includes third-party code pinned by its package lock.
|
||||
|
||||
- raylib: zlib/libpng license, see `LICENSE` in the locked raylib source package.
|
||||
- Noto fonts: SIL Open Font License 1.1, see `fonts/noto/LICENSE.txt` in the source tree.
|
||||
- Liberation Sans: SIL Open Font License 1.1, see `assets/fonts/LICENSE-Liberation`.
|
||||
`src/backend/pixmap_font.zi` holds outlines of its Latin glyphs for the
|
||||
|
||||
@@ -7,7 +7,7 @@ Shift+Tab traverse eligible controls; Enter and Space activate focused
|
||||
controls while editors keep their normal key handling. Modal scopes reject
|
||||
outside focus, activation and edit requests.
|
||||
|
||||
The Linux desktop host now exposes an optional AT-SPI bridge through GIO.
|
||||
The Linux desktop host exposes an optional AT-SPI bridge through GIO.
|
||||
It registers the application with the accessibility bus, uses retained
|
||||
generations for object paths, reconciles reordered and removed objects, and
|
||||
provides Accessible, Application, Component, Action, Text and EditableText
|
||||
@@ -37,5 +37,5 @@ readonly and disabled controls, modal blocking and password redaction.
|
||||
These checks establish the implemented protocol paths, not complete Orca or
|
||||
other screen-reader usability. Text boundary/extents methods, list Selection,
|
||||
table interfaces, and Windows/macOS/mobile accessibility remain unverified
|
||||
or unsupported. Raylib, Canvas2D and terminal hosts do not currently
|
||||
or unsupported. Canvas2D and terminal hosts do not currently
|
||||
provide the Linux bridge automatically.
|
||||
+39
-106
@@ -1,5 +1,7 @@
|
||||
# Kryon API
|
||||
|
||||
This reference covers 0.4.0 and Unreleased changes on master.
|
||||
|
||||
Kryon is an ordinary Ziran package. An application imports the modules it
|
||||
uses; no widget names are recognized by the Ziran compiler or `.zx` loader.
|
||||
The public package imports are declared in [`ziran.toml`](../ziran.toml).
|
||||
@@ -25,8 +27,7 @@ clears its whole surface before `PaintFlush`. `EndFrameDamaged` keeps its
|
||||
existing behavior of emitting a full repaint immediately.
|
||||
|
||||
`frame_transition.FrameSurfaceCopy(surface)` copies a borrowed retained frame
|
||||
into an owned surface before its target is reused. The Raylib host performs
|
||||
the copy on its render thread. Capture before committing the destination
|
||||
into an owned surface before its target is reused. Capture before committing the destination
|
||||
frame, draw with `FrameTransition`, and call `FrameSurfaceRelease` when the
|
||||
transition ends. An invalid source or failed allocation returns an empty surface.
|
||||
|
||||
@@ -347,8 +348,7 @@ Applications must apply the edit and preserve the result's cursor and anchor.
|
||||
|
||||
A `TextArea` can preview a markup language over its value without changing
|
||||
it. `hidden` bytes take no width or caret stop, `strong` bytes are bold and
|
||||
`italic` bytes slanted (backends that register a slant raster, as Raylib
|
||||
does, draw them leaning; others upright), and `colors` tint spans.
|
||||
`italic` bytes slanted when the host registers a slant raster (otherwise upright), and `colors` tint spans.
|
||||
`lines` draws a logical line at its own size (`TextArea.Line.scale`), such as
|
||||
a heading: its rows wrap, take caret stops and take height at that size.
|
||||
`blocks` adds boxes under a line, one under another in order, the first in
|
||||
@@ -393,7 +393,7 @@ a fresh press; holding a key does not invent repeats. Indices use the existing
|
||||
uppercase ASCII and named `Key` codes; index zero is unused.
|
||||
|
||||
The snapshot also carries `pointer`, `secondary`, `focused`, `modifiers`,
|
||||
`wheel`, and `elapsed_ms`, `delta_ms`, `sequence`. Desktop, Canvas and Raylib
|
||||
`wheel`, and `elapsed_ms`, `delta_ms`, `sequence`. Desktop and Canvas
|
||||
sample a monotonic clock once per successful host poll: first delta is zero,
|
||||
later deltas are nonnegative, and repeated captures have identical timing.
|
||||
Sequence starts at one for each opened host. Pointer coordinates use the
|
||||
@@ -407,24 +407,21 @@ press and repeat flags, preventing a focus change from activating a shortcut.
|
||||
Hosts publish on the session's owning thread with `FrameInputBegin(session, snapshot) -> bool` and call
|
||||
`FrameInputEnd(session)` after the callback, including failure paths. Publishing
|
||||
copies the value and rejects replacement while that session's frame is open.
|
||||
Kryon's standard Desktop, Canvas and Raylib app loops do this automatically.
|
||||
Kryon's standard Desktop and Canvas app loops do this automatically.
|
||||
Desktop freezes raw SDL key events for its own window; Canvas freezes existing
|
||||
DOM held state and edge queues before widget reads. Both clear publication on
|
||||
callback cancellation, terminal polls and host teardown. Custom Desktop or
|
||||
Canvas loops call `DesktopFrameInputBegin(session)` or
|
||||
`CanvasFrameInputBegin(session)` after the matching successful poll, and
|
||||
`FrameInputEnd(session)` when their callback ends (including failure paths).
|
||||
The host also ends publication before presentation can yield. Custom Raylib
|
||||
loops call `RaylibFrameInputBegin(session)` after `PollRaylib`, then
|
||||
`FrameInputEnd` when their callback ends. Other providers must supply
|
||||
The host also ends publication before presentation can yield. Other providers must supply
|
||||
equivalent gathered state; this API does not infer held keys from consumed
|
||||
keyboard events. A hosted
|
||||
bundle requests only `frame_snapshot.CaptureFrameInputHost`; `WidgetHostCall`
|
||||
validates the session against the active `WidgetHostBegin` before returning
|
||||
that session's published snapshot. No input is queried outside that frame.
|
||||
|
||||
Capturing never consumes `KeyboardTake`, `TypedTextTake`, Raylib's key/character
|
||||
queues, IME, clipboard, or Escape routing. Applications retain movement,
|
||||
Capturing never consumes `KeyboardTake`, `TypedTextTake`, IME, clipboard, or Escape routing. Applications retain movement,
|
||||
simulation, repeat cadence, and navigation policy. The existing `FrameInput`
|
||||
replay record and its apply/field helpers retain their contract.
|
||||
|
||||
@@ -503,9 +500,7 @@ row-major straight RGBA8 and copied/consumed synchronously; reuse the input buff
|
||||
after the call. Create failure returns a zero texture. Update returns true for
|
||||
accepted unchanged data, and false preserves the old pixels. Only successful
|
||||
changed data invalidates retained paint. Smooth sampling and alpha use the
|
||||
ordinary Image renderer on native Raylib, Desktop/Cairo, pixmap and Canvas.
|
||||
Raylib resolves managed IDs to bounded native RGBA textures lazily by image
|
||||
revision. Explicit `Image.Props.tint`, including white for original colors,
|
||||
ordinary Image renderer on Desktop/Cairo, pixmap and Canvas. Explicit `Image.Props.tint`, including white for original colors,
|
||||
applies to straight RGBA pixels. GPU reset and native window close/reopen
|
||||
preserve the session's CPU image; textures are recreated when next painted.
|
||||
Completed native worker frames own deduplicated copies of the revisions they
|
||||
@@ -544,7 +539,7 @@ On hosts with a distinct selection clipboard, use
|
||||
`SystemPrimarySet(text) -> bool`. `SystemPrimaryText` returns a caller-owned,
|
||||
whole-UTF-8 prefix borrowed from `buffer`; an empty result can mean either an
|
||||
empty selection or an unsupported host, so use `SystemPrimaryAvailable` when
|
||||
that distinction matters. SDL desktop and Linux Raylib hosts connect these
|
||||
that distinction matters. Linux SDL desktop hosts connect these
|
||||
calls to the platform PRIMARY selection. Android, Canvas, terminal, pixmap,
|
||||
bundle and unsupported desktop hosts return unavailable rather than falling
|
||||
back to CLIPBOARD.
|
||||
@@ -975,8 +970,8 @@ produces an empty mesh. Rotation and scale stay on the standard image surface.
|
||||
nearest-neighbour sampling for the whole map; `nearest_tiles` selects individual
|
||||
tile indices while the rest remain smooth. Sampling survives the hosted codec.
|
||||
A hosted map uses batched sampling only when its host advertises
|
||||
`tile_map.sampling`; older hosts draw the same standard Images individually.
|
||||
Pixel snapping also works on older hosts because the bundle fits the bounds.
|
||||
`tile_map.sampling`; hosts without mesh support draw the same standard Images individually.
|
||||
Pixel snapping uses bounds fitted by the bundle.
|
||||
|
||||
`WidgetPaletteUse` scopes semantic colors along with widget rules. Hosted
|
||||
`AppThemeColor` calls and compositions using canvas, surface, text, border and
|
||||
@@ -992,14 +987,13 @@ changing widget props. Retained frames then compose and paint again, including
|
||||
when a browser graphics context resets or an app updates its image assets.
|
||||
|
||||
`Shape.Draw(Shape.Props)`, `Circle(Shape.CircleProps)`, `Shape.Ring(Shape.RingProps)` and
|
||||
`Shape.Triangle(Shape.TriangleProps)` draw shapes as raylib's `DrawLineEx`, `DrawCircle`
|
||||
and `DrawCircleGradient`, `DrawRing` and `DrawTriangle` do. Like `Box`, each
|
||||
`Shape.Triangle(Shape.TriangleProps)` draw lines, circles, radial gradients,
|
||||
rings and triangles. Like `Box`, each
|
||||
is decorative: it submits a node covering what it draws and queues one paint
|
||||
command. Kryon cuts the shape into triangles, clips them to its parent's clip
|
||||
and sends each colour's triangles to the host in one `RasterTriangles` call;
|
||||
a radial fade is drawn as rings of one colour each. `Box.Props.fill_bottom`
|
||||
with `has_fill_bottom` fades a box's fill from top to bottom, as
|
||||
`DrawRectangleGradientV` does.
|
||||
with `has_fill_bottom` fades a box's fill from top to bottom.
|
||||
Import `kryon/shape` to use these shapes, including in a portable hosted
|
||||
bundle.
|
||||
|
||||
@@ -1032,8 +1026,8 @@ A program carries only what it uses. `kryon/app` imports each platform's
|
||||
window (`desktop_window`, `page_window`) and frame loop (`frames_desktop`,
|
||||
`frames_web`) as separate modules, so `App.Show(window)` reaches only the
|
||||
window: on Linux the checked program of `examples/window.zi` is the window,
|
||||
`kryon/app`, `app_types`, `desktop_window`, `sdl_event`, `pixmap_sdl` and C
|
||||
strings. In a portable bundle the window is `zx_window`: the checked program is
|
||||
`kryon/app`, `app_types`, `desktop_window`, `desktop_process_linux`,
|
||||
`sdl_event`, `pixmap_sdl` and C strings. In a portable bundle the window is `zx_window`: the checked program is
|
||||
the window, `kryon/app`, `app_types` and `zx_window`, and the bundle asks its
|
||||
host only for the window, its events, clearing and presenting
|
||||
(`ZxWindowOpenHost`, `ZxWindowEventHost`, `ZxWindowClearHost`,
|
||||
@@ -1052,7 +1046,7 @@ canvas player binds the window to the page's canvas (`window_page_player`),
|
||||
lowers the bundle to Wasm in the page and runs it, each wait for an event
|
||||
yielding to the page. `App.Run(window, Draw)` brings the frame loop, the widget tree's frame
|
||||
driver (`TreeFrameUse`) and, on Linux, the accessibility tree
|
||||
(`AccessibilityTreeUse`). The desktop raster loads pictures, smooth copies and
|
||||
(`DesktopAccessibilityUse`). The desktop raster loads pictures, smooth copies and
|
||||
fonts when a frame first draws them, video when it opens, and the test driver
|
||||
only with `KRYON_TEST_DRIVER`. `make pay-per-import-test` checks the examples'
|
||||
generated C, the window's checked programs and its bundle's modules and host
|
||||
@@ -1061,16 +1055,16 @@ capabilities.
|
||||
The project tool accepts a program as a project's entry. When the entry module
|
||||
declares `main`, `kryon build --profile NAME` generates a host that only calls
|
||||
that `main`, for a `desktop` profile and for a `canvas` page alike. A program
|
||||
entry needs `codegen = "c99"`; a portable `zx` profile needs a `Frame` entry
|
||||
and is refused otherwise.
|
||||
entry uses `codegen = "c99"` for native source builds. Desktop and Canvas
|
||||
`codegen = "zx"` profiles also accept a program with its own `main`; the
|
||||
player binds its window capabilities. `Frame` entries use the frame host.
|
||||
|
||||
The selected host owns the process entry point, calls `BeginFrame` and
|
||||
`EndFrame`, supplies input to the session, and presents paint operations.
|
||||
Every host reports the same key codes through `KeyboardTake`: letters as
|
||||
uppercase ASCII and named keys as `KeyEnter`, `KeyBackspace`, `KeyLeft`, and
|
||||
the other `Key` constants. A letter is the one the active keyboard layout types,
|
||||
not its physical position; on Raylib, `RaylibLayoutKey` converts a position from
|
||||
`RaylibKeyDown`. `TypedTextTake` collects pending text into the caller's byte
|
||||
not its physical position. `TypedTextTake` collects pending text into the caller's byte
|
||||
buffer, and `TextFieldInputFor(key, modifiers, text)` turns both into a
|
||||
focused `TextField`'s input.
|
||||
An entire Unicode scalar must fit before it is consumed; a buffer of at least
|
||||
@@ -1079,8 +1073,7 @@ the next scalar without consuming it, and `TypedCodepointCapacity(session)`
|
||||
reports free slots in the bounded 32-scalar session queue.
|
||||
|
||||
Every graphical host owns an ordered key/text queue and exposes one session
|
||||
delivery call: `DesktopInputTake(session)`, `CanvasInputTake(session)`, or
|
||||
`RaylibInputTake(session)`. Poll the host every frame, including while session
|
||||
delivery call: `DesktopInputTake(session)` or `CanvasInputTake(session)`. Poll the host every frame, including while session
|
||||
text remains unread, then call its take once before composition. The take
|
||||
transfers one editing action or a printable-key/text run into that session and
|
||||
returns `(key, modifiers)` using portable key and modifier codes. Unread text
|
||||
@@ -1092,16 +1085,6 @@ Desktop's bounded 256-record delivery queue backpressures SDL key and text
|
||||
events without blocking window lifecycle events. Run
|
||||
`build-queue -- make test-focus TEST=desktop_input_backpressure` for the native
|
||||
SDL source and saved-IR regression.
|
||||
Raylib fills its ordered queue from the platform key, repeat and text streams
|
||||
during `PollRaylib()`, applying the active keyboard layout before delivery.
|
||||
A Raylib app that has nothing to animate can call
|
||||
`RaylibWaitForActivity(descriptors, milliseconds)` between frames instead of
|
||||
drawing: it returns `RaylibActivityDescriptor`, `RaylibActivityInput` or
|
||||
`RaylibActivityNone`, and `RaylibActivityUnsupported` on hosts that must keep
|
||||
drawing. After `RaylibActivityInput` draw two frames, since a frame uses input
|
||||
the previous one read. `RaylibPrepareGlyphs(text)` readies many characters at
|
||||
once, so drawing them one at a time does not rebuild a font for each.
|
||||
|
||||
The Canvas app host retains unread key presses, repeats, IME commits and
|
||||
gamepad navigation across drawing frames. Pressed/released snapshot flags still
|
||||
expire at the frame boundary; delivery does not replay them. Each queued press
|
||||
@@ -1109,9 +1092,7 @@ or repeat retains its browser event's Shift, Control/Meta and Alt modifiers.
|
||||
Custom loops call `CanvasInputTake(session)`; an empty take reports current held
|
||||
modifiers. `CanvasModifiers()` and `CaptureFrameInput(session).modifiers` still
|
||||
report held state at their own sampling time, so consuming a shortcut never
|
||||
changes held keys or snapshot flags. Canvas keeps raylib-named
|
||||
`GetKeyPressed`/`GetCharPressed` program exports only for raylib applications
|
||||
compiled for the browser; they are frame observations, not Kryon session input.
|
||||
changes held keys or snapshot flags.
|
||||
|
||||
Application code owns its product state and calls widgets within `Frame`.
|
||||
The complete manifest and build commands are in [PROJECTS.md](PROJECTS.md).
|
||||
@@ -1158,15 +1139,7 @@ screen's pixels and kept, with the 255 others painted most recently, as the
|
||||
rectangles it paints, so a screen with many icons does not rasterize them
|
||||
again every frame. A host that draws textures registers
|
||||
`SvgIconUseTextures(make, free)` and then paints each icon as one image of
|
||||
the same pixels; raylib's `OpenRaylib` does, and a raylib host that opens its
|
||||
own window calls `RaylibUseIconTextures()` after `InitWindow`.
|
||||
|
||||
A native game host using `raylib_runtime` can enable
|
||||
`RaylibCompletePictureFrames(true)` for its `BeginRaylibFrame` /
|
||||
`EndRaylibFrame` loop. Two retained screen textures keep the last complete
|
||||
frame visible while newly requested images decode, including later animation
|
||||
sprites. Decoding continues while that frame is held. Hosts that want images
|
||||
to appear progressively keep the default, `false`.
|
||||
the same pixels.
|
||||
|
||||
A bundle draws a row of choices, such as a week or calendar view, with
|
||||
`SegmentedControl.Draw(session, props, options)` from
|
||||
@@ -1228,9 +1201,7 @@ Other platform services an application may import:
|
||||
| [`file_download`](../src/backend/file_download.zi) | `FileDownloadStart`, `FileDownloadPoll` and `FileDownloadRelease`: a large file downloaded to a path, appearing only when complete, through curl, the browser's streaming `fetch` into the page's file system, or the Android activity |
|
||||
| [`http_transfer`](../src/backend/http_transfer.zi) | `HttpTransferStart`, `HttpTransferPoll` and `HttpTransferCancel`: HTTP requests that run while the application draws, through curl on a worker thread, the Android activity's transport, or the browser's `fetch` |
|
||||
| [`page_socket`](../src/backend/page_socket.zi) | `PageSocketOpen`, `PageSocketPoll` and `PageSocketClose`: a browser WebSocket for text events, polled each frame, with bounded messages and a token carried as a subprotocol |
|
||||
| [`browser_viewport`](../src/backend/browser_viewport.zi) | `BrowserViewportMeasure` and `BrowserResizeSettled`: the room a canvas application has in the browser, and when a new size has settled enough to resize to, for applications such as raylib web builds that size their own canvas |
|
||||
| [`raylib_secondary_window`](../src/backend/raylib_secondary_window.zi) | Up to three extra SDL windows for a raylib application, such as a floating timer, each drawing its own Kryon tree with its own pointer (`SecondaryWindowInput`) |
|
||||
| [`raylib_trace`](../src/backend/raylib_trace.zi) | Where raylib's log goes: `RaylibTraceToConsole`, `RaylibTraceToFile` for Windows applications without a console, and `TraceLog(level, text)` |
|
||||
| [`browser_viewport`](../src/backend/browser_viewport.zi) | `BrowserViewportMeasure` and `BrowserResizeSettled`: the room a canvas application has in the browser, and when a new size has settled enough to resize to, for applications that size their own canvas |
|
||||
|
||||
After a completed HTTP poll, `transfer.failure` distinguishes a response that
|
||||
exceeded the caller's buffer (`HTTP_TRANSFER_FAILURE_CAPACITY`) from a transport
|
||||
@@ -1353,8 +1324,7 @@ an application does to request a cursor, registers the decoder through the
|
||||
`CursorPictureHost(asset_path, width, height, pixels, premultiplied) -> bool`
|
||||
host capability; the cursor module the hosts themselves import does not, so a
|
||||
program that requests no cursor links no image decoder. A host that shows no
|
||||
picture cursors exports the capability and returns false, as the raylib,
|
||||
Canvas, terminal and pixmap hosts do, and a custom host linked with a program
|
||||
picture cursors exports the capability and returns false, as the terminal and pixmap hosts do, and a custom host linked with a program
|
||||
that imports `kryon/cursor` exports it too. An application that hosts widget
|
||||
bundles imports `kryon/cursor` for its guests' picture cursors.
|
||||
|
||||
@@ -1425,8 +1395,7 @@ in logical units (56 by default). The app keeps its movement rules.
|
||||
`Text.Props.rotation` rotates text clockwise in degrees about `bounds` top left
|
||||
plus `Text.Props.origin` (logical units). Zero keeps horizontal text; `origin =
|
||||
Vector2.{bounds.width / 2.0, bounds.height / 2.0}` rotates about the box centre.
|
||||
Layout and font sizes stay unchanged. Native Raylib (including Android) and Canvas
|
||||
preserve the same pivot; local text clipping rotates with the text,
|
||||
Layout and font sizes stay unchanged. Native and Canvas rasters preserve the same pivot; local text clipping rotates with the text,
|
||||
while ancestor clipping stays in its original coordinate space.
|
||||
|
||||
## Reading pages
|
||||
@@ -1439,7 +1408,7 @@ own content anchors and page indexes so reflow preserves the reading place.
|
||||
|
||||
`Text.Props.line_gap` supplies extra units between lines. `typeface` names a
|
||||
registered face or a font asset. Hosted fonts pass the same asset policy as
|
||||
images; absolute host paths are refused. Raylib and Canvas select the face
|
||||
images; absolute host paths are refused. Native and Canvas hosts select the face
|
||||
for measurement and for queued paint, restoring the interface font afterward.
|
||||
|
||||
`Text.Props.wrap = Text.Wrap.TextWrapAnywhere` wraps at extended Unicode grapheme
|
||||
@@ -1452,16 +1421,6 @@ for the resulting lines.
|
||||
|
||||
## View transforms
|
||||
|
||||
`raylib_runtime.RaylibTouches(points: []Vector2) -> s32` reads the most recent
|
||||
successful `PollRaylib` touch snapshot. It returns the active count clamped to
|
||||
0–8 and writes only the first `min(count, points.count)` coordinates; an empty
|
||||
slice can query the count. Coordinates include the Android surface offset
|
||||
and use the current `RaylibZoom()`, like `PollPointer`. Unwritten entries stay
|
||||
unchanged. Repeated calls do not poll or consume input, including on the app
|
||||
worker. Before the first poll, after shutdown or a terminal poll, and while
|
||||
unfocused the count is zero. Point order follows raylib, without stable finger
|
||||
identities; applications own gesture tracking and pinch/pan behavior.
|
||||
|
||||
`view_transform.ViewFit(viewport, page_width, page_height, maximum)` returns
|
||||
the state for a page that fills its viewport at zoom 1. The pure mapping and
|
||||
mutation helpers convert between page and screen coordinates, zoom at a point,
|
||||
@@ -1490,8 +1449,7 @@ uppercase ASCII, named keys from 256 (Escape), as `desktop_keys` maps SDL's.
|
||||
`DesktopMonitorUsable()` give the window's monitor in desktop pixels, and
|
||||
`DesktopDisplayScale()` its density over 96 dpi (X11's `Xft.dpi` when set).
|
||||
- `kryon/desktop_secondary_window`: up to three more windows, each with its
|
||||
own Cairo surface, presenter and events, with the calls of
|
||||
`raylib_secondary_window`: `OpenSecondaryWindow(title, x, y, width,
|
||||
own Cairo surface, presenter and events: `OpenSecondaryWindow(title, x, y, width,
|
||||
height, flags, background, scale)`, `CloseSecondaryWindow`,
|
||||
`BeginSecondaryWindow`/`EndSecondaryWindow` around
|
||||
`BeginSecondaryFrame`/`EndSecondaryFrame`, `SecondaryWindowInput`,
|
||||
@@ -1554,7 +1512,7 @@ effects, asset music and gain. Providers retain those capability bits when
|
||||
the device is unavailable or suspended. Bit 8 advertises bounded PCM streams.
|
||||
|
||||
Bits 16, 32 and 64 advertise asset pause/resume, asset-music position, and
|
||||
PCM pause/resume respectively. An older or partial provider need not implement
|
||||
PCM pause/resume respectively. A partial provider need not implement
|
||||
these features; check its bits and result code. Existing operation/state wire
|
||||
values are unchanged; Pause, Resume and Paused are appended.
|
||||
|
||||
@@ -1622,24 +1580,6 @@ are copied/decoded into provider-owned storage; no native pointer or decoder
|
||||
handle crosses the VM. The host reply codec uses named fields, and the VM
|
||||
copies its strings before the host reuses the reply buffers.
|
||||
|
||||
Hosts import `kryon/media_audio_raylib` and call `MediaAudioUseRaylib()` once
|
||||
on their owning thread. It reuses Raylib memory music streams on native
|
||||
Raylib hosts and the current Canvas WebAudio engine on the web. The decoder
|
||||
is chosen by content, not name: bytes starting with an Ogg page whose first
|
||||
packet is `OpusHead` decode through the `audio` package (libopus) on Linux,
|
||||
Windows and Android, streamed into a Raylib audio stream in two 2048-frame
|
||||
blocks that `Status` and `MediaAudioOwnerTick` refill. Other bytes, including
|
||||
Vorbis Ogg, stay on Raylib's decoders. These hosts link libopus: `-lopus -lm`
|
||||
from Kryon's makefiles, or the static `lib/libopus.a` in the `renderer-raylib`
|
||||
artifact (Android builds the package's `opus` target). On macOS, Ogg Opus
|
||||
currently returns `Unsupported`; the browser decodes Opus itself. Linux,
|
||||
Windows (MinGW under Wine), Android device and browser behavior is tested
|
||||
with null or muted audio. There is no Seek or duration operation. A browser
|
||||
reports `Suspended` before its context runs: the app can retry after a real
|
||||
user gesture; no play request is queued to run in another app later.
|
||||
The standalone `RaylibBundleOpen` installs this provider. Other hosts that
|
||||
have not installed one receive `Unsupported`, regardless of platform name.
|
||||
|
||||
`HostedApp.audio` stores the owner for the actual VM instance. The existing
|
||||
`AppContextCall` dispatches audio only in an identified app's active widget
|
||||
frame, validates its session and existing widget asset policy, and reads
|
||||
@@ -1673,7 +1613,7 @@ with `MediaAudioUseProvider`; existing owners retain their provider until
|
||||
closed. The caller retains cue selection, score/synthesis, volume UI, mute,
|
||||
phrase scheduling and any single-in-flight music transition policy.
|
||||
|
||||
On the Linux desktop without raylib, `kryon/media_audio_desktop`'s
|
||||
On the desktop, `kryon/media_audio_desktop`'s
|
||||
`MediaAudioUseDesktop()` installs a provider on Kryon's own mixer and SDL2
|
||||
sink, opening the device with the first voice. Programs can also use them
|
||||
directly:
|
||||
@@ -1788,10 +1728,8 @@ or delivered remain suppressed when the clock moves backward. Android allows at
|
||||
most 480 active Kryon rules per host package and 64 per authenticated hosted app;
|
||||
replacements do not consume another slot and cancellation frees it.
|
||||
|
||||
The Android scaffold includes the notification receiver and permissions. Existing
|
||||
Android hosts must include `org.kryonlabs.notifications.NotificationReceiver`
|
||||
from the canonical scaffold, declare POST_NOTIFICATIONS and
|
||||
RECEIVE_BOOT_COMPLETED, and merge its receiver actions from the scaffold manifest.
|
||||
The Android scaffold declares the notification receiver, POST_NOTIFICATIONS
|
||||
and RECEIVE_BOOT_COMPLETED permissions, and receiver actions.
|
||||
Include `android_notifications` in the native graph so receiver exports survive
|
||||
linking. `notification_desktop` dispatches immediate notification effects to the
|
||||
Android implementation when ANDROID_BUILD is defined. Custom activities provide
|
||||
@@ -2221,9 +2159,8 @@ renderers filter sRGB texels in linear light and use the same clamp/repeat and
|
||||
top-row/V-bottom rules. `SceneTextureCoordinate` exposes the exact object-space
|
||||
coordinate transform for procedural geometry and tests.
|
||||
|
||||
`ImageMaterial` replaces the old raw-pixel texture attachment API. Shader
|
||||
samplers remain the separate programmable linear-RGBA surface; convert sRGB
|
||||
first when using those bindings.
|
||||
`ImageMaterial` attaches scene textures. Shader samplers use programmable
|
||||
linear-RGBA values; convert sRGB first when using those bindings.
|
||||
|
||||
### Light cookies
|
||||
|
||||
@@ -2303,9 +2240,7 @@ the hours, the sky and the grade on native and portable builds (`make
|
||||
daylight-test`).
|
||||
|
||||
Linux uses the existing system image loader and packaged WebP/AVIF adapters,
|
||||
copying the original straight pixels before Cairo premultiplies them. The
|
||||
Raylib WASM target reads files in the Emscripten filesystem and uses its existing
|
||||
image decoder; assets must be preloaded. Android reads relative APK asset paths
|
||||
copying the original straight pixels before Cairo premultiplies them. Android reads relative APK asset paths
|
||||
through the current NativeActivity's asset manager, or absolute filesystem
|
||||
paths. It uses the existing PNG decoder and the activity's `decodeBundleImage`
|
||||
method for other supported formats, including JPEG orientation. Unsupported
|
||||
@@ -2332,8 +2267,7 @@ while preserving the caller's clip for subsequent drawing. Android frames lock,
|
||||
paint and post NativeActivity pixels directly, and pause while the activity is
|
||||
paused or has no window. `SyncWindowSurface` refreshes Android's shared surface
|
||||
and touch transform. Closing requests activity shutdown, drains its lifecycle
|
||||
commands, then frees its native pixels. No native operation in this adapter
|
||||
requires raylib. Canvas keeps its page lifecycle.
|
||||
commands, then frees its native pixels. Canvas keeps its page lifecycle.
|
||||
|
||||
Custom hosts import `kryon/window_icon` for
|
||||
`SetWindowIcon(encoded: string, file_type: string) -> bool`. Encoded bytes
|
||||
@@ -2341,5 +2275,4 @@ are borrowed for the call; native hosts decode through their shared image
|
||||
codecs, apply JPEG orientation, and preserve full dimensions and straight
|
||||
alpha. The native window must already exist. False means invalid or
|
||||
unsupported data, a missing SDL window, or a browser/Android host where the
|
||||
application icon belongs to the page or package manifest. Native AVIF
|
||||
requires `AVIF_RAYLIB` and the codec archives used by the renderer.
|
||||
application icon belongs to the page or package manifest. Native AVIF uses the shared codec libraries.
|
||||
@@ -14,7 +14,6 @@ library. The compiler and bundle loader have no Kryon-specific branches.
|
||||
| `src/project/*.zi` | Kryon project tool that builds an app through Ziran |
|
||||
| `tests/*_host.zi` | Ziran behavior-test hosts; not part of the library or application hosts |
|
||||
| Application repositories | Screens, assets, translations, product data, and workflows |
|
||||
| Game2D repository | Optional game API; Kryon determines its shared raylib revision when both packages are used |
|
||||
|
||||
All maintained implementation files under `src/` are `.zi`. The core module
|
||||
inventory is [`src/ui/modules.txt`](../src/ui/modules.txt). Applications import
|
||||
@@ -30,9 +29,10 @@ The host supplies system effects such as windows, terminal output, font and
|
||||
image loading, rasterization, and storage. A host should not implement a
|
||||
second set of widget decisions.
|
||||
|
||||
An application exports `Frame(session: Session, viewport: Rectangle) -> s32`.
|
||||
The selected host calls it between `BeginFrame` and `EndFrame`. Package
|
||||
profiles choose the terminal, desktop, raylib or Canvas2D host;
|
||||
An application owns `main` and calls `App.Show` or `App.Run`, or exports
|
||||
`Frame(session: Session, viewport: Rectangle) -> s32` for a profile host.
|
||||
A frame host calls it between `BeginFrame` and `EndFrame`. Package
|
||||
profiles choose the terminal, desktop, Android or Canvas2D host;
|
||||
see [BACKENDS.md](BACKENDS.md). A non-graphical Ziran program can
|
||||
import a Kryon policy module without selecting any of these hosts.
|
||||
|
||||
@@ -42,8 +42,7 @@ import a Kryon policy module without selecting any of these hosts.
|
||||
compiles native objects, and creates a C archive from generated source.
|
||||
`make test` exercises the checked library through source, saved `.zir`, and
|
||||
portable `.zx` behavior, Canvas2D Wasm effects, and packaged Canvas2D
|
||||
browser applications in private headless Chromium. Desktop and
|
||||
raylib package tests run separately on private Xvfb displays;
|
||||
browser applications in private headless Chromium. Desktop package tests run on private Xvfb displays;
|
||||
CI runs them too. `make sanitize-test` repeats the behavior tests with AddressSanitizer and UndefinedBehaviorSanitizer.
|
||||
[FEATURE_MATRIX.md](FEATURE_MATRIX.md) states exactly what those checks cover.
|
||||
|
||||
|
||||
+19
-206
@@ -20,22 +20,9 @@ backend = "desktop"
|
||||
Run `ziran tool kryon build` or `ziran tool kryon run` from the application.
|
||||
See [Ziran projects](PROJECTS.md) for the complete package manifest.
|
||||
|
||||
MediaAudio's Raylib and Canvas providers support individual voice Pause/Resume.
|
||||
Raylib uses Pause/ResumeMusicStream and Pause/ResumeAudioStream, and reports
|
||||
GetMusicTimePlayed for asset music. Canvas retains music offsets against the
|
||||
AudioContext clock and re-creates only that voice's source on explicit Resume;
|
||||
paused PCM retains at most two immutable buffers and their remaining offsets.
|
||||
No owner pauses the shared context. See [MediaAudio](API.md) for capability
|
||||
bits and position availability. Native tests use Raylib/miniaudio's paced null
|
||||
backend; browser tests use a disposable muted headless context and trusted gesture.
|
||||
Ogg Opus assets decode through the `audio` package on native Linux and Windows;
|
||||
those targets link `-lopus -lm` (the `renderer-raylib` artifact ships a static
|
||||
`lib/libopus.a`). Android portable guests use the platform `MediaPlayer`
|
||||
service through JNI instead of carrying an audio codec.
|
||||
|
||||
## Renderer artifacts in build scripts
|
||||
|
||||
The package exports `renderer-raylib`, `renderer-desktop` and `renderer-web`
|
||||
The package exports `renderer-desktop`, `renderer-desktop-windows` and `renderer-web`
|
||||
artifacts for the supported native and browser targets. Request them through
|
||||
`ziran pkg artifact kryon:NAME --platform OS-ARCH-ABI`, using the application's
|
||||
package wrapper and locked graph. Ziran's `scripts/ziran_artifacts.py` verifies
|
||||
@@ -64,8 +51,6 @@ in the application.
|
||||
| --- | --- | --- |
|
||||
| `terminal` | `src/backend/terminal_run.zi` | 80 × 24 terminal cells via `terminal.zi` |
|
||||
| `desktop` | `src/backend/desktop_run.zi` | SDL2 window with Cairo raster |
|
||||
| `raylib` | `src/backend/raylib_run.zi` | raylib SDL2/OpenGL ES 2 window |
|
||||
| `raylib` with `platform = "web"` | `src/backend/raylib_run.zi` | raylib WebGL 1 page with Emscripten and Asyncify; see [raylib in the browser](#raylib-in-the-browser) |
|
||||
| `canvas` | `src/backend/canvas_run.zi` | Canvas2D page with Emscripten and Asyncify |
|
||||
| `android` | app `src/main.zi` → `android_run.zi` | Android NativeActivity package with direct `ANativeWindow` pixel presentation |
|
||||
|
||||
@@ -80,13 +65,12 @@ The returned key uses shared codes, including 320–329 for numeric-keypad
|
||||
digits, and carries the modifiers held when that key arrived.
|
||||
Standalone `AppContext` applications use the compiled host
|
||||
`canvas_app_run.zi`.
|
||||
Polygon-clipped images use native Cairo/Canvas path clips. Raylib caches bounded polygon triangulations and draws them directly on the
|
||||
GPU, including all Jungle puzzle pieces. Complex polygons and pixel hosts use
|
||||
Polygon-clipped images use native Cairo/Canvas path clips. Complex polygons and pixel hosts use
|
||||
clipped spans while preserving the original source mapping.
|
||||
SDL pixel hosts prefer accelerated texture presentation without blocking on
|
||||
vertical refresh. `SDL_RENDER_DRIVER` retains explicit driver selection,
|
||||
including `software`; hosts without an accelerated driver use software
|
||||
presentation automatically. Pixel rasterization remains on CPU workers.
|
||||
SDL pixel hosts use software presentation by default. `SDL_RENDER_DRIVER`
|
||||
retains explicit driver selection; `KRYON_PIXMAP_GPU=1` requests accelerated
|
||||
presentation. Pixel rasterization remains on CPU workers unless the host
|
||||
explicitly enables a GPU painter.
|
||||
Desktop windows become visible only after their first complete frame has
|
||||
been uploaded and presented. A failed initial upload or copy leaves the
|
||||
window hidden until presentation succeeds.
|
||||
@@ -95,83 +79,12 @@ The `image_preview` module also supplies `ImageCompress` for smaller upright
|
||||
JPEG copies. It keeps transparent and animated originals intact and returns
|
||||
no replacement when encoding would increase file size.
|
||||
|
||||
## raylib in the browser
|
||||
|
||||
A `raylib` profile with `platform = "web"` builds the same raylib host, or a
|
||||
project's own raylib host, as a WebGL page. raylib's `PLATFORM_WEB` library
|
||||
(GLFW through Emscripten, OpenGL ES 2 on WebGL 1, with `rmodels` and `raudio`)
|
||||
builds once into `build/raylib-web/`, and the generated program is compiled
|
||||
with `PLATFORM_WEB` defined, so no POSIX threads are used.
|
||||
|
||||
```toml
|
||||
[tool.kryon.profiles.web]
|
||||
backend = "raylib"
|
||||
platform = "web"
|
||||
host = "src/host.zi" # optional custom raylib host
|
||||
assets = "assets" # mounted at /assets
|
||||
preload = "client/bin/textures@textures mods"
|
||||
```
|
||||
|
||||
| Key | Meaning |
|
||||
| --- | --- |
|
||||
| `platform` | `web` builds a browser page. It needs `backend = "raylib"` with c99 codegen; `library`, `static_archive` and `native_artifacts` are rejected. |
|
||||
| `host` | A project host as for native raylib. The default is `raylib_run.zi`. |
|
||||
| `assets` | One project directory, mounted at its own relative path. |
|
||||
| `preload` | Space-separated project directories, `DIR` or `DIR@MOUNT`, mounted at `/DIR` or `/MOUNT`. It needs `platform = "web"`. |
|
||||
|
||||
`ziran tool kryon build --profile web` writes `index.html`, `index.js`,
|
||||
`index.wasm` and, when files are preloaded, `index.data` to
|
||||
`build/NAME-PROFILE/`. A new build replaces the directory only after the link
|
||||
succeeds. Serve that directory over HTTP, not `file://`, so the page can fetch
|
||||
its module and data. Copy it as a whole, for example to a site's `play/`
|
||||
directory. The page's working directory is `/`, so relative asset paths
|
||||
resolve as they do from the project directory on the desktop. Kryon's UI font
|
||||
is preloaded at `/kryon-font.ttf`. The page's `<title>` and raylib's window
|
||||
title come from `[tool.kryon.install] name` or else the package name. The page
|
||||
records how the program ended in `document.body.dataset.kryon` (`exit CODE` or
|
||||
`abort REASON`).
|
||||
|
||||
The program keeps its ordinary blocking loop. Emscripten's ASYNCIFY suspends
|
||||
the program inside `PollRaylib()`: raylib's web `WindowShouldClose()` sleeps
|
||||
12 ms, which returns to the browser so it can present the frame and deliver
|
||||
input. The frame rate therefore depends on that sleep. Kryon sets raylib's
|
||||
target FPS to 0 in the page, because a frame limit would spin the browser's
|
||||
only thread. A custom host follows these rules:
|
||||
|
||||
- Call `OpenRaylib(width, height, title, flags)` once. Pass
|
||||
`FLAG_WINDOW_RESIZABLE` (4, the default) so the canvas follows the browser
|
||||
window, and keep the result of `RaylibViewport()` per frame rather than the
|
||||
opening size.
|
||||
- Loop on `while PollRaylib() { ... }` from `main` or a procedure called
|
||||
directly by it. Each frame calls `PollRaylib()` once. Do not wait, sleep or
|
||||
spin anywhere else in the loop.
|
||||
- Inside a frame call `RaylibFrameInputBegin(session)`, then
|
||||
`BeginRaylibFrame()`. Draw the world after it: clear the background, then
|
||||
call `BeginMode3D`, the 3D drawing and `EndMode3D`. Then call
|
||||
`BeginFrame(session, ...)`, the app's `Frame`, `EndFrame`,
|
||||
`FrameInputEnd(session)` and `EndRaylibFrame()`. Kryon paints above
|
||||
whatever the host drew earlier in the frame.
|
||||
- Use only GLES2/WebGL 1 features: no geometry shaders, `#version 100`
|
||||
shaders, and power-of-two textures when mipmaps or repeat wrapping are
|
||||
needed.
|
||||
- Read files through the preloaded mounts. Writes stay in the page's memory
|
||||
file system and are lost on reload.
|
||||
- Leave out native-only libraries: threads, `#system_library` libraries other
|
||||
than raylib, libc and libm, and `RunRaylibAppFrame` worker pipelines. WebP assets
|
||||
decode with the `webp` package's authored still-image engine; AVIF assets
|
||||
do not decode in this host.
|
||||
- Return from `main` to end the page. `CloseRaylib()` releases the WebGL
|
||||
context.
|
||||
|
||||
`make raylib-web-project-test` builds such a host, with a 3D cube under a
|
||||
Kryon `Box` and `Image`, and checks the page in private headless Chromium.
|
||||
|
||||
## Experimental SDL3 GPU renderer
|
||||
|
||||
Custom Linux x86_64 GNU hosts can import `kryon/pixmap_sdl3` and
|
||||
`kryon/pixmap_sdl3_gpu`. This is an opt-in rendering prototype, rather than a
|
||||
new project profile: the host supplies an SDL3 window, input loop and
|
||||
presentation. Existing desktop, SDL2 and Raylib profiles keep their behavior.
|
||||
presentation. Desktop profiles keep their behavior.
|
||||
The handwritten renderer is Ziran; SDL3 supplies the GPU API and shaders.
|
||||
|
||||
Kryon's `native-sdl3` artifact builds static SDL 3.4.18 from its pinned official
|
||||
@@ -230,17 +143,10 @@ texel ties in the 1.25× zoom scene can choose the adjacent texel, as in the SDL
|
||||
reference; the test accepts only analytically identified checker boundaries
|
||||
within the image and clip. The shared sampler is therefore not byte-exact at
|
||||
those ties. SDL3 also converts byte colors to float colors in 1536-vertex chunks,
|
||||
which can add draw calls; this does not establish a speedup over SDL2 or Raylib.
|
||||
which can add draw calls; this does not establish a speedup over SDL2.
|
||||
See the executable lifecycle example in
|
||||
[`tests/sdl3_renderer_host_test.zi`](../tests/sdl3_renderer_host_test.zi).
|
||||
|
||||
After `make sdl3-test`, the separate comparison harness is available with
|
||||
`build-queue -- python3 tests/backend_render_benchmark.py --smoke`. It records
|
||||
device identity, parity and raw samples under ignored
|
||||
`work/backend-render-benchmark`. The test-only Raylib adapter currently fails
|
||||
the zoom scene's pixel oracle, so the comparison returns status 2 and excludes
|
||||
that scene's Raylib timings. This does not make the SDL3 integration test fail.
|
||||
|
||||
For SDL2 versus SDL3 on a physical AMD GPU under Linux, use the explicit
|
||||
hardware mode (choose the render node from `/sys/class/drm/renderD*/device`):
|
||||
|
||||
@@ -261,8 +167,7 @@ The report records that device's render node, PCI address, vendor/device IDs,
|
||||
kernel driver, renderer/API and Mesa versions. A mismatched device, software
|
||||
renderer, missing execution evidence or failed pixel oracle blocks hardware
|
||||
timing. This qualification currently requires AMD's Linux DRM counters; it
|
||||
does not infer acceleration from the Vulkan API name. Raylib is excluded
|
||||
from this hardware comparison. The default software mode still forces
|
||||
does not infer acceleration from the Vulkan API name. The default software mode still forces
|
||||
llvmpipe on private Xvfb; `--backends sdl2 sdl3` restricts its smoke test.
|
||||
|
||||
Every selected backend must pass all 120 frames of all five 480×320 scenes
|
||||
@@ -276,28 +181,6 @@ measurement. Offscreen results do not measure visible-window/compositor
|
||||
performance, and other running workloads and GPU clock changes remain
|
||||
uncontrolled. No backend default or SDL2 software fallback is changed.
|
||||
|
||||
The 2026-11-02 hardware run used AMD Radeon Graphics
|
||||
(RAPHAEL_MENDOCINO), `/dev/dri/renderD129`, PCI `0000:7a:00.0`,
|
||||
vendor/device `1002:13c0`, kernel `amdgpu`, Mesa 25.0.7. SDL2 used
|
||||
radeonsi OpenGL 4.6; SDL3 used RADV Vulkan. Both passed 600 parity frames,
|
||||
with zero failures after the specified checker-boundary allowance. Five
|
||||
randomized trials per scene used 1,200 timed frames and 240 warmup frames.
|
||||
Median drained frames/s, SDL2 then SDL3, were:
|
||||
|
||||
- Text: 7,709 / 7,115 (SDL3 −7.7%).
|
||||
- Images: 2,819 / 2,894 (+2.7%).
|
||||
- Shapes: 4,047 / 4,794 (+18.5%).
|
||||
- Scroll: 8,270 / 6,633 (−19.8%).
|
||||
- Zoom: 9,829 / 7,406 (−24.7%).
|
||||
|
||||
These are scene-specific observations from this machine, with trial spread
|
||||
and concurrent workloads; the small image difference does not establish a
|
||||
general advantage. The old forced-software comparison is not hardware
|
||||
evidence. Raw frame samples and DRM counters are in ignored
|
||||
`work/backend-render-benchmark/hardware.json`; the compact
|
||||
`hardware-summary.json` includes every trial's throughput and CPU latency
|
||||
p50/p95. Load averages were approximately 6.3/6.1/5.9 at both ends of the run.
|
||||
|
||||
## AVIF images
|
||||
|
||||
Native AVIF and WebP decoding is supplied by the standalone Ziran `avif`,
|
||||
@@ -322,9 +205,7 @@ before publishing any pixels. Browser codecs and pixel-renderer inputs retain
|
||||
their existing paths.
|
||||
|
||||
`Image.Draw(Image.Props)` accepts AVIF assets through the same path as PNG/JPEG/WebP,
|
||||
including extensionless names and packaged bundle/APK assets. Raylib hosts opt
|
||||
in with `AVIF_RAYLIB` and the pinned archives; builds without it decode no AVIF
|
||||
and link no codec library. Native hosts
|
||||
including extensionless names and packaged bundle/APK assets. Native hosts
|
||||
decode with the locked libavif 1.3 and dav1d, its assembly selected at run time
|
||||
for the CPU (x86 SSE2 to AVX-512, ARMv7 and AArch64 NEON); Android 9 requires
|
||||
no OS AVIF support. libaom is linked as the explicit comparison oracle, never
|
||||
@@ -336,7 +217,7 @@ and Release, including the original large YUV420 crash input and background
|
||||
image loading.
|
||||
8/10/12-bit color and monochrome decode to straight 8-bit RGBA; alpha and
|
||||
container clean aperture, rotation and mirroring are preserved. The renderer
|
||||
then premultiplies for Cairo or composites normally in Raylib. HDR tone mapping
|
||||
then premultiplies for Cairo. HDR tone mapping
|
||||
and ICC display color management are outside the existing 8-bit image surface.
|
||||
|
||||
Encoded files are limited to 256 MiB, dimensions to 32768 per axis and pixel
|
||||
@@ -357,19 +238,6 @@ bytes. Only the first decoded frame is retained.
|
||||
| Linux AArch64 | dav1d NEON, dotprod, i8mm | qemu-user: strict parity |
|
||||
| Windows, macOS | dav1d via the same recipe | unverified here |
|
||||
|
||||
`mk/raylib-library.mk` builds `AVIF_A`, `AOM_A` and Linux `AVIF_SO` beside the
|
||||
existing renderer archives; `AVIF_A` contains dav1d. Building it needs Meson,
|
||||
Ninja and, on x86, NASM; `ZIRAN_AVIF_TOOLS` can name a directory holding the
|
||||
avif package's pinned Meson/Ninja. `kryon_android_codecs(webp, avif, aom)`
|
||||
links the static codec for each ABI; older scaffolds receive the source paths
|
||||
through `KRYON_ANDROID_AVIF_DIR`, `KRYON_ANDROID_AOM_DIR` and `KRYON_DAV1D_DIR`
|
||||
(otherwise dav1d comes from the locked package graph). The Raylib artifact
|
||||
includes the static codec archives. The desktop artifact includes the
|
||||
self-contained `libkryonavif.so`; `renderer_link` retains it as a runtime
|
||||
dependency so application packaging tools carry it into their lib directory.
|
||||
Cairo also searches beside the executable and its `lib`/`../lib` directories;
|
||||
`KRYON_AVIF_LIBRARY` can select an explicit codec file for custom hosts.
|
||||
|
||||
Canvas uses the browser AVIF decoder through `PageImageDecode`; supported
|
||||
browsers (Firefox 93+, Chromium 85+, Safari 16.4+) supply their native AVIF
|
||||
implementation. In a browser without AVIF, every AVIF decode fails cleanly:
|
||||
@@ -384,7 +252,7 @@ strict libavif digests in `tests/avif_strict_digests.zi`, tolerance 0. The
|
||||
independent goldens keep small documented tolerances: ±1 for 10/12-bit and
|
||||
grayscale (8-bit rounding of the source pattern), ±4 premultiplied (unpremultiply
|
||||
rounding) and ±3 for Jungle title samples (YUV420 conversion versus Pillow).
|
||||
`make avif-render-test` checks real Cairo and private-display Raylib rendering,
|
||||
`make avif-render-test` checks native rendering,
|
||||
including a portable bundle using the public Image widget. `make android-avif-test
|
||||
ANDROID_NDK=... ANDROID_SERIAL=ZE2223BQZT` builds all four ABIs and runs the
|
||||
ARMv7 strict-parity/golden-pixel tests on the Android 9 USB Moto, asserting each
|
||||
@@ -411,20 +279,11 @@ its name. Lossy, lossless and alpha pictures decode to straight RGBA. An
|
||||
animated WebP decodes to its first complete frame, since Kryon images are
|
||||
still; `ImageCompress` keeps animated originals unchanged.
|
||||
|
||||
- The raylib and Android hosts decode through `webp_image.zi` with libwebp's
|
||||
decoder and animation demuxer, built from the locked `libwebp` source
|
||||
package into the static `kryonwebp` archive (`cmake/WebP.cmake`, no
|
||||
encoder or threads). Images above 67108864 pixels are refused. The static
|
||||
adapter retains its 2147483647-byte input cap; Cairo retains its 256 MiB
|
||||
encoded-file budget.
|
||||
`mk/raylib-library.mk` builds it as `WEBP_A` beside `RAYLIB_A`;
|
||||
`kryon_android_codecs` builds it for each ABI; the `renderer-raylib`
|
||||
artifact lists `lib/libkryonwebp.a` in its archives.
|
||||
- The desktop (Cairo) host loads the system libwebp demuxer
|
||||
(`libwebpdemux.so.2`) on first use, like its other optional codecs.
|
||||
- The canvas host uses the browser's own WebP decoder.
|
||||
|
||||
`make raylib-webp-decode-test` and `make test-focus TEST=ziran_image_decode_linux_test` decode the
|
||||
`make test-focus TEST=ziran_image_decode_linux_test` decode the
|
||||
`tests/fixtures/webp` pictures natively, `tests/webp_browser_test.py` does the
|
||||
same in headless Chromium, and `make android-webp-link-test` links the
|
||||
decoder for every Android ABI.
|
||||
@@ -436,32 +295,6 @@ are ignored. `tests/ziran_png_test.sh` compares independent reference pixels
|
||||
for 33 fixtures through source and saved IR in bundles, C and Go, including
|
||||
malformed streams and bounded decoder output.
|
||||
|
||||
The raylib host uses `raylib_runtime.zi` and the raylib revision pinned as a
|
||||
Ziran source dependency. The canvas host uses its dedicated `canvas_raster.zi` provider over
|
||||
a Canvas2D browser ABI; see [Canvas2D browser host](canvas.md). Backend build
|
||||
dependencies and link flags live in `mk/ziran-project.mk`. Platform calls are
|
||||
declared with Ziran foreign imports; handwritten host implementation is
|
||||
Ziran.
|
||||
|
||||
On Linux, the Raylib host resolves system typefaces and missing characters
|
||||
through [Fontconfig](https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-devel/).
|
||||
Measurement and drawing use the same fallback face and advances. TrueType and
|
||||
OpenType collections are extracted into owned standalone font bytes following
|
||||
the [OpenType table and checksum rules](https://learn.microsoft.com/en-us/typography/opentype/spec/otff).
|
||||
Glyph atlases remain available for later frames, and queued text is flushed
|
||||
before replacing an atlas.
|
||||
Missing characters are checked against the source before rebuilding an atlas.
|
||||
Text measurement refreshes the base atlas; cached drawing sizes refresh only
|
||||
when used, so a new character cannot rebuild every cached zoom at once.
|
||||
|
||||
`make raylib-typeface-test` decodes real fonts and checks mixed Latin/CJK text,
|
||||
supplementary characters, collection bounds and checksums, retained sources,
|
||||
and disposal in C from source and saved IR. It replaces only graphics
|
||||
submission and texture allocation, so it needs no display and does not verify
|
||||
rendered pixels. Supply `RAYLIB_A` for an existing Raylib archive (and
|
||||
`RAYLIB_LIBS` for its link flags); Fontconfig and an installed CJK outline font
|
||||
are required. Whole-application captures still require a private display.
|
||||
|
||||
Browser projects save the selected `_run` host and `canvas_raster.zi` as
|
||||
generation roots without entry pruning. This keeps both the host `main` and
|
||||
the raster adapters available to the paint queue. Native projects continue
|
||||
@@ -497,7 +330,6 @@ LRU budgets, so a large cover and its small marker do not evict each other.
|
||||
| Backend | Lanczos copy |
|
||||
| --- | --- |
|
||||
| Desktop/Cairo | Cached surface, drawn 1:1 |
|
||||
| Raylib | Uploaded texture; the CPU copy is freed after upload |
|
||||
| pixmap and SDL3 GPU | A copy slot drawn 1:1 (threaded builds only, `PIXMAP_LANCZOS`), so the CPU rows and GPU hosts show the same bytes |
|
||||
| Canvas | Ziran resampler in slices, from the texture's pixels read back, then uploaded |
|
||||
|
||||
@@ -525,7 +357,7 @@ already does this by pushing a wake event. `PixmapLanczosWait` and
|
||||
smooth picture is final.
|
||||
|
||||
`make lanczos-goldens-test` (part of `make test`) compares Cairo, pixmap,
|
||||
Raylib on a private Xvfb display and Canvas in headless Firefox against
|
||||
Canvas in a private headless browser against
|
||||
Pillow goldens. `make lanczos-benchmark` times Kryon against Pillow,
|
||||
Pillow-SIMD, libvips and stb_image_resize2. It reports ms per output
|
||||
megapixel, extra peak memory and PSNR against a float64 reference, on
|
||||
@@ -559,23 +391,6 @@ a JDK, the Android SDK with NDK `28.2.13676358` and CMake `3.22.1`
|
||||
`libavif` and `libaom` source packages. Scaffolds pass their source roots to
|
||||
`kryon_android_codecs`; the packaged host links no renderer or audio library.
|
||||
|
||||
A custom raylib Android host defines `KRYON_RAYLIB_HOST` during Ziran generation.
|
||||
This selects raylib's pointer and clipboard exports while retaining Android
|
||||
platform services. Direct touch consumers call `AndroidPointerFrame()` and
|
||||
`AndroidSecondarySample()` from `android_touch`; those samples do not replace
|
||||
the selected renderer's generic input exports.
|
||||
JNI also selects raylib's `GetAndroidApp()` for this host, so private files,
|
||||
Java calls and process preparation use the raylib-owned NativeActivity.
|
||||
Before initializing graphics, custom hosts can read the announced native window
|
||||
with `GetAndroidPendingSurfaceSize(width, height)` from `android_surface`. It
|
||||
returns positive dimensions without consuming or acknowledging lifecycle commands.
|
||||
Once EGL is current, surface synchronization reads its drawing-buffer extent.
|
||||
If raylib's fixed buffer request no longer matches the native window after
|
||||
picture-in-picture, synchronization releases that request. Subsequent EGL
|
||||
buffers follow the native window size; software hosts use the native window.
|
||||
The same synchronization maps window-local touch samples into the decorated
|
||||
surface, including replayed quick taps and logical zoom.
|
||||
|
||||
At runtime a `NativeActivity` subclass owns the Java side: it reports window
|
||||
insets, display cutouts, IME state, density, dark mode and orientation
|
||||
through JNI natives registered by the generated `src/android_glue.zi`, and
|
||||
@@ -636,9 +451,8 @@ input such as `KeyboardTake`, `TypedCodepointTake`,
|
||||
`PointerWheelTake`, and pointer state. `KeyboardModifiers` reports
|
||||
Shift, Control, and Alt keys as `KeyModifierShift`, `KeyModifierControl`, and
|
||||
`KeyModifierAlt` bits, so a shortcut such as Ctrl+S is a key press read with
|
||||
the modifiers that were down. Desktop, Canvas and Raylib custom loops call
|
||||
`DesktopInputTake(session)`, `CanvasInputTake(session)` or
|
||||
`RaylibInputTake(session)` before each frame. Each take transfers ordered text
|
||||
the modifiers that were down. Desktop and Canvas custom loops call
|
||||
`DesktopInputTake(session)` or `CanvasInputTake(session)` before each frame. Each take transfers ordered text
|
||||
to that session and returns the next key with the modifiers retained when the
|
||||
press or repeat arrived, so shortcuts remain intact even when every physical
|
||||
key is released before a frame. `CanvasModifiers()` and the immutable frame
|
||||
@@ -653,7 +467,7 @@ window hosts and ignores terminal escape sequences. The project test drives
|
||||
this through a private PTY. The other hosts can capture a frame with
|
||||
`KRYON_CAPTURE_PATH`; the graphical integration tests run on private Xvfb
|
||||
displays. Run `make test` for the library, browser, and typeface gates, plus
|
||||
`make desktop-project-test` and `make raylib-project-test` for graphical
|
||||
`make desktop-project-test` for graphical
|
||||
capture and input.
|
||||
Never run graphical tests against the developer's live display.
|
||||
|
||||
@@ -666,7 +480,7 @@ buffer that is too small leaves the next path queued. Text drops are ignored.
|
||||
## Portable programmable scene rendering
|
||||
|
||||
`scene_render` executes `shader` material programs in Ziran on CPU before
|
||||
presentation. Cairo, Raylib (including WebAssembly), and Android's
|
||||
presentation. Cairo and Android's
|
||||
ANativeWindow/Pixmap host consume the resulting managed bitmap through the
|
||||
standard Image surface. These hosts do not need a shader-language bridge.
|
||||
This interface does not claim GPU execution, GLSL compilation, vertex-shader
|
||||
@@ -683,8 +497,7 @@ materials and the Pixmap-to-ANativeWindow presentation path on the USB Moto. It
|
||||
uses a private offscreen AImageReader window, verifies posted RGBA pixels,
|
||||
clipping, alpha and binding changes, and destroys/recreates that window while
|
||||
keeping the CPU program and bitmap alive. It does not launch or alter an owner
|
||||
app. `make shader-web-test` exercises the corresponding Raylib WebGL presentation
|
||||
inside a private headless browser. These targets also load a real PNG through
|
||||
app. These targets also load a real PNG through
|
||||
`kryon/image_pixels`; activity-bound Android asset/JNI decoding is a separate
|
||||
application integration responsibility.
|
||||
|
||||
|
||||
+1
-3
@@ -4,7 +4,6 @@
|
||||
| --- | --- |
|
||||
| Ziran | Language, compiler, standard library, `.zir`, `.zx`, and generic host capabilities |
|
||||
| Kryon | Reusable Ziran UI modules, widget decisions, and UI hosts |
|
||||
| Game2D | Optional game API and game behavior using Kryon's selected raylib backend |
|
||||
| Applications | Screens, copy, translations, assets, data storage, migrations, and product workflows |
|
||||
|
||||
Kryon is imported by applications. It is not linked into programs that never
|
||||
@@ -18,7 +17,6 @@ decisions. The host may call native libraries through declared Ziran foreign
|
||||
bindings, but must not duplicate widget policy.
|
||||
|
||||
Make upstream Kryon changes on `master` and commit them there. A downstream
|
||||
app picks them up by updating its `ziran.lock`, or, if it still vendors
|
||||
Kryon, by moving its clean `vendor/kryon` submodule pointer. Never edit
|
||||
app picks them up by updating its `ziran.lock`. Never edit
|
||||
Kryon's source inside an application. See [ARCHITECTURE.md](ARCHITECTURE.md)
|
||||
for source modules and [PROJECTS.md](PROJECTS.md) for package use.
|
||||
@@ -37,11 +37,10 @@ and Indic joins intact, including joins across preedit segments. Existing
|
||||
The native Cairo host uses Pango for shaping, bidirectional placement and
|
||||
font fallback. Caret measurement uses the full shaped line rather than a
|
||||
separately shaped prefix. `tests/native_text_test.sh` checks combining marks,
|
||||
Arabic joining, Hebrew caret/hit positions and text longer than the former
|
||||
1,024-byte draw limit through source/saved IR and C.
|
||||
Arabic joining, Hebrew caret/hit positions and long text through source/saved IR and C.
|
||||
|
||||
Logical Left/Right movement is still by grapheme order. Mixed bidirectional
|
||||
selection uses a single highlight rectangle, and separately styled preedit
|
||||
runs are not shaped as one joined run. Pixmap, raylib and other hosts retain
|
||||
runs are not shaped as one joined run. Pixmap and other hosts retain
|
||||
their own font/rendering capabilities; Cairo shaping does not imply all-host
|
||||
bidirectional support.
|
||||
@@ -21,7 +21,7 @@ li{margin:.25rem 0}
|
||||
<h2>Library packages</h2>
|
||||
<table>
|
||||
<tr><th>Package</th><th>Ziran source</th><th>Native code generation</th><th>Package verification</th></tr>
|
||||
<tr><td class="">Core UI (<code>src/ui</code>)</td><td class="ok">✅ <code>.zi</code> modules listed in <code>modules.txt</code> and two public import modules</td><td class="ok">✅ C and Go generation in <code>make</code></td><td class="ok">✅ <code>make test</code> builds the library and runs source, saved <code>.zir</code>, and <code>.zx</code> behavior tests</td></tr>
|
||||
<tr><td class="">Core UI (<code>src/ui</code>)</td><td class="ok">✅ <code>.zi</code> modules listed in <code>modules.txt</code> and named package exports</td><td class="ok">✅ C and Go generation in <code>make</code></td><td class="ok">✅ <code>make test</code> builds the library and runs source, saved <code>.zir</code>, and <code>.zx</code> behavior tests</td></tr>
|
||||
</table>
|
||||
<p>The generated C archive is a build output of Ziran source. Behavior tests use Ziran hosts in <code>tests/*_host.zi</code>. Code generation verifies that a module lowers for a target; it does not prove that every native host runs on that target.</p>
|
||||
<h2>Application hosts</h2>
|
||||
@@ -29,9 +29,8 @@ li{margin:.25rem 0}
|
||||
<tr><th>Backend</th><th>Implementation</th><th>Input and presentation verification</th><th>Current status</th></tr>
|
||||
<tr><td class="">Terminal</td><td class=""><code>src/backend/terminal_run.zi</code></td><td class="">Private PTY project test covers ASCII, UTF-8, invalid input, and escape sequences</td><td class="ok">✅ supported</td></tr>
|
||||
<tr><td class="">Desktop</td><td class=""><code>src/backend/desktop_run.zi</code></td><td class="">Private Xvfb project test covers image capture, keyboard, UTF-8 text, and wheel input</td><td class="ok">✅ supported on the tested Linux host</td></tr>
|
||||
<tr><td class="">Raylib</td><td class=""><code>src/backend/raylib_run.zi</code></td><td class="">Private Xvfb project test covers image capture and input</td><td class="ok">✅ supported on the tested Linux host</td></tr>
|
||||
<tr><td class="">Web Canvas</td><td class=""><code>src/backend/canvas_run.zi</code></td><td class="">Headless Chromium checks Canvas2D pixels, clips, input, textures, fonts, lifecycle, WebAudio, and file behavior</td><td class="ok">✅ supported through Emscripten on the tested browser</td></tr>
|
||||
<tr><td class="">Android</td><td class="">app <code>src/main.zi</code> + <code>src/backend/android_run.zi</code></td><td class=""><code>tests/ziran_android_device_test.sh</code> checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back</td><td class="ok">✅ supported through NativeActivity with raylib OpenGL ES 2</td></tr>
|
||||
<tr><td class="">Android</td><td class="">app <code>src/main.zi</code> + <code>src/backend/android_run.zi</code></td><td class=""><code>tests/ziran_android_device_test.sh</code> checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back</td><td class="ok">✅ supported through NativeActivity with direct ANativeWindow pixel presentation</td></tr>
|
||||
</table>
|
||||
<p>The desktop and raylib project tests run separately with <code>make desktop-project-test</code> and <code>make raylib-project-test</code>; they must use a private Xvfb display. CI runs both on every push in their own job. The Canvas2D project test runs in <code>make test</code> and launches only private headless Chromium.</p>
|
||||
<p>The desktop project test (<code>make desktop-project-test</code>) uses a private Xvfb display. The Canvas2D project test runs in <code>make test</code> and launches only private headless Chromium. <code>make zx-window-test</code> covers bare-window bundles through the native desktop player and host library. Code generation alone does not establish platform execution.</p>
|
||||
</body></html>
|
||||
@@ -10,7 +10,7 @@ module and host boundaries.
|
||||
|
||||
| Package | Ziran source | Native code generation | Package verification |
|
||||
| --- | --- | --- | --- |
|
||||
| Core UI (`src/ui`) | ✅ `.zi` modules listed in `modules.txt` and two public import modules | ✅ C and Go generation in `make` | ✅ `make test` builds the library and runs source, saved `.zir`, and `.zx` behavior tests |
|
||||
| Core UI (`src/ui`) | ✅ `.zi` modules listed in `modules.txt` and named package exports | ✅ C and Go generation in `make` | ✅ `make test` builds the library and runs source, saved `.zir`, and `.zx` behavior tests |
|
||||
|
||||
The generated C archive is a build output of Ziran source. Behavior tests use
|
||||
Ziran hosts in `tests/*_host.zi`. Code generation verifies that a module lowers
|
||||
@@ -22,11 +22,11 @@ for a target; it does not prove that every native host runs on that target.
|
||||
| --- | --- | --- | --- |
|
||||
| Terminal | `src/backend/terminal_run.zi` | Private PTY project test covers ASCII, UTF-8, invalid input, and escape sequences | ✅ supported |
|
||||
| Desktop | `src/backend/desktop_run.zi` | Private Xvfb project test covers image capture, keyboard, UTF-8 text, and wheel input | ✅ supported on the tested Linux host |
|
||||
| Raylib | `src/backend/raylib_run.zi` | Private Xvfb project test covers image capture and input | ✅ supported on the tested Linux host |
|
||||
| Web Canvas | `src/backend/canvas_run.zi` | Headless Chromium checks Canvas2D pixels, clips, input, textures, fonts, lifecycle, WebAudio, and file behavior | ✅ supported through Emscripten on the tested browser |
|
||||
| Android | app `src/main.zi` + `src/backend/android_run.zi` | `tests/ziran_android_device_test.sh` checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back | ✅ supported through NativeActivity with raylib OpenGL ES 2 |
|
||||
| Android | app `src/main.zi` + `src/backend/android_run.zi` | `tests/ziran_android_device_test.sh` checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back | ✅ supported through NativeActivity with direct ANativeWindow pixel presentation |
|
||||
|
||||
The desktop and raylib project tests run separately with
|
||||
`make desktop-project-test` and `make raylib-project-test`; they must use a
|
||||
private Xvfb display. CI runs both on every push in their own job. The Canvas2D
|
||||
project test runs in `make test` and launches only private headless Chromium.
|
||||
The desktop project test (`make desktop-project-test`) uses a private Xvfb
|
||||
display. The Canvas2D project test runs in `make test` and launches only private
|
||||
headless Chromium. `make zx-window-test` covers bare-window bundles through
|
||||
the native desktop player and host library. Code generation alone does not
|
||||
establish platform execution.
|
||||
+3
-11
@@ -23,15 +23,8 @@ rejected frames, and 2 for invalid arguments or files. Files are limited to
|
||||
64 MiB each.
|
||||
|
||||
The entry takes no arguments, returns an integer, and samples exactly one
|
||||
input record per frame. Existing entries may keep a module-local
|
||||
`PollPointer() -> PointerFrame`. Five-column traces remain supported:
|
||||
|
||||
```
|
||||
x y down pressed released
|
||||
```
|
||||
|
||||
For keyboard, text, composition, wheel, resize, clipboard and time, declare a
|
||||
module-local `PollFrameInput() -> FrameInput` and use the twenty-column format:
|
||||
input record per frame. Declare a module-local `PollFrameInput() -> FrameInput` and use the
|
||||
twenty-column format:
|
||||
|
||||
```
|
||||
x y down pressed released secondary_down secondary_pressed secondary_released key modifiers wheel width height elapsed_ms text_hex ime_phase ime_cursor ime_selection ime_hex clipboard_hex
|
||||
@@ -50,8 +43,7 @@ are accepted. A trace holds at most 1,024 samples within 1 MiB.
|
||||
`FrameInputField` converts text and composition into a `TextField.Input`.
|
||||
Applications explicitly use the recorded viewport and elapsed time rather
|
||||
than reading wall time. Clipboard reads use the recorded input and clipboard
|
||||
writes appear in the JSON. Rich traces produce format version 2; legacy
|
||||
pointer traces keep version 1.
|
||||
writes appear in the JSON. Captures use format version 2.
|
||||
|
||||
Capture includes focus, read-only state, selection and committed editor text.
|
||||
Secure editor values, lengths and selections are redacted. A document larger
|
||||
|
||||
+42
-30
@@ -15,11 +15,13 @@ disabled component neither accepts text nor keeps focus.
|
||||
|
||||
## Tag input
|
||||
|
||||
```ziran
|
||||
TagInput :: (session: Session, props: TagInputProps,
|
||||
state: *TagInputState) -> TagInputResult
|
||||
TagInputApply :: (state: *TagInputState,
|
||||
props: TagInputProps) -> TagInputResult
|
||||
```zi
|
||||
TagInput :: #import "kryon/tag_input";
|
||||
|
||||
TagInput.Draw :: (session: Session, props: TagInput.Props,
|
||||
state: *TagInput.TagInputState) -> TagInput.TagInputResult
|
||||
TagInput.TagInputApply :: (state: *TagInput.TagInputState,
|
||||
props: TagInput.Props) -> TagInput.TagInputResult
|
||||
```
|
||||
|
||||
`TagInputState` owns up to 64 tags and their stable caller IDs, the editable
|
||||
@@ -36,11 +38,13 @@ buttons, and nested field all honor disabled state and stylesheet cascade.
|
||||
|
||||
## One-time code
|
||||
|
||||
```ziran
|
||||
OneTimeCode :: (session: Session, props: OneTimeCodeProps,
|
||||
state: *OneTimeCodeState) -> OneTimeCodeResult
|
||||
OneTimeCodeApply :: (state: *OneTimeCodeState,
|
||||
props: OneTimeCodeProps) -> OneTimeCodeResult
|
||||
```zi
|
||||
OneTimeCode :: #import "kryon/one_time_code";
|
||||
|
||||
OneTimeCode.Draw :: (session: Session, props: OneTimeCode.Props,
|
||||
state: *OneTimeCode.OneTimeCodeState) -> OneTimeCode.OneTimeCodeResult
|
||||
OneTimeCode.OneTimeCodeApply :: (state: *OneTimeCode.OneTimeCodeState,
|
||||
props: OneTimeCode.Props) -> OneTimeCode.OneTimeCodeResult
|
||||
```
|
||||
|
||||
The state owns 1–12 alphanumeric slots, the cursor, focus, and prior completion.
|
||||
@@ -58,11 +62,13 @@ real retained nodes.
|
||||
|
||||
## Inline edit
|
||||
|
||||
```ziran
|
||||
InlineEdit :: (session: Session, props: InlineEditProps,
|
||||
state: *InlineEditState) -> InlineEditResult
|
||||
InlineEditApply :: (state: *InlineEditState,
|
||||
props: InlineEditProps) -> InlineEditResult
|
||||
```zi
|
||||
InlineEdit :: #import "kryon/inline_edit";
|
||||
|
||||
InlineEdit.Draw :: (session: Session, props: InlineEdit.Props,
|
||||
state: *InlineEdit.InlineEditState) -> InlineEdit.InlineEditResult
|
||||
InlineEdit.InlineEditApply :: (state: *InlineEdit.InlineEditState,
|
||||
props: InlineEdit.Props) -> InlineEdit.InlineEditResult
|
||||
```
|
||||
|
||||
Activation selects the current value for replacement. Normal text and paste
|
||||
@@ -74,11 +80,13 @@ and whether the committed value changed.
|
||||
|
||||
## Scrub field
|
||||
|
||||
```ziran
|
||||
ScrubField :: (session: Session, props: ScrubFieldProps,
|
||||
state: *ScrubFieldState) -> ScrubFieldResult
|
||||
ScrubFieldApply :: (state: *ScrubFieldState,
|
||||
props: ScrubFieldProps) -> ScrubFieldResult
|
||||
```zi
|
||||
ScrubField :: #import "kryon/scrub_field";
|
||||
|
||||
ScrubField.Draw :: (session: Session, props: ScrubField.Props,
|
||||
state: *ScrubField.ScrubFieldState) -> ScrubField.ScrubFieldResult
|
||||
ScrubField.ScrubFieldApply :: (state: *ScrubField.ScrubFieldState,
|
||||
props: ScrubField.Props) -> ScrubField.ScrubFieldResult
|
||||
```
|
||||
|
||||
Arrow-left/right, arrow-up/down, and horizontal drag use the same step. Shift
|
||||
@@ -95,11 +103,13 @@ metrics and can be overridden by ID/class stylesheet rules.
|
||||
|
||||
## Money field
|
||||
|
||||
```ziran
|
||||
MoneyField :: (session: Session, props: MoneyFieldProps,
|
||||
state: *MoneyFieldState) -> MoneyFieldResult
|
||||
MoneyFieldApply :: (state: *MoneyFieldState,
|
||||
props: MoneyFieldProps) -> MoneyFieldResult
|
||||
```zi
|
||||
MoneyField :: #import "kryon/money_field";
|
||||
|
||||
MoneyField.Draw :: (session: Session, props: MoneyField.Props,
|
||||
state: *MoneyField.MoneyFieldState) -> MoneyField.MoneyFieldResult
|
||||
MoneyField.MoneyFieldApply :: (state: *MoneyField.MoneyFieldState,
|
||||
props: MoneyField.Props) -> MoneyField.MoneyFieldResult
|
||||
```
|
||||
|
||||
The state owns a `float64` value and the focused edit bytes. Blurred display
|
||||
@@ -115,11 +125,13 @@ hidden in widget state.
|
||||
|
||||
## Shortcut recorder
|
||||
|
||||
```ziran
|
||||
ShortcutRecorder :: (session: Session, props: ShortcutRecorderProps,
|
||||
state: *ShortcutRecorderState) -> ShortcutRecorderResult
|
||||
ShortcutRecorderApply :: (state: *ShortcutRecorderState,
|
||||
props: ShortcutRecorderProps) -> ShortcutRecorderResult
|
||||
```zi
|
||||
ShortcutRecorder :: #import "kryon/shortcut_recorder";
|
||||
|
||||
ShortcutRecorder.Draw :: (session: Session, props: ShortcutRecorder.Props,
|
||||
state: *ShortcutRecorder.ShortcutRecorderState) -> ShortcutRecorder.ShortcutRecorderResult
|
||||
ShortcutRecorder.ShortcutRecorderApply :: (state: *ShortcutRecorder.ShortcutRecorderState,
|
||||
props: ShortcutRecorder.Props) -> ShortcutRecorder.ShortcutRecorderResult
|
||||
```
|
||||
|
||||
Activation records only while this widget is focused. A supported key plus
|
||||
|
||||
+10
-6
@@ -2,14 +2,18 @@
|
||||
|
||||
The six overlay families are retained Ziran widgets with caller-owned state and deterministic results. `Apply` functions are pure state transitions suitable to component hosting; widget functions take a `Session`, explicit props and a caller-owned state pointer, then submit popup/modal tree nodes and paint effects. No family owns process-global UI state.
|
||||
|
||||
Import `kryon/tooltip`, `kryon/sheet`, `kryon/command_palette`,
|
||||
`kryon/hover_card`, `kryon/confirm_popover` or `kryon/guided_tour` under the
|
||||
corresponding widget name. Each module exposes `Props` and `Draw`.
|
||||
|
||||
## Composition
|
||||
|
||||
- `Tooltip(session, props, state)` and `TooltipApply(state, props)` implement hover/focus delay, warm replay, touch/press suppression, truncation-only mode, placement fitting, flipping, clamping and ellipsis text.
|
||||
- `Sheet(session, props, state)` and `SheetApply(state, props)` implement all four sides, clamped min/max size, safe-area insets, scrim/Escape/drag close, deterministic motion and focus wrap/return.
|
||||
- `CommandPalette(session, props, state)` and `CommandPaletteApply(state, props)` implement fuzzy prefix/run/word scoring, stable command order, contiguous group starts, text editing, Up/Down/Enter/Escape, pointer activation and explicit owner takeover.
|
||||
- `HoverCard(session, props, state)` and `HoverCardApply(state, props)` implement open delay, movement tolerance, content grace, interactive action dispatch, focus paths and placement fitting.
|
||||
- `ConfirmPopover(session, props, state)` and `ConfirmPopoverApply(state, props)` implement danger styling, initial confirm focus, Enter/Space confirm, Escape/cancel, outside close and trigger focus return.
|
||||
- `GuidedTour(session, props, state)` and `GuidedTourApply(state, props)` implement target geometry, padded highlight hole, four-band scrim, card fitting, count formatting, Back/Next/Done/Skip and three-focus wrap.
|
||||
- `Tooltip.Draw(session, props, state)` and `Tooltip.TooltipApply(state, props)` implement hover/focus delay, warm replay, touch/press suppression, truncation-only mode, placement fitting, flipping, clamping and ellipsis text.
|
||||
- `Sheet.Draw(session, props, state)` and `Sheet.SheetApply(state, props)` implement all four sides, clamped min/max size, safe-area insets, scrim/Escape/drag close, deterministic motion and focus wrap/return.
|
||||
- `CommandPalette.Draw(session, props, state)` and `CommandPalette.CommandPaletteApply(state, props)` implement fuzzy prefix/run/word scoring, stable command order, contiguous group starts, text editing, Up/Down/Enter/Escape, pointer activation and explicit owner takeover.
|
||||
- `HoverCard.Draw(session, props, state)` and `HoverCard.HoverCardApply(state, props)` implement open delay, movement tolerance, content grace, interactive action dispatch, focus paths and placement fitting.
|
||||
- `ConfirmPopover.Draw(session, props, state)` and `ConfirmPopover.ConfirmPopoverApply(state, props)` implement danger styling, initial confirm focus, Enter/Space confirm, Escape/cancel, outside close and trigger focus return.
|
||||
- `GuidedTour.Draw(session, props, state)` and `GuidedTour.GuidedTourApply(state, props)` implement target geometry, padded highlight hole, four-band scrim, card fitting, count formatting, Back/Next/Done/Skip and three-focus wrap.
|
||||
|
||||
Each `*StateFor` constructor returns an isolated, serializable state value. Results identify nodes, geometry, interaction outcome and state change; callers supply `now_ms` and retain ownership. Empty `id`, `class_name`, key and action values follow the explicit prop values, while nonpositive geometry/delay fallbacks use the documented defaults in the matching `*_props.zi` module.
|
||||
|
||||
|
||||
+2
-2
@@ -26,14 +26,14 @@ The build directory is stable and locked for the whole run. Desktop variables
|
||||
are scrubbed. RSS comes from the native runner's `/proc/self/status` VmHWM
|
||||
after the measured frames. Unlike a launcher's `wait4` high-water mark, it
|
||||
excludes the Python process's memory before exec. Schema 2 baselines use this
|
||||
measurement; capture a new baseline when migrating from schema 1. The timings
|
||||
measurement. The timings
|
||||
exclude warmup; the runner CPU-seconds counter includes initialization and all
|
||||
warmup/measured frames, and excludes compilation and the Python launcher. Timings
|
||||
cover the pixmap pipeline, not native window presentation, asset decoding,
|
||||
screen-reader overhead, process idle wakeups or GPU/browser rendering.
|
||||
|
||||
The widget review harness measures actual public controls, rather than mock
|
||||
faces. It includes all 54 core gallery scenes plus light and dark system-palette
|
||||
faces. It includes the core gallery scenes plus light and dark system-palette
|
||||
compositions. Each interactive scene captures resting, disabled, hover, keyboard
|
||||
focus and held-press states, using the same 480 × 320 viewport.
|
||||
|
||||
|
||||
+11
-60
@@ -119,13 +119,9 @@ for lock, cache, and override details.
|
||||
### Foreign renderer artifacts
|
||||
|
||||
Builders can request Kryon's foreign libraries and standard resources through
|
||||
the generic Ziran artifact API (toolchain revision 5461202417d48e2b31122354419179b262d7530c
|
||||
or later):
|
||||
the generic Ziran artifact API:
|
||||
|
||||
```sh
|
||||
ziran pkg artifact kryon:renderer-raylib --platform linux-x86_64-gnu --locked
|
||||
CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar \
|
||||
ziran pkg artifact kryon:renderer-raylib --platform windows-x86_64-mingw --locked
|
||||
ziran pkg artifact kryon:renderer-desktop --platform linux-x86_64-gnu --locked
|
||||
ziran pkg artifact kryon:renderer-web --platform emscripten-wasm32-emscripten --locked
|
||||
```
|
||||
@@ -142,44 +138,22 @@ Ziran's ordinary compiler invocation. No generated Ziran source tree or object
|
||||
list is part of this contract.
|
||||
|
||||
Every recipe includes `resources/kryon-font.ttf` and its Liberation license.
|
||||
`renderer-raylib` also includes `lib/libraylib.a`, the four public Raylib headers
|
||||
under `include/`, and the Raylib license. Linux uses SDL2/GLES2; Windows uses
|
||||
RGFW/OpenGL 1.1. Both preserve JPEG, TrueType and audio support. Linux
|
||||
`renderer-desktop` declares the existing SDL/Cairo/FreeType/Pango/Fontconfig/GIO
|
||||
system dependencies rather than redistributing system libraries.
|
||||
Linux desktop builds use SDL2, Cairo, FreeType, Pango, Fontconfig and GIO.
|
||||
|
||||
`renderer-web` supplies `web/ziran_web.js` from the selected Ziran toolchain,
|
||||
`js_libraries`, browser link flags and `preload_files` entries (`path`, `mount`)
|
||||
for the standard font at `/kryon-font.ttf`. Feed these to Emscripten's
|
||||
`--js-library` and `--preload-file` arguments. Game resources remain separate.
|
||||
|
||||
The Raylib recipe also accepts `android-aarch64-bionic` and
|
||||
`android-armv7-bionic`. Set `[tool.kryon.renderer] android_ndk` to the installed
|
||||
NDK directory and `android_api` to a decimal API level (default 21, minimum 21).
|
||||
Set `CC` to that ABI/API's NDK clang executable so compiler identity is keyed,
|
||||
for example `aarch64-linux-android21-clang`. This foreign Raylib artifact recipe
|
||||
is independent of Kryon's Android app host and retains its GLES2, image, font
|
||||
and audio options.
|
||||
NativeActivity glue, the application shared library, edition, packaging and
|
||||
signing remain with the app packaging build. Unsupported recipe/platform pairs
|
||||
fail explicitly. Other hosts and architectures are not yet provider targets.
|
||||
|
||||
Widget and renderer Ziran code remains ordinary `kryon/...` imports. These
|
||||
artifacts do not provide a separately compiled Ziran component ABI: the current
|
||||
generic artifact API stages provider files but does not define such a language
|
||||
component interface. Builders must not rewrite generated C/H or reconstruct a
|
||||
private module/object list to manufacture one.
|
||||
|
||||
Run `make renderer-artifact-test` for real outputs, hashes, dirty isolation and
|
||||
a maintained Raylib renderer compiled and run on private Xvfb. Add `--cross`
|
||||
to `python3 tests/renderer_artifact_test.py` for installed MinGW and Android
|
||||
toolchains. After pushing, `--clean --revision COMMIT` uses normal immutable
|
||||
package resolution and requires two independent consumers to receive the exact
|
||||
same descriptor. A dirty canonical provider deliberately cannot prove reuse.
|
||||
|
||||
Define each profile under `[tool.kryon.profiles.NAME]`. It requires `backend`;
|
||||
`codegen` defaults to `c99`. Supported backends are `terminal`, `desktop`,
|
||||
`raylib`, `canvas`, `pixmap`, and `android`. Set `default_profile` under `[tool.kryon]` when there
|
||||
`canvas`, `pixmap`, and `android`. Set `default_profile` under `[tool.kryon]` when there
|
||||
are several profiles. `--profile NAME` selects another. `run` asks for a
|
||||
profile when there are several, none is specified, and it runs in a
|
||||
terminal; otherwise it uses the default.
|
||||
@@ -188,7 +162,6 @@ terminal; otherwise it uses the default.
|
||||
| --- | --- | --- |
|
||||
| `terminal` | 80 × 24 terminal cells | TTY for interactive input; redirected output renders once |
|
||||
| `desktop` | SDL2 window with Cairo raster | SDL2, Cairo, and FreeType development libraries |
|
||||
| `raylib` | raylib SDL2/OpenGL ES 2 window | the locked raylib source package and SDL2, DRM, EGL, GLESv2 |
|
||||
| `canvas` | Canvas2D browser page | Emscripten with Asyncify; see [Canvas host](canvas.md) |
|
||||
| `pixmap` | headless 960 × 600 frame printed as a PPM image | nothing; `kryon run shot > frame.ppm` |
|
||||
| `android` | installable APK through a generated `droid/` Gradle project and direct NativeActivity host | a JDK, the Android SDK with NDK `28.2.13676358` and CMake `3.22.1`, the locked codec source packages, and `[tool.kryon.android] package`; see [Android host](BACKENDS.md#android-host) |
|
||||
@@ -261,12 +234,11 @@ with `native_artifacts` and an explicit `native_platform`:
|
||||
```toml
|
||||
[tool.kryon.profiles.desktop]
|
||||
backend = "desktop"
|
||||
native_artifacts = "kryon:renderer-raylib"
|
||||
native_artifacts = "kryon:renderer-desktop"
|
||||
native_platform = "linux-x86_64-gnu"
|
||||
```
|
||||
|
||||
This adds Raylib's foreign support, for example for `MediaAudio`, to the
|
||||
existing SDL/Cairo profile. It keeps that profile's host and rendering path.
|
||||
This adds the desktop codec support and resources to the SDL/Cairo profile.
|
||||
Use space-separated `package:artifact` selections for several providers.
|
||||
Selections come from the application's resolved package graph; no cache
|
||||
paths or prebuilt archive copies belong in its manifest. The toolchain must
|
||||
@@ -290,7 +262,7 @@ default_profile = "tui"
|
||||
|
||||
## Zx applications
|
||||
|
||||
Desktop, raylib, Canvas and Android profiles can package an ordinary `Frame`
|
||||
Desktop, Canvas and Android profiles can package an ordinary `Frame`
|
||||
application as the same portable program with its resources:
|
||||
|
||||
```toml
|
||||
@@ -307,29 +279,14 @@ shell interprets the bundle and uses Canvas2D for rendering. It includes a
|
||||
file picker for opening another downloaded ZX without recompiling its UI.
|
||||
Unsupported required services are reported before replacing the running app.
|
||||
|
||||
`backend = "raylib"` with `codegen = "zx"` builds a generic native player
|
||||
beside the bundle. `make zx-raylib` builds that player directly; pass a ZX
|
||||
path to it or use `--check FILE.zx` to validate without opening a window.
|
||||
Images are decoded directly from the bundle, with no resource extraction.
|
||||
The native player carries its host font beside the executable. Linux uses
|
||||
SDL/GLES; Windows and macOS use GLFW/OpenGL. HTTP uses libcurl; install its
|
||||
development package or supply `ZX_RAYLIB_HTTP_LIBS` for your target.
|
||||
Cross builds can supply
|
||||
`ZX_RAYLIB_CC`, `ZX_RAYLIB_AR`, `ZX_RAYLIB_OBJCOPY`,
|
||||
`ZX_RAYLIB_ARCHIVE`, `ZX_RAYLIB_DEFINES` and `ZX_RAYLIB_LIBS`.
|
||||
Use a separate `ZX_RAYLIB_DIR` for each target. macOS uses the same renderer
|
||||
and has platform build settings, but has not been executed in this checkout.
|
||||
|
||||
An Android profile with `codegen = "zx"` builds its portable guest first,
|
||||
then packages `app.zx`, the VM and the raylib-free native host into the APK. Its
|
||||
then packages `app.zx`, the VM and the NativeActivity host into the APK. Its
|
||||
`Frame` is not compiled into native application code. The canonical scaffold
|
||||
handles display density, safe-area insets, touch, hardware/soft-keyboard input
|
||||
and graphics restoration without resetting bundle state. It also registers a
|
||||
ZX file opener: Android document URIs are copied into private cache and
|
||||
validated before replacing the running app. Invalid files retain the current
|
||||
instance. Existing customized Android scaffolds must adopt the updated
|
||||
Gradle/CMake and activity/manifest glue to use this profile.
|
||||
`make zx-android-test` builds ARM64, ARMv7 and x86-64 shells. Runtime testing
|
||||
instance. `make zx-android-test` builds ARM64, ARMv7 and x86-64 shells. Runtime testing
|
||||
uses `python3 tests/zx_android_test.py --serial emulator-NNNN` and accepts
|
||||
only an explicitly selected disposable emulator.
|
||||
|
||||
@@ -432,11 +389,10 @@ returns `{"status":"unavailable"}` when the harness does not grant one.
|
||||
`AppSupports("kryon.input.desktop")` is true when the device's main input is
|
||||
a keyboard and mouse: native desktop hosts answer yes, Android and the web
|
||||
no, and a harness that runs inside another host passes the question on.
|
||||
Older hosts answer no, so an app keeps its touch behaviour there.
|
||||
An app that imports `kryon/app_theme` follows the host's theme:
|
||||
`AppThemeColor(token, fallback)` returns the host stylesheet's colour for
|
||||
`canvas`, `surface`, `border`, `text`, `accent` or `link`, and `fallback` for
|
||||
a token the host lacks or on a host older than the module.
|
||||
a token the host lacks.
|
||||
An app with a look of its own, such as a game, imports `kryon/widget_palette`
|
||||
instead: `WidgetPaletteUse(session, palette)` asks the host to draw the
|
||||
widgets that follow in that palette's colours (as `SystemPalette`), until the
|
||||
@@ -503,11 +459,6 @@ with `autostart` the login entry to `~/.config/autostart/example.desktop`.
|
||||
Setting `autostart = false` removes an autostart entry that `ziran install`
|
||||
wrote earlier. Browser profiles cannot be installed.
|
||||
|
||||
The raylib profile builds its static raylib dependency in Kryon's `build/`
|
||||
directory. The Kryon host chooses and owns that backend. Game code belongs in
|
||||
the separate Game2D package; applications using both should rely on Kryon's
|
||||
selected backend and raylib revision.
|
||||
|
||||
The project binary is `build/<package-name>-<profile>`. Checked Ziran modules
|
||||
are saved in `build/generated/<profile>/ir/` as `.zir`; generated C is in
|
||||
`build/generated/<profile>/c/`. `ziran inspect FILE.zir` displays a saved
|
||||
@@ -534,7 +485,7 @@ all three images match; `build/pixmap-parity/grid.png` shows them side by side.
|
||||
`tools/image_tools.zi`, compiled to C, compares two PPM images, converts
|
||||
them to PNG, and lays out such grids.
|
||||
|
||||
Kryon's `make desktop-project-test` and `make raylib-project-test` exercise the graphical hosts on private Xvfb
|
||||
Kryon's `make desktop-project-test` exercises the graphical host on private Xvfb
|
||||
displays, including keyboard and Unicode text input. `make canvas-project-test`
|
||||
builds a real Canvas2D project and loads it in private headless Chromium. Do
|
||||
not run graphical tests on the developer's live display.
|
||||
@@ -586,7 +537,7 @@ Custom native hosts can import `kryon/app_asset_path` and call
|
||||
buffer: a resolved path borrows it; an unchanged path borrows the original text.
|
||||
`ResolveAppAssetForExecutable(path, executable, output)` supplies an explicit
|
||||
executable for hosts/tests. Neither changes the process working directory.
|
||||
The standard Cairo and Raylib image loaders use this resolver automatically;
|
||||
The standard native image loaders use this resolver automatically;
|
||||
a custom asset-reader callback still has exclusive ownership of its resources.
|
||||
|
||||
A host embedding another UI packages that UI's referenced files under its own
|
||||
|
||||
Whitespace-only changes.
@@ -14,6 +14,3 @@ support system, light and dark preferences. `SetReducedMotion` controls motion.
|
||||
|
||||
Typed style rules and optional CSS remain available for application-specific
|
||||
colors and control styling, using the same components and interaction behavior.
|
||||
|
||||
The former style-picker gallery route remains a single-style example so
|
||||
existing links continue to open.
|
||||
@@ -1,14 +0,0 @@
|
||||
# Web host status
|
||||
|
||||
Kryon's current web host is the Canvas2D backend in `src/backend/`.
|
||||
Applications compile Ziran to C, then Emscripten links that generated C with
|
||||
small browser effect libraries. The Ziran host implementation remains in
|
||||
`.zi`; JavaScript supplies only browser effects that Ziran foreign imports
|
||||
declare. See [BACKENDS.md](BACKENDS.md) and
|
||||
[Canvas2D browser host](canvas.md).
|
||||
|
||||
The browser profile generates from the selected host plus the Canvas raster
|
||||
adapter and without entry pruning. This is not a revival of the removed `.kry` compiler.
|
||||
|
||||
Kryon has no separate JavaScript widget runtime or source-language compiler.
|
||||
The files above are the current web support documentation.
|
||||
@@ -7,8 +7,7 @@ decisions. Tests that only verify code generation do not prove behavior.
|
||||
The current `make test` gate builds the core and optional packages and runs
|
||||
the `tests/ziran_*` behavior suite through the relevant source, saved `.zir`,
|
||||
portable `.zx`, and native targets. Package project tests verify imports and
|
||||
terminal host behavior. `make desktop-project-test` and
|
||||
`make raylib-project-test` verify graphical
|
||||
terminal host behavior. `make desktop-project-test` verifies graphical
|
||||
capture and input on private Xvfb displays.
|
||||
|
||||
For an affected widget, check the interaction that changed through the
|
||||
|
||||
+2
-7
@@ -55,13 +55,8 @@ its UI scale setting, so the wheel and the Appearance slider drive one value,
|
||||
and hands that setting to `ZoomDPI` each frame.
|
||||
|
||||
A host that draws an application unchanged applies the factor as a render
|
||||
scale and divides pointer positions and the viewport by it. Kryon's raylib
|
||||
runner does this for every application it runs, with no application code:
|
||||
`ZoomWheel` and `ZoomKey` run before each frame, the wheel and the shortcut
|
||||
keys they consume never reach the application, and `RaylibSetZoom` scales the
|
||||
frame, so layout reflows to the smaller viewport as a browser page does and
|
||||
text is rebaked at its scaled size to stay sharp. `KRYON_ZOOM=1.5` starts a
|
||||
window at 150%; the native ZX player draws a bundle at that density too.
|
||||
scale and divides pointer positions and the viewport by it. Layout reflows
|
||||
to the scaled viewport; text is rasterized at the scaled size.
|
||||
|
||||
An application imports the module as `Zoom` (and `DPI` for the platform enum)
|
||||
from the Kryon package. To opt out, or to force zoom on every platform, call
|
||||
|
||||
+4
-5
@@ -10,7 +10,7 @@ them with Emscripten, and Ziran's Web bridge:
|
||||
-sASYNCIFY -sSINGLE_FILE=1 -sEXIT_RUNTIME=1 -sENVIRONMENT=web
|
||||
```
|
||||
|
||||
Kryon contains no JavaScript or C. The browser hosts (`page_core.zi`,
|
||||
The browser hosts (`page_core.zi`,
|
||||
`page_paint.zi`, `page_texture.zi`, `page_font.zi`, `page_events.zi`,
|
||||
`page_files.zi`, `page_input.zi`, `page_mesh.zi`, `canvas_audio_host.zi`, `dom_host.zi`) are
|
||||
written in Ziran and reach the page through `std/web.zi`; the one JavaScript
|
||||
@@ -34,10 +34,9 @@ needed. Ordinary host paint and custom emitters use complete painting. Text
|
||||
measurement leaves retained pixels intact. This adds no extra full-size surface.
|
||||
The dedicated `canvas_raster.zi` provider
|
||||
calls the Canvas modules directly, so retained widgets use the same paint
|
||||
queue, font selection, and clipping path as the native host. Project builds do
|
||||
not pass an entry to IR or C generation: the selected `_run` module owns
|
||||
`main`, while `canvas_raster.zi` remains reachable as a second root for raster
|
||||
and typeface adapters.
|
||||
queue, font selection, and clipping path as the native host. Frame-profile builds retain the selected `_run` host and `canvas_raster.zi`
|
||||
as generation roots for raster and typeface adapters. A program entry owns
|
||||
its own `main`.
|
||||
|
||||
`RequestWindowClose` is currently a raw browser host capability. An application
|
||||
may declare it against `host_api`; the host records the request and observes it
|
||||
|
||||
+4
-2
@@ -1,10 +1,12 @@
|
||||
# Compact navigation
|
||||
|
||||
`NavigationBar` can compose a compact vertical rail or horizontal dock using
|
||||
`Navigation.Draw` can compose a compact vertical rail or horizontal dock using
|
||||
the same themed buttons, keyboard activation and retained pointer capture as
|
||||
other Kryon controls.
|
||||
|
||||
```ziran
|
||||
```zi
|
||||
Navigation :: #import "kryon/navigation";
|
||||
|
||||
props: Navigation.Props
|
||||
props.key = KeyHash("navigation")
|
||||
props.compact = true
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=docs.html"><title>API docs moved</title></head><body><a href="docs.html">API docs moved</a></body></html>
|
||||
@@ -1,13 +0,0 @@
|
||||
# Kryon Labs mark
|
||||
|
||||
`mark.svg` is a clean vector reconstruction of Proposal 01, Modular K, from
|
||||
the exploratory Kryon Labs logo rasters generated on 2026-09-26. The original
|
||||
proposals, exact prompts, and provenance are retained in the local Kryon Labs
|
||||
profile archive under `work/branding/logo-proposals/2026-09-26/`; they are not
|
||||
tracked site assets. The reconstruction keeps the selected block geometry and
|
||||
colors without the raster texture or wordmark baked into the proposal image.
|
||||
|
||||
The site uses the mark in its header and footer. `favicon.svg` adds an ivory
|
||||
backplate for browser tabs; `favicon-32.png`, `favicon.ico`, and
|
||||
`apple-touch-icon.png` are raster versions of it. `og.svg` is the editable social
|
||||
card source for `og.png`.
|
||||
@@ -1,18 +0,0 @@
|
||||
# Kryon Labs editorial assets
|
||||
|
||||
Created for the approved website redesign on 2026-09-19.
|
||||
|
||||
- `workshop.webp`: original ink-and-watercolor hero, generated with the built-in
|
||||
`image_gen` tool using the approved page mockup as a reference. Exact prompt:
|
||||
`workshop-prompt.txt`. WebP export: 1536 × 1024, quality 84.
|
||||
- Site-root `og.png`: current 1200 × 630 Kryon Labs social card rendered from
|
||||
the site-root `og.svg`, using the new mark in `../brand/mark.svg`. The earlier
|
||||
generated card prompt remains in `social-card-prompt.txt` for reference.
|
||||
- Manrope and Newsreader are served locally. Their OFL license texts are included.
|
||||
- Application screenshots and metadata come from the Kryon showcase registry via
|
||||
the existing `scripts/update-showcase.py` build step.
|
||||
|
||||
Original generated images and the approved mockup are retained in
|
||||
`/mnt/storage/Projects/waozi-design-proposals/2026-09-19/kryonlabs/` on the design
|
||||
workstation. Image-generation originals are also retained in the tool's default
|
||||
output directory. No compiler assets are loaded by the homepage.
|
||||
@@ -1,24 +0,0 @@
|
||||
# Product previews
|
||||
|
||||
These images show real applications and modules. App captures use synthetic
|
||||
fixtures on a private display; they contain no owner account or repository data.
|
||||
They describe development builds, not released downloads.
|
||||
|
||||
- `terminal.webp`: Terminal with sample shell output, captured on private Xvfb.
|
||||
- `browser.webp`: Browser rendering a local Field notes sample page.
|
||||
- `github-overview.webp` and `github-repositories.webp`: GitHub client using
|
||||
fixture repositories and accounts on private Xvfb.
|
||||
- `kryon-gallery.webp`: a selection of widgets from the real browser gallery.
|
||||
- `plot-candles.webp`: the gallery CandleChart example (`plot/4`), with sample data.
|
||||
- `data-views-table.webp`: the gallery TableView example (`data_views/2`), with sample data.
|
||||
- `css-packs.webp`: the same fixture interface with the real CSS style packs.
|
||||
- `game2d-controls.webp`: the Game2D control chooser, compiled and rendered in
|
||||
the private browser live editor.
|
||||
|
||||
The gallery and editor captures use an isolated headless Chromium with inherited
|
||||
display and desktop-session variables removed. WebP files are binary exports of
|
||||
those captures. The original app and module implementations own their interfaces;
|
||||
these are not illustrated mockups.
|
||||
|
||||
The SVG icons in `mingcute/` are copied from the MingCute package's upstream
|
||||
assets. Their Apache-2.0 license is retained as `mingcute/LICENSE.txt`.
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=docs.html"><title>Benchmarks moved</title></head><body><a href="docs.html">Benchmarks moved</a></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=widgets.html"><title>Components moved</title></head><body><a href="widgets.html">Components moved</a></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=widgets.html"><title>Live editor moved</title></head><body><a href="widgets.html">Live editor moved</a></body></html>
|
||||
@@ -1,38 +0,0 @@
|
||||
# Kryon live editor
|
||||
|
||||
`../demo.html` offers Source, Preview, and Both views. Both is the default on
|
||||
wide screens; narrow screens and `?mini` embeds start with the interactive
|
||||
preview. Opening source loads the browser compiler. Edits compile after a
|
||||
350 ms pause, and Ctrl/Command + Enter compiles immediately. Compilation errors
|
||||
keep the last working preview. Reset restores `src/app.zi`.
|
||||
|
||||
The compiler runs in a worker and uses Ziran's ordinary checker and portable
|
||||
bundle writer. The compiled app runs in a sandboxed iframe with a persistent
|
||||
VM instance. `src/preview_host.zi` binds raw input, font measurements, and
|
||||
raster effects to the existing Kryon Canvas host; widget behavior comes from
|
||||
the ordinary Kryon library. Source stays in the browser. Programs must fit
|
||||
Ziran's portable subset and the installed Canvas capabilities. Each VM frame
|
||||
has a statement limit, and compilation and rendering have timeout recovery.
|
||||
|
||||
Build the normal initial preview with `build-queue -- ./build.sh`. For changes
|
||||
in this checkout, set the ignored `ziran.local.toml` override `kryon` to this
|
||||
repository root. The source build resolves that override with `ziran lock`
|
||||
before compiling; production locks retain actual published revisions. To rebuild the editor's
|
||||
compiler and Canvas host, activate Emscripten 6.0.6 and run:
|
||||
|
||||
```sh
|
||||
python3 build_preview.py
|
||||
```
|
||||
|
||||
The script resolves the configured Ziran and Kryon sources with `ziran pkg
|
||||
path`, including the demo's ignored local overrides. Use a Ziran revision
|
||||
that provides `BuildBundle` and `BundleInstanceLimitSteps`. The three generated
|
||||
editor assets in `../assets/` are committed with the static site, alongside
|
||||
the original `widgets.html` preview.
|
||||
|
||||
From the Kryon repository root, `build-queue -- make site-browser-test`
|
||||
runs the Python browser suite in a private headless Chromium. It covers the
|
||||
app and module catalogs, responsive navigation, themes, keyboard focus,
|
||||
legacy routes, and real editor compilation, including rotated text. To retain
|
||||
review images, run `build-queue -- python3 tests/site_browser_test.py
|
||||
--screenshots backup/labs-site/verification` after confirming `backup/` is ignored.
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=docs.html"><title>Language docs moved</title></head><body><a href="docs.html">Language docs moved</a></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=widgets.html"><title>Examples moved</title></head><body><a href="widgets.html">Examples moved</a></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=renderers.html"><title>Platform matrix moved</title></head><body><a href="renderers.html">Platform matrix moved</a></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=apps.html"><title>Showcase moved</title></head><body><a href="apps.html">Showcase moved</a></body></html>
|
||||
@@ -4,7 +4,7 @@ Import `kryon/Window` and call `WindowFocused()` to read whether the application
|
||||
own visible window has keyboard focus. The call changes no window, focus, input
|
||||
or desktop setting. Linux SDL and the desktop portable player inspect only the
|
||||
window created by their host. Hidden and minimized SDL windows report false.
|
||||
Raylib and browser canvas hosts use their existing window focus signals.
|
||||
Browser Canvas hosts use their existing window focus signals.
|
||||
|
||||
An embedded pixel-surface player forwards `WindowFocusedHost` to its platform
|
||||
callback. The callback must return the focus of that child application, rather
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ make -C examples widget-catalog # desktop
|
||||
make -C examples widget-catalog-web # Canvas/Wasm
|
||||
make gallery-zx # one complete portable ZX per example
|
||||
make site-gallery # stage the gallery for the existing site
|
||||
make site # rebuild the gallery, editor and initial demo
|
||||
make site # package the website, gallery and editor
|
||||
```
|
||||
|
||||
Run `./build/gallery-desktop` from `examples/gallery/`. The web output is
|
||||
@@ -82,7 +82,7 @@ target also compiles both programs for Go, C/Web, and portable ZX.
|
||||
`Image.Draw(Image.Props)` with a path-backed PNG and red tint, then writes
|
||||
`build/examples/image-desktop.png`. The host imports Ziran's generic
|
||||
`c_string` module for safe C string arguments. It handles shapes, text, and
|
||||
path-backed PNG images. Texture handles and other image formats remain open.
|
||||
path-backed PNG images. See [image host support](../docs/BACKENDS.md#webp-images) for image formats.
|
||||
|
||||
`make -C examples time-picker` builds `demo/time_picker_demo.zi`, Kryon's
|
||||
`TimePicker` without a time, with one, disabled and in a small form, with a
|
||||
|
||||
+10
-16
@@ -1,24 +1,18 @@
|
||||
# Bundled icon sheets
|
||||
|
||||
`ui.webp` and `pfp.webp` are lossless WebP sheets. Their decoded RGBA pixels,
|
||||
dimensions, icon IDs and 64 × 64 source rectangles match the original PNGs.
|
||||
The other five sheets retain their PNG encoding. Each JSON manifest's `image`
|
||||
field names the shipped file.
|
||||
`ui.webp` and `pfp.webp` are lossless WebP sheets with 64 × 64 source
|
||||
rectangles. The other five sheets use PNG encoding. Each JSON manifest's
|
||||
`image` field names its shipped sheet; icon IDs and source rectangles are
|
||||
listed in the manifest.
|
||||
|
||||
Consumers updating Kryon must update their package lock and image packaging
|
||||
lists together: replace `icons/ui.png` and `icons/pfp.png` with `icons/ui.webp`
|
||||
and `icons/pfp.webp`, and update explicit references. Run
|
||||
`scripts/sync-icons.sh DEST_DIR [SHEET ...]` to copy the official sheets and
|
||||
manifests. This does not delete old consumer files; remove obsolete PNGs from
|
||||
the consumer's packaging list when integrating. Applications pinned to an
|
||||
older Kryon keep that version's paths until they update the package.
|
||||
Run `scripts/sync-icons.sh DEST_DIR [SHEET ...]` to copy the selected sheets
|
||||
and manifests into an application's asset directory. With no sheet names,
|
||||
the script copies all sheets. Package the filenames named by those manifests.
|
||||
|
||||
`scripts/import-mingcute-icons.py` and `scripts/generate-nav-icons.py` write
|
||||
lossless WebP with exact transparent RGB preservation. Never use photo quality
|
||||
settings for these icon sheets. The gallery's published `catalog-image.png`
|
||||
is explicitly encoded as PNG from the WebP source.
|
||||
is encoded as PNG from the WebP source.
|
||||
|
||||
`tests/ziran_icon_catalog_test.sh` verifies catalog paths, sync, MIME type,
|
||||
dimensions and hashes of every decoded RGBA byte from the original sheets.
|
||||
`tests/raylib_webp_decode_test.sh` also decodes the staged sheets through the
|
||||
native renderer and compares every byte, from source and saved IR.
|
||||
`python3 tests/icon_assets_test.py build/scratch/icon-assets` verifies sync,
|
||||
manifest paths, MIME type, dimensions and hashes of every decoded RGBA byte.
|
||||
@@ -22,18 +22,6 @@ MAINTAINED = [
|
||||
('docs.html', 'Docs — Kryon', 'Kryon ownership, public surface, local commands and integration boundaries.'),
|
||||
('renderers.html', 'Platforms — Kryon', 'Kryon runs through Ziran desktop and Canvas hosts; support varies by backend and target.'),
|
||||
]
|
||||
REDIRECTS = {
|
||||
'api.html': ('docs.html', 'API docs moved'),
|
||||
'components.html': ('widgets.html', 'Components moved'),
|
||||
'demo.html': ('widgets.html', 'Live editor moved'),
|
||||
'live-examples.html': ('widgets.html', 'Examples moved'),
|
||||
'language.html': ('docs.html', 'Language docs moved'),
|
||||
'showcase.html': ('apps.html', 'Showcase moved'),
|
||||
'matrices.html': ('renderers.html', 'Platform matrix moved'),
|
||||
'benchmarks.html': ('docs.html', 'Benchmarks moved'),
|
||||
}
|
||||
|
||||
|
||||
|
||||
def write(path, text):
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
@@ -104,8 +92,6 @@ def main():
|
||||
revision = hashlib.file_digest(stream, 'sha256').hexdigest()[:16]
|
||||
for name, title, description in MAINTAINED:
|
||||
write(SITE / name, '<!doctype html>\n<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>' + html.escape(title) + '</title><meta name="description" content="' + html.escape(description, quote=True) + '"><link rel="stylesheet" href="current.css?v=' + revision + '"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=' + revision + '"></script></body></html>\n')
|
||||
for name, (target, title) in REDIRECTS.items():
|
||||
write(SITE / name, '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=' + target + '"><title>' + title + '</title></head><body><a href="' + target + '">' + title + '</a></body></html>\n')
|
||||
print('Packaged live Ziran website: 7 routes, 101 shared widget examples')
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
import re
|
||||
|
||||
SITE = Path(__file__).resolve().parents[1] / 'docs/site'
|
||||
PAGES = ['index', 'apps', 'modules', 'getting-started', 'docs', 'renderers', 'widgets', 'demo']
|
||||
PAGES = ['index', 'apps', 'modules', 'getting-started', 'docs', 'renderers', 'widgets']
|
||||
|
||||
|
||||
class Head(HTMLParser):
|
||||
|
||||
@@ -11,7 +11,7 @@ kryon install # ~/.local/bin/{{name}} and a menu entry
|
||||
```
|
||||
|
||||
`kryon build portable` exports `build/{{name}}-portable.zx`. Copy or download
|
||||
that file and open it with `kryon run {{name}}-portable.zx` using the shared
|
||||
that file and open it with `ziran run {{name}}-portable.zx` using the shared
|
||||
Zx player; no app source is needed.
|
||||
|
||||
`ziran run`, `ziran build`, and `ziran install` do the same, because
|
||||
|
||||
@@ -11,7 +11,7 @@ kryon run web # Canvas2D browser page (Emscripten)
|
||||
```
|
||||
|
||||
`kryon build portable` exports `build/{{name}}-portable.zx`. Copy or download
|
||||
that file and open it with `kryon run {{name}}-portable.zx` using the shared
|
||||
that file and open it with `ziran run {{name}}-portable.zx` using the shared
|
||||
Zx player; no app source is needed.
|
||||
|
||||
Add a page by writing a procedure like `Library` and a `Tab` for it in
|
||||
|
||||
@@ -10,7 +10,7 @@ kryon install # ~/.local/bin/{{name}}
|
||||
```
|
||||
|
||||
`kryon build portable` exports `build/{{name}}-portable.zx`. Copy or download
|
||||
that file and open it with `kryon run {{name}}-portable.zx` using the shared
|
||||
that file and open it with `ziran run {{name}}-portable.zx` using the shared
|
||||
Zx player; no app source is needed.
|
||||
|
||||
`src/layout.zi` sizes rows in character cells on the terminal host and in
|
||||
|
||||
@@ -9,7 +9,7 @@ kryon run desktop # the same page in a window
|
||||
```
|
||||
|
||||
`kryon build portable` exports `build/{{name}}-portable.zx`. Copy or download
|
||||
that file and open it with `kryon run {{name}}-portable.zx` using the shared
|
||||
that file and open it with `ziran run {{name}}-portable.zx` using the shared
|
||||
Zx player; no app source is needed.
|
||||
|
||||
Serve `build/` with any static file server to publish it.
|
||||
@@ -24,13 +24,6 @@ from PIL import Image, ImageChops
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SITE = ROOT / 'docs/site'
|
||||
PAGES = ['index', 'getting-started', 'widgets', 'modules', 'apps', 'docs', 'renderers']
|
||||
REDIRECT_TARGETS = {
|
||||
'api': 'docs.html',
|
||||
'components': 'widgets.html', 'demo': 'widgets.html', 'live-examples': 'widgets.html',
|
||||
'language': 'docs.html', 'showcase': 'apps.html', 'matrices': 'renderers.html',
|
||||
'benchmarks': 'docs.html',
|
||||
}
|
||||
REDIRECTS = list(REDIRECT_TARGETS)
|
||||
VIEWPORTS = (320, 390, 768, 1024, 1366)
|
||||
EXPECTED_SCENE_COUNT = 101
|
||||
|
||||
@@ -294,6 +287,8 @@ def check_picture(browser, name, shots):
|
||||
|
||||
|
||||
def check_files(site):
|
||||
maintained = {name + '.html' for name in PAGES}
|
||||
assert {path.name for path in site.rglob('*.html')} == maintained, 'Unmaintained website page'
|
||||
for name in PAGES:
|
||||
source = (site / (name + '.html')).read_text()
|
||||
assert source.count('<canvas ') == 1 and '<iframe' not in source
|
||||
|
||||
Reference in new issue
Block a user