std: restructure step 3 — ffi/ moves, build.sx, math dir spelling, fixtures

- objc.sx, objc_block.sx (from std/) + sdl3/opengl/raylib/stb/stb_truetype/
  wasm vendor bindings (from modules/ root) -> modules/ffi/
- std/uikit.sx deleted: platform/uikit.sx already declares UIApplicationMain
  and imports objc; '#framework "UIKit"' cannot live in a file imported on
  macOS targets (unconditional link directive, UIKit is iOS-only), so the
  three iOS-only examples carry the 3-line glue inline. 1607/1608/1616 also
  un-rotted (dead ns_string -> 'xx "..."' Into conversions, callconv(.c)
  msgSend fn-ptrs) — all three build for ios-sim/ios again.
- math/math.sx -> math/scalar.sx; one spelling '#import "modules/math"'
  everywhere (4 pinned IR snapshots regenerated: dir import adds Vec2/Mat4
  to the type tables).
- compiler.sx -> build.sx (imports, CLAUDE.md bundling table, specs.md).
- testpkg/ + test_c.sx -> tests/fixtures/ (resolve CWD-relative from repo
  root, same as vendors/).
- library-internal imports use full modules/... paths (std.sx tail,
  platform/bundle.sx, fixtures).
This commit is contained in:
agra
2026-06-11 08:37:22 +03:00
parent 59f0aa7716
commit 12bf61a9fc
142 changed files with 5026 additions and 4161 deletions

View File

@@ -14,7 +14,11 @@
// (no ARC; UIKit retains it as the key window anyway).
#import "modules/std.sx";
#import "modules/std/uikit.sx";
#import "modules/ffi/objc.sx";
#framework "UIKit";
UIApplicationMain :: (argc: s32, argv: *void, principal_class: *NSString, delegate_class: *NSString) -> s32 #foreign;
g_window : *void = ---;
@@ -44,22 +48,22 @@ did_finish_launching :: (self: *void, _cmd: *void, app: *void, opts: *void) -> u
sel_connected_scenes := sel_registerName("connectedScenes".ptr);
sel_any_object := sel_registerName("anyObject".ptr);
msg_o : (*void, *void) -> *void = xx objc_msgSend;
msg_v : (*void, *void) -> void = xx objc_msgSend;
msg_oo : (*void, *void, *void) -> void = xx objc_msgSend;
msg_ooo : (*void, *void, *void) -> *void = xx objc_msgSend;
msg_o : (*void, *void) -> *void callconv(.c) = xx objc_msgSend;
msg_v : (*void, *void) -> void callconv(.c) = xx objc_msgSend;
msg_oo : (*void, *void, *void) -> void callconv(.c) = xx objc_msgSend;
msg_ooo : (*void, *void, *void) -> *void callconv(.c) = xx objc_msgSend;
// Modern iOS path: get the connected windowScene, then construct the
// window via initWithWindowScene: so UIKit auto-sizes it and attaches
// it to the display in one step.
scenes := msg_o(app, sel_connected_scenes);
scene := msg_o(scenes, sel_any_object);
if scene == xx 0 { NSLog(ns_string("[sx] scene NULL\n".ptr)); return 1; }
NSLog(ns_string("[sx] scene: ok\n".ptr));
if scene == xx 0 { NSLog(xx "[sx] scene NULL\n"); return 1; }
NSLog(xx "[sx] scene: ok\n");
win_raw := msg_o(UIWindow, sel_alloc);
g_window = msg_ooo(win_raw, sel_init_with_scene, scene);
NSLog(ns_string("[sx] window: ok\n".ptr));
NSLog(xx "[sx] window: ok\n");
vc_raw := msg_o(UIViewController, sel_alloc);
vc := msg_o(vc_raw, sel_init);
@@ -71,7 +75,7 @@ did_finish_launching :: (self: *void, _cmd: *void, app: *void, opts: *void) -> u
msg_oo(g_window, sel_set_bg, blue);
msg_v(g_window, sel_make_key_visible);
NSLog(ns_string("[sx] makeKeyAndVisible done\n".ptr));
NSLog(xx "[sx] makeKeyAndVisible done\n");
return 1;
}
@@ -90,5 +94,5 @@ main :: () -> s32 {
xx window_setter, "v@:@".ptr);
objc_registerClassPair(SxAppDelegate);
return UIApplicationMain(0, xx 0, xx 0, ns_string("SxAppDelegate".ptr));
return UIApplicationMain(0, xx 0, xx 0, xx "SxAppDelegate");
}