Fix Photos behavior fixture native UI linking

This commit is contained in:
waozi committed 2026-11-03 08:08:31 -03:00
1 parent 319fa9f3ae
commit 635c968633
2 files changed
+124 -2

No files matched your search

+121
View File
@@ -0,0 +1,121 @@
// The real node-app host imports native widgets as well as hosted ones.
// Photos' UI is observed by ScreenCall in photos_app_behavior, so none of
// these native backend effects may run. Supply their current Kryon ABI for
// linking, and fail if a widget bypasses the test's hosted observations.
#import "drawing_props"
#import "geometry"
c :: #system_library "c";
UnexpectedNativeUi :: (code: s32) #foreign c "exit";
#program_export
MeasureGlyphWidth :: (value: string, font: s32, typeface: string) -> s32 {
unused value
unused font
unused typeface
UnexpectedNativeUi(70)
return 0
}
#program_export
MeasureGlyphLineHeight :: (font: s32, typeface: string) -> s32 {
unused font
unused typeface
UnexpectedNativeUi(70)
return 0
}
#program_export
ImageWidth :: (path: string) -> s32 {
unused path
UnexpectedNativeUi(70)
return 0
}
#program_export
ImageHeight :: (path: string) -> s32 {
unused path
UnexpectedNativeUi(70)
return 0
}
#program_export
RasterRoundedRectangle :: (bounds: Rectangle, radius: float32,
segments: s32, color: Color) {
unused bounds
unused radius
unused segments
unused color
UnexpectedNativeUi(70)
}
#program_export
RasterRoundedRectangleOutline :: (bounds: Rectangle, radius: float32,
segments: s32, width: float32, color: Color) {
unused bounds
unused radius
unused segments
unused width
unused color
UnexpectedNativeUi(70)
}
#program_export
RasterLine :: (bounds: Rectangle, color: Color) {
unused bounds
unused color
UnexpectedNativeUi(70)
}
#program_export
RasterText :: (value: string, x: s32, y: s32, font: s32, color: Color) {
unused value
unused x
unused y
unused font
unused color
UnexpectedNativeUi(70)
}
#program_export
RasterTextClipped :: (value: string, x: s32, y: s32, font: s32,
color: Color, clip: Rectangle) {
unused value
unused x
unused y
unused font
unused color
unused clip
UnexpectedNativeUi(70)
}
#program_export
RasterImage :: (path: string, texture_id: u32, source: Rectangle,
destination: Rectangle, clip: Rectangle, origin: Vector2,
rotation: float32, radius: float32, tint: Color) {
unused path
unused texture_id
unused source
unused destination
unused clip
unused origin
unused rotation
unused radius
unused tint
UnexpectedNativeUi(70)
}
#program_export
RasterImageMesh :: (path: string, texture_id: u32, source: Rectangle,
points: []Vector2, columns: s32, rows: s32, clip: Rectangle,
tint: Color) {
unused path
unused texture_id
unused source
unused points
unused columns
unused rows
unused clip
unused tint
UnexpectedNativeUi(70)
}
+3 -2
View File
@@ -10,7 +10,8 @@ packages=${INBE_PACKAGES:-"$root/build/packages"}
work=${PHOTOS_APP_TEST_DIR:-"$root/build/photos-app-test"}
include=$packages/ziran/include
curl=${CURL_LIBRARY:-$(ls /usr/lib/x86_64-linux-gnu/libcurl.so.4 2>/dev/null || echo -lcurl)}
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS SESSION_MANAGER
export YUE_DESKTOP_RECOVERY=0
mkdir -p "$(dirname "$work")"
exec 9>"$work.lock"
@@ -31,7 +32,7 @@ mkdir -p "$work/generated"
--module-path "$packages/daochi-client" \
--entry photos_app_behavior:Check \
-o "$work/generated" "$root/tests/photos_app_behavior.zi" \
"$root/tests/sync_test_host.zi"
"$root/tests/sync_test_host.zi" "$root/tests/photos_app_raster_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "photos_app_behavior.h"
#include <stdio.h>