objc: migrate remaining ns_string call sites to xx NSString

NSLog's fmt, addObserver's name, UIApplicationMain's principal-class, CADisplayLink's run-loop mode, and metal's newLibraryWithSource/newFunctionWithName string args are retyped *NSString, so their call sites read xx "..." instead of ns_string("...".ptr). ns_string is now used only by impl Into(*NSString) for string.
This commit is contained in:
agra
2026-05-30 17:54:23 +03:00
parent 8e3c3ae981
commit a29ede0383
3 changed files with 18 additions and 20 deletions

View File

@@ -15,7 +15,7 @@
#import "modules/platform/types.sx";
#import "modules/platform/api.sx";
UIApplicationMain :: (argc: s32, argv: *void, principal_class: *void, delegate_class: *void) -> s32 #foreign;
UIApplicationMain :: (argc: s32, argv: *void, principal_class: *NSString, delegate_class: *void) -> s32 #foreign;
dlsym :: (handle: *void, name: [*]u8) -> *void #foreign;
chdir :: (path: [*]u8) -> s32 #foreign;
@@ -105,7 +105,7 @@ NSBundle :: #foreign #objc_class("NSBundle") {
NSNotificationCenter :: #foreign #objc_class("NSNotificationCenter") {
#extends NSObject;
defaultCenter :: () -> *NSNotificationCenter;
addObserver_selector_name_object :: (self: *Self, observer: *void, sel: *void, name: *void, obj: *void);
addObserver_selector_name_object :: (self: *Self, observer: *void, sel: *void, name: *NSString, obj: *void);
}
// ── RunLoop + display timing (Phase 3.2 C3) ────────────────────────────
@@ -118,7 +118,7 @@ NSRunLoop :: #foreign #objc_class("NSRunLoop") {
CADisplayLink :: #foreign #objc_class("CADisplayLink") {
#extends NSObject;
displayLinkWithTarget_selector :: (target: *void, sel: *void) -> *CADisplayLink;
addToRunLoop_forMode :: (self: *Self, runloop: *NSRunLoop, mode: *void);
addToRunLoop_forMode :: (self: *Self, runloop: *NSRunLoop, mode: *NSString);
targetTimestamp :: (self: *Self) -> f64;
duration :: (self: *Self) -> f64;
}
@@ -212,7 +212,7 @@ SxAppDelegate :: #objc_class("SxAppDelegate") {
center.addObserver_selector_name_object(
xx self,
sel_registerName("sxKeyboardWillChangeFrame:".ptr),
ns_string("UIKeyboardWillChangeFrameNotification".ptr),
xx "UIKeyboardWillChangeFrameNotification",
null);
}
}
@@ -364,7 +364,7 @@ impl Platform for UIKitPlatform {
self.has_frame_closure = true;
g_uikit_plat = self;
inline if OS == .ios {
UIApplicationMain(0, xx 0, xx 0, ns_string("SxAppDelegate".ptr));
UIApplicationMain(0, xx 0, xx "SxAppDelegate", xx 0);
}
}
@@ -513,7 +513,7 @@ impl Platform for UIKitPlatform {
status := glCheckFramebufferStatus(GL_FRAMEBUFFER);
if status != GL_FRAMEBUFFER_COMPLETE {
NSLog(ns_string("[sx] framebuffer incomplete after renderbuffer setup\n".ptr));
NSLog(xx "[sx] framebuffer incomplete after renderbuffer setup\n");
}
}
@@ -698,10 +698,9 @@ impl Platform for UIKitPlatform {
link := CADisplayLink.displayLinkWithTarget_selector(gl_view, sel_tick);
self.display_link = link;
runloop := NSRunLoop.currentRunLoop();
mode_ns := ns_string("kCFRunLoopDefaultMode".ptr);
link.addToRunLoop_forMode(runloop, mode_ns);
link.addToRunLoop_forMode(runloop, xx "kCFRunLoopDefaultMode");
NSLog(ns_string("[sx] UIKitPlatform booted\n".ptr));
NSLog(xx "[sx] UIKitPlatform booted\n");
}
// CADisplayLink callback (vsync-paced). Drives keyboard-inset