Commit Graph
318 Commits
Author SHA1 Message Date
waozi bbd4ccf498 Measure a canvas application's room in the browser with browser_viewport
The visual viewport, narrowed to the canvas frame, the canvas's parent or
the canvas, measured in Zi through the web bridge; and a debounce that
resizes only once a new size has held for two frames with no pointer
down. Moved from Inner Breeze's JavaScript and web window code so raylib
web builds share it.
2026-10-11 11:18:52 -03:00
waozi 27f3f1e05c Pick documents and scan QR codes on Android with android_picker
The activity's document picker and camera scanner answer later, so a
numbered request is opened and polled each frame; each answer is taken
once by the request that asked, and a newer request replaces one still
waiting. Moved from Inner Breeze so other Android applications get it.
2026-10-11 11:11:50 -03:00
waozi c00ef4c224 Read browser WebSocket events with page_socket
page_socket opens a WebSocket through the web bridge and queues its text
messages for polling each frame. Binary or oversized messages, a full
queue, or no open after ten seconds close the socket, and URLs with
credentials are refused; a token travels as the second subprotocol. A
headless-browser test runs against a small local WebSocket server. It
replaces Inner Breeze's JavaScript socket.
2026-10-11 10:58:48 -03:00
waozi 86254a5453 Hand finished files to the user with file_export
ExportBytes and ExportFile download a file in the browser, through a
blob link built on the web bridge, or open Android's share sheet through
the activity's shareFile. A headless-browser test checks the downloaded
names and bytes. It comes from Inner Breeze's data and account export.

fseek and ftell take a C long, 32 bits on wasm and 32-bit Android, so
file_export and file_download now declare it as isize.
2026-10-11 10:55:05 -03:00
waozi 5d41090b1c Edit Android text through the input method's snapshots
android_text_editor lets an activity's input connection edit the focused
field as UTF-8 snapshots through TextRequest, so composition, autocorrect
and suggestions work. Stale revisions, a replaced field's late edits and
edits after blur are refused. android_device's text input calls it, and
falls back to code points when the activity has no input connection. It
comes from Inner Breeze.

The Android test host no longer replaces dlsym, which AddressSanitizer
needs at startup; the real one finds no raylib state either, so the
Android device tests now also pass under the sanitizers.
2026-10-11 10:40:19 -03:00
waozi 9d7a3093b1 Download files to disk with file_download
file_download fetches a large file, such as music or an app package, to a
path while the application keeps drawing; the file appears there only
once complete. Linux and BSD desktops run curl as a child process, the
browser streams fetch's body into the page's file system through the web
bridge, and Android asks the activity, whose callbacks the application
binds to FileDownloadNative*. Native and headless-browser tests download
from a local server. It comes from Inner Breeze.
2026-10-11 10:24:50 -03:00
waozi c2755c9d14 Add HTTP transfers and raylib secondary windows
http_transfer runs HTTP requests while the application keeps drawing:
curl on a detached worker thread on desktops, the activity's transport on
Android, and fetch through the web bridge in the browser. A cancelled
transfer never writes into the caller's buffer, answers that do not fit
fail instead of arriving cut, and only http and https URLs are accepted.
Native and headless-browser tests run against a local server.

raylib_secondary_window gives a raylib application on SDL up to three
extra windows, each drawing its own Kryon tree into a render texture that
is copied to the window, so the main OpenGL context stays current. Its
probe runs on a private Xvfb display.

Both come from Inner Breeze.
2026-10-11 10:11:17 -03:00
waozi 20e8ee86ad Add file picking, window close, idle time, notification and raylib log services
These come from Inner Breeze so any Kryon application can use them:

- file_picker: zenity on Linux and BSD, Windows' common dialog, and the
  browser's file chooser through the web bridge, which copies the chosen
  file into the page's file system. A browser test answers the chooser in
  headless Chromium; a fake zenity checks the arguments natively.
- window_close: close requests for the application's own SDL or Win32
  window.
- idle_time: session idle time from Mutter or the freedesktop screen saver
  over D-Bus, and whether the session is Wayland.
- notification_desktop: the notification host for Linux and BSD through
  notify-send.
- raylib_trace: raylib's log to the console or logcat with routine notes
  dropped, or to a log file for Windows applications without a console.
2026-10-11 10:00:36 -03:00
waozi afd7e8198f Open links with open_uri and describe the whole Android app glue
open_uri opens a URI with the platform's handler: the desktop opener as a
child process, Windows' shell, Plan 9's plumber, an Android ACTION_VIEW
intent or a new browser tab through the web bridge. It moves here from
Inner Breeze so any Kryon application can open links.

android_jni's NativeAndroidApp now carries every field of the glue's
android_app, including the command pipe, and AndroidInternalDataPath
returns the app's files folder. A test checks the layouts against the NDK
headers for all four Android ABIs.
2026-10-11 09:45:56 -03:00
waozi fe37943f21 Run a bundle inside a host application with hosted_app
Applications that run another .zib in their window each opened the
bundle, checked its capabilities, bound them, limited its steps and kept a
working instance through restarts. hosted_app does that once:
HostedAppStart asks the host about every capability and binds them to one
HostCall with field names matched, HostedAppRun runs under a step limit and
marks a trap as failed, HostedAppRestart closes the old instance only once
the new one passes the host's handshake, and HostedAppAsset finds a packed
asset by its exact path.
2026-10-11 00:23:19 -03:00
waozi 53ea0fdb87 Host the widgets of a bundle that runs inside another application
An application that runs a .zib inside its own window answered each
widget's HostedHost call with its own codec and dispatcher. Kryon now owns
that host side next to the bundle side: widget_host draws a bundle's widgets
in the frame's session, refuses calls from another frame, foreign records,
texture handles and assets its host's callback rejects, and closes scrolls
the bundle leaves open. WidgetHostSupports lists the calls it answers,
including Toggle.

widget_codec is generated from Kryon's widget records by
scripts/generate-widget-codecs.py, whose --uses option lets an application
generate codecs for its own records on top of Kryon's. hosted_values holds
the shared helpers: fields match by name, so a bundle and its host may be
built against different layouts.
2026-10-11 00:04:50 -03:00
waozi 9b7ee6274b Retain TextArea wrapping for stable font metrics 2026-10-06 01:52:35 -03:00
waozi 84fa544090 Name the shared key codes and map them to text field input
Hosts now agree on key codes, so Kryon names them (KeyEnter, KeyBackspace,
KeyLeft, ...) next to the modifier bits. TypedTextTake collects a frame's
typed codepoints as UTF-8, and TextFieldInputFor turns a key, modifiers, and
typed text into a focused TextField's input, which apps each wrote by hand.
2026-09-30 01:31:27 -03:00
waozi 2a00c369d1 Move KSS into its own package
Style sheet parsing, formatting, the style packs, and their tests now
live in kryonlabs/kss, which depends on Kryon. Kryon keeps the rule
table and style resolution, so an app that builds its rules in code no
longer carries a parser; apps that read .kss text add the KSS package
and import kss/Kss or kss/SystemStyle.
2026-09-29 20:56:26 -03:00
waozi 0525f80226 Build browser profiles through the package map
Canvas and DOM builds now check and save the app with `ziran ir
--project`, like native builds, so an app's Git dependencies and
package-qualified imports such as Kryon/Widgets work on the web too.
Browser routing is exported as PageRoute for apps that read or push
the page route.
2026-09-29 20:36:20 -03:00
waozi 2e74cf287b Move Plot, the data views, and Syntax into their own packages
PlotWidget now lives in kryonlabs/plot, TableView and TreeView in
kryonlabs/data-views, and the Ziran, C, and Make tokenizer in
ziranlang/syntax, which no longer depends on Kryon. Apps add them with
`ziran add URL` and import plot/Plot, data_views/TableView, or
syntax/Syntax.

Kryon exports the building blocks those packages draw with (session,
tree, surface, paint_queue, style, style_sheet, widget_kind, and the
rest), so a widget package imports kryon/NAME instead of reaching into
Kryon's source directories. The API guide describes writing one.
2026-09-29 19:47:57 -03:00
waozi 535235d81e Complete semantic DOM browser host and modular Canvas rastering 2026-09-27 16:49:34 -03:00
waozi 8a0c03fa38 Own installed style typeface bytes in Kryon 2026-09-27 11:28:15 -03:00
waozi a63545f44d Remove obsolete Kryon runtime and migration archives 2026-09-27 10:36:49 -03:00
waozi 987f5843f9 Export optional Kryon modules for Ziran packages 2026-09-27 01:12:46 -03:00
waozi 1280b0e579 Expose core widgets and optional plot as Ziran modules 2026-09-27 00:54:26 -03:00
waozi b6acf3b7f2 Split KSS authoring into an optional package 2026-09-26 16:18:49 -03:00
waozi 856978727e Move guide and locale policy to Inbe 2026-09-26 16:10:06 -03:00
waozi cd439879b4 Expose borrowed locale text lookup for apps 2026-09-25 03:05:14 -03:00
waozi 813a9b6b4b Complete current Ziran widget library migration and tests 2026-09-25 02:40:09 -03:00
waozi 20f5e34891 Keep cursor and frame pacing decisions entirely in Ziran 2026-09-24 16:28:52 -03:00
waozi 618fe643e2 Bind reusable pointer input and prove desktop bundle rendering 2026-09-24 15:33:17 -03:00
waozi b581577b1c Complete Kryon migration to current Ziran syntax and host queue 2026-09-24 14:43:35 -03:00
waozi 40c79de115 Document the value based Scroll widget API 2026-09-24 12:43:40 -03:00
waozi e10462dc0f Delete legacy header-based Kryon path 2026-09-24 01:06:16 -03:00
waozi 960e7e63a9 Apply inherited viewports to text and image paint 2026-09-23 23:35:59 -03:00
waozi b109c530fd Clip retained child input to ancestor viewports 2026-09-23 23:08:04 -03:00
waozi 4b93f9e354 Move SegmentedControl into checked Ziran widget library 2026-09-23 12:30:36 -03:00
waozi 22b2648425 Move Collapsible interaction and paint into checked Ziran 2026-09-23 12:06:47 -03:00
waozi af007e1bd6 Move Toast state and rendering into checked Ziran widget 2026-09-23 11:51:13 -03:00
waozi a2509f0ed3 Move swipe gesture state and ownership into Ziran 2026-09-23 11:35:19 -03:00
waozi 8461e27f5c Move PanedView into checked Ziran widget library 2026-09-23 11:19:28 -03:00
waozi 324ba75f54 Complete checked TreeView scrollbar and navigation 2026-09-23 11:05:22 -03:00
waozi a7d027a09f Implement TreeView as checked Ziran widget 2026-09-23 10:53:23 -03:00
waozi 16cd54926d Move device preference policy into checked Ziran 2026-09-23 10:39:08 -03:00
waozi 0f20ae7153 Place checked widget children during tree submission 2026-09-23 10:29:03 -03:00
waozi bf7a1e8934 Port retained layout containers to Ziran 2026-09-23 10:17:03 -03:00
waozi 66095ce54c Port Link and Flow from page host to Ziran 2026-09-23 10:08:40 -03:00
waozi b8b1b3015d Port page heading and paragraph text to checked Ziran 2026-09-23 09:58:35 -03:00
waozi 0a3ae9e277 Port page and section containers to Ziran 2026-09-23 09:45:39 -03:00
waozi 655a9b1ba4 Add portable retained tree parent scopes 2026-09-23 09:32:18 -03:00
waozi 16fa1569b4 Port Router navigation to portable Ziran 2026-09-23 09:24:11 -03:00
waozi 1203beded7 Parse locale catalogs into portable caller owned spans 2026-09-23 08:52:11 -03:00
waozi 478a24e8e9 Move locale selection and lookup to portable Ziran 2026-09-23 08:35:06 -03:00
waozi c2468c81cb Move route list and stack policy to portable slices 2026-09-23 08:28:05 -03:00