Commit Graph
64 Commits
Author SHA1 Message Date
waozi a585f1ced5 Implement Canvas WebAudio backend 2026-08-19 16:35:44 -03:00
waozi 8f8a2736e6 Align installed desktop metadata names 2026-08-19 15:53:17 -03:00
waozi e0c588cd23 Add Linux desktop integration helpers 2026-08-19 15:47:56 -03:00
waozi 7b6048a9df canvas: split the backend into per-concern sources
canvas_backend.c (1882 lines) becomes canvas_window/input/draw/texture/
text/os/audio.c plus canvas_internal.h, one file per banner section the
monolith had already grown. Pure code motion: the node call-sequence
gate records an identical 413-call trace before and after.

The canvas branches in Makefile, mk/common.mk, and examples/Makefile no
longer append the backend file on top of the src/ find sweep — that
would have compiled every canvas TU twice. docs: BACKENDS.md path and
empty-TU wording, FEATURE_MATRIX.md stale 'approximated' note.
2026-08-18 22:29:08 -03:00
waozi 86ceaf1b1e build: link FreeBSD curl codec dependencies 2026-08-17 13:00:26 -03:00
waozi ccec103ebc k2b: report call kinds the KRB vocabulary cannot express
A cartridge that comes out thin (inbe's pet screen: an egg widget,
locale text, Paragraphs) was silently missing everything k2b cannot
lower. The builder now tracks dropped call kinds per file and prints
one stderr line: 'k2b: <file>: N call kinds not in KRB: Paragraph x2
draw_egg x1 ...' - pet_screen.kry reports seven, which is the honest
content of the gap.
2026-08-16 07:52:09 -05:00
waozi b44b946979 kryon owns the transport, not the vendor: drop kry_zai
kry_json + kry_http are provider-neutral stdlib pieces; a z.ai GLM
client (endpoint, model, key handling, wire format) is harness logic and
moved to krait (native_ai.c). inbe and other apps no longer link a
specific commercial LLM vendor.
2026-08-15 06:56:29 -05:00
waozi a502700ed0 kry std: kry_json, kry_http, kry_zai — the AI-harness foundation
- kry_json: dependency-free recursive-descent parser (objects/arrays/
  strings with \u escapes + surrogate pairs, numbers, bools) and a
  compact KryJsonBuf emitter. Depth-capped against hostile input.
- kry_http: async libcurl-easy client (HAS_LIBCURL) on the existing
  KryThread worker pattern — POST-JSON/GET, poll for state, body owned
  by the request. Stub when curl is absent. file:// counts as success
  (HTTP code 0), which the hermetic tests use.
- kry_zai: z.ai GLM chat-completions client (OpenAI-compatible) on the
  two above. Coding-Plan endpoint default, glm-4.6, ZAI_API_KEY/
  ZAI_BASE_URL/ZAI_MODEL env with an in-process override; thinking
  disabled for fast answers. Live test gated on ZAI_API_KEY.
- mk/vendor.mk: KRYON_CURL_TRANSITIVE_LDLIBS (brotli/zstd) the vendored
  static curl needs at final link.
2026-08-14 22:06:36 -05:00
waozi b8ca07feca Add cross-platform notification helpers
One raylib-style API in notification.h (SendNotification,
SendNotificationEx with tag/id/priority, CancelNotification,
CancelAllNotifications, permission probing, SetNotificationAppName),
three real backends in src/notification/notification.c:

- Android: pure JNI through the native activity -- channels on API 26+,
  legacy Builder priorities on 21-25, areNotificationsEnabled /
  POST_NOTIFICATIONS runtime request on 24+/33+. No Java-side code
  required, so any kryon app gets notifications unchanged.
- Web: the browser Notification API via EM_JS, with an id registry so
  cancel works.
- Desktop Linux: org.freedesktop.Notifications over GDBus
  (KRYON_NOTIFICATION_GDBUS + gio-2.0; mk/vendor.mk exports the probe
  flags). urgency + desktop-entry hints from the priority and app name.
- Everything else: honest stub (supported=0).

Verified: desktop path end-to-end against a live xfce Notifyd
(supported=1 send=1), stub branch syntax-clean, full kryon test suite
green.
2026-08-14 21:32:38 -05:00
waozi 3abe06995c vendor.mk: fix K2C path export (make ate the sed $ anchors)
The platform-mapping sed used $ regex anchors, which make expands as
variables -- KRYON_BUILD_PLATFORM came out empty and consumers got
build/-x86_64/bin/k2c. Rewrite with tr + anchor-free sed.
2026-08-14 14:14:05 -05:00
waozi 37d1443a2d Remove legacy build/bin tool aliases; export canonical K2C for consumers
The LEGACY_K2C/K2IR/K2B/KT/KRYON_CMD rules copied the per-platform
build/<platform>-<arch>/bin tools to the old top-level build/bin paths.
inbe and uku hardcoded those legacy paths, which is the only reason the
aliases existed.

- mk/vendor.mk now exports the canonical tool paths (KRYON_TOOLS_BIN,
  K2C) using the same platform/arch mapping kryon itself uses, so
  consumers include one file instead of hardcoding paths.
- New phony 'k2c' target builds the compiler by name; consumers call
  'make -C  k2c'.
- Legacy alias variables and rules deleted.
2026-08-14 14:12:41 -05:00
waozi ef5d313e16 Fix CI links and platform icons 2026-08-13 12:12:34 -03:00
waozi ecb4ad24e6 build: make 2D physics (Box2D) optional via KRYON_WITH_PHYSICS
Box2D was a hard dependency of libkryon.a: physics_world.c and the
Body2D/Area2D/CollisionShape2D nodes include <box2d/box2d.h>, so every
consumer had to build and link box2d even for UI-only apps.

Add a KRYON_WITH_PHYSICS toggle (default 1, current behavior):
- mk/vendor.mk exposes KRYON_PHYSICS_SRCS, KRYON_PHYSICS_CPPFLAGS, and
  KRYON_PHYSICS_DEPS (empty when off) so apps can opt out in one place.
- The kryon Makefile filters the four physics sources out of SRCS and drops
  the box2d include/build/link when KRYON_WITH_PHYSICS=0.
- scene_builtins.c gates the Body2D/Area2D/CollisionShape2D registration and
  the physics stepper install behind #if KRYON_WITH_PHYSICS; the stepper
  pointer in scene_tree.c stays NULL and is already NULL-checked, so a
  physics-off lib ticks scenes safely.

The public headers were already box2d-free (b2WorldId/b2BodyId are stored as
opaque raw ints), so no header changes are needed. UI-only apps build with
KRYON_WITH_PHYSICS=0 to drop box2d entirely.
2026-08-12 19:29:44 -05:00
waozi ed512eae71 raylib build: purge stale .o/.a from vendored sources before recompiling
The vendored raylib copy could ship leftover .o/.a files that shadow a
recompile, causing symbol/link mismatches (the CUSTOM_CFLAGS rename drop).
Delete any prebuilt objects right after copying the sources, before the
prepare script and sub-make run, for native, web, and both Windows targets.
2026-08-12 19:02:11 -05:00
waozi d60cd4303e Add raylib rename-check post-build step to fix symbol collision
Some build environments cause the nested raylib sub-make to drop the
CUSTOM_CFLAGS rename header, leaving unrenamed symbols in libraylib.a
(GetCodepoint, TextSplit, LoadUTF8, etc.) that collide with kryon's
forwarders at link time. The root cause is an environment-specific
interaction between the nested make and the compiler that I could not
fully pin down despite extensive investigation (the flags are correct,
manual compiles with identical flags rename correctly, but the make-driven
compile does not).

The fix: a post-build check in KRYON_RAYLIB_DESKTOP_RULE (mk/raylib.mk)
that verifies the rename took effect and, if not, recompiles rtext.o
directly with the rename header and replaces it in the archive. Proven
correct in isolation — the recompiled rtext.o has correctly-renamed
symbols and ar rcs replaces the member cleanly.
2026-08-12 11:35:39 -05:00
waozi e8eb0dd789 Phase 4: Box2D v3 physics integration
Vendor Box2D v3.1.1 (erincatto/box2d) as a submodule; wired into
mk/vendor.mk (CMake static archive, samples/tests/benchmarks off) and
CPPFLAGS_BASE (-Ivendor/box2d/include). libkryon.a now depends on it.

Runtime:
- include/scene_tree.h: KryScene carries an opaque b2WorldId + physics_enabled;
  KryScenePhysicsCreate/Destroy build/tear down the world; KryScenePhysicsTick
  steps it via a function pointer installed by physics_world.c (keeps
  scene_tree.c free of a box2d.h dependency)
- src/scene/physics_world.c: owns the only #include <box2d/box2d.h>; world
  creation/step, body+shape creation helpers, transform sync
- src/scene/node_body2d.c: static/kinematic/dynamic body; creates b2Body on
  ready, syncs transform on physics_process, debug-draws an outline
- src/scene/node_collision_shape2d.c: box/circle shape attached to the nearest
  Body2D ancestor on ready
- src/scene/node_area2d.c: trigger volume (sensor) node
- include/node2d_props.h: Body2DProps/CollisionShape2DProps/Area2DProps +
  allocators
- src/scene/scene_physics_internal.h: private bridge for Box2D-typed helpers

Example: examples/22_physics.kry (a dynamic box falling onto a static ground).
2026-08-12 09:06:23 -05:00
waozi 90e759af65 Support standalone KITE IDE 2026-08-01 09:59:24 -03:00
waozi e6bb5e7372 Add compiler diagnostics and UI text backend fixes 2026-07-27 12:14:20 -03:00
waozi ce2bddba02 Add Kryon IDE start page and fix preview inspection
Replace the bare recent-projects welcome screen with a centered start
page: a New Project action that scaffolds project.kryon + a hello-world
main.kry into a chosen folder, a Recent Projects list, and an Examples
grid with one card per examples/*.kry. The sidebar is hidden when no
project is open so the start page fills the canvas; opening a .kry
selects its screen and shows the preview column.

Update examples to the current kc syntax: drop the removed `var` keyword
from all declarations (they already use `name: type = value`) and replace
the custom `set_theme` verb in 03_theme.kry with `native SetCurrentTheme`
so the generated C compiles. All 17 examples now transpile and build.

Fix the preview inspect overlay registering zero widgets. draw_preview_pane
restored the editor camera via SetUIInspectFrame(NULL) through SetUIFrame,
which wiped the widget list that DrawAppScreen had just populated. Restore
the camera directly instead, so the 17 preview widgets survive and
DrawUIInspectOverlay can outline them and click-to-source works.

Build with -fPIE in mk/common.mk so the static lib links into PIE
executables on PIE-default Linux toolchains.
2026-07-24 20:16:11 -05:00
waozi 137f6ac413 Rename Flint runtime to Kryon 2026-07-20 11:25:19 -03:00
waozi 2123449504 Add Kryon widget inspection lifecycle 2026-07-20 10:56:27 -03:00
waozi a462581680 Add Clay and remove fontchop 2026-07-18 07:29:00 -03:00
waozi fd3adb5de4 Add real font asset loading 2026-07-16 21:43:27 -03:00
waozi d606232116 Use fontchop submodule for UI fonts 2026-07-15 23:36:23 -03:00
waozi 17afae92cb Add Markdown support and text area UI 2026-07-12 01:27:59 -03:00
waozi 76c8916320 Fix icon slider popup and raylib build lock 2026-07-11 20:37:41 -03:00
waozi 2d08e7a4cc Track raylib source prep in build rules 2026-07-11 17:50:55 -03:00
waozi 645f91d43e Fix Windows raylib wrapper symbols 2026-07-11 17:35:41 -03:00
waozi 997c171136 Run curl protocol check from build tree 2026-07-11 17:14:48 -03:00
waozi a3837ff3bb Fix release build dependency checks 2026-07-11 17:12:24 -03:00
waozi 6f685051f6 Reorganize Flint sources and profile icons 2026-07-11 13:08:04 -03:00
waozi dc83383773 build: update Makefiles for moved sources (ui, lyra, file_dialog) and use wildcard SRCS 2026-07-11 12:41:17 -03:00
waozi 06d0d82ec3 Generate Raylib backend wrappers 2026-07-10 23:51:06 -03:00
waozi 9c26a1c1df Delegate platform Raylib rules 2026-07-10 23:07:30 -03:00
waozi 97e1ceaa89 Share Raylib build rules across Flint apps 2026-07-10 22:55:24 -03:00
waozi 914d5ca333 Use static vendored curl builds 2026-07-10 22:40:29 -03:00
waozi dbd81e389c Disable linker depfiles for vendored curl 2026-07-10 22:38:24 -03:00
waozi f1975d5917 Build vendored curl shared library before install 2026-07-10 22:35:53 -03:00
waozi faf2d95044 Move Raylib backend fixes into Flint 2026-07-10 22:30:19 -03:00
waozi c9b17de738 Add FreeBSD package categories 2026-07-10 21:54:20 -03:00
waozi 4d1e150737 Add FreeBSD package make support 2026-07-10 19:24:59 -03:00
waozi e88dcf4cae Use native output directories for host builds 2026-07-10 00:39:10 -03:00
waozi 671f5183cf rm legacy cli 2026-07-09 22:17:39 -03:00
waozi 965f27d6e7 Use external helpers for desktop file dialogs 2026-07-09 19:25:26 -03:00
waozi 6d859bd7a0 Support BSD make and generic liboqs builds 2026-07-09 18:51:30 -03:00
waozi 0868f12a66 Use raylib fork for audio period controls 2026-07-09 18:27:01 -03:00
waozi d981aff430 Rename public API to raylib-style names 2026-07-09 15:42:55 -03:00
waozi 398b6daa21 Add native FreeBSD support 2026-07-09 13:25:23 -03:00
waozi 6b4b94effe Set curl runpath for vendored LibreSSL 2026-06-27 18:38:02 -03:00
waozi 81e6ecdb48 Add Lyra account and shared vendor build rules 2026-06-27 17:22:55 -03:00