refactor(ffi-linkage): Phase 6.2 — migrate platform/ #foreign→extern/export
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).
This commit is contained in:
@@ -38,31 +38,31 @@
|
|||||||
|
|
||||||
// ── Foreign Java types ──────────────────────────────────────────────────
|
// ── Foreign Java types ──────────────────────────────────────────────────
|
||||||
|
|
||||||
Bundle :: #foreign #jni_class("android/os/Bundle") { }
|
Bundle :: #jni_class("android/os/Bundle") extern { }
|
||||||
JContext :: #foreign #jni_class("android/content/Context") {
|
JContext :: #jni_class("android/content/Context") extern {
|
||||||
getAssets :: (self: *Self) -> *AssetManagerJ;
|
getAssets :: (self: *Self) -> *AssetManagerJ;
|
||||||
}
|
}
|
||||||
AssetManagerJ :: #foreign #jni_class("android/content/res/AssetManager") { }
|
AssetManagerJ :: #jni_class("android/content/res/AssetManager") extern { }
|
||||||
|
|
||||||
Surface :: #foreign #jni_class("android/view/Surface") { }
|
Surface :: #jni_class("android/view/Surface") extern { }
|
||||||
SurfaceHolder :: #foreign #jni_class("android/view/SurfaceHolder") {
|
SurfaceHolder :: #jni_class("android/view/SurfaceHolder") extern {
|
||||||
getSurface :: (self: *Self) -> *Surface;
|
getSurface :: (self: *Self) -> *Surface;
|
||||||
addCallback :: (self: *Self, cb: *SurfaceHolderCallback);
|
addCallback :: (self: *Self, cb: *SurfaceHolderCallback);
|
||||||
}
|
}
|
||||||
SurfaceView :: #foreign #jni_class("android/view/SurfaceView") {
|
SurfaceView :: #jni_class("android/view/SurfaceView") extern {
|
||||||
new :: (ctx: *JContext) -> *Self; // no `self: *Self` → class method
|
new :: (ctx: *JContext) -> *Self; // no `self: *Self` → class method
|
||||||
getHolder :: (self: *Self) -> *SurfaceHolder;
|
getHolder :: (self: *Self) -> *SurfaceHolder;
|
||||||
}
|
}
|
||||||
SurfaceHolderCallback :: #foreign #jni_class("android/view/SurfaceHolder$Callback") { }
|
SurfaceHolderCallback :: #jni_class("android/view/SurfaceHolder$Callback") extern { }
|
||||||
|
|
||||||
MotionEvent :: #foreign #jni_class("android/view/MotionEvent") {
|
MotionEvent :: #jni_class("android/view/MotionEvent") extern {
|
||||||
getAction :: (self: *Self) -> i32;
|
getAction :: (self: *Self) -> i32;
|
||||||
getX :: (self: *Self) -> f32;
|
getX :: (self: *Self) -> f32;
|
||||||
getY :: (self: *Self) -> f32;
|
getY :: (self: *Self) -> f32;
|
||||||
}
|
}
|
||||||
|
|
||||||
JView :: #foreign #jni_class("android/view/View") { }
|
JView :: #jni_class("android/view/View") extern { }
|
||||||
ActivityClass :: #foreign #jni_class("android/app/Activity") {
|
ActivityClass :: #jni_class("android/app/Activity") extern {
|
||||||
setContentView :: (self: *Self, v: *JView);
|
setContentView :: (self: *Self, v: *JView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,25 +70,25 @@ ActivityClass :: #foreign #jni_class("android/app/Activity") {
|
|||||||
|
|
||||||
// C side of file_utils — installs the AAssetManager so `read_file_bytes`
|
// C side of file_utils — installs the AAssetManager so `read_file_bytes`
|
||||||
// can route through `AAssetManager_open` when running on Android.
|
// can route through `AAssetManager_open` when running on Android.
|
||||||
sx_android_set_asset_manager :: (mgr: *void) #foreign;
|
sx_android_set_asset_manager :: (mgr: *void) extern;
|
||||||
|
|
||||||
__android_log_print :: (prio: i32, tag: *u8, fmt: *u8) -> i32 #foreign;
|
__android_log_print :: (prio: i32, tag: *u8, fmt: *u8) -> i32 extern;
|
||||||
usleep :: (us: u32) -> i32 #foreign;
|
usleep :: (us: u32) -> i32 extern;
|
||||||
|
|
||||||
// libandroid
|
// libandroid
|
||||||
ANativeWindow_fromSurface :: (env: *void, surface: *void) -> *void #foreign;
|
ANativeWindow_fromSurface :: (env: *void, surface: *void) -> *void extern;
|
||||||
ANativeWindow_release :: (window: *void) #foreign;
|
ANativeWindow_release :: (window: *void) extern;
|
||||||
ANativeWindow_getWidth :: (window: *void) -> i32 #foreign;
|
ANativeWindow_getWidth :: (window: *void) -> i32 extern;
|
||||||
ANativeWindow_getHeight :: (window: *void) -> i32 #foreign;
|
ANativeWindow_getHeight :: (window: *void) -> i32 extern;
|
||||||
ANativeWindow_setBuffersGeometry :: (w: *void, width: i32, height: i32, fmt: i32) -> i32 #foreign;
|
ANativeWindow_setBuffersGeometry :: (w: *void, width: i32, height: i32, fmt: i32) -> i32 extern;
|
||||||
|
|
||||||
AAssetManager_fromJava :: (env: *void, mgr: *void) -> *void #foreign;
|
AAssetManager_fromJava :: (env: *void, mgr: *void) -> *void extern;
|
||||||
|
|
||||||
// pthread (link libpthread is built into bionic).
|
// pthread (link libpthread is built into bionic).
|
||||||
pthread_create :: (thread: *u64, attr: *void, start: (*void) -> *void callconv(.c), arg: *void) -> i32 #foreign;
|
pthread_create :: (thread: *u64, attr: *void, start: (*void) -> *void callconv(.c), arg: *void) -> i32 extern;
|
||||||
pthread_mutex_init :: (m: *void, attr: *void) -> i32 #foreign;
|
pthread_mutex_init :: (m: *void, attr: *void) -> i32 extern;
|
||||||
pthread_mutex_lock :: (m: *void) -> i32 #foreign;
|
pthread_mutex_lock :: (m: *void) -> i32 extern;
|
||||||
pthread_mutex_unlock :: (m: *void) -> i32 #foreign;
|
pthread_mutex_unlock :: (m: *void) -> i32 extern;
|
||||||
|
|
||||||
// EGL. Constants from <EGL/egl.h>. We bring up an ES3 context with a
|
// EGL. Constants from <EGL/egl.h>. We bring up an ES3 context with a
|
||||||
// 24-bit RGB framebuffer + 24-bit depth (same shape chess used under
|
// 24-bit RGB framebuffer + 24-bit depth (same shape chess used under
|
||||||
@@ -112,17 +112,17 @@ EGL_WINDOW_BIT :i32: 0x0004;
|
|||||||
EGL_NATIVE_VISUAL_ID :i32: 0x302E;
|
EGL_NATIVE_VISUAL_ID :i32: 0x302E;
|
||||||
EGL_CONTEXT_CLIENT_VERSION :i32: 0x3098;
|
EGL_CONTEXT_CLIENT_VERSION :i32: 0x3098;
|
||||||
|
|
||||||
eglGetDisplay :: (id: u64) -> *void #foreign;
|
eglGetDisplay :: (id: u64) -> *void extern;
|
||||||
eglInitialize :: (d: *void, major: *i32, minor: *i32) -> u32 #foreign;
|
eglInitialize :: (d: *void, major: *i32, minor: *i32) -> u32 extern;
|
||||||
eglChooseConfig :: (d: *void, attrs: *i32, configs: **void, sz: i32, num: *i32) -> u32 #foreign;
|
eglChooseConfig :: (d: *void, attrs: *i32, configs: **void, sz: i32, num: *i32) -> u32 extern;
|
||||||
eglGetConfigAttrib :: (d: *void, cfg: *void, attr: i32, value: *i32) -> u32 #foreign;
|
eglGetConfigAttrib :: (d: *void, cfg: *void, attr: i32, value: *i32) -> u32 extern;
|
||||||
eglCreateContext :: (d: *void, cfg: *void, share: *void, attrs: *i32) -> *void #foreign;
|
eglCreateContext :: (d: *void, cfg: *void, share: *void, attrs: *i32) -> *void extern;
|
||||||
eglCreateWindowSurface :: (d: *void, cfg: *void, window: *void, attrs: *i32) -> *void #foreign;
|
eglCreateWindowSurface :: (d: *void, cfg: *void, window: *void, attrs: *i32) -> *void extern;
|
||||||
eglMakeCurrent :: (d: *void, draw: *void, read: *void, ctx: *void) -> u32 #foreign;
|
eglMakeCurrent :: (d: *void, draw: *void, read: *void, ctx: *void) -> u32 extern;
|
||||||
eglSwapBuffers :: (d: *void, surface: *void) -> u32 #foreign;
|
eglSwapBuffers :: (d: *void, surface: *void) -> u32 extern;
|
||||||
eglDestroyContext :: (d: *void, ctx: *void) -> u32 #foreign;
|
eglDestroyContext :: (d: *void, ctx: *void) -> u32 extern;
|
||||||
eglDestroySurface :: (d: *void, surface: *void) -> u32 #foreign;
|
eglDestroySurface :: (d: *void, surface: *void) -> u32 extern;
|
||||||
eglTerminate :: (d: *void) -> u32 #foreign;
|
eglTerminate :: (d: *void) -> u32 extern;
|
||||||
|
|
||||||
// ── Touch ring ──────────────────────────────────────────────────────────
|
// ── Touch ring ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
@@ -11,21 +11,21 @@
|
|||||||
// signatures (`getWindow :: (self: *Self) -> *Window`) still resolve
|
// signatures (`getWindow :: (self: *Self) -> *Window`) still resolve
|
||||||
// against the bare name within the namespace.
|
// against the bare name within the namespace.
|
||||||
|
|
||||||
WindowInsets :: #foreign #jni_class("android/view/WindowInsets") {
|
WindowInsets :: #jni_class("android/view/WindowInsets") extern {
|
||||||
getSystemWindowInsetTop :: (self: *Self) -> i32;
|
getSystemWindowInsetTop :: (self: *Self) -> i32;
|
||||||
getSystemWindowInsetLeft :: (self: *Self) -> i32;
|
getSystemWindowInsetLeft :: (self: *Self) -> i32;
|
||||||
getSystemWindowInsetBottom :: (self: *Self) -> i32;
|
getSystemWindowInsetBottom :: (self: *Self) -> i32;
|
||||||
getSystemWindowInsetRight :: (self: *Self) -> i32;
|
getSystemWindowInsetRight :: (self: *Self) -> i32;
|
||||||
}
|
}
|
||||||
|
|
||||||
View :: #foreign #jni_class("android/view/View") {
|
View :: #jni_class("android/view/View") extern {
|
||||||
getRootWindowInsets :: (self: *Self) -> *WindowInsets;
|
getRootWindowInsets :: (self: *Self) -> *WindowInsets;
|
||||||
}
|
}
|
||||||
|
|
||||||
Window :: #foreign #jni_class("android/view/Window") {
|
Window :: #jni_class("android/view/Window") extern {
|
||||||
getDecorView :: (self: *Self) -> *View;
|
getDecorView :: (self: *Self) -> *View;
|
||||||
}
|
}
|
||||||
|
|
||||||
Activity :: #foreign #jni_class("android/app/Activity") {
|
Activity :: #jni_class("android/app/Activity") extern {
|
||||||
getWindow :: (self: *Self) -> *Window;
|
getWindow :: (self: *Self) -> *Window;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
g_sdl_plat : *SdlPlatform = null;
|
g_sdl_plat : *SdlPlatform = null;
|
||||||
|
|
||||||
chdir :: (path: [*]u8) -> i32 #foreign;
|
chdir :: (path: [*]u8) -> i32 extern;
|
||||||
SDL_GetBasePath :: () -> [*]u8 #foreign;
|
SDL_GetBasePath :: () -> [*]u8 extern;
|
||||||
|
|
||||||
// A macOS `.app` launched via Finder / `open` starts with CWD=`/`, so a
|
// A macOS `.app` launched via Finder / `open` starts with CWD=`/`, so a
|
||||||
// game's CWD-relative asset loads (`read_file_bytes("assets/...")`) miss and
|
// game's CWD-relative asset loads (`read_file_bytes("assets/...")`) miss and
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
#import "modules/platform/types.sx";
|
#import "modules/platform/types.sx";
|
||||||
#import "modules/platform/api.sx";
|
#import "modules/platform/api.sx";
|
||||||
|
|
||||||
UIApplicationMain :: (argc: i32, argv: *void, principal_class: *NSString, delegate_class: *NSString) -> i32 #foreign;
|
UIApplicationMain :: (argc: i32, argv: *void, principal_class: *NSString, delegate_class: *NSString) -> i32 extern;
|
||||||
dlsym :: (handle: *void, name: [*]u8) -> *void #foreign;
|
dlsym :: (handle: *void, name: [*]u8) -> *void extern;
|
||||||
chdir :: (path: [*]u8) -> i32 #foreign;
|
chdir :: (path: [*]u8) -> i32 extern;
|
||||||
|
|
||||||
// QuartzCore's wall-clock helper used by CoreAnimation. Seconds since boot,
|
// QuartzCore's wall-clock helper used by CoreAnimation. Seconds since boot,
|
||||||
// monotonic. We use it as the timebase for keyboard-inset lockstep so the
|
// monotonic. We use it as the timebase for keyboard-inset lockstep so the
|
||||||
// per-frame interpolation lines up with UIKit's own animation timestamp.
|
// per-frame interpolation lines up with UIKit's own animation timestamp.
|
||||||
CACurrentMediaTime :: () -> f64 #foreign;
|
CACurrentMediaTime :: () -> f64 extern;
|
||||||
|
|
||||||
|
|
||||||
// kEAGLRenderingAPIOpenGLES3 = 3
|
// kEAGLRenderingAPIOpenGLES3 = 3
|
||||||
@@ -58,13 +58,13 @@ CGRect :: struct {
|
|||||||
// side name maps to its Obj-C selector via the default mangling rule
|
// side name maps to its Obj-C selector via the default mangling rule
|
||||||
// (split on `_`; each piece becomes a keyword with `:`).
|
// (split on `_`; each piece becomes a keyword with `:`).
|
||||||
|
|
||||||
NSValue :: #foreign #objc_class("NSValue") {
|
NSValue :: #objc_class("NSValue") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
// CGRect unboxing — returns by value via the sret/HFA path.
|
// CGRect unboxing — returns by value via the sret/HFA path.
|
||||||
CGRectValue :: (self: *Self) -> CGRect;
|
CGRectValue :: (self: *Self) -> CGRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSNumber :: #foreign #objc_class("NSNumber") {
|
NSNumber :: #objc_class("NSNumber") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
// Class method (no `self: *Self` first param → static dispatch).
|
// Class method (no `self: *Self` first param → static dispatch).
|
||||||
numberWithBool :: (b: i8) -> *NSNumber;
|
numberWithBool :: (b: i8) -> *NSNumber;
|
||||||
@@ -73,36 +73,36 @@ NSNumber :: #foreign #objc_class("NSNumber") {
|
|||||||
unsignedLongValue :: (self: *Self) -> u64;
|
unsignedLongValue :: (self: *Self) -> u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary :: #foreign #objc_class("NSDictionary") {
|
NSDictionary :: #objc_class("NSDictionary") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
objectForKey :: (self: *Self, key: *NSString) -> *void;
|
objectForKey :: (self: *Self, key: *NSString) -> *void;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSMutableDictionary :: #foreign #objc_class("NSMutableDictionary") {
|
NSMutableDictionary :: #objc_class("NSMutableDictionary") extern {
|
||||||
#extends NSDictionary;
|
#extends NSDictionary;
|
||||||
dictionary :: () -> *NSMutableDictionary;
|
dictionary :: () -> *NSMutableDictionary;
|
||||||
setObject_forKey :: (self: *Self, obj: *void, key: *void);
|
setObject_forKey :: (self: *Self, obj: *void, key: *void);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSSet :: #foreign #objc_class("NSSet") {
|
NSSet :: #objc_class("NSSet") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
anyObject :: (self: *Self) -> *void;
|
anyObject :: (self: *Self) -> *void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Notifications + Bundle (Phase 3.2 C2) ──────────────────────────────
|
// ── Notifications + Bundle (Phase 3.2 C2) ──────────────────────────────
|
||||||
|
|
||||||
NSNotification :: #foreign #objc_class("NSNotification") {
|
NSNotification :: #objc_class("NSNotification") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
userInfo :: (self: *Self) -> *NSDictionary;
|
userInfo :: (self: *Self) -> *NSDictionary;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSBundle :: #foreign #objc_class("NSBundle") {
|
NSBundle :: #objc_class("NSBundle") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
mainBundle :: () -> *NSBundle;
|
mainBundle :: () -> *NSBundle;
|
||||||
resourcePath :: (self: *Self) -> *NSString;
|
resourcePath :: (self: *Self) -> *NSString;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSNotificationCenter :: #foreign #objc_class("NSNotificationCenter") {
|
NSNotificationCenter :: #objc_class("NSNotificationCenter") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
defaultCenter :: () -> *NSNotificationCenter;
|
defaultCenter :: () -> *NSNotificationCenter;
|
||||||
addObserver_selector_name_object :: (self: *Self, observer: *void, sel: *void, name: *NSString, obj: *void);
|
addObserver_selector_name_object :: (self: *Self, observer: *void, sel: *void, name: *NSString, obj: *void);
|
||||||
@@ -110,12 +110,12 @@ NSNotificationCenter :: #foreign #objc_class("NSNotificationCenter") {
|
|||||||
|
|
||||||
// ── RunLoop + display timing (Phase 3.2 C3) ────────────────────────────
|
// ── RunLoop + display timing (Phase 3.2 C3) ────────────────────────────
|
||||||
|
|
||||||
NSRunLoop :: #foreign #objc_class("NSRunLoop") {
|
NSRunLoop :: #objc_class("NSRunLoop") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
currentRunLoop :: () -> *NSRunLoop;
|
currentRunLoop :: () -> *NSRunLoop;
|
||||||
}
|
}
|
||||||
|
|
||||||
CADisplayLink :: #foreign #objc_class("CADisplayLink") {
|
CADisplayLink :: #objc_class("CADisplayLink") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
displayLinkWithTarget_selector :: (target: *void, sel: *void) -> *CADisplayLink;
|
displayLinkWithTarget_selector :: (target: *void, sel: *void) -> *CADisplayLink;
|
||||||
addToRunLoop_forMode :: (self: *Self, runloop: *NSRunLoop, mode: *NSString);
|
addToRunLoop_forMode :: (self: *Self, runloop: *NSRunLoop, mode: *NSString);
|
||||||
@@ -126,23 +126,23 @@ CADisplayLink :: #foreign #objc_class("CADisplayLink") {
|
|||||||
// ── View tree + GL drawables (Phase 3.2 C5) ────────────────────────────
|
// ── View tree + GL drawables (Phase 3.2 C5) ────────────────────────────
|
||||||
// (Declared before UIView so `layer :: (...) -> *CALayer` can reference it.)
|
// (Declared before UIView so `layer :: (...) -> *CALayer` can reference it.)
|
||||||
|
|
||||||
CALayer :: #foreign #objc_class("CALayer") {
|
CALayer :: #objc_class("CALayer") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
setOpaque :: (self: *Self, opaque: i8);
|
setOpaque :: (self: *Self, opaque: i8);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAEAGLLayer :: #foreign #objc_class("CAEAGLLayer") {
|
CAEAGLLayer :: #objc_class("CAEAGLLayer") extern {
|
||||||
#extends CALayer;
|
#extends CALayer;
|
||||||
class :: () -> *void;
|
class :: () -> *void;
|
||||||
setDrawableProperties :: (self: *Self, props: *void);
|
setDrawableProperties :: (self: *Self, props: *void);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAMetalLayer :: #foreign #objc_class("CAMetalLayer") {
|
CAMetalLayer :: #objc_class("CAMetalLayer") extern {
|
||||||
#extends CALayer;
|
#extends CALayer;
|
||||||
class :: () -> *void;
|
class :: () -> *void;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAGLContext :: #foreign #objc_class("EAGLContext") {
|
EAGLContext :: #objc_class("EAGLContext") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
alloc :: () -> *EAGLContext;
|
alloc :: () -> *EAGLContext;
|
||||||
initWithAPI :: (self: *Self, api: i32) -> *EAGLContext;
|
initWithAPI :: (self: *Self, api: i32) -> *EAGLContext;
|
||||||
@@ -153,7 +153,7 @@ EAGLContext :: #foreign #objc_class("EAGLContext") {
|
|||||||
|
|
||||||
// ── UIKit chrome (Phase 3.2 C4) ────────────────────────────────────────
|
// ── UIKit chrome (Phase 3.2 C4) ────────────────────────────────────────
|
||||||
|
|
||||||
UIScreen :: #foreign #objc_class("UIScreen") {
|
UIScreen :: #objc_class("UIScreen") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
mainScreen :: () -> *UIScreen;
|
mainScreen :: () -> *UIScreen;
|
||||||
nativeScale :: (self: *Self) -> f64;
|
nativeScale :: (self: *Self) -> f64;
|
||||||
@@ -164,13 +164,13 @@ UIScreen :: #foreign #objc_class("UIScreen") {
|
|||||||
// Most UIKit classes inherit from it; sx-defined classes that
|
// Most UIKit classes inherit from it; sx-defined classes that
|
||||||
// participate in lifecycle callbacks (delegates, scene delegates)
|
// participate in lifecycle callbacks (delegates, scene delegates)
|
||||||
// extend it so the runtime picks up the responder-chain behavior.
|
// extend it so the runtime picks up the responder-chain behavior.
|
||||||
UIResponder :: #foreign #objc_class("UIResponder") {
|
UIResponder :: #objc_class("UIResponder") extern {
|
||||||
#extends NSObject;
|
#extends NSObject;
|
||||||
becomeFirstResponder :: (self: *Self) -> i8;
|
becomeFirstResponder :: (self: *Self) -> i8;
|
||||||
resignFirstResponder :: (self: *Self) -> i8;
|
resignFirstResponder :: (self: *Self) -> i8;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIView :: #foreign #objc_class("UIView") {
|
UIView :: #objc_class("UIView") extern {
|
||||||
#extends UIResponder;
|
#extends UIResponder;
|
||||||
safeAreaInsets :: (self: *Self) -> UIEdgeInsets;
|
safeAreaInsets :: (self: *Self) -> UIEdgeInsets;
|
||||||
addSubview :: (self: *Self, view: *void);
|
addSubview :: (self: *Self, view: *void);
|
||||||
@@ -178,7 +178,7 @@ UIView :: #foreign #objc_class("UIView") {
|
|||||||
setContentScaleFactor :: (self: *Self, scale: f64);
|
setContentScaleFactor :: (self: *Self, scale: f64);
|
||||||
}
|
}
|
||||||
|
|
||||||
UIWindow :: #foreign #objc_class("UIWindow") {
|
UIWindow :: #objc_class("UIWindow") extern {
|
||||||
#extends UIView;
|
#extends UIView;
|
||||||
alloc :: () -> *UIWindow;
|
alloc :: () -> *UIWindow;
|
||||||
initWithWindowScene :: (self: *Self, scene: *void) -> *UIWindow;
|
initWithWindowScene :: (self: *Self, scene: *void) -> *UIWindow;
|
||||||
@@ -187,14 +187,14 @@ UIWindow :: #foreign #objc_class("UIWindow") {
|
|||||||
screen :: (self: *Self) -> *UIScreen;
|
screen :: (self: *Self) -> *UIScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIViewController :: #foreign #objc_class("UIViewController") {
|
UIViewController :: #objc_class("UIViewController") extern {
|
||||||
#extends UIResponder;
|
#extends UIResponder;
|
||||||
alloc :: () -> *UIViewController;
|
alloc :: () -> *UIViewController;
|
||||||
init :: (self: *Self) -> *UIViewController;
|
init :: (self: *Self) -> *UIViewController;
|
||||||
setView :: (self: *Self, view: *void);
|
setView :: (self: *Self, view: *void);
|
||||||
}
|
}
|
||||||
|
|
||||||
UITextField :: #foreign #objc_class("UITextField") {
|
UITextField :: #objc_class("UITextField") extern {
|
||||||
#extends UIResponder;
|
#extends UIResponder;
|
||||||
alloc :: () -> *UITextField;
|
alloc :: () -> *UITextField;
|
||||||
init :: (self: *Self) -> *UITextField;
|
init :: (self: *Self) -> *UITextField;
|
||||||
@@ -203,7 +203,7 @@ UITextField :: #foreign #objc_class("UITextField") {
|
|||||||
// SxAppDelegate — UIApplicationMain's delegate class (the app delegate, a
|
// SxAppDelegate — UIApplicationMain's delegate class (the app delegate, a
|
||||||
// UIResponder — NOT the UIApplication principal class). Method bodies
|
// UIResponder — NOT the UIApplication principal class). Method bodies
|
||||||
// dispatch to UIKitPlatform methods on the shared `g_uikit_plat`.
|
// dispatch to UIKitPlatform methods on the shared `g_uikit_plat`.
|
||||||
SxAppDelegate :: #objc_class("SxAppDelegate") {
|
SxAppDelegate :: #objc_class("SxAppDelegate") export {
|
||||||
#extends UIResponder;
|
#extends UIResponder;
|
||||||
|
|
||||||
application_didFinishLaunchingWithOptions :: (self: *Self, app: *void, opts: *void) -> BOOL {
|
application_didFinishLaunchingWithOptions :: (self: *Self, app: *void, opts: *void) -> BOOL {
|
||||||
@@ -233,7 +233,7 @@ SxAppDelegate :: #objc_class("SxAppDelegate") {
|
|||||||
// SxSceneDelegate — iOS 13+ scene-based lifecycle delegate. Two
|
// SxSceneDelegate — iOS 13+ scene-based lifecycle delegate. Two
|
||||||
// `#implements` declarations formally conform to the scene-delegate
|
// `#implements` declarations formally conform to the scene-delegate
|
||||||
// protocols — iOS rejects the class otherwise.
|
// protocols — iOS rejects the class otherwise.
|
||||||
SxSceneDelegate :: #objc_class("SxSceneDelegate") {
|
SxSceneDelegate :: #objc_class("SxSceneDelegate") export {
|
||||||
#extends UIResponder;
|
#extends UIResponder;
|
||||||
#implements UISceneDelegate;
|
#implements UISceneDelegate;
|
||||||
#implements UIWindowSceneDelegate;
|
#implements UIWindowSceneDelegate;
|
||||||
@@ -827,7 +827,7 @@ uikit_chdir_to_bundle :: () {
|
|||||||
// M3.3 — migrated to declarative `#objc_class` form. The compiler
|
// M3.3 — migrated to declarative `#objc_class` form. The compiler
|
||||||
// synthesises class-pair init, metaclass `+layerClass`, and the
|
// synthesises class-pair init, metaclass `+layerClass`, and the
|
||||||
// instance-method IMP trampolines at module init.
|
// instance-method IMP trampolines at module init.
|
||||||
SxGLView :: #objc_class("SxGLView") {
|
SxGLView :: #objc_class("SxGLView") export {
|
||||||
#extends UIView;
|
#extends UIView;
|
||||||
|
|
||||||
layerClass :: () => CAEAGLLayer.class();
|
layerClass :: () => CAEAGLLayer.class();
|
||||||
@@ -886,7 +886,7 @@ uikit_first_touch :: (touches: *void) -> *void {
|
|||||||
//
|
//
|
||||||
// M3.4 — migrated to declarative `#objc_class`. Only `+layerClass`
|
// M3.4 — migrated to declarative `#objc_class`. Only `+layerClass`
|
||||||
// differs from SxGLView (returns CAMetalLayer instead of CAEAGLLayer).
|
// differs from SxGLView (returns CAMetalLayer instead of CAEAGLLayer).
|
||||||
SxMetalView :: #objc_class("SxMetalView") {
|
SxMetalView :: #objc_class("SxMetalView") export {
|
||||||
#extends UIView;
|
#extends UIView;
|
||||||
|
|
||||||
layerClass :: () => CAMetalLayer.class();
|
layerClass :: () => CAMetalLayer.class();
|
||||||
|
|||||||
Reference in New Issue
Block a user