Pure source rename across uikit/android/android_jni/sdl3 (~64 #foreign sites):
- 30 fn decls '… #foreign;' → '… extern;'
- 34 import runtime classes '#foreign #objc_class/#jni_class("X") {' →
'#objc_class/#jni_class("X") extern {' (prefix → postfix modifier)
- 4 defined Sx* obj-c classes '#objc_class("X") {' → '… export {'
Behavior-preserving (AST already unified post-Phase-5.0). Verified byte-identical
IR via 'sx ir' on the uikit importers 1610 + 1606 (which compile uikit incl. the
4 defined Sx* classes on host) and an sdl3 probe; android.sx (host-incompatible,
only compiles under OS==.android) verified by an identical 4-error dedup set (the
keyword-neutral 'foreign symbol already bound' message is unchanged). Empty
snapshot diff; suite green (647 corpus / 444 unit, 0 failed).
32 lines
1.4 KiB
Plaintext
32 lines
1.4 KiB
Plaintext
// Declarative JNI class bindings for the standard Android system-bar
|
|
// inset chain (`Activity.getWindow → Window.getDecorView → View
|
|
// .getRootWindowInsets → WindowInsets.getSystemWindowInset{Top,Left,
|
|
// Bottom,Right}`). Intended to be imported under a named namespace
|
|
// (e.g. `Jni :: #import "library/modules/platform/android_jni.sx"`) so
|
|
// the bare class names don't pollute the top-level namespace —
|
|
// `View` in particular collides with `modules/ui/view.sx`'s protocol.
|
|
// Inside the namespace these are referenced as `Jni.Activity`,
|
|
// `Jni.Window`, etc. The compiler registers the decls both qualified
|
|
// and bare in `foreign_class_map`, so cross-class refs in method
|
|
// signatures (`getWindow :: (self: *Self) -> *Window`) still resolve
|
|
// against the bare name within the namespace.
|
|
|
|
WindowInsets :: #jni_class("android/view/WindowInsets") extern {
|
|
getSystemWindowInsetTop :: (self: *Self) -> i32;
|
|
getSystemWindowInsetLeft :: (self: *Self) -> i32;
|
|
getSystemWindowInsetBottom :: (self: *Self) -> i32;
|
|
getSystemWindowInsetRight :: (self: *Self) -> i32;
|
|
}
|
|
|
|
View :: #jni_class("android/view/View") extern {
|
|
getRootWindowInsets :: (self: *Self) -> *WindowInsets;
|
|
}
|
|
|
|
Window :: #jni_class("android/view/Window") extern {
|
|
getDecorView :: (self: *Self) -> *View;
|
|
}
|
|
|
|
Activity :: #jni_class("android/app/Activity") extern {
|
|
getWindow :: (self: *Self) -> *Window;
|
|
}
|